From 777c1cbd40eb63365f2c28e38f6a93beb2d1c9d1 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Tue, 16 Aug 2011 11:25:56 -0400 Subject: Coding style and whitespace cleanup. --- a11y/ea-factory.h | 4 +- a11y/gal-a11y-factory.h | 2 +- a11y/gal-a11y-util.c | 12 +- .../gui/contact-editor/e-contact-editor-fullname.c | 2 +- addressbook/gui/contact-editor/e-contact-editor.c | 89 +- .../gui/contact-editor/e-contact-quick-add.c | 38 +- addressbook/gui/contact-editor/eab-editor.c | 12 +- addressbook/gui/contact-editor/eab-editor.h | 2 +- addressbook/gui/contact-editor/test-editor.c | 6 +- .../contact-list-editor/e-contact-list-editor.c | 30 +- .../gui/contact-list-editor/e-contact-list-model.c | 10 +- addressbook/gui/merging/eab-contact-compare.c | 75 +- addressbook/gui/merging/eab-contact-compare.h | 6 +- addressbook/gui/merging/eab-contact-merging.c | 58 +- addressbook/gui/widgets/e-addressbook-model.c | 16 +- .../gui/widgets/e-addressbook-reflow-adapter.c | 68 +- .../gui/widgets/e-addressbook-table-adapter.c | 69 +- addressbook/gui/widgets/e-addressbook-view.c | 26 +- addressbook/gui/widgets/e-minicard-label.c | 31 +- addressbook/gui/widgets/e-minicard-view-widget.c | 66 +- addressbook/gui/widgets/e-minicard-view.c | 67 +- addressbook/gui/widgets/e-minicard.c | 75 +- addressbook/gui/widgets/ea-addressbook-view.c | 2 +- addressbook/gui/widgets/ea-addressbook-view.h | 2 +- addressbook/gui/widgets/ea-addressbook.c | 12 +- addressbook/gui/widgets/ea-minicard-view.c | 24 +- addressbook/gui/widgets/ea-minicard-view.h | 2 +- addressbook/gui/widgets/ea-minicard.c | 12 +- addressbook/gui/widgets/ea-minicard.h | 2 +- addressbook/gui/widgets/eab-config.c | 18 +- addressbook/gui/widgets/eab-config.h | 5 +- addressbook/gui/widgets/eab-contact-display.c | 81 +- addressbook/gui/widgets/eab-gui-util.c | 99 +- addressbook/gui/widgets/gal-view-minicard.c | 4 +- .../importers/evolution-addressbook-importers.h | 4 +- addressbook/importers/evolution-csv-importer.c | 128 +- addressbook/importers/evolution-ldif-importer.c | 59 +- addressbook/importers/evolution-vcard-importer.c | 80 +- addressbook/printing/e-contact-print.c | 17 +- addressbook/printing/test-print.c | 3 +- .../evolution-addressbook-export-list-cards.c | 29 +- .../evolution-addressbook-export-list-folders.c | 2 +- addressbook/tools/evolution-addressbook-export.c | 5 +- calendar/gui/alarm-notify/alarm-notify-dialog.c | 104 +- calendar/gui/alarm-notify/alarm-notify.c | 2 +- calendar/gui/alarm-notify/alarm-queue.c | 38 +- calendar/gui/alarm-notify/alarm.c | 11 +- calendar/gui/alarm-notify/config-data.c | 11 +- calendar/gui/alarm-notify/notify-main.c | 5 +- calendar/gui/alarm-notify/util.c | 6 +- calendar/gui/calendar-config.c | 30 +- calendar/gui/calendar-config.h | 6 +- calendar/gui/calendar-view-factory.c | 5 +- calendar/gui/calendar-view.c | 16 +- calendar/gui/comp-util.c | 51 +- calendar/gui/comp-util.h | 4 +- calendar/gui/dialogs/alarm-dialog.c | 121 +- calendar/gui/dialogs/alarm-list-dialog.c | 18 +- calendar/gui/dialogs/calendar-setup.c | 68 +- calendar/gui/dialogs/changed-comp.c | 5 +- calendar/gui/dialogs/comp-editor-page.c | 15 +- calendar/gui/dialogs/comp-editor-page.h | 6 +- calendar/gui/dialogs/comp-editor-util.c | 25 +- calendar/gui/dialogs/comp-editor.c | 96 +- calendar/gui/dialogs/comp-editor.h | 10 +- calendar/gui/dialogs/copy-source-dialog.c | 11 +- calendar/gui/dialogs/delete-comp.c | 8 +- calendar/gui/dialogs/delete-error.c | 3 +- calendar/gui/dialogs/e-delegate-dialog.c | 24 +- calendar/gui/dialogs/e-delegate-dialog.h | 6 +- calendar/gui/dialogs/e-send-options-utils.c | 4 +- calendar/gui/dialogs/event-editor.c | 5 +- calendar/gui/dialogs/event-page.c | 205 +- calendar/gui/dialogs/goto-dialog.c | 18 +- calendar/gui/dialogs/memo-page.c | 25 +- calendar/gui/dialogs/recur-comp.c | 7 +- calendar/gui/dialogs/recurrence-page.c | 106 +- calendar/gui/dialogs/save-comp.c | 3 +- calendar/gui/dialogs/schedule-page.c | 29 +- calendar/gui/dialogs/select-source-dialog.c | 6 +- calendar/gui/dialogs/send-comp.c | 16 +- calendar/gui/dialogs/task-details-page.c | 30 +- calendar/gui/dialogs/task-editor.c | 3 +- calendar/gui/dialogs/task-page.c | 116 +- calendar/gui/e-alarm-list.c | 61 +- calendar/gui/e-cal-component-preview.c | 6 +- calendar/gui/e-cal-config.c | 15 +- calendar/gui/e-cal-config.h | 2 +- calendar/gui/e-cal-event.c | 3 +- calendar/gui/e-cal-list-view.c | 56 +- calendar/gui/e-cal-model-calendar.c | 51 +- calendar/gui/e-cal-model-calendar.h | 2 +- calendar/gui/e-cal-model-memos.c | 38 +- calendar/gui/e-cal-model-memos.h | 2 +- calendar/gui/e-cal-model-tasks.c | 95 +- calendar/gui/e-cal-model-tasks.h | 2 +- calendar/gui/e-cal-model.c | 302 +- calendar/gui/e-cal-model.h | 2 +- calendar/gui/e-calendar-view.c | 118 +- calendar/gui/e-cell-date-edit-text.c | 22 +- calendar/gui/e-date-time-list.c | 29 +- calendar/gui/e-day-view-layout.c | 106 +- calendar/gui/e-day-view-layout.h | 2 +- calendar/gui/e-day-view-main-item.c | 58 +- calendar/gui/e-day-view-time-item.c | 97 +- calendar/gui/e-day-view-top-item.c | 34 +- calendar/gui/e-day-view.c | 988 ++++--- calendar/gui/e-day-view.h | 98 +- calendar/gui/e-meeting-attendee.c | 93 +- calendar/gui/e-meeting-attendee.h | 6 +- calendar/gui/e-meeting-list-view.c | 229 +- calendar/gui/e-meeting-store.c | 128 +- calendar/gui/e-meeting-time-sel-item.c | 173 +- calendar/gui/e-meeting-time-sel.c | 454 +-- calendar/gui/e-meeting-time-sel.h | 64 +- calendar/gui/e-meeting-types.h | 10 +- calendar/gui/e-meeting-utils.c | 4 +- calendar/gui/e-memo-table.c | 13 +- calendar/gui/e-select-names-editable.c | 6 +- calendar/gui/e-select-names-renderer.c | 28 +- calendar/gui/e-task-table.c | 53 +- calendar/gui/e-timezone-entry.c | 16 +- calendar/gui/e-week-view-event-item.c | 46 +- calendar/gui/e-week-view-layout.c | 142 +- calendar/gui/e-week-view-layout.h | 8 +- calendar/gui/e-week-view-main-item.c | 40 +- calendar/gui/e-week-view-titles-item.c | 4 +- calendar/gui/e-week-view.c | 483 ++-- calendar/gui/e-week-view.h | 66 +- calendar/gui/ea-cal-view-event.c | 24 +- calendar/gui/ea-cal-view.c | 52 +- calendar/gui/ea-cal-view.h | 2 +- calendar/gui/ea-calendar.c | 6 +- calendar/gui/ea-day-view-cell.c | 17 +- calendar/gui/ea-day-view-cell.h | 2 +- calendar/gui/ea-day-view-main-item.c | 186 +- calendar/gui/ea-day-view-main-item.h | 2 +- calendar/gui/ea-day-view.c | 7 +- calendar/gui/ea-day-view.h | 2 +- calendar/gui/ea-gnome-calendar.c | 12 +- calendar/gui/ea-gnome-calendar.h | 2 +- calendar/gui/ea-jump-button.c | 6 +- calendar/gui/ea-week-view-cell.c | 17 +- calendar/gui/ea-week-view-cell.h | 2 +- calendar/gui/ea-week-view-main-item.c | 168 +- calendar/gui/ea-week-view-main-item.h | 2 +- calendar/gui/ea-week-view.c | 7 +- calendar/gui/ea-week-view.h | 2 +- calendar/gui/gnome-cal.c | 93 +- calendar/gui/gnome-cal.h | 4 +- calendar/gui/itip-utils.c | 20 +- calendar/gui/misc.c | 6 +- calendar/gui/print.c | 512 ++-- calendar/gui/tag-calendar.c | 16 +- calendar/gui/weekday-picker.c | 19 +- calendar/importers/icalendar-importer.c | 110 +- capplet/anjal-settings-main.c | 5 +- capplet/settings/anjal-mail-view.c | 19 +- capplet/settings/mail-account-view.c | 85 +- capplet/settings/mail-account-view.h | 2 +- capplet/settings/mail-capplet-shell.c | 19 +- capplet/settings/mail-guess-servers.c | 16 +- capplet/settings/mail-settings-view.c | 34 +- capplet/settings/mail-view.c | 93 +- capplet/settings/mail-view.h | 6 +- composer/e-msg-composer.c | 31 +- e-util/e-alert.c | 41 +- e-util/e-bit-array.c | 46 +- e-util/e-categories-config.c | 6 +- e-util/e-config.c | 154 +- e-util/e-config.h | 10 +- e-util/e-datetime-format.c | 78 +- e-util/e-dialog-utils.c | 5 +- e-util/e-dialog-widgets.c | 16 +- e-util/e-event.c | 102 +- e-util/e-event.h | 8 +- e-util/e-html-utils.c | 27 +- e-util/e-icon-factory.c | 4 +- e-util/e-import.c | 61 +- e-util/e-import.h | 2 +- e-util/e-mktemp.c | 5 +- e-util/e-plugin-util.c | 62 +- e-util/e-plugin.c | 116 +- e-util/e-plugin.h | 6 +- e-util/e-poolv.c | 8 +- e-util/e-signature-list.c | 25 +- e-util/e-signature.c | 3 +- e-util/e-sorter-array.c | 32 +- e-util/e-sorter.c | 28 +- e-util/e-text-event-processor-emacs-like.c | 8 +- e-util/e-text-event-processor.c | 24 +- e-util/e-unicode.c | 27 +- e-util/e-util.c | 63 +- e-util/e-xml-utils.c | 5 +- e-util/gconf-bridge.c | 60 +- em-format/em-format-quote.c | 6 +- em-format/em-format.c | 46 +- em-format/em-format.h | 8 +- em-format/em-inline-filter.c | 58 +- em-format/em-stripsig-filter.h | 4 +- filter/e-filter-code.c | 3 +- filter/e-filter-color.c | 3 +- filter/e-filter-datespec.c | 28 +- filter/e-filter-input.c | 5 +- filter/e-filter-part.c | 4 +- filter/e-filter-rule.c | 16 +- filter/e-rule-context.c | 6 +- filter/e-rule-editor.c | 48 +- libgnomecanvas/gailcanvas.c | 20 +- libgnomecanvas/gailcanvas.h | 2 +- libgnomecanvas/gailcanvasgroup.c | 6 +- libgnomecanvas/gailcanvasgroup.h | 2 +- libgnomecanvas/gailcanvasgroupfactory.c | 4 +- libgnomecanvas/gailcanvasitem.c | 34 +- libgnomecanvas/gailcanvasitem.h | 2 +- libgnomecanvas/gailcanvasitemfactory.c | 6 +- libgnomecanvas/gailcanvastext.c | 96 +- libgnomecanvas/gailcanvastext.h | 2 +- libgnomecanvas/gailcanvastextfactory.c | 4 +- libgnomecanvas/gailcanvaswidget.c | 4 +- libgnomecanvas/gailcanvaswidget.h | 2 +- libgnomecanvas/gailcanvaswidgetfactory.c | 4 +- libgnomecanvas/gnome-canvas-pixbuf.c | 24 +- libgnomecanvas/gnome-canvas-rect.c | 2 +- libgnomecanvas/gnome-canvas-rich-text.c | 141 +- libgnomecanvas/gnome-canvas-text.c | 45 +- libgnomecanvas/gnome-canvas-text.h | 4 +- libgnomecanvas/gnome-canvas-util.c | 11 +- libgnomecanvas/gnome-canvas-widget.c | 34 +- libgnomecanvas/gnome-canvas.c | 232 +- mail/e-mail-browser.c | 7 +- mail/e-mail-folder-utils.c | 3 +- mail/e-mail-migrate.c | 24 +- mail/e-mail-notebook-view.c | 86 +- mail/e-mail-pane.c | 2 +- mail/e-mail-paned-view.c | 3 +- mail/e-mail-reader-utils.c | 3 +- mail/e-mail-reader-utils.h | 4 +- mail/e-mail-reader.c | 4 +- mail/e-mail-session.c | 10 +- mail/e-mail-store.c | 2 +- mail/e-mail-tab-picker.c | 30 +- mail/e-mail-tab.c | 2958 ++++++++++---------- mail/em-account-editor.c | 339 ++- mail/em-composer-utils.c | 48 +- mail/em-config.c | 14 +- mail/em-event.c | 3 +- mail/em-filter-editor.c | 3 +- mail/em-filter-rule.c | 69 +- mail/em-folder-properties.c | 8 +- mail/em-folder-selector.c | 10 +- mail/em-folder-tree-model.c | 2 +- mail/em-folder-tree.c | 37 +- mail/em-folder-utils.c | 13 +- mail/em-format-hook.c | 41 +- mail/em-format-html-display.c | 62 +- mail/em-format-html-print.c | 2 +- mail/em-format-html.c | 120 +- mail/em-format-html.h | 12 +- mail/em-html-stream.c | 7 +- mail/em-subscription-editor.c | 5 +- mail/em-sync-stream.c | 3 +- mail/em-utils.c | 29 +- mail/em-vfolder-rule.c | 44 +- mail/importers/elm-importer.c | 32 +- mail/importers/evolution-mbox-importer.c | 36 +- mail/importers/mail-importer.c | 13 +- mail/importers/mail-importer.h | 2 +- mail/importers/pine-importer.c | 63 +- mail/mail-autofilter.c | 42 +- mail/mail-config.c | 3 +- mail/mail-folder-cache.c | 36 +- mail/mail-mt.c | 10 +- mail/mail-ops.c | 26 +- mail/mail-send-recv.c | 102 +- mail/mail-tools.c | 6 +- mail/mail-vfolder.c | 46 +- mail/message-list.c | 467 ++- mail/message-list.h | 2 +- modules/addressbook/addressbook-config.c | 114 +- modules/addressbook/addressbook-config.h | 4 +- modules/addressbook/autocompletion-config.c | 20 +- modules/addressbook/e-book-shell-migrate.c | 16 +- modules/addressbook/e-book-shell-view-actions.c | 12 +- modules/addressbook/eab-composer-util.c | 4 +- modules/addressbook/openldap-extract.h | 30 +- modules/calendar/e-cal-shell-content.c | 7 +- modules/calendar/e-cal-shell-migrate.c | 16 +- modules/calendar/e-cal-shell-view-actions.c | 3 +- modules/calendar/e-cal-shell-view-private.c | 3 +- modules/calendar/e-cal-shell-view.c | 6 +- modules/calendar/e-calendar-preferences.c | 52 +- modules/calendar/e-memo-shell-migrate.c | 6 +- modules/calendar/e-task-shell-migrate.c | 6 +- modules/mail/e-mail-shell-backend.c | 6 +- modules/mail/e-mail-shell-view-private.c | 6 +- modules/mail/em-composer-prefs.c | 4 +- modules/mail/em-mailer-prefs.c | 80 +- modules/mail/em-network-prefs.c | 30 +- modules/mailto-handler/evolution-mailto-handler.c | 2 +- modules/plugin-lib/e-plugin-lib.c | 31 +- modules/plugin-manager/evolution-plugin-manager.c | 6 +- modules/plugin-mono/e-plugin-mono.c | 20 +- modules/plugin-python/e-plugin-python.c | 8 +- modules/startup-wizard/evolution-startup-wizard.c | 3 +- modules/windows-sens/evolution-windows-sens.c | 143 +- plugins/addressbook-file/addressbook-file.c | 6 +- plugins/attachment-reminder/attachment-reminder.c | 45 +- plugins/audio-inline/audio-inline.c | 31 +- plugins/backup-restore/backup-restore.c | 37 +- plugins/backup-restore/backup.c | 22 +- plugins/bbdb/bbdb.c | 40 +- plugins/bbdb/bbdb.h | 4 +- plugins/bbdb/gaimbuddies.c | 22 +- plugins/caldav/caldav-browse-server.c | 122 +- plugins/caldav/caldav-browse-server.h | 2 +- plugins/caldav/caldav-source.c | 16 +- plugins/calendar-file/calendar-file.c | 29 +- plugins/calendar-http/calendar-http.c | 32 +- plugins/calendar-weather/calendar-weather.c | 66 +- plugins/dbx-import/dbx-importer.c | 39 +- plugins/default-source/default-source.c | 18 +- plugins/email-custom-header/email-custom-header.c | 73 +- plugins/external-editor/external-editor.c | 26 +- plugins/face/face.c | 26 +- .../google-account-setup/google-contacts-source.c | 22 +- plugins/google-account-setup/google-source.c | 61 +- plugins/image-inline/image-inline.c | 3 +- plugins/imap-features/imap-headers.c | 24 +- plugins/itip-formatter/itip-formatter.c | 116 +- plugins/itip-formatter/itip-view.c | 200 +- plugins/mail-notification/mail-notification.c | 16 +- plugins/mail-to-task/mail-to-task.c | 47 +- .../mailing-list-actions/mailing-list-actions.c | 3 +- plugins/mark-all-read/mark-all-read.c | 16 +- plugins/prefer-plain/prefer-plain.c | 64 +- plugins/pst-import/pst-importer.c | 156 +- plugins/publish-calendar/publish-calendar.c | 124 +- plugins/publish-calendar/publish-format-fb.c | 15 +- plugins/publish-calendar/publish-format-ical.c | 16 +- plugins/publish-calendar/publish-location.c | 3 +- plugins/publish-calendar/url-editor-dialog.c | 75 +- plugins/save-calendar/csv-format.c | 53 +- plugins/save-calendar/ical-format.c | 15 +- plugins/save-calendar/rdf-format.c | 36 +- plugins/save-calendar/save-calendar.c | 28 +- plugins/templates/templates.c | 115 +- plugins/tnef-attachments/tnef-plugin.c | 614 ++-- plugins/vcard-inline/vcard-inline.c | 8 +- .../webdav-account-setup/webdav-contacts-source.c | 13 +- shell/e-shell-meego.c | 8 +- shell/e-shell-migrate.c | 7 +- shell/e-shell-switcher.c | 18 +- shell/e-shell-utils.c | 2 +- shell/e-shell-view.c | 3 +- shell/e-shell-window-actions.c | 58 +- shell/e-shell-window.c | 8 +- shell/es-event.c | 11 +- shell/killev.c | 3 +- shell/main.c | 3 +- smclient/eggdesktopfile.c | 149 +- smclient/eggsmclient-xsmp.c | 120 +- smclient/eggsmclient.c | 26 +- smime/gui/ca-trust-dialog.c | 19 +- smime/gui/ca-trust-dialog.h | 2 +- smime/gui/cert-trust-dialog.c | 8 +- smime/gui/cert-trust-dialog.h | 2 +- smime/gui/certificate-manager.c | 34 +- smime/gui/certificate-viewer.c | 23 +- smime/gui/certificate-viewer.h | 2 +- smime/gui/component.c | 22 +- smime/gui/e-cert-selector.c | 37 +- smime/lib/e-asn1-object.c | 88 +- smime/lib/e-cert-db.c | 194 +- smime/lib/e-cert-db.h | 14 +- smime/lib/e-cert-trust.c | 8 +- smime/lib/e-cert.c | 161 +- smime/lib/e-cert.h | 10 +- smime/lib/e-pkcs12.c | 81 +- smime/lib/e-pkcs12.h | 6 +- smime/tests/import-cert.c | 3 +- widgets/e-timezone-dialog/e-timezone-dialog.c | 58 +- widgets/menus/gal-define-views-dialog.c | 59 +- widgets/menus/gal-define-views-model.c | 44 +- widgets/menus/gal-view-collection.c | 113 +- widgets/menus/gal-view-collection.h | 2 +- widgets/menus/gal-view-etable.c | 55 +- widgets/menus/gal-view-instance-save-as-dialog.c | 30 +- widgets/menus/gal-view-instance.c | 36 +- widgets/menus/gal-view-new-dialog.c | 47 +- widgets/misc/e-action-combo-box.c | 4 +- widgets/misc/e-attachment.c | 3 +- widgets/misc/e-buffer-tagger.c | 61 +- widgets/misc/e-calendar-item.c | 517 ++-- widgets/misc/e-calendar-item.h | 58 +- widgets/misc/e-calendar.c | 103 +- widgets/misc/e-calendar.h | 4 +- widgets/misc/e-canvas-background.c | 34 +- widgets/misc/e-canvas-utils.c | 40 +- widgets/misc/e-canvas-utils.h | 4 +- widgets/misc/e-canvas-vbox.c | 46 +- widgets/misc/e-canvas.c | 3 +- widgets/misc/e-cell-renderer-combo.c | 35 +- widgets/misc/e-combo-cell-editable.c | 45 +- widgets/misc/e-contact-map-window.c | 8 +- widgets/misc/e-contact-map-window.h | 4 +- widgets/misc/e-contact-map.c | 44 +- widgets/misc/e-contact-map.h | 2 +- widgets/misc/e-contact-marker.c | 52 +- widgets/misc/e-contact-marker.h | 2 +- widgets/misc/e-dateedit.c | 299 +- widgets/misc/e-dateedit.h | 26 +- widgets/misc/e-import-assistant.c | 25 +- widgets/misc/e-map.c | 86 +- widgets/misc/e-paned.c | 32 +- widgets/misc/e-picture-gallery.c | 42 +- widgets/misc/e-printable.c | 34 +- widgets/misc/e-searching-tokenizer.c | 132 +- widgets/misc/e-selection-model-array.c | 69 +- widgets/misc/e-selection-model.c | 3 +- widgets/misc/e-send-options.c | 41 +- widgets/misc/e-url-entry.c | 9 +- widgets/misc/e-web-view-preview.c | 69 +- widgets/misc/e-web-view.c | 3 +- widgets/misc/ea-calendar-cell.c | 13 +- widgets/misc/ea-calendar-cell.h | 2 +- widgets/misc/ea-calendar-item.c | 202 +- widgets/misc/ea-cell-table.c | 49 +- widgets/misc/test-calendar.c | 7 +- widgets/misc/test-dateedit.c | 39 +- widgets/misc/test-preferences-window.c | 7 +- widgets/table/e-cell-checkbox.c | 10 +- widgets/table/e-cell-combo.c | 103 +- widgets/table/e-cell-date-edit.c | 130 +- widgets/table/e-cell-date-edit.h | 10 +- widgets/table/e-cell-date.c | 14 +- widgets/table/e-cell-hbox.c | 30 +- widgets/table/e-cell-number.c | 11 +- widgets/table/e-cell-percent.c | 18 +- widgets/table/e-cell-pixbuf.c | 77 +- widgets/table/e-cell-popup.c | 102 +- widgets/table/e-cell-popup.h | 8 +- widgets/table/e-cell-size.c | 11 +- widgets/table/e-cell-text.c | 273 +- widgets/table/e-cell-text.h | 8 +- widgets/table/e-cell-tree.c | 94 +- widgets/table/e-cell-vbox.c | 27 +- widgets/table/e-cell.c | 163 +- widgets/table/e-cell.h | 2 +- widgets/table/e-popup-menu.c | 12 +- widgets/table/e-table-click-to-add.c | 47 +- widgets/table/e-table-col.c | 10 +- widgets/table/e-table-col.h | 10 +- widgets/table/e-table-column-specification.c | 4 +- widgets/table/e-table-config.c | 104 +- widgets/table/e-table-extras.c | 8 +- widgets/table/e-table-field-chooser-dialog.c | 27 +- widgets/table/e-table-field-chooser-item.c | 55 +- widgets/table/e-table-field-chooser-item.h | 2 +- widgets/table/e-table-field-chooser.c | 26 +- widgets/table/e-table-group-container.c | 213 +- widgets/table/e-table-group-container.h | 2 +- widgets/table/e-table-group-leaf.c | 58 +- widgets/table/e-table-group.c | 71 +- widgets/table/e-table-header-item.c | 176 +- widgets/table/e-table-header-item.h | 4 +- widgets/table/e-table-header-utils.c | 37 +- widgets/table/e-table-header-utils.h | 2 +- widgets/table/e-table-header.c | 86 +- widgets/table/e-table-item.c | 402 ++- widgets/table/e-table-item.h | 12 +- widgets/table/e-table-memory-callbacks.c | 54 +- widgets/table/e-table-memory-store.c | 95 +- widgets/table/e-table-memory.c | 14 +- widgets/table/e-table-model.c | 60 +- widgets/table/e-table-one.c | 32 +- widgets/table/e-table-search.c | 7 +- widgets/table/e-table-selection-model.c | 85 +- widgets/table/e-table-selection-model.h | 2 +- widgets/table/e-table-sort-info.c | 42 +- widgets/table/e-table-sorted-variable.c | 20 +- widgets/table/e-table-sorted.c | 36 +- widgets/table/e-table-sorter.c | 61 +- widgets/table/e-table-sorting-utils.c | 75 +- widgets/table/e-table-specification.c | 10 +- widgets/table/e-table-state.c | 20 +- widgets/table/e-table-subset-variable.c | 44 +- widgets/table/e-table-subset.c | 150 +- widgets/table/e-table-utils.c | 9 +- widgets/table/e-table-without.c | 73 +- widgets/table/e-table.c | 499 ++-- widgets/table/e-table.h | 4 +- widgets/table/e-tree-memory-callbacks.c | 79 +- widgets/table/e-tree-memory.c | 82 +- widgets/table/e-tree-model.c | 128 +- widgets/table/e-tree-selection-model.c | 132 +- widgets/table/e-tree-sorted.c | 237 +- widgets/table/e-tree-table-adapter.c | 253 +- widgets/table/e-tree.c | 441 +-- widgets/table/gal-a11y-e-cell-popup.c | 12 +- widgets/table/gal-a11y-e-cell-registry.c | 20 +- widgets/table/gal-a11y-e-cell-toggle.c | 18 +- widgets/table/gal-a11y-e-cell-tree.c | 20 +- widgets/table/gal-a11y-e-cell-vbox.c | 15 +- widgets/table/gal-a11y-e-cell.c | 90 +- .../table/gal-a11y-e-table-click-to-add-factory.c | 2 +- widgets/table/gal-a11y-e-table-click-to-add.c | 18 +- widgets/table/gal-a11y-e-table-column-header.c | 10 +- widgets/table/gal-a11y-e-table-factory.c | 2 +- widgets/table/gal-a11y-e-table-item-factory.c | 2 +- widgets/table/gal-a11y-e-table-item.c | 184 +- widgets/table/gal-a11y-e-table.c | 19 +- widgets/table/gal-a11y-e-tree-factory.c | 2 +- widgets/table/gal-a11y-e-tree.c | 14 +- widgets/text/e-reflow-model.c | 31 +- widgets/text/e-reflow.c | 110 +- widgets/text/e-text-model-repos.c | 9 +- widgets/text/e-text-model.c | 59 +- widgets/text/e-text.c | 170 +- widgets/text/gal-a11y-e-text-factory.c | 2 +- widgets/text/gal-a11y-e-text.c | 148 +- 521 files changed, 16877 insertions(+), 11588 deletions(-) diff --git a/a11y/ea-factory.h b/a11y/ea-factory.h index b156b3b4b2..f68b3a065b 100644 --- a/a11y/ea-factory.h +++ b/a11y/ea-factory.h @@ -30,7 +30,7 @@ #include #define EA_FACTORY_PARTA_GOBJECT(type, type_as_function, opt_create_accessible) \ -static AtkObject* \ +static AtkObject * \ type_as_function ## _factory_create_accessible (GObject *obj) \ { \ AtkObject *accessible; \ @@ -40,7 +40,7 @@ type_as_function ## _factory_create_accessible (GObject *obj) \ } #define EA_FACTORY_PARTA(type, type_as_function, opt_create_accessible) \ -static AtkObject* \ +static AtkObject * \ type_as_function ## _factory_create_accessible (GObject *obj) \ { \ GtkWidget *widget; \ diff --git a/a11y/gal-a11y-factory.h b/a11y/gal-a11y-factory.h index 3c774dd52c..9cd2b7b151 100644 --- a/a11y/gal-a11y-factory.h +++ b/a11y/gal-a11y-factory.h @@ -36,7 +36,7 @@ type_as_function ## _factory_get_accessible_type (void) \ return type; \ } \ \ -static AtkObject* \ +static AtkObject * \ type_as_function ## _factory_create_accessible (GObject *obj) \ { \ GtkWidget *widget; \ diff --git a/a11y/gal-a11y-util.c b/a11y/gal-a11y-util.c index 5bc91b70b7..9d44758187 100644 --- a/a11y/gal-a11y-util.c +++ b/a11y/gal-a11y-util.c @@ -28,12 +28,12 @@ #include "gal-a11y-util.h" GType -gal_a11y_type_register_static_with_private (GType parent_type, - const gchar *type_name, - GTypeInfo *info, - GTypeFlags flags, - gint priv_size, - gint *priv_offset) +gal_a11y_type_register_static_with_private (GType parent_type, + const gchar *type_name, + GTypeInfo *info, + GTypeFlags flags, + gint priv_size, + gint *priv_offset) { GTypeQuery query; diff --git a/addressbook/gui/contact-editor/e-contact-editor-fullname.c b/addressbook/gui/contact-editor/e-contact-editor-fullname.c index c2dc45304b..c23a05ba6f 100644 --- a/addressbook/gui/contact-editor/e-contact-editor-fullname.c +++ b/addressbook/gui/contact-editor/e-contact-editor-fullname.c @@ -249,7 +249,7 @@ e_contact_editor_fullname_init (EContactEditorFullname *e_contact_editor_fullnam GTK_WINDOW (e_contact_editor_fullname), "contact-new"); } -GtkWidget* +GtkWidget * e_contact_editor_fullname_new (const EContactName *name) { GtkWidget *widget = g_object_new (E_TYPE_CONTACT_EDITOR_FULLNAME, NULL); diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c index 5dd02b48e6..6ce9524afc 100644 --- a/addressbook/gui/contact-editor/e-contact-editor.c +++ b/addressbook/gui/contact-editor/e-contact-editor.c @@ -76,11 +76,11 @@ enum { static void e_contact_editor_init (EContactEditor *editor); static void e_contact_editor_class_init (EContactEditorClass *klass); static void e_contact_editor_set_property (GObject *object, - guint prop_id, + guint property_id, const GValue *value, GParamSpec *pspec); static void e_contact_editor_get_property (GObject *object, - guint prop_id, + guint property_id, GValue *value, GParamSpec *pspec); static void e_contact_editor_dispose (GObject *object); @@ -488,7 +488,7 @@ name_to_style (const EContactName *name, string = g_strjoinv(" ", strings); break; case 2: - midstrptr=midstring; + midstrptr = midstring; if (name) { if (name->family && *name->family) *(midstrptr++) = name->family; @@ -567,7 +567,8 @@ file_as_get_style (EContactEditor *editor) } static void -file_as_set_style (EContactEditor *editor, gint style) +file_as_set_style (EContactEditor *editor, + gint style) { gchar *string; gint i; @@ -1008,7 +1009,8 @@ get_ui_slot (EVCardAttribute *attr) } static void -set_ui_slot (EVCardAttribute *attr, gint slot) +set_ui_slot (EVCardAttribute *attr, + gint slot) { EVCardAttributeParam *param; gchar *slot_str; @@ -1524,7 +1526,8 @@ extract_phone (EContactEditor *editor) } static void -init_phone_record_type (EContactEditor *editor, gint record) +init_phone_record_type (EContactEditor *editor, + gint record) { GtkWidget *phone_type_combo_box; GtkWidget *phone_entry; @@ -1945,7 +1948,8 @@ extract_im (EContactEditor *editor) } static void -sensitize_im_types (EContactEditor *editor, GtkWidget *combo_box) +sensitize_im_types (EContactEditor *editor, + GtkWidget *combo_box) { GtkTreeModel *model; GtkTreeIter iter; @@ -1971,7 +1975,9 @@ sensitize_im_types (EContactEditor *editor, GtkWidget *combo_box) } static void -sensitize_im_record (EContactEditor *editor, gint record, gboolean enabled) +sensitize_im_record (EContactEditor *editor, + gint record, + gboolean enabled) { GtkWidget *service_combo_box; #ifdef ENABLE_IM_LOCATION @@ -2038,7 +2044,8 @@ init_personal (EContactEditor *editor) } static void -init_address_textview (EContactEditor *editor, gint record) +init_address_textview (EContactEditor *editor, + gint record) { gchar *textview_name; GtkWidget *textview; @@ -2078,7 +2085,8 @@ init_address_field (EContactEditor *editor, } static void -init_address_record (EContactEditor *editor, gint record) +init_address_record (EContactEditor *editor, + gint record) { init_address_textview (editor, record); init_address_field (editor, record, "city"); @@ -2325,7 +2333,8 @@ set_address_label (EContact *contact, } static void -extract_address_record (EContactEditor *editor, gint record) +extract_address_record (EContactEditor *editor, + gint record) { EContactAddress *address; @@ -2411,7 +2420,9 @@ sensitize_address_field (EContactEditor *editor, } static void -sensitize_address_record (EContactEditor *editor, gint record, gboolean enabled) +sensitize_address_record (EContactEditor *editor, + gint record, + gboolean enabled) { sensitize_address_textview (editor, record, enabled); sensitize_address_field (editor, record, "city", enabled); @@ -2520,7 +2531,8 @@ static FieldMapping simple_field_map[] = { }; static void -init_simple_field (EContactEditor *editor, GtkWidget *widget) +init_simple_field (EContactEditor *editor, + GtkWidget *widget) { GObject *changed_object = NULL; @@ -2569,7 +2581,9 @@ init_simple_field (EContactEditor *editor, GtkWidget *widget) } static void -fill_in_simple_field (EContactEditor *editor, GtkWidget *widget, gint field_id) +fill_in_simple_field (EContactEditor *editor, + GtkWidget *widget, + gint field_id) { EContact *contact; @@ -2707,9 +2721,9 @@ extract_simple_field (EContactEditor *editor, EContactDate date; if (e_date_edit_get_date ( E_DATE_EDIT (widget), - (gint *)&date.year, - (gint *)&date.month, - (gint *)&date.day)) + (gint *) &date.year, + (gint *) &date.month, + (gint *) &date.day)) e_contact_set (contact, field_id, &date); else e_contact_set (contact, field_id, NULL); @@ -2809,7 +2823,8 @@ extract_simple_field (EContactEditor *editor, } static void -sensitize_simple_field (GtkWidget *widget, gboolean enabled) +sensitize_simple_field (GtkWidget *widget, + gboolean enabled) { if (GTK_IS_ENTRY (widget)) gtk_editable_set_editable (GTK_EDITABLE (widget), enabled); @@ -3258,7 +3273,7 @@ categories_clicked (GtkWidget *button, return; } - g_signal_connect(dialog, "response", + g_signal_connect (dialog, "response", G_CALLBACK (categories_response), editor); /* Close the category dialog if the editor is closed*/ @@ -3649,7 +3664,8 @@ save_contact (EContactEditor *ce, } static void -e_contact_editor_save_contact (EABEditor *editor, gboolean should_close) +e_contact_editor_save_contact (EABEditor *editor, + gboolean should_close) { save_contact (E_CONTACT_EDITOR (editor), should_close); } @@ -3782,7 +3798,7 @@ e_contact_editor_is_changed (EABEditor *editor) return E_CONTACT_EDITOR (editor)->changed; } -static GtkWindow* +static GtkWindow * e_contact_editor_get_window (EABEditor *editor) { return GTK_WINDOW (E_CONTACT_EDITOR (editor)->app); @@ -3837,14 +3853,17 @@ app_delete_event_cb (GtkWidget *widget, } static void -show_help_cb (GtkWidget *widget, gpointer data) +show_help_cb (GtkWidget *widget, + gpointer data) { /* FIXME Pass a proper parent window. */ e_display_help (NULL, "usage-contact-cards"); } static GList * -add_to_tab_order (GList *list, GtkBuilder *builder, const gchar *name) +add_to_tab_order (GList *list, + GtkBuilder *builder, + const gchar *name) { GtkWidget *widget = e_builder_get_widget (builder, name); return g_list_prepend (list, widget); @@ -3857,7 +3876,7 @@ setup_tab_order (GtkBuilder *builder) GList *list = NULL; /* container = e_builder_get_widget(builder, "table-contact-editor-general"); - + * if (container) { list = add_to_tab_order(list, builder, "entry-fullname"); list = add_to_tab_order(list, builder, "entry-jobtitle"); @@ -3867,7 +3886,7 @@ setup_tab_order (GtkBuilder *builder) list = add_to_tab_order(list, builder, "entry-phone-2"); list = add_to_tab_order(list, builder, "entry-phone-3"); list = add_to_tab_order(list, builder, "entry-phone-4"); - + * list = add_to_tab_order(list, builder, "entry-email1"); list = add_to_tab_order(list, builder, "alignment-htmlmail"); list = add_to_tab_order(list, builder, "entry-web"); @@ -4253,12 +4272,16 @@ e_contact_editor_new (EShell *shell, } static void -notify_readonly_cb (EBookClient *book_client, GParamSpec *pspec, EContactEditor *ce) +notify_readonly_cb (EBookClient *book_client, + GParamSpec *pspec, + EContactEditor *ce) { + EClient *client; gint new_target_editable; gboolean changed = FALSE; - new_target_editable = !e_client_is_readonly (E_CLIENT (ce->target_client)); + client = E_CLIENT (ce->target_client); + new_target_editable = !e_client_is_readonly (client); if (ce->target_editable != new_target_editable) changed = TRUE; @@ -4271,7 +4294,7 @@ notify_readonly_cb (EBookClient *book_client, GParamSpec *pspec, EContactEditor static void e_contact_editor_set_property (GObject *object, - guint prop_id, + guint property_id, const GValue *value, GParamSpec *pspec) { @@ -4279,7 +4302,7 @@ e_contact_editor_set_property (GObject *object, editor = E_CONTACT_EDITOR (object); - switch (prop_id) { + switch (property_id) { case PROP_SOURCE_CLIENT: { gboolean writable; gboolean changed = FALSE; @@ -4429,14 +4452,14 @@ e_contact_editor_set_property (GObject *object, NULL, g_value_get_pointer (value)); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void e_contact_editor_get_property (GObject *object, - guint prop_id, + guint property_id, GValue *value, GParamSpec *pspec) { @@ -4444,7 +4467,7 @@ e_contact_editor_get_property (GObject *object, e_contact_editor = E_CONTACT_EDITOR (object); - switch (prop_id) { + switch (property_id) { case PROP_SOURCE_CLIENT: g_value_set_object (value, e_contact_editor->source_client); break; @@ -4480,7 +4503,7 @@ e_contact_editor_get_property (GObject *object, g_value_set_pointer (value, e_contact_editor->required_fields); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } diff --git a/addressbook/gui/contact-editor/e-contact-quick-add.c b/addressbook/gui/contact-editor/e-contact-quick-add.c index 0b33f8aa79..96af36fed2 100644 --- a/addressbook/gui/contact-editor/e-contact-quick-add.c +++ b/addressbook/gui/contact-editor/e-contact-quick-add.c @@ -91,7 +91,8 @@ quick_add_unref (QuickAdd *qa) } static void -quick_add_set_name (QuickAdd *qa, const gchar *name) +quick_add_set_name (QuickAdd *qa, + const gchar *name) { if (name == qa->name) return; @@ -101,7 +102,8 @@ quick_add_set_name (QuickAdd *qa, const gchar *name) } static void -quick_add_set_email (QuickAdd *qa, const gchar *email) +quick_add_set_email (QuickAdd *qa, + const gchar *email) { if (email == qa->email) return; @@ -111,7 +113,8 @@ quick_add_set_email (QuickAdd *qa, const gchar *email) } static void -quick_add_set_vcard (QuickAdd *qa, const gchar *vcard) +quick_add_set_vcard (QuickAdd *qa, + const gchar *vcard) { if (vcard == qa->vcard) return; @@ -332,7 +335,9 @@ edit_contact (QuickAdd *qa) #define QUICK_ADD_RESPONSE_EDIT_FULL 2 static void -clicked_cb (GtkWidget *w, gint button, gpointer closure) +clicked_cb (GtkWidget *w, + gint button, + gpointer closure) { QuickAdd *qa = (QuickAdd *) closure; @@ -400,7 +405,8 @@ sanitize_widgets (QuickAdd *qa) } static void -source_changed (ESourceComboBox *source_combo_box, QuickAdd *qa) +source_changed (ESourceComboBox *source_combo_box, + QuickAdd *qa) { ESource *source; @@ -423,7 +429,7 @@ build_quick_add_dialog (QuickAdd *qa) GtkWidget *label; GtkTable *table; ESource *source; - const gint xpad=0, ypad=0; + const gint xpad = 0, ypad = 0; g_return_val_if_fail (qa != NULL, NULL); @@ -480,7 +486,7 @@ build_quick_add_dialog (QuickAdd *qa) gtk_table_set_col_spacings (table, 12); label = gtk_label_new_with_mnemonic (_("_Full name")); - gtk_label_set_mnemonic_widget ((GtkLabel*) label, qa->name_entry); + gtk_label_set_mnemonic_widget ((GtkLabel *) label, qa->name_entry); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_table_attach (table, label, @@ -522,8 +528,10 @@ build_quick_add_dialog (QuickAdd *qa) } void -e_contact_quick_add (const gchar *in_name, const gchar *email, - EContactQuickAddCallback cb, gpointer closure) +e_contact_quick_add (const gchar *in_name, + const gchar *email, + EContactQuickAddCallback cb, + gpointer closure) { QuickAdd *qa; GtkWidget *dialog; @@ -543,10 +551,10 @@ e_contact_quick_add (const gchar *in_name, const gchar *email, /* Remove extra whitespace and the quotes some mailers put around names. */ g_strstrip (name); len = strlen (name); - if ((name[0] == '\'' && name[len-1] == '\'') || + if ((name[0] == '\'' && name[len - 1] == '\'') || (name[0] == '"' && name[len-1] == '"')) { name[0] = ' '; - name[len-1] = ' '; + name[len - 1] = ' '; } g_strstrip (name); } @@ -570,7 +578,7 @@ e_contact_quick_add_free_form (const gchar *text, EContactQuickAddCallback cb, gpointer closure) { - gchar *name=NULL, *email=NULL; + gchar *name = NULL, *email = NULL; const gchar *last_at, *s; gboolean in_quote; @@ -612,7 +620,7 @@ e_contact_quick_add_free_form (const gchar *text, /* ...and then split the text there */ if (!bad_char) { if (text < last_at) - name = g_strndup (text, last_at-text); + name = g_strndup (text, last_at - text); email = g_strdup (last_at); } } @@ -629,8 +637,8 @@ e_contact_quick_add_free_form (const gchar *text, *email = ' '; changed = TRUE; } - if (email[strlen (email)-1] == '>') { - email[strlen (email)-1] = ' '; + if (email[strlen (email) - 1] == '>') { + email[strlen (email) - 1] = ' '; changed = TRUE; } if (changed) diff --git a/addressbook/gui/contact-editor/eab-editor.c b/addressbook/gui/contact-editor/eab-editor.c index bea34db512..241bc477a4 100644 --- a/addressbook/gui/contact-editor/eab-editor.c +++ b/addressbook/gui/contact-editor/eab-editor.c @@ -301,7 +301,8 @@ eab_editor_raise (EABEditor *editor) } void -eab_editor_save_contact (EABEditor *editor, gboolean should_close) +eab_editor_save_contact (EABEditor *editor, + gboolean should_close) { EABEditorClass *class; @@ -339,7 +340,7 @@ eab_editor_is_valid (EABEditor *editor) return class->is_valid (editor); } -GtkWindow* +GtkWindow * eab_editor_get_window (EABEditor *editor) { EABEditorClass *class; @@ -353,11 +354,12 @@ eab_editor_get_window (EABEditor *editor) } /* This function prompts for saving if editor conents are in changed state and - save or discards or cancels (just returns with out doing anything) according - to user input. Editor gets destroyed in case of save and discard case. */ + * save or discards or cancels (just returns with out doing anything) according + * to user input. Editor gets destroyed in case of save and discard case. */ gboolean -eab_editor_prompt_to_save_changes (EABEditor *editor, GtkWindow *window) +eab_editor_prompt_to_save_changes (EABEditor *editor, + GtkWindow *window) { if (!eab_editor_is_changed (editor)) { eab_editor_close (EAB_EDITOR (editor)); diff --git a/addressbook/gui/contact-editor/eab-editor.h b/addressbook/gui/contact-editor/eab-editor.h index 43e36e53a3..cf8a20aecb 100644 --- a/addressbook/gui/contact-editor/eab-editor.h +++ b/addressbook/gui/contact-editor/eab-editor.h @@ -68,7 +68,7 @@ struct _EABEditorClass { void (* save_contact) (EABEditor *editor, gboolean should_close); gboolean (* is_valid) (EABEditor *editor); gboolean (* is_changed) (EABEditor *editor); - GtkWindow* (* get_window) (EABEditor *editor); + GtkWindow * (* get_window) (EABEditor *editor); /* signals */ void (* contact_added) (EABEditor *editor, const GError *error, EContact *contact); diff --git a/addressbook/gui/contact-editor/test-editor.c b/addressbook/gui/contact-editor/test-editor.c index 2f54bd57b1..1d9c24aed7 100644 --- a/addressbook/gui/contact-editor/test-editor.c +++ b/addressbook/gui/contact-editor/test-editor.c @@ -67,7 +67,8 @@ read_file (gchar *name) /* Callback used when a contact editor is closed */ static void -editor_closed_cb (EContactEditor *ce, gpointer data) +editor_closed_cb (EContactEditor *ce, + gpointer data) { static gint count = 2; @@ -79,7 +80,8 @@ editor_closed_cb (EContactEditor *ce, gpointer data) } gint -main (gint argc, gchar *argv[]) +main (gint argc, + gchar *argv[]) { gchar *cardstr; EContactEditor *ce; diff --git a/addressbook/gui/contact-list-editor/e-contact-list-editor.c b/addressbook/gui/contact-list-editor/e-contact-list-editor.c index 7ad6c124cc..1750f5a686 100644 --- a/addressbook/gui/contact-list-editor/e-contact-list-editor.c +++ b/addressbook/gui/contact-list-editor/e-contact-list-editor.c @@ -258,7 +258,7 @@ contact_list_editor_add_destination (GtkWidget *widget, static void contact_list_editor_add_email (EContactListEditor *editor, - const gchar *email) + const gchar *email) { CamelInternetAddress *addr; EContactListEditorPrivate *priv = editor->priv; @@ -424,7 +424,7 @@ contact_list_editor_render_destination (GtkTreeViewColumn *column, static void contact_list_editor_selection_changed_cb (GtkTreeSelection *selection, - gpointer user_data) + gpointer user_data) { EContactListEditor *editor = user_data; GtkTreeModel *model; @@ -545,15 +545,17 @@ contact_list_editor_delete_event_cb (GtkWidget *widget, void contact_list_editor_drag_data_received_cb (GtkWidget *widget, GdkDragContext *context, - gint x, gint y, - GtkSelectionData *selection_data, - guint info, - guint time); + gint x, + gint y, + GtkSelectionData *selection_data, + guint info, + guint time); void contact_list_editor_drag_data_received_cb (GtkWidget *widget, GdkDragContext *context, - gint x, gint y, + gint x, + gint y, GtkSelectionData *selection_data, guint info, guint time) @@ -695,7 +697,7 @@ contact_list_editor_email_entry_key_press_event_cb (GtkWidget *widget, gint cpos = -1; entry = GTK_ENTRY (WIDGET (EMAIL_ENTRY)); - g_object_get (G_OBJECT (entry), "cursor-position", &cpos, NULL); + g_object_get (entry, "cursor-position", &cpos, NULL); /* not the first letter */ if (cpos > 0) { @@ -817,7 +819,7 @@ contact_list_editor_remove_button_clicked_cb (GtkWidget *widget) } /* new_selection != NULL when there is at least one item below the - removed selection */ + * removed selection */ if (new_selection) { path = gtk_tree_row_reference_get_path (new_selection); gtk_tree_selection_select_path (selection, path); @@ -825,7 +827,7 @@ contact_list_editor_remove_button_clicked_cb (GtkWidget *widget) gtk_tree_row_reference_free (new_selection); } else { /* If selection was including the last item in the list, then - find and select the new last item */ + * find and select the new last item */ GtkTreeIter iter, iter2; /* When FALSE is returned, there are no items in the list to be selected */ @@ -1157,7 +1159,7 @@ setup_custom_widgets (EContactListEditor *editor) combo_box = WIDGET (SOURCE_MENU); if (!e_book_client_get_sources (&source_list, &error)) source_list = NULL; - g_object_set (G_OBJECT (combo_box), "source-list", source_list, NULL); + g_object_set (combo_box, "source-list", source_list, NULL); if (source_list) g_object_unref (source_list); @@ -1242,7 +1244,7 @@ contact_list_editor_constructor (GType type, static void contact_list_editor_set_property (GObject *object, guint property_id, - const GValue *value, + const GValue *value, GParamSpec *pspec) { switch (property_id) { @@ -1772,8 +1774,8 @@ e_contact_list_editor_get_contact (EContactListEditor *editor) save_contact_list (model, &iter, &attrs, &parent_id); /* Put it in reverse order because e_vcard_add_attribute also uses prepend, - but we want to keep order of mails there. Hopefully noone will change - the behaviour of the e_vcard_add_attribute. */ + * but we want to keep order of mails there. Hopefully noone will change + * the behaviour of the e_vcard_add_attribute. */ for (a = attrs; a; a = a->next) { e_vcard_add_attribute (E_VCARD (contact), a->data); } diff --git a/addressbook/gui/contact-list-editor/e-contact-list-model.c b/addressbook/gui/contact-list-editor/e-contact-list-model.c index e4eee15cb1..6774eee3b7 100644 --- a/addressbook/gui/contact-list-editor/e-contact-list-model.c +++ b/addressbook/gui/contact-list-editor/e-contact-list-model.c @@ -137,7 +137,7 @@ e_contact_list_model_has_uid (EContactListModel *model, return (g_hash_table_lookup (model->priv->uids_table, uid) != NULL); } -GtkTreePath* +GtkTreePath * e_contact_list_model_add_destination (EContactListModel *model, EDestination *destination, GtkTreeIter *parent, @@ -213,7 +213,7 @@ e_contact_list_model_add_contact (EContactListModel *model, static void contact_list_model_unref_row_dest (EContactListModel *model, - GtkTreeIter *iter) + GtkTreeIter *iter) { EDestination *dest; GtkTreeModel *tree_model; @@ -227,7 +227,7 @@ contact_list_model_unref_row_dest (EContactListModel *model, e_destination_get_contact_uid (dest))); /* If the list is only once in the model, then remove it from the hash table, - otherwise decrease the counter by one */ + * otherwise decrease the counter by one */ if (list_refs <= 1) { g_hash_table_remove (model->priv->uids_table, e_destination_get_contact_uid (dest)); @@ -270,11 +270,11 @@ e_contact_list_model_remove_row (EContactListModel *model, g_return_if_fail (iter); /* Use helper function to update our reference counters in - hash tables but don't remove any row. */ + * hash tables but don't remove any row. */ contact_list_model_unref_row_dest (model, iter); /* Get iter of parent of the row to be removed. After the row is removed, check if there are - any more children left for the parent_iter, an eventually remove the parent_iter as well */ + * any more children left for the parent_iter, an eventually remove the parent_iter as well */ if (gtk_tree_model_iter_parent (GTK_TREE_MODEL (model), &parent_iter, iter)) { gtk_tree_store_remove (GTK_TREE_STORE (model), iter); if (!gtk_tree_model_iter_has_child (GTK_TREE_MODEL (model), &parent_iter)) { diff --git a/addressbook/gui/merging/eab-contact-compare.c b/addressbook/gui/merging/eab-contact-compare.c index fd6ad8c012..a25ad4e403 100644 --- a/addressbook/gui/merging/eab-contact-compare.c +++ b/addressbook/gui/merging/eab-contact-compare.c @@ -33,10 +33,10 @@ #include "eab-contact-compare.h" /* This is an "optimistic" combiner: the best of the two outcomes is - selected. */ + * selected. */ static EABContactMatchType combine_comparisons (EABContactMatchType prev, - EABContactMatchType new_info) + EABContactMatchType new_info) { if (new_info == EAB_CONTACT_MATCH_NOT_APPLICABLE) return prev; @@ -46,7 +46,7 @@ combine_comparisons (EABContactMatchType prev, /*** Name comparisons ***/ /* This *so* doesn't belong here... at least not implemented in a - sucky way like this. But it can be fixed later. */ + * sucky way like this. But it can be fixed later. */ /* This is very Anglocentric. */ static const gchar *name_synonyms[][2] = { @@ -83,7 +83,9 @@ static const gchar *name_synonyms[][2] = { }; static gboolean -name_fragment_match_with_synonyms (const gchar *a, const gchar *b, gboolean strict) +name_fragment_match_with_synonyms (const gchar *a, + const gchar *b, + gboolean strict) { gint i; @@ -94,7 +96,7 @@ name_fragment_match_with_synonyms (const gchar *a, const gchar *b, gboolean stri return TRUE; /* Check for nicknames. Yes, the linear search blows. */ - for (i=0; name_synonyms[i][0]; ++i) { + for (i = 0; name_synonyms[i][0]; ++i) { if (!e_utf8_casefold_collate (name_synonyms[i][0], a) && !e_utf8_casefold_collate (name_synonyms[i][1], b)) @@ -109,14 +111,19 @@ name_fragment_match_with_synonyms (const gchar *a, const gchar *b, gboolean stri } EABContactMatchType -eab_contact_compare_name_to_string (EContact *contact, const gchar *str) +eab_contact_compare_name_to_string (EContact *contact, + const gchar *str) { return eab_contact_compare_name_to_string_full (contact, str, FALSE, NULL, NULL, NULL); } EABContactMatchType -eab_contact_compare_name_to_string_full (EContact *contact, const gchar *str, gboolean allow_partial_matches, - gint *matched_parts_out, EABContactMatchPart *first_matched_part_out, gint *matched_character_count_out) +eab_contact_compare_name_to_string_full (EContact *contact, + const gchar *str, + gboolean allow_partial_matches, + gint *matched_parts_out, + EABContactMatchPart *first_matched_part_out, + gint *matched_character_count_out) { gchar **namev, **givenv = NULL, **addv = NULL, **familyv = NULL; @@ -172,8 +179,8 @@ eab_contact_compare_name_to_string_full (EContact *contact, const gchar *str, gb this_part_match = EAB_CONTACT_MATCH_PART_NONE; /* When we are allowing partials, we are strict about the matches we allow. - Does this make sense? Not really, but it does the right thing for the purposes - of completion. */ + * Does this make sense? Not really, but it does the right thing for the purposes + * of completion. */ if (givenv && this_part_match == EAB_CONTACT_MATCH_PART_NONE) { for (j = 0; givenv[j]; ++j) { @@ -182,7 +189,7 @@ eab_contact_compare_name_to_string_full (EContact *contact, const gchar *str, gb this_part_match = EAB_CONTACT_MATCH_PART_GIVEN_NAME; /* We remove a piece of a name once it has been matched against, so - that "john john" won't match "john doe". */ + * that "john john" won't match "john doe". */ g_free (givenv[j]); givenv[j] = g_strdup (""); break; @@ -261,7 +268,8 @@ eab_contact_compare_name_to_string_full (EContact *contact, const gchar *str, gb } EABContactMatchType -eab_contact_compare_file_as (EContact *contact1, EContact *contact2) +eab_contact_compare_file_as (EContact *contact1, + EContact *contact2) { EABContactMatchType match_type; gchar *a, *b; @@ -292,10 +300,11 @@ eab_contact_compare_file_as (EContact *contact1, EContact *contact2) } EABContactMatchType -eab_contact_compare_name (EContact *contact1, EContact *contact2) +eab_contact_compare_name (EContact *contact1, + EContact *contact2) { EContactName *a, *b; - gint matches=0, possible=0; + gint matches = 0, possible = 0; gboolean family_match = FALSE; g_return_val_if_fail (E_IS_CONTACT (contact1), EAB_CONTACT_MATCH_NOT_APPLICABLE); @@ -337,8 +346,8 @@ eab_contact_compare_name (EContact *contact1, EContact *contact2) e_contact_name_free (b); /* Now look at the # of matches and try to intelligently map - an EAB_CONTACT_MATCH_* type to it. Special consideration is given - to family-name matches. */ + * an EAB_CONTACT_MATCH_* type to it. Special consideration is given + * to family-name matches. */ if (possible == 0) return EAB_CONTACT_MATCH_NOT_APPLICABLE; @@ -349,7 +358,7 @@ eab_contact_compare_name (EContact *contact1, EContact *contact2) if (possible == matches) return family_match ? EAB_CONTACT_MATCH_EXACT : EAB_CONTACT_MATCH_PARTIAL; - if (possible == matches+1) + if (possible == matches + 1) return family_match ? EAB_CONTACT_MATCH_VAGUE : EAB_CONTACT_MATCH_NONE; return EAB_CONTACT_MATCH_NONE; @@ -358,7 +367,8 @@ eab_contact_compare_name (EContact *contact1, EContact *contact2) /*** Nickname Comparisons ***/ EABContactMatchType -eab_contact_compare_nickname (EContact *contact1, EContact *contact2) +eab_contact_compare_nickname (EContact *contact1, + EContact *contact2) { g_return_val_if_fail (contact1 && E_IS_CONTACT (contact1), EAB_CONTACT_MATCH_NOT_APPLICABLE); g_return_val_if_fail (contact2 && E_IS_CONTACT (contact2), EAB_CONTACT_MATCH_NOT_APPLICABLE); @@ -369,7 +379,8 @@ eab_contact_compare_nickname (EContact *contact1, EContact *contact2) /*** E-mail Comparisons ***/ static gboolean -match_email_username (const gchar *addr1, const gchar *addr2) +match_email_username (const gchar *addr1, + const gchar *addr2) { gint c1, c2; if (addr1 == NULL || addr2 == NULL) @@ -388,7 +399,8 @@ match_email_username (const gchar *addr1, const gchar *addr2) } static gboolean -match_email_hostname (const gchar *addr1, const gchar *addr2) +match_email_hostname (const gchar *addr1, + const gchar *addr2) { gint c1, c2; gboolean seen_at1, seen_at2; @@ -436,7 +448,8 @@ match_email_hostname (const gchar *addr1, const gchar *addr2) } static EABContactMatchType -compare_email_addresses (const gchar *addr1, const gchar *addr2) +compare_email_addresses (const gchar *addr1, + const gchar *addr2) { if (addr1 == NULL || *addr1 == 0 || addr2 == NULL || *addr2 == 0) @@ -449,7 +462,8 @@ compare_email_addresses (const gchar *addr1, const gchar *addr2) } EABContactMatchType -eab_contact_compare_email (EContact *contact1, EContact *contact2) +eab_contact_compare_email (EContact *contact1, + EContact *contact2) { EABContactMatchType match = EAB_CONTACT_MATCH_NOT_APPLICABLE; GList *contact1_email, *contact2_email; @@ -473,8 +487,8 @@ eab_contact_compare_email (EContact *contact1, EContact *contact2) i1 = contact1_email; /* Do pairwise-comparisons on all of the e-mail addresses. If - we find an exact match, there is no reason to keep - checking. */ + * we find an exact match, there is no reason to keep + * checking. */ while (i1 && match != EAB_CONTACT_MATCH_EXACT) { gchar *addr1 = (gchar *) i1->data; @@ -500,7 +514,8 @@ eab_contact_compare_email (EContact *contact1, EContact *contact2) } EABContactMatchType -eab_contact_compare_address (EContact *contact1, EContact *contact2) +eab_contact_compare_address (EContact *contact1, + EContact *contact2) { g_return_val_if_fail (contact1 && E_IS_CONTACT (contact1), EAB_CONTACT_MATCH_NOT_APPLICABLE); g_return_val_if_fail (contact2 && E_IS_CONTACT (contact2), EAB_CONTACT_MATCH_NOT_APPLICABLE); @@ -511,7 +526,8 @@ eab_contact_compare_address (EContact *contact1, EContact *contact2) } EABContactMatchType -eab_contact_compare_telephone (EContact *contact1, EContact *contact2) +eab_contact_compare_telephone (EContact *contact1, + EContact *contact2) { g_return_val_if_fail (contact1 && E_IS_CONTACT (contact1), EAB_CONTACT_MATCH_NOT_APPLICABLE); g_return_val_if_fail (contact2 && E_IS_CONTACT (contact2), EAB_CONTACT_MATCH_NOT_APPLICABLE); @@ -522,7 +538,8 @@ eab_contact_compare_telephone (EContact *contact1, EContact *contact2) } EABContactMatchType -eab_contact_compare (EContact *contact1, EContact *contact2) +eab_contact_compare (EContact *contact1, + EContact *contact2) { EABContactMatchType result; @@ -660,13 +677,13 @@ query_cb (GObject *source_object, #define MAX_QUERY_PARTS 10 static void use_common_book_client (EBookClient *book_client, - MatchSearchInfo *info) + MatchSearchInfo *info) { EContact *contact = info->contact; EContactName *contact_name; GList *contact_email; gchar *query_parts[MAX_QUERY_PARTS]; - gint p=0; + gint p = 0; gchar *contact_file_as, *qj; EBookQuery *query = NULL; gint i; diff --git a/addressbook/gui/merging/eab-contact-compare.h b/addressbook/gui/merging/eab-contact-compare.h index df67c5d752..7ce31eddb9 100644 --- a/addressbook/gui/merging/eab-contact-compare.h +++ b/addressbook/gui/merging/eab-contact-compare.h @@ -40,9 +40,9 @@ typedef enum { typedef enum { EAB_CONTACT_MATCH_PART_NOT_APPLICABLE = -1, EAB_CONTACT_MATCH_PART_NONE = 0, - EAB_CONTACT_MATCH_PART_GIVEN_NAME = 1<<0, - EAB_CONTACT_MATCH_PART_ADDITIONAL_NAME = 1<<2, - EAB_CONTACT_MATCH_PART_FAMILY_NAME = 1<<3 + EAB_CONTACT_MATCH_PART_GIVEN_NAME = 1 << 0, + EAB_CONTACT_MATCH_PART_ADDITIONAL_NAME = 1 << 2, + EAB_CONTACT_MATCH_PART_FAMILY_NAME = 1 << 3 } EABContactMatchPart; typedef void (*EABContactMatchQueryCallback) (EContact *contact, EContact *match, EABContactMatchType type, gpointer closure); diff --git a/addressbook/gui/merging/eab-contact-merging.c b/addressbook/gui/merging/eab-contact-merging.c index 557af481bb..70e43fa284 100644 --- a/addressbook/gui/merging/eab-contact-merging.c +++ b/addressbook/gui/merging/eab-contact-merging.c @@ -210,7 +210,8 @@ add_contact_ready_cb (GObject *source_object, } static void -doit (EContactMergingLookup *lookup, gboolean force_modify) +doit (EContactMergingLookup *lookup, + gboolean force_modify) { if (lookup->op == E_CONTACT_MERGING_ADD) { if (force_modify) @@ -236,7 +237,9 @@ cancelit (EContactMergingLookup *lookup) } static void -dialog_map (GtkWidget *window, GdkEvent *event, GtkWidget *table) +dialog_map (GtkWidget *window, + GdkEvent *event, + GtkWidget *table) { GtkAllocation allocation; gint h, w; @@ -256,7 +259,8 @@ dialog_map (GtkWidget *window, GdkEvent *event, GtkWidget *table) } static void -dropdown_changed (GtkWidget *dropdown, dropdown_data *data) +dropdown_changed (GtkWidget *dropdown, + dropdown_data *data) { gchar *str; str = gtk_combo_box_text_get_active_text (GTK_COMBO_BOX_TEXT (dropdown)); @@ -357,7 +361,7 @@ mergeit (EContactMergingLookup *lookup) use_field = E_CONTACT_EMAIL_2; break; } - else/*Either the new contact has no email OR the email already exist in the duplicate contact*/ + else/*Either the new contact has no email OR the email already exist in the duplicate contact */ continue; case 2: /*New contact has email and it is equal to neither of the 2 emails in the duplicate contact*/ @@ -381,7 +385,7 @@ mergeit (EContactMergingLookup *lookup) } label = gtk_label_new (_("Email")); hbox = gtk_hbox_new (FALSE, 0); - gtk_box_pack_start (GTK_BOX (hbox), (GtkWidget*) label, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (hbox), (GtkWidget *) label, FALSE, FALSE, 0); gtk_table_attach_defaults (table, (GtkWidget *) hbox, 0, 1, row, row + 1); dropdown = gtk_combo_box_text_new (); @@ -398,7 +402,7 @@ mergeit (EContactMergingLookup *lookup) g_signal_connect (dropdown, "changed", G_CALLBACK(dropdown_changed), data); hbox = gtk_hbox_new (FALSE, 0); - gtk_box_pack_start (GTK_BOX (hbox), (GtkWidget*) dropdown, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (hbox), (GtkWidget *) dropdown, FALSE, FALSE, 0); gtk_table_attach_defaults (table, (GtkWidget *) hbox, 1, 2, row, row + 1); gtk_widget_show ((GtkWidget *) dropdown); continue; @@ -407,13 +411,13 @@ mergeit (EContactMergingLookup *lookup) row++; label = gtk_label_new (e_contact_pretty_name (field)); hbox = gtk_hbox_new (FALSE, 0); - gtk_box_pack_start (GTK_BOX (hbox), (GtkWidget*) label, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (hbox), (GtkWidget *) label, FALSE, FALSE, 0); gtk_table_attach_defaults (table, (GtkWidget *) hbox, 0, 1, row, row + 1); label = gtk_label_new (string); hbox = gtk_hbox_new (FALSE, 0); - gtk_box_pack_start (GTK_BOX (hbox), (GtkWidget*) label, FALSE, FALSE, 0); - gtk_table_attach_defaults (table, (GtkWidget*) hbox, 1, 2, row, row + 1); + gtk_box_pack_start (GTK_BOX (hbox), (GtkWidget *) label, FALSE, FALSE, 0); + gtk_table_attach_defaults (table, (GtkWidget *) hbox, 1, 2, row, row + 1); continue; } @@ -422,7 +426,7 @@ mergeit (EContactMergingLookup *lookup) row++; label = gtk_label_new (e_contact_pretty_name (field)); hbox = gtk_hbox_new (FALSE, 0); - gtk_box_pack_start (GTK_BOX (hbox), (GtkWidget*) label, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (hbox), (GtkWidget *) label, FALSE, FALSE, 0); gtk_table_attach_defaults (table, (GtkWidget *) hbox, 0, 1, row, row + 1); data = g_new0 (dropdown_data, 1); dropdown = gtk_combo_box_text_new (); @@ -443,7 +447,7 @@ mergeit (EContactMergingLookup *lookup) g_signal_connect (dropdown, "changed", G_CALLBACK(dropdown_changed), data); hbox = gtk_hbox_new (FALSE, 0); - gtk_box_pack_start (GTK_BOX (hbox), (GtkWidget*) dropdown, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (hbox), (GtkWidget *) dropdown, FALSE, FALSE, 0); gtk_table_attach_defaults (table, (GtkWidget *) hbox, 1, 2, row, row + 1); gtk_widget_show_all ((GtkWidget *) dropdown); } @@ -475,7 +479,8 @@ mergeit (EContactMergingLookup *lookup) } static gboolean -check_if_same (EContact *contact, EContact *match) +check_if_same (EContact *contact, + EContact *match) { EContactField field; GList *email_attr_list; @@ -487,7 +492,7 @@ check_if_same (EContact *contact, EContact *match) num_of_email = g_list_length (email_attr_list); if ((field == E_CONTACT_EMAIL_1 || field == E_CONTACT_EMAIL_2 - || field == E_CONTACT_EMAIL_3 || field == E_CONTACT_EMAIL_4) && (num_of_email<4)) { + || field == E_CONTACT_EMAIL_3 || field == E_CONTACT_EMAIL_4) && (num_of_email < 4)) { str = (gchar *) e_contact_get_const (contact, field); switch (num_of_email) { @@ -522,7 +527,9 @@ check_if_same (EContact *contact, EContact *match) } static void -response (GtkWidget *dialog, gint response, EContactMergingLookup *lookup) +response (GtkWidget *dialog, + gint response, + EContactMergingLookup *lookup) { static gint merge_response; @@ -547,7 +554,10 @@ response (GtkWidget *dialog, gint response, EContactMergingLookup *lookup) } static void -match_query_callback (EContact *contact, EContact *match, EABContactMatchType type, gpointer closure) +match_query_callback (EContact *contact, + EContact *match, + EABContactMatchType type, + gpointer closure) { EContactMergingLookup *lookup = closure; gint flag; @@ -631,9 +641,9 @@ match_query_callback (EContact *contact, EContact *match, EABContactMatchType ty gboolean eab_merging_book_add_contact (EBookClient *book_client, - EContact *contact, - EABMergingIdAsyncCallback cb, - gpointer closure) + EContact *contact, + EABMergingIdAsyncCallback cb, + gpointer closure) { EContactMergingLookup *lookup; @@ -654,9 +664,9 @@ eab_merging_book_add_contact (EBookClient *book_client, gboolean eab_merging_book_modify_contact (EBookClient *book_client, - EContact *contact, - EABMergingAsyncCallback cb, - gpointer closure) + EContact *contact, + EABMergingAsyncCallback cb, + gpointer closure) { EContactMergingLookup *lookup; @@ -677,9 +687,9 @@ eab_merging_book_modify_contact (EBookClient *book_client, gboolean eab_merging_book_find_contact (EBookClient *book_client, - EContact *contact, - EABMergingContactAsyncCallback cb, - gpointer closure) + EContact *contact, + EABMergingContactAsyncCallback cb, + gpointer closure) { EContactMergingLookup *lookup; diff --git a/addressbook/gui/widgets/e-addressbook-model.c b/addressbook/gui/widgets/e-addressbook-model.c index dc1068dea3..74e794bd6e 100644 --- a/addressbook/gui/widgets/e-addressbook-model.c +++ b/addressbook/gui/widgets/e-addressbook-model.c @@ -324,10 +324,13 @@ view_complete_cb (EBookClientView *client_view, static void readonly_cb (EBookClient *book_client, - GParamSpec *pspec, + GParamSpec *pspec, EAddressbookModel *model) { - e_addressbook_model_set_editable (model, !e_client_is_readonly (E_CLIENT (book_client))); + gboolean editable; + + editable = !e_client_is_readonly (E_CLIENT (book_client)); + e_addressbook_model_set_editable (model, editable); } static void @@ -734,7 +737,7 @@ e_addressbook_model_get_type (void) return type; } -EAddressbookModel* +EAddressbookModel * e_addressbook_model_new (void) { return g_object_new (E_TYPE_ADDRESSBOOK_MODEL, NULL); @@ -742,7 +745,7 @@ e_addressbook_model_new (void) EContact * e_addressbook_model_get_contact (EAddressbookModel *model, - gint row) + gint row) { GPtrArray *array; @@ -845,6 +848,8 @@ void e_addressbook_model_set_client (EAddressbookModel *model, EBookClient *book_client) { + gboolean editable; + g_return_if_fail (E_IS_ADDRESSBOOK_MODEL (model)); g_return_if_fail (E_IS_BOOK_CLIENT (book_client)); @@ -878,7 +883,8 @@ e_addressbook_model_set_client (EAddressbookModel *model, book_client, "backend-died", G_CALLBACK (backend_died_cb), model); - e_addressbook_model_set_editable (model, !e_client_is_readonly (E_CLIENT (book_client))); + editable = !e_client_is_readonly (E_CLIENT (book_client)); + e_addressbook_model_set_editable (model, editable); if (model->priv->client_view_idle_id == 0) model->priv->client_view_idle_id = g_idle_add ( diff --git a/addressbook/gui/widgets/e-addressbook-reflow-adapter.c b/addressbook/gui/widgets/e-addressbook-reflow-adapter.c index 680a511d05..0d2fc85478 100644 --- a/addressbook/gui/widgets/e-addressbook-reflow-adapter.c +++ b/addressbook/gui/widgets/e-addressbook-reflow-adapter.c @@ -99,7 +99,8 @@ unlink_model (EAddressbookReflowAdapter *adapter) } static gint -text_height (PangoLayout *layout, const gchar *text) +text_height (PangoLayout *layout, + const gchar *text) { gint height; @@ -119,7 +120,8 @@ addressbook_dispose (GObject *object) } static void -addressbook_set_width (EReflowModel *erm, gint width) +addressbook_set_width (EReflowModel *erm, + gint width) { } @@ -135,14 +137,16 @@ addressbook_count (EReflowModel *erm) /* This function returns the height of the minicontact in question */ static gint -addressbook_height (EReflowModel *erm, gint i, GnomeCanvasGroup *parent) +addressbook_height (EReflowModel *erm, + gint i, + GnomeCanvasGroup *parent) { EAddressbookReflowAdapter *adapter = E_ADDRESSBOOK_REFLOW_ADAPTER (erm); EAddressbookReflowAdapterPrivate *priv = adapter->priv; EContactField field; gint count = 0; gchar *string; - EContact *contact = (EContact*) e_addressbook_model_contact_at (priv->model, i); + EContact *contact = (EContact *) e_addressbook_model_contact_at (priv->model, i); PangoLayout *layout; gint height; @@ -220,18 +224,21 @@ addressbook_create_cmp_cache (EReflowModel *erm) } static gint -addressbook_compare (EReflowModel *erm, gint n1, gint n2, GHashTable *cmp_cache) +addressbook_compare (EReflowModel *erm, + gint n1, + gint n2, + GHashTable *cmp_cache) { EAddressbookReflowAdapter *adapter = E_ADDRESSBOOK_REFLOW_ADAPTER (erm); EAddressbookReflowAdapterPrivate *priv = adapter->priv; EContact *contact1, *contact2; if (priv->loading) { - return n1-n2; + return n1 - n2; } else { - contact1 = (EContact*) e_addressbook_model_contact_at (priv->model, n1); - contact2 = (EContact*) e_addressbook_model_contact_at (priv->model, n2); + contact1 = (EContact *) e_addressbook_model_contact_at (priv->model, n1); + contact2 = (EContact *) e_addressbook_model_contact_at (priv->model, n2); if (contact1 && contact2) { const gchar *file_as1, *file_as2; @@ -292,7 +299,9 @@ adapter_open_contact (EMinicard *card, } static GnomeCanvasItem * -addressbook_incarnate (EReflowModel *erm, gint i, GnomeCanvasGroup *parent) +addressbook_incarnate (EReflowModel *erm, + gint i, + GnomeCanvasGroup *parent) { EAddressbookReflowAdapter *adapter = E_ADDRESSBOOK_REFLOW_ADAPTER (erm); EAddressbookReflowAdapterPrivate *priv = adapter->priv; @@ -319,7 +328,9 @@ addressbook_incarnate (EReflowModel *erm, gint i, GnomeCanvasGroup *parent) } static void -addressbook_reincarnate (EReflowModel *erm, gint i, GnomeCanvasItem *item) +addressbook_reincarnate (EReflowModel *erm, + gint i, + GnomeCanvasItem *item) { EAddressbookReflowAdapter *adapter = E_ADDRESSBOOK_REFLOW_ADAPTER (erm); EAddressbookReflowAdapterPrivate *priv = adapter->priv; @@ -331,8 +342,9 @@ addressbook_reincarnate (EReflowModel *erm, gint i, GnomeCanvasItem *item) static void create_contact (EAddressbookModel *model, - gint index, gint count, - EAddressbookReflowAdapter *adapter) + gint index, + gint count, + EAddressbookReflowAdapter *adapter) { e_reflow_model_items_inserted (E_REFLOW_MODEL (adapter), index, @@ -341,8 +353,8 @@ create_contact (EAddressbookModel *model, static void remove_contacts (EAddressbookModel *model, - gpointer data, - EAddressbookReflowAdapter *adapter) + gpointer data, + EAddressbookReflowAdapter *adapter) { GArray *indices = (GArray *) data; gint count = indices->len; @@ -358,22 +370,22 @@ remove_contacts (EAddressbookModel *model, static void modify_contact (EAddressbookModel *model, - gint index, - EAddressbookReflowAdapter *adapter) + gint index, + EAddressbookReflowAdapter *adapter) { e_reflow_model_item_changed (E_REFLOW_MODEL (adapter), index); } static void model_changed (EAddressbookModel *model, - EAddressbookReflowAdapter *adapter) + EAddressbookReflowAdapter *adapter) { e_reflow_model_changed (E_REFLOW_MODEL (adapter)); } static void search_started (EAddressbookModel *model, - EAddressbookReflowAdapter *adapter) + EAddressbookReflowAdapter *adapter) { EAddressbookReflowAdapterPrivate *priv = adapter->priv; @@ -382,8 +394,8 @@ search_started (EAddressbookModel *model, static void search_result (EAddressbookModel *model, - const GError *error, - EAddressbookReflowAdapter *adapter) + const GError *error, + EAddressbookReflowAdapter *adapter) { EAddressbookReflowAdapterPrivate *priv = adapter->priv; @@ -394,14 +406,14 @@ search_result (EAddressbookModel *model, static void addressbook_set_property (GObject *object, - guint prop_id, + guint property_id, const GValue *value, GParamSpec *pspec) { EAddressbookReflowAdapter *adapter = E_ADDRESSBOOK_REFLOW_ADAPTER (object); EAddressbookReflowAdapterPrivate *priv = adapter->priv; - switch (prop_id) { + switch (property_id) { case PROP_CLIENT: g_object_set (priv->model, "client", g_value_get_object (value), @@ -418,21 +430,21 @@ addressbook_set_property (GObject *object, NULL); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void addressbook_get_property (GObject *object, - guint prop_id, + guint property_id, GValue *value, GParamSpec *pspec) { EAddressbookReflowAdapter *adapter = E_ADDRESSBOOK_REFLOW_ADAPTER (object); EAddressbookReflowAdapterPrivate *priv = adapter->priv; - switch (prop_id) { + switch (property_id) { case PROP_CLIENT: { g_object_get_property (G_OBJECT (priv->model), "client", value); @@ -452,7 +464,7 @@ addressbook_get_property (GObject *object, g_value_set_object (value, priv->model); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } @@ -568,7 +580,7 @@ e_addressbook_reflow_adapter_get_type (void) void e_addressbook_reflow_adapter_construct (EAddressbookReflowAdapter *adapter, - EAddressbookModel *model) + EAddressbookModel *model) { EAddressbookReflowAdapterPrivate *priv = adapter->priv; @@ -616,7 +628,7 @@ e_addressbook_reflow_adapter_new (EAddressbookModel *model) EContact * e_addressbook_reflow_adapter_get_contact (EAddressbookReflowAdapter *adapter, - gint index) + gint index) { EAddressbookReflowAdapterPrivate *priv = adapter->priv; diff --git a/addressbook/gui/widgets/e-addressbook-table-adapter.c b/addressbook/gui/widgets/e-addressbook-table-adapter.c index e47b5bb186..f102b684d7 100644 --- a/addressbook/gui/widgets/e-addressbook-table-adapter.c +++ b/addressbook/gui/widgets/e-addressbook-table-adapter.c @@ -107,7 +107,9 @@ addressbook_row_count (ETableModel *etc) /* This function returns the value at a particular point in our ETableModel. */ static gpointer -addressbook_value_at (ETableModel *etc, gint col, gint row) +addressbook_value_at (ETableModel *etc, + gint col, + gint row) { EAddressbookTableAdapter *adapter = EAB_TABLE_ADAPTER (etc); EAddressbookTableAdapterPrivate *priv = adapter->priv; @@ -157,7 +159,10 @@ contact_modified_cb (EBookClient *book_client, } static void -addressbook_set_value_at (ETableModel *etc, gint col, gint row, gconstpointer val) +addressbook_set_value_at (ETableModel *etc, + gint col, + gint row, + gconstpointer val) { EAddressbookTableAdapter *adapter = EAB_TABLE_ADAPTER (etc); EAddressbookTableAdapterPrivate *priv = adapter->priv; @@ -199,33 +204,17 @@ addressbook_set_value_at (ETableModel *etc, gint col, gint row, gconstpointer va /* This function returns whether a particular cell is editable. */ static gboolean -addressbook_is_cell_editable (ETableModel *etc, gint col, gint row) +addressbook_is_cell_editable (ETableModel *etc, + gint col, + gint row) { -#if 0 - EAddressbookTableAdapter *adapter = EAB_TABLE_ADAPTER (etc); - EAddressbookTableAdapterPrivate *priv = adapter->priv; - const EContact *contact; - - if (row >= 0 && row < e_addressbook_model_contact_count (priv->model)) - contact = e_addressbook_model_contact_at (priv->model, row); - else - contact = NULL; - - if (!e_addressbook_model_editable (priv->model)) - return FALSE; - else if (contact && e_contact_get ((EContact *) contact, E_CONTACT_IS_LIST)) - /* we only allow editing of the name and file as for - * lists */ - return col == E_CONTACT_FULL_NAME || col == E_CONTACT_FILE_AS; - else - return col < E_CONTACT_LAST_SIMPLE_STRING; -#endif - return FALSE; } static void -addressbook_append_row (ETableModel *etm, ETableModel *source, gint row) +addressbook_append_row (ETableModel *etm, + ETableModel *source, + gint row) { EAddressbookTableAdapter *adapter = EAB_TABLE_ADAPTER (etm); EAddressbookTableAdapterPrivate *priv = adapter->priv; @@ -248,32 +237,41 @@ addressbook_append_row (ETableModel *etm, ETableModel *source, gint row) /* This function duplicates the value passed to it. */ static gpointer -addressbook_duplicate_value (ETableModel *etc, gint col, gconstpointer value) +addressbook_duplicate_value (ETableModel *etc, + gint col, + gconstpointer value) { return g_strdup (value); } /* This function frees the value passed to it. */ static void -addressbook_free_value (ETableModel *etc, gint col, gpointer value) +addressbook_free_value (ETableModel *etc, + gint col, + gpointer value) { g_free (value); } static gpointer -addressbook_initialize_value (ETableModel *etc, gint col) +addressbook_initialize_value (ETableModel *etc, + gint col) { return g_strdup(""); } static gboolean -addressbook_value_is_empty (ETableModel *etc, gint col, gconstpointer value) +addressbook_value_is_empty (ETableModel *etc, + gint col, + gconstpointer value) { return !(value && *(gchar *) value); } static gchar * -addressbook_value_to_string (ETableModel *etc, gint col, gconstpointer value) +addressbook_value_to_string (ETableModel *etc, + gint col, + gconstpointer value) { return g_strdup (value); } @@ -316,8 +314,9 @@ eab_table_adapter_init (GObject *object) static void create_contact (EAddressbookModel *model, - gint index, gint count, - EAddressbookTableAdapter *adapter) + gint index, + gint count, + EAddressbookTableAdapter *adapter) { e_table_model_pre_change (E_TABLE_MODEL (adapter)); e_table_model_rows_inserted (E_TABLE_MODEL (adapter), index, count); @@ -325,8 +324,8 @@ create_contact (EAddressbookModel *model, static void remove_contacts (EAddressbookModel *model, - gpointer data, - EAddressbookTableAdapter *adapter) + gpointer data, + EAddressbookTableAdapter *adapter) { GArray *indices = (GArray *) data; gint count = indices->len; @@ -345,8 +344,8 @@ remove_contacts (EAddressbookModel *model, static void modify_contact (EAddressbookModel *model, - gint index, - EAddressbookTableAdapter *adapter) + gint index, + EAddressbookTableAdapter *adapter) { /* clear whole cache */ g_hash_table_remove_all (adapter->priv->emails); diff --git a/addressbook/gui/widgets/e-addressbook-view.c b/addressbook/gui/widgets/e-addressbook-view.c index 55310949b0..7f3a7a85b8 100644 --- a/addressbook/gui/widgets/e-addressbook-view.c +++ b/addressbook/gui/widgets/e-addressbook-view.c @@ -298,8 +298,8 @@ addressbook_view_create_table_view (EAddressbookView *view, e_cell_date_set_format_component (E_CELL_DATE (cell), "addressbook"); /* Here we create the table. We give it the three pieces of - the table we've created, the header, the model, and the - initial layout. It does the rest. */ + * the table we've created, the header, the model, and the + * initial layout. It does the rest. */ etspecfile = g_build_filename ( EVOLUTION_ETSPECDIR, "e-addressbook-view.etspec", NULL); widget = e_table_new_from_spec_file ( @@ -973,7 +973,8 @@ e_addressbook_view_get_view_object (EAddressbookView *view) /* Helper for e_addressbook_view_get_selected() */ static void -add_to_list (gint model_row, gpointer closure) +add_to_list (gint model_row, + gpointer closure) { GSList **list = closure; *list = g_slist_prepend (*list, GINT_TO_POINTER (model_row)); @@ -1058,7 +1059,9 @@ e_addressbook_view_get_paste_target_list (EAddressbookView *view) } static void -status_message (EAddressbookView *view, const gchar *status, gint percent) +status_message (EAddressbookView *view, + const gchar *status, + gint percent) { EActivity *activity; EShellView *shell_view; @@ -1122,7 +1125,8 @@ folder_bar_message (EAddressbookView *view, } static void -stop_state_changed (GObject *object, EAddressbookView *view) +stop_state_changed (GObject *object, + EAddressbookView *view) { command_state_change (view); } @@ -1180,7 +1184,8 @@ contact_print_button_draw_page (GtkPrintOperation *operation, } static void -e_contact_print_button (EPrintable *printable, GtkPrintOperationAction action) +e_contact_print_button (EPrintable *printable, + GtkPrintOperationAction action) { GtkPrintOperation *operation; @@ -1362,7 +1367,8 @@ addressbook_view_confirm_delete (GtkWindow *parent, } void -e_addressbook_view_delete_selection (EAddressbookView *view, gboolean is_delete) +e_addressbook_view_delete_selection (EAddressbookView *view, + gboolean is_delete) { GSList *list, *l; gboolean plural = FALSE, is_list = FALSE; @@ -1621,13 +1627,15 @@ view_transfer_contacts (EAddressbookView *view, } void -e_addressbook_view_copy_to_folder (EAddressbookView *view, gboolean all) +e_addressbook_view_copy_to_folder (EAddressbookView *view, + gboolean all) { view_transfer_contacts (view, FALSE, all); } void -e_addressbook_view_move_to_folder (EAddressbookView *view, gboolean all) +e_addressbook_view_move_to_folder (EAddressbookView *view, + gboolean all) { view_transfer_contacts (view, TRUE, all); } diff --git a/addressbook/gui/widgets/e-minicard-label.c b/addressbook/gui/widgets/e-minicard-label.c index 967853d7b6..c22ffe58a5 100644 --- a/addressbook/gui/widgets/e-minicard-label.c +++ b/addressbook/gui/widgets/e-minicard-label.c @@ -37,8 +37,8 @@ static void e_minicard_label_init (EMinicardLabel *card); static void e_minicard_label_class_init (EMinicardLabelClass *klass); -static void e_minicard_label_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); -static void e_minicard_label_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); +static void e_minicard_label_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); +static void e_minicard_label_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); static gboolean e_minicard_label_event (GnomeCanvasItem *item, GdkEvent *event); static void e_minicard_label_realize (GnomeCanvasItem *item); static void e_minicard_label_unrealize (GnomeCanvasItem *item); @@ -199,7 +199,10 @@ e_minicard_label_init (EMinicardLabel *minicard_label) } static void -e_minicard_label_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) +e_minicard_label_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) { EMinicardLabel *e_minicard_label; GnomeCanvasItem *item; @@ -207,7 +210,7 @@ e_minicard_label_set_property (GObject *object, guint prop_id, const GValue *va e_minicard_label = E_MINICARD_LABEL (object); item = GNOME_CANVAS_ITEM (object); - switch (prop_id) { + switch (property_id) { case PROP_WIDTH: e_minicard_label->width = g_value_get_double (value); e_minicard_label_resize_children (e_minicard_label); @@ -234,19 +237,22 @@ e_minicard_label_set_property (GObject *object, guint prop_id, const GValue *va g_object_set (e_minicard_label->field, "editable", FALSE /* e_minicard_label->editable */, NULL); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void -e_minicard_label_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) +e_minicard_label_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) { EMinicardLabel *e_minicard_label; e_minicard_label = E_MINICARD_LABEL (object); - switch (prop_id) { + switch (property_id) { case PROP_WIDTH: g_value_set_double (value, e_minicard_label->width); break; @@ -275,7 +281,7 @@ e_minicard_label_get_property (GObject *object, guint prop_id, GValue *value, G g_value_set_boolean (value, e_minicard_label->editable); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } @@ -341,7 +347,8 @@ e_minicard_label_unrealize (GnomeCanvasItem *item) } static gboolean -e_minicard_label_event (GnomeCanvasItem *item, GdkEvent *event) +e_minicard_label_event (GnomeCanvasItem *item, + GdkEvent *event) { EMinicardLabel *e_minicard_label; @@ -455,13 +462,15 @@ set_colors (EMinicardLabel *label) } static void -e_minicard_label_style_set (EMinicardLabel *label, GtkStyle *previous_style) +e_minicard_label_style_set (EMinicardLabel *label, + GtkStyle *previous_style) { set_colors (label); } static void -e_minicard_label_reflow (GnomeCanvasItem *item, gint flags) +e_minicard_label_reflow (GnomeCanvasItem *item, + gint flags) { EMinicardLabel *e_minicard_label = E_MINICARD_LABEL (item); diff --git a/addressbook/gui/widgets/e-minicard-view-widget.c b/addressbook/gui/widgets/e-minicard-view-widget.c index 65fa12d9f1..0a0b19df94 100644 --- a/addressbook/gui/widgets/e-minicard-view-widget.c +++ b/addressbook/gui/widgets/e-minicard-view-widget.c @@ -37,12 +37,12 @@ static void e_minicard_view_widget_class_init (EMinicardViewWidgetClass *class); static void e_minicard_view_widget_set_property (GObject *object, - guint prop_id, + guint property_id, const GValue *value, GParamSpec *pspec); static void e_minicard_view_widget_get_property (GObject *object, - guint prop_id, + guint property_id, GValue *value, GParamSpec *pspec); static void e_minicard_view_widget_dispose (GObject *object); @@ -231,15 +231,15 @@ e_minicard_view_widget_new (EAddressbookReflowAdapter *adapter) static void e_minicard_view_widget_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec) + guint property_id, + const GValue *value, + GParamSpec *pspec) { EMinicardViewWidget *emvw; emvw = E_MINICARD_VIEW_WIDGET (object); - switch (prop_id) { + switch (property_id) { case PROP_CLIENT: if (emvw->book_client) g_object_unref (emvw->book_client); @@ -277,22 +277,22 @@ e_minicard_view_widget_set_property (GObject *object, } break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void e_minicard_view_widget_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) + guint property_id, + GValue *value, + GParamSpec *pspec) { EMinicardViewWidget *emvw; emvw = E_MINICARD_VIEW_WIDGET (object); - switch (prop_id) { + switch (property_id) { case PROP_CLIENT: g_value_set_object (value, emvw->book_client); break; @@ -306,7 +306,7 @@ e_minicard_view_widget_get_property (GObject *object, g_value_set_double (value, emvw->column_width); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } @@ -335,49 +335,57 @@ e_minicard_view_widget_dispose (GObject *object) } static void -selection_change (ESelectionModel *esm, EMinicardViewWidget *widget) +selection_change (ESelectionModel *esm, + EMinicardViewWidget *widget) { - g_signal_emit (widget, - signals[SELECTION_CHANGE], 0); + g_signal_emit (widget, signals[SELECTION_CHANGE], 0); } static void -selection_row_change (ESelectionModel *esm, gint row, EMinicardViewWidget *widget) +selection_row_change (ESelectionModel *esm, + gint row, + EMinicardViewWidget *widget) { selection_change (esm, widget); } static void -column_width_changed (ESelectionModel *esm, double width, EMinicardViewWidget *widget) +column_width_changed (ESelectionModel *esm, + gdouble width, + EMinicardViewWidget *widget) { - g_signal_emit (widget, - signals[COLUMN_WIDTH_CHANGED], 0, width); + g_signal_emit (widget, signals[COLUMN_WIDTH_CHANGED], 0, width); } static void -create_contact (EMinicardView *view, EMinicardViewWidget *widget) +create_contact (EMinicardView *view, + EMinicardViewWidget *widget) { g_signal_emit (widget, signals[CREATE_CONTACT], 0); } static void -create_contact_list (EMinicardView *view, EMinicardViewWidget *widget) +create_contact_list (EMinicardView *view, + EMinicardViewWidget *widget) { g_signal_emit (widget, signals[CREATE_CONTACT_LIST], 0); } static guint -right_click (EMinicardView *view, GdkEvent *event, EMinicardViewWidget *widget) +right_click (EMinicardView *view, + GdkEvent *event, + EMinicardViewWidget *widget) { guint ret_val; - g_signal_emit (widget, - signals[RIGHT_CLICK], 0, - event, &ret_val); + + g_signal_emit (widget, signals[RIGHT_CLICK], 0, event, &ret_val); + return ret_val; } static void -e_minicard_view_widget_style_set (GtkWidget *widget, GtkStyle *previous_style) +e_minicard_view_widget_style_set (GtkWidget *widget, + GtkStyle *previous_style) { EMinicardViewWidget *view = E_MINICARD_VIEW_WIDGET (widget); GtkStyle *style; @@ -493,7 +501,7 @@ e_minicard_view_widget_get_selection_model (EMinicardViewWidget *view) } EMinicardView * -e_minicard_view_widget_get_view (EMinicardViewWidget *view) +e_minicard_view_widget_get_view (EMinicardViewWidget *view) { if (view->emv) return E_MINICARD_VIEW (view->emv); @@ -502,7 +510,8 @@ e_minicard_view_widget_get_view (EMinicardViewWidget *view) } static gboolean -e_minicard_view_widget_real_focus_in_event (GtkWidget *widget, GdkEventFocus *event) +e_minicard_view_widget_real_focus_in_event (GtkWidget *widget, + GdkEventFocus *event) { GnomeCanvas *canvas; EMinicardViewWidget *view; @@ -524,6 +533,5 @@ e_minicard_view_widget_real_focus_in_event (GtkWidget *widget, GdkEventFocus *ev return GTK_WIDGET_CLASS (parent_class)->focus_in_event (widget, event); return FALSE; - } diff --git a/addressbook/gui/widgets/e-minicard-view.c b/addressbook/gui/widgets/e-minicard-view.c index 91a4a12991..ba52e7a0a8 100644 --- a/addressbook/gui/widgets/e-minicard-view.c +++ b/addressbook/gui/widgets/e-minicard-view.c @@ -81,11 +81,11 @@ static GtkTargetEntry drag_types[] = { static void e_minicard_view_drag_data_get (GtkWidget *widget, - GdkDragContext *context, - GtkSelectionData *selection_data, - guint info, - guint time, - EMinicardView *view) + GdkDragContext *context, + GtkSelectionData *selection_data, + guint info, + guint time, + EMinicardView *view) { GdkAtom target; @@ -149,7 +149,7 @@ e_minicard_view_drag_begin (EAddressbookReflowAdapter *adapter, target_list = gtk_target_list_new (drag_types, G_N_ELEMENTS (drag_types)); context = gtk_drag_begin (GTK_WIDGET (GNOME_CANVAS_ITEM (view)->canvas), - target_list, actions, 1/*XXX*/, event); + target_list, actions, 1/*XXX */, event); if (!view->canvas_drag_data_get_id) view->canvas_drag_data_get_id = g_signal_connect ( @@ -235,15 +235,15 @@ adapter_changed (EMinicardView *view) static void e_minicard_view_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec) + guint property_id, + const GValue *value, + GParamSpec *pspec) { EMinicardView *view; view = E_MINICARD_VIEW (object); - switch (prop_id) { + switch (property_id) { case PROP_ADAPTER: if (view->adapter) { if (view->writable_status_id || view->stop_state_id) { @@ -303,22 +303,22 @@ e_minicard_view_set_property (GObject *object, set_empty_message (view); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void e_minicard_view_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) + guint property_id, + GValue *value, + GParamSpec *pspec) { EMinicardView *view; view = E_MINICARD_VIEW (object); - switch (prop_id) { + switch (property_id) { case PROP_ADAPTER: g_value_set_object (value, view->adapter); break; @@ -335,7 +335,7 @@ e_minicard_view_get_property (GObject *object, "editable", value); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } @@ -378,7 +378,8 @@ e_minicard_view_dispose (GObject *object) } static guint -e_minicard_view_right_click (EMinicardView *view, GdkEvent *event) +e_minicard_view_right_click (EMinicardView *view, + GdkEvent *event) { guint ret_val = 0; g_signal_emit (view, signals[RIGHT_CLICK], 0, @@ -387,7 +388,8 @@ e_minicard_view_right_click (EMinicardView *view, GdkEvent *event) } static gboolean -e_minicard_view_event (GnomeCanvasItem *item, GdkEvent *event) +e_minicard_view_event (GnomeCanvasItem *item, + GdkEvent *event) { EMinicardView *view; @@ -463,32 +465,6 @@ e_minicard_view_selection_event (EReflow *reflow, return return_val; } -#if 0 -static gint -compare_to_utf_str (EMinicard *card, const gchar *utf_str) -{ - g_return_val_if_fail (card != NULL, 0); - g_return_val_if_fail (E_IS_MINICARD (card), 0); - - if (g_unichar_isdigit (g_utf8_get_char (utf_str))) { - return 1; - } - - if (card->card) { - gchar *file_as; - g_object_get (card->card, - "file_as", &file_as, - NULL); - if (file_as) - return g_utf8_strcasecmp (file_as, utf_str); - else - return 0; - } else { - return 0; - } -} -#endif - static void e_minicard_view_class_init (EMinicardViewClass *klass) { @@ -625,7 +601,8 @@ typedef struct { } ModelAndList; static void -add_to_list (gint index, gpointer closure) +add_to_list (gint index, + gpointer closure) { ModelAndList *mal = closure; mal->list = g_slist_prepend ( diff --git a/addressbook/gui/widgets/e-minicard.c b/addressbook/gui/widgets/e-minicard.c index 352604984c..78d98e2cb2 100644 --- a/addressbook/gui/widgets/e-minicard.c +++ b/addressbook/gui/widgets/e-minicard.c @@ -43,8 +43,8 @@ static void e_minicard_init (EMinicard *card); static void e_minicard_class_init (EMinicardClass *class); -static void e_minicard_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); -static void e_minicard_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); +static void e_minicard_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); +static void e_minicard_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); static void e_minicard_dispose (GObject *object); static void e_minicard_finalize (GObject *object); static gboolean e_minicard_event (GnomeCanvasItem *item, GdkEvent *event); @@ -266,7 +266,8 @@ e_minicard_init (EMinicard *minicard) } static void -set_selected (EMinicard *minicard, gboolean selected) +set_selected (EMinicard *minicard, + gboolean selected) { GnomeCanvas *canvas; GtkStyle *style; @@ -299,7 +300,8 @@ set_selected (EMinicard *minicard, gboolean selected) } static void -set_has_cursor (EMinicard *minicard, gboolean has_cursor) +set_has_cursor (EMinicard *minicard, + gboolean has_cursor) { if (!minicard->has_focus && has_cursor) e_canvas_item_grab_focus (GNOME_CANVAS_ITEM (minicard), FALSE); @@ -307,7 +309,10 @@ set_has_cursor (EMinicard *minicard, gboolean has_cursor) } static void -e_minicard_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) +e_minicard_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) { GnomeCanvasItem *item; EMinicard *e_minicard; @@ -317,7 +322,7 @@ e_minicard_set_property (GObject *object, guint prop_id, const GValue *value, G item = GNOME_CANVAS_ITEM (object); e_minicard = E_MINICARD (object); - switch (prop_id) { + switch (property_id) { case PROP_WIDTH: if (e_minicard->width != g_value_get_double (value)) { e_minicard->width = g_value_get_double (value); @@ -376,19 +381,22 @@ e_minicard_set_property (GObject *object, guint prop_id, const GValue *value, G e_minicard->changed = FALSE; break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void -e_minicard_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) +e_minicard_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) { EMinicard *e_minicard; e_minicard = E_MINICARD (object); - switch (prop_id) { + switch (property_id) { case PROP_WIDTH: g_value_set_double (value, e_minicard->width); break; @@ -411,7 +419,7 @@ e_minicard_get_property (GObject *object, guint prop_id, GValue *value, GParamS g_value_set_object (value, e_minicard->contact); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } @@ -466,7 +474,8 @@ e_minicard_finalize (GObject *object) } static void -e_minicard_style_set (EMinicard *minicard, GtkStyle *previous_style) +e_minicard_style_set (EMinicard *minicard, + GtkStyle *previous_style) { GnomeCanvasItem *item = GNOME_CANVAS_ITEM (minicard); @@ -552,7 +561,8 @@ e_minicard_activate_editor (EMinicard *minicard) } static gboolean -e_minicard_event (GnomeCanvasItem *item, GdkEvent *event) +e_minicard_event (GnomeCanvasItem *item, + GdkEvent *event) { EMinicard *e_minicard; @@ -658,7 +668,7 @@ e_minicard_event (GnomeCanvasItem *item, GdkEvent *event) gint view_index = e_sorter_model_to_sorted (reflow->selection->sorter, model_index); if (view_index == 0) - view_index = row_count-1; + view_index = row_count - 1; else view_index--; @@ -683,7 +693,7 @@ e_minicard_event (GnomeCanvasItem *item, GdkEvent *event) gint model_index = e_selection_model_cursor_row (reflow->selection); gint view_index = e_sorter_model_to_sorted (reflow->selection->sorter, model_index); - if (view_index == row_count-1) + if (view_index == row_count - 1) view_index = 0; else view_index++; @@ -718,7 +728,7 @@ e_minicard_event (GnomeCanvasItem *item, GdkEvent *event) } static void -e_minicard_resize_children ( EMinicard *e_minicard ) +e_minicard_resize_children (EMinicard *e_minicard) { GList *list; gboolean is_list = GPOINTER_TO_INT (e_contact_get (e_minicard->contact, E_CONTACT_IS_LIST)); @@ -742,7 +752,9 @@ e_minicard_resize_children ( EMinicard *e_minicard ) } static void -add_field (EMinicard *e_minicard, EContactField field, gdouble left_width) +add_field (EMinicard *e_minicard, + EContactField field, + gdouble left_width) { GnomeCanvasItem *new_item; GnomeCanvasGroup *group; @@ -808,7 +820,11 @@ get_email_location (EVCardAttribute *attr) } static void -add_email_field (EMinicard *e_minicard, GList *email_list, gdouble left_width, gint limit, gboolean is_list) +add_email_field (EMinicard *e_minicard, + GList *email_list, + gdouble left_width, + gint limit, + gboolean is_list) { GnomeCanvasItem *new_item; GnomeCanvasGroup *group; @@ -820,7 +836,7 @@ add_email_field (EMinicard *e_minicard, GList *email_list, gdouble left_width, g GList *emails = e_contact_get (e_minicard->contact, E_CONTACT_EMAIL); group = GNOME_CANVAS_GROUP ( e_minicard ); - for (l=email_list, le=emails; l!=NULL && count < limit && le!=NULL; l = l->next, le=le->next) { + for (l = email_list, le = emails; l != NULL && count < limit && le != NULL; l = l->next, le = le->next) { const gchar *tmp; gchar *email = NULL; gchar *string = NULL; @@ -881,7 +897,8 @@ add_email_field (EMinicard *e_minicard, GList *email_list, gdouble left_width, g } static gint -get_left_width (EMinicard *e_minicard, gboolean is_list) +get_left_width (EMinicard *e_minicard, + gboolean is_list) { gchar *name; EContactField field; @@ -910,7 +927,7 @@ get_left_width (EMinicard *e_minicard, gboolean is_list) } static void -remodel ( EMinicard *e_minicard ) +remodel (EMinicard *e_minicard) { GnomeCanvasItem *item = GNOME_CANVAS_ITEM (e_minicard); gint count = 0; @@ -947,7 +964,7 @@ remodel ( EMinicard *e_minicard ) for (field = E_CONTACT_FULL_NAME; field != (E_CONTACT_LAST_SIMPLE_STRING -1) && count < 5; field++) { EMinicardField *minicard_field = NULL; - gboolean is_email=FALSE; + gboolean is_email = FALSE; if (field == E_CONTACT_FAMILY_NAME || field == E_CONTACT_GIVEN_NAME) continue; @@ -958,7 +975,7 @@ remodel ( EMinicard *e_minicard ) if (email_rendered) continue; email_rendered = TRUE; - is_email=TRUE; + is_email = TRUE; } if (list) @@ -992,7 +1009,7 @@ remodel ( EMinicard *e_minicard ) limit = 5 - count; email = e_contact_get_attributes (e_minicard->contact, E_CONTACT_EMAIL); add_email_field (e_minicard, email, left_width, limit, is_list); - if (count+limit >5) + if (count + limit >5) count = 5; else count = count + g_list_length (email); @@ -1014,7 +1031,8 @@ remodel ( EMinicard *e_minicard ) } static void -e_minicard_reflow (GnomeCanvasItem *item, gint flags) +e_minicard_reflow (GnomeCanvasItem *item, + gint flags) { EMinicard *e_minicard = E_MINICARD (item); @@ -1074,7 +1092,8 @@ e_minicard_get_card_id (EMinicard *minicard) } gint -e_minicard_compare (EMinicard *minicard1, EMinicard *minicard2) +e_minicard_compare (EMinicard *minicard1, + EMinicard *minicard2) { gint cmp = 0; @@ -1109,7 +1128,8 @@ e_minicard_compare (EMinicard *minicard1, EMinicard *minicard2) } gint -e_minicard_selected (EMinicard *minicard, GdkEvent *event) +e_minicard_selected (EMinicard *minicard, + GdkEvent *event) { gint ret_val = 0; GnomeCanvasItem *item = GNOME_CANVAS_ITEM (minicard); @@ -1129,7 +1149,8 @@ e_minicard_selected (EMinicard *minicard, GdkEvent *event) } static gint -e_minicard_drag_begin (EMinicard *minicard, GdkEvent *event) +e_minicard_drag_begin (EMinicard *minicard, + GdkEvent *event) { gint ret_val = 0; GnomeCanvasItem *parent; diff --git a/addressbook/gui/widgets/ea-addressbook-view.c b/addressbook/gui/widgets/ea-addressbook-view.c index 2d432b6a76..c5bb9fc018 100644 --- a/addressbook/gui/widgets/ea-addressbook-view.c +++ b/addressbook/gui/widgets/ea-addressbook-view.c @@ -106,7 +106,7 @@ ea_ab_view_get_description (AtkObject *accessible) return _("evolution address book"); } -AtkObject* +AtkObject * ea_ab_view_new (GObject *obj) { GObject *object; diff --git a/addressbook/gui/widgets/ea-addressbook-view.h b/addressbook/gui/widgets/ea-addressbook-view.h index db9e008ab1..55da1d5e37 100644 --- a/addressbook/gui/widgets/ea-addressbook-view.h +++ b/addressbook/gui/widgets/ea-addressbook-view.h @@ -48,7 +48,7 @@ struct _EaABViewClass }; GType ea_ab_view_get_type (void); -AtkObject* ea_ab_view_new (GObject *obj); +AtkObject * ea_ab_view_new (GObject *obj); G_END_DECLS diff --git a/addressbook/gui/widgets/ea-addressbook.c b/addressbook/gui/widgets/ea-addressbook.c index b67d876139..b57720be39 100644 --- a/addressbook/gui/widgets/ea-addressbook.c +++ b/addressbook/gui/widgets/ea-addressbook.c @@ -36,9 +36,9 @@ EA_FACTORY_GOBJECT (EA_TYPE_MINICARD_VIEW, ea_minicard_view, ea_minicard_view_ne EA_FACTORY_GOBJECT (EA_TYPE_AB_VIEW, ea_ab_view, ea_ab_view_new) static gboolean ea_addressbook_focus_watcher (GSignalInvocationHint *ihint, - guint n_param_values, - const GValue *param_values, - gpointer data); + guint n_param_values, + const GValue *param_values, + gpointer data); void e_minicard_a11y_init (void) { @@ -64,9 +64,9 @@ void eab_view_a11y_init (void) static gboolean ea_addressbook_focus_watcher (GSignalInvocationHint *ihint, - guint n_param_values, - const GValue *param_values, - gpointer data) + guint n_param_values, + const GValue *param_values, + gpointer data) { GObject *object; GdkEvent *event; diff --git a/addressbook/gui/widgets/ea-minicard-view.c b/addressbook/gui/widgets/ea-minicard-view.c index a61c6074a0..58d3a5fd2b 100644 --- a/addressbook/gui/widgets/ea-minicard-view.c +++ b/addressbook/gui/widgets/ea-minicard-view.c @@ -51,7 +51,7 @@ static void atk_selection_interface_init (AtkSelectionIface *iface); static gboolean selection_interface_add_selection (AtkSelection *selection, gint i); static gboolean selection_interface_clear_selection (AtkSelection *selection); -static AtkObject* selection_interface_ref_selection (AtkSelection *selection, +static AtkObject * selection_interface_ref_selection (AtkSelection *selection, gint i); static gint selection_interface_get_selection_count (AtkSelection *selection); static gboolean selection_interface_is_child_selected (AtkSelection *selection, @@ -187,7 +187,7 @@ ea_minicard_view_get_description (AtkObject *accessible) return _("evolution address book"); } -AtkObject* +AtkObject * ea_minicard_view_new (GObject *obj) { GObject *object; @@ -242,7 +242,8 @@ static AtkStateSet *ea_minicard_view_ref_state_set (AtkObject *obj) } static AtkObject * -ea_minicard_view_ref_child (AtkObject *accessible, gint index) +ea_minicard_view_ref_child (AtkObject *accessible, + gint index) { EReflow *reflow; gint child_num; @@ -288,7 +289,8 @@ atk_selection_interface_init (AtkSelectionIface *iface) } static gboolean -selection_interface_add_selection (AtkSelection *selection, gint i) +selection_interface_add_selection (AtkSelection *selection, + gint i) { AtkGObjectAccessible *atk_gobj= NULL; EReflow *reflow = NULL; @@ -322,8 +324,9 @@ selection_interface_clear_selection (AtkSelection *selection) return TRUE; } -static AtkObject* -selection_interface_ref_selection (AtkSelection *selection, gint i) +static AtkObject * +selection_interface_ref_selection (AtkSelection *selection, + gint i) { return ea_minicard_view_ref_child (ATK_OBJECT (selection), i); } @@ -344,7 +347,8 @@ selection_interface_get_selection_count (AtkSelection *selection) } static gboolean -selection_interface_is_child_selected (AtkSelection *selection, gint i) +selection_interface_is_child_selected (AtkSelection *selection, + gint i) { AtkGObjectAccessible *atk_gobj = NULL; EReflow *reflow = NULL; @@ -407,13 +411,15 @@ static gint atk_action_interface_get_n_action (AtkAction *iface) } static const gchar * -atk_action_interface_get_description (AtkAction *iface, gint i) +atk_action_interface_get_description (AtkAction *iface, + gint i) { return atk_action_interface_get_name (iface, i); } static const gchar * -atk_action_interface_get_name (AtkAction *iface, gint i) +atk_action_interface_get_name (AtkAction *iface, + gint i) { if ( i >= G_N_ELEMENTS (action_name) || i < 0) return NULL; diff --git a/addressbook/gui/widgets/ea-minicard-view.h b/addressbook/gui/widgets/ea-minicard-view.h index 320c74d15e..889674bb92 100644 --- a/addressbook/gui/widgets/ea-minicard-view.h +++ b/addressbook/gui/widgets/ea-minicard-view.h @@ -49,7 +49,7 @@ struct _EaMinicardViewClass GType ea_minicard_view_get_type (void); -AtkObject* ea_minicard_view_new (GObject *obj); +AtkObject * ea_minicard_view_new (GObject *obj); G_END_DECLS diff --git a/addressbook/gui/widgets/ea-minicard.c b/addressbook/gui/widgets/ea-minicard.c index 2e8d4281ef..45d496ffa0 100644 --- a/addressbook/gui/widgets/ea-minicard.c +++ b/addressbook/gui/widgets/ea-minicard.c @@ -229,7 +229,8 @@ ea_minicard_get_n_children (AtkObject *accessible) } static AtkObject * -ea_minicard_ref_child (AtkObject *accessible, gint index) +ea_minicard_ref_child (AtkObject *accessible, + gint index) { return NULL; } @@ -246,7 +247,8 @@ atk_action_interface_init (AtkActionIface *iface) } static gboolean -atk_action_interface_do_action (AtkAction *iface, gint i) +atk_action_interface_do_action (AtkAction *iface, + gint i) { EMinicard *minicard = NULL; @@ -278,13 +280,15 @@ atk_action_interface_get_n_action (AtkAction *iface) } static const gchar * -atk_action_interface_get_description (AtkAction *iface, gint i) +atk_action_interface_get_description (AtkAction *iface, + gint i) { return atk_action_interface_get_name (iface, i); } static const gchar * -atk_action_interface_get_name (AtkAction *iface, gint i) +atk_action_interface_get_name (AtkAction *iface, + gint i) { if ( i >= G_N_ELEMENTS (action_name) || i < 0) return NULL; diff --git a/addressbook/gui/widgets/ea-minicard.h b/addressbook/gui/widgets/ea-minicard.h index d4c96fa787..ea27158011 100644 --- a/addressbook/gui/widgets/ea-minicard.h +++ b/addressbook/gui/widgets/ea-minicard.h @@ -49,7 +49,7 @@ struct _EaMinicardClass }; GType ea_minicard_get_type (void); -AtkObject* ea_minicard_new (GObject *obj); +AtkObject * ea_minicard_new (GObject *obj); G_END_DECLS diff --git a/addressbook/gui/widgets/eab-config.c b/addressbook/gui/widgets/eab-config.c index 5cb8d25e81..e1a0501203 100644 --- a/addressbook/gui/widgets/eab-config.c +++ b/addressbook/gui/widgets/eab-config.c @@ -40,7 +40,8 @@ ecp_init (EABConfig *cfg) } static void -ecp_target_free (EConfig *ec, EConfigTarget *t) +ecp_target_free (EConfig *ec, + EConfigTarget *t) { struct _EABConfigPrivate *p = EAB_CONFIG (ec)->priv; @@ -78,13 +79,15 @@ ecp_target_free (EConfig *ec, EConfigTarget *t) } static void -ecp_source_changed (struct _ESource *source, EConfig *ec) +ecp_source_changed (ESource *source, + EConfig *ec) { e_config_target_changed (ec, E_CONFIG_TARGET_CHANGED_STATE); } static void -ecp_set_target (EConfig *ec, EConfigTarget *t) +ecp_set_target (EConfig *ec, + EConfigTarget *t) { struct _EABConfigPrivate *p = EAB_CONFIG (ec)->priv; @@ -137,7 +140,8 @@ eab_config_get_type (void) } EABConfig * -eab_config_new (gint type, const gchar *menuid) +eab_config_new (gint type, + const gchar *menuid) { EABConfig *ecp = g_object_new (eab_config_get_type (), NULL); e_config_construct (&ecp->config, type, menuid); @@ -145,7 +149,8 @@ eab_config_new (gint type, const gchar *menuid) } EABConfigTargetSource * -eab_config_target_new_source (EABConfig *ecp, struct _ESource *source) +eab_config_target_new_source (EABConfig *ecp, + ESource *source) { EABConfigTargetSource *t = e_config_target_new ( &ecp->config, EAB_CONFIG_TARGET_SOURCE, sizeof (*t)); @@ -157,7 +162,8 @@ eab_config_target_new_source (EABConfig *ecp, struct _ESource *source) } EABConfigTargetPrefs * -eab_config_target_new_prefs (EABConfig *ecp, GConfClient *gconf) +eab_config_target_new_prefs (EABConfig *ecp, + GConfClient *gconf) { EABConfigTargetPrefs *t = e_config_target_new ( &ecp->config, EAB_CONFIG_TARGET_PREFS, sizeof (*t)); diff --git a/addressbook/gui/widgets/eab-config.h b/addressbook/gui/widgets/eab-config.h index 7cf79244e2..70023360e0 100644 --- a/addressbook/gui/widgets/eab-config.h +++ b/addressbook/gui/widgets/eab-config.h @@ -25,6 +25,7 @@ #define __EAB_CONFIG_H__ #include +#include #include "e-util/e-config.h" #define EAB_TYPE_CONFIG (eab_config_get_type ()) @@ -56,7 +57,7 @@ typedef struct _EABConfigTargetSource EABConfigTargetSource; struct _EABConfigTargetSource { EConfigTarget target; - struct _ESource *source; + ESource *source; }; typedef struct _EABConfigTargetPrefs EABConfigTargetPrefs; @@ -73,7 +74,7 @@ typedef struct _EConfigItem EABConfigItem; GType eab_config_get_type (void); EABConfig *eab_config_new (gint type, const gchar *menuid); -EABConfigTargetSource *eab_config_target_new_source (EABConfig *ecp, struct _ESource *source); +EABConfigTargetSource *eab_config_target_new_source (EABConfig *ecp, ESource *source); EABConfigTargetPrefs *eab_config_target_new_prefs (EABConfig *ecp, GConfClient *gconf); G_END_DECLS diff --git a/addressbook/gui/widgets/eab-contact-display.c b/addressbook/gui/widgets/eab-contact-display.c index 56a2511d64..da558352bb 100644 --- a/addressbook/gui/widgets/eab-contact-display.c +++ b/addressbook/gui/widgets/eab-contact-display.c @@ -52,7 +52,7 @@ struct _EABContactDisplayPrivate { GtkOrientation orientation; gboolean show_maps; - GHashTable *closed_lists; /* see render_contact_list_* */ + GHashTable *closed_lists; /* see render_contact_list_ * */ }; enum { @@ -193,7 +193,9 @@ static GtkActionEntry internal_mailto_entries[] = { }; static void -render_address_link (GString *buffer, EContact *contact, gint map_type) +render_address_link (GString *buffer, + EContact *contact, + gint map_type) { EContactAddress *adr; GString *link = g_string_new (""); @@ -366,8 +368,7 @@ accum_multival_attribute (GString *buffer, GList *val_list, *l; /* Workaround till bug [1] is fixed. - [1] https://bugzilla.gnome.org/show_bug.cgi?id=473862 - */ + * [1] https://bugzilla.gnome.org/show_bug.cgi?id=473862 */ icon = NULL; val_list = e_contact_get (contact, field); @@ -409,7 +410,8 @@ get_email_location (EVCardAttribute *attr) } static void -render_title_block (GString *buffer, EContact *contact) +render_title_block (GString *buffer, + EContact *contact) { const gchar *str; gchar *html; @@ -455,9 +457,9 @@ render_title_block (GString *buffer, EContact *contact) static void render_contact_list_row (GString *buffer, - EDestination *destination, - EABContactDisplay *display) - { + EDestination *destination, + EABContactDisplay *display) +{ gchar *evolution_imagesdir = g_filename_to_uri (EVOLUTION_IMAGESDIR, NULL, NULL); gboolean list_collapsed = FALSE; const gchar *listId = e_destination_get_contact_uid (destination), *textrep; @@ -576,13 +578,14 @@ render_contact_list (GString *buffer, } static void -render_contact_block (GString *buffer, EContact *contact) +render_contact_block (GString *buffer, + EContact *contact) { GString *accum; GList *email_list, *l, *email_attr_list, *al; gint email_num = 0; const gchar *nl; - gchar *nick=NULL; + gchar *nick = NULL; accum = g_string_new (""); nl = ""; @@ -592,7 +595,7 @@ render_contact_block (GString *buffer, EContact *contact) email_list = e_contact_get (contact, E_CONTACT_EMAIL); email_attr_list = e_contact_get_attributes (contact, E_CONTACT_EMAIL); - for (l = email_list, al=email_attr_list; l && al; l = l->next, al = al->next) { + for (l = email_list, al = email_attr_list; l && al; l = l->next, al = al->next) { gchar *name = NULL, *mail = NULL; gchar *attr_str = (gchar *) get_email_location ((EVCardAttribute *) al->data); @@ -669,7 +672,8 @@ render_contact_block (GString *buffer, EContact *contact) } static void -render_work_block (GString *buffer, EContact *contact) +render_work_block (GString *buffer, + EContact *contact) { GString *accum = g_string_new (""); @@ -696,7 +700,8 @@ render_work_block (GString *buffer, EContact *contact) } static void -render_personal_block (GString *buffer, EContact *contact) +render_personal_block (GString *buffer, + EContact *contact) { GString *accum = g_string_new (""); @@ -719,7 +724,8 @@ render_personal_block (GString *buffer, EContact *contact) } static void -render_note_block (GString *buffer, EContact *contact) +render_note_block (GString *buffer, + EContact *contact) { const gchar *str; gchar *html; @@ -738,7 +744,9 @@ render_note_block (GString *buffer, EContact *contact) } static void -render_address_map (GString *buffer, EContact *contact, gint map_type) +render_address_map (GString *buffer, + EContact *contact, + gint map_type) { #ifdef WITH_CONTACT_MAPS if (map_type == E_CONTACT_ADDRESS_WORK) { @@ -750,7 +758,9 @@ render_address_map (GString *buffer, EContact *contact, gint map_type) } static void -render_contact_horizontal (GString *buffer, EContact *contact, gboolean show_maps) +render_contact_horizontal (GString *buffer, + EContact *contact, + gboolean show_maps) { g_string_append (buffer, ""); render_title_block (buffer, contact); @@ -776,7 +786,9 @@ render_contact_horizontal (GString *buffer, EContact *contact, gboolean show_map } static void -render_contact_vertical (GString *buffer, EContact *contact, gboolean show_maps) +render_contact_vertical (GString *buffer, + EContact *contact, + gboolean show_maps) { /* First row: photo & name */ g_string_append (buffer, "
"); @@ -817,7 +829,10 @@ render_contact_vertical (GString *buffer, EContact *contact, gboolean show_maps) } static void -render_contact (GString *buffer, EContact *contact, GtkOrientation orientation, gboolean show_maps) +render_contact (GString *buffer, + EContact *contact, + GtkOrientation orientation, + gboolean show_maps) { if (orientation == GTK_ORIENTATION_VERTICAL) render_contact_vertical (buffer, contact, show_maps); @@ -911,9 +926,9 @@ eab_contact_display_render_compact (EABContactDisplay *display, GdkPixbuf *pixbuf; /* figure out if we need to downscale the - image here. we don't scale the pixbuf - itself, just insert width/height tags in - the html */ + * image here. we don't scale the pixbuf + * itself, just insert width/height tags in + * the html */ gdk_pixbuf_loader_write (loader, photo->data.inlined.data, photo->data.inlined.length, NULL); gdk_pixbuf_loader_close (loader, NULL); pixbuf = gdk_pixbuf_loader_get_pixbuf (loader); @@ -1259,7 +1274,7 @@ contact_display_link_clicked (EWebView *web_view, contact_display_emit_send_message (display, index); return; } else if (g_str_has_prefix (uri, "##") && g_str_has_suffix (uri, "##")) { - gchar *list_id = g_strndup (uri+2, strlen (uri) - 4); + gchar *list_id = g_strndup (uri + 2, strlen (uri) - 4); if (g_hash_table_lookup (display->priv->closed_lists, list_id)) { g_hash_table_remove (display->priv->closed_lists, list_id); @@ -1278,19 +1293,21 @@ contact_display_link_clicked (EWebView *web_view, } #ifdef WITH_CONTACT_MAPS -/** - * Clutter event handling workaround. Clutter-gtk propagates events down to parent widgets. - * In this case it leads to GtkHTML scrolling up and down while user's trying to zoom in the - * champlain widget. This workaround stops the propagation from map widget down to GtkHTML - */ +/* XXX Clutter event handling workaround. Clutter-gtk propagates events down + * to parent widgets. In this case it leads to GtkHTML scrolling up and + * down while user's trying to zoom in the champlain widget. This + * workaround stops the propagation from map widget down to GtkHTML. */ static gboolean -handle_map_scroll_event (GtkWidget *widget, GdkEvent *event) +handle_map_scroll_event (GtkWidget *widget, + GdkEvent *event) { return TRUE; } static void -contact_display_object_requested (GtkHTML *html, GtkHTMLEmbedded *eb, EABContactDisplay *display) +contact_display_object_requested (GtkHTML *html, + GtkHTMLEmbedded *eb, + EABContactDisplay *display) { EContact *contact = display->priv->contact; const gchar *name = e_contact_get_const (contact, E_CONTACT_FILE_AS); @@ -1587,7 +1604,8 @@ eab_contact_display_get_orientation (EABContactDisplay *display) } void -eab_contact_display_set_orientation (EABContactDisplay *display, GtkOrientation orientation) +eab_contact_display_set_orientation (EABContactDisplay *display, + GtkOrientation orientation) { EABContactDisplayMode mode; EContact *contact; @@ -1620,7 +1638,8 @@ eab_contact_display_get_show_maps (EABContactDisplay *display) } void -eab_contact_display_set_show_maps (EABContactDisplay *display, gboolean show_maps) +eab_contact_display_set_show_maps (EABContactDisplay *display, + gboolean show_maps) { EABContactDisplayMode mode; EContact *contact; diff --git a/addressbook/gui/widgets/eab-gui-util.c b/addressbook/gui/widgets/eab-gui-util.c index d910b339b4..c951b290c7 100644 --- a/addressbook/gui/widgets/eab-gui-util.c +++ b/addressbook/gui/widgets/eab-gui-util.c @@ -83,23 +83,29 @@ typedef enum { } AddressFormat; void -eab_error_dialog (EAlertSink *alert_sink, const gchar *msg, const GError *error) +eab_error_dialog (EAlertSink *alert_sink, + const gchar *msg, + const GError *error) { if (error && error->message) { if (alert_sink) - e_alert_submit (alert_sink, - "addressbook:generic-error", - msg, error->message, NULL); + e_alert_submit ( + alert_sink, + "addressbook:generic-error", + msg, error->message, NULL); else e_alert_run_dialog_for_args ( - e_shell_get_active_window (NULL), - "addressbook:generic-error", - msg, error->message, NULL); + e_shell_get_active_window (NULL), + "addressbook:generic-error", + msg, error->message, NULL); } } void -eab_load_error_dialog (GtkWidget *parent, EAlertSink *alert_sink, ESource *source, const GError *error) +eab_load_error_dialog (GtkWidget *parent, + EAlertSink *alert_sink, + ESource *source, + const GError *error) { gchar *label_string, *label = NULL, *uri; gboolean can_detail_error = TRUE; @@ -110,10 +116,12 @@ eab_load_error_dialog (GtkWidget *parent, EAlertSink *alert_sink, ESource *sourc if (g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_OFFLINE_UNAVAILABLE)) { can_detail_error = FALSE; - label_string = _("This address book cannot be opened. This either means this " - "book is not marked for offline usage or not yet downloaded " - "for offline usage. Please load the address book once in online mode " - "to download its contents."); + label_string = + _("This address book cannot be opened. This either " + "means this book is not marked for offline usage " + "or not yet downloaded for offline usage. Please " + "load the address book once in online mode to " + "download its contents."); } else if (uri && g_str_has_prefix (uri, "local:")) { @@ -187,7 +195,8 @@ eab_load_error_dialog (GtkWidget *parent, EAlertSink *alert_sink, ESource *sourc } void -eab_search_result_dialog (EAlertSink *alert_sink, const GError *error) +eab_search_result_dialog (EAlertSink *alert_sink, + const GError *error) { gchar *str = NULL; @@ -265,7 +274,8 @@ make_safe_filename (gchar *name) } static void -source_selection_changed_cb (ESourceSelector *selector, GtkWidget *ok_button) +source_selection_changed_cb (ESourceSelector *selector, + GtkWidget *ok_button) { ESource *except_source = NULL, *selected; @@ -276,7 +286,11 @@ source_selection_changed_cb (ESourceSelector *selector, GtkWidget *ok_button) } ESource * -eab_select_source (ESource *except_source, const gchar *title, const gchar *message, const gchar *select_uid, GtkWindow *parent) +eab_select_source (ESource *except_source, + const gchar *title, + const gchar *message, + const gchar *select_uid, + GtkWindow *parent) { ESource *source; ESourceList *source_list; @@ -395,7 +409,8 @@ remove_contact_ready_cb (GObject *source_object, } static void -do_delete_from_source (gpointer data, gpointer user_data) +do_delete_from_source (gpointer data, + gpointer user_data) { ContactCopyProcess *process = user_data; EContact *contact = data; @@ -441,7 +456,10 @@ process_unref (ContactCopyProcess *process) } static void -contact_added_cb (EBookClient *book_client, const GError *error, const gchar *id, gpointer user_data) +contact_added_cb (EBookClient *book_client, + const GError *error, + const gchar *id, + gpointer user_data) { ContactCopyProcess *process = user_data; @@ -462,7 +480,8 @@ contact_added_cb (EBookClient *book_client, const GError *error, const gchar *id } static void -do_copy (gpointer data, gpointer user_data) +do_copy (gpointer data, + gpointer user_data) { EBookClient *book_client; EContact *contact; @@ -568,11 +587,12 @@ eab_transfer_contacts (EBookClient *source_client, } /* To parse something like... -=?UTF-8?Q?=E0=A4=95=E0=A4=95=E0=A4=AC=E0=A5=82=E0=A5=8B=E0=A5=87?=\t\n=?UTF-8?Q?=E0=A4=B0?=\t\n -and return the decoded representation of name & email parts. -*/ + * =?UTF-8?Q?=E0=A4=95=E0=A4=95=E0=A4=AC=E0=A5=82=E0=A5=8B=E0=A5=87?=\t\n=?UTF-8?Q?=E0=A4=B0?=\t\n + * and return the decoded representation of name & email parts. */ gboolean -eab_parse_qp_email (const gchar *string, gchar **name, gchar **email) +eab_parse_qp_email (const gchar *string, + gchar **name, + gchar **email) { struct _camel_header_address *address; gboolean res = FALSE; @@ -595,9 +615,9 @@ eab_parse_qp_email (const gchar *string, gchar **name, gchar **email) } /* This is only wrapper to parse_qp_mail, it decodes string and if returned TRUE, - then makes one string and returns it, otherwise returns NULL. - Returned string is usable to place directly into GtkHtml stream. - Returned value should be freed with g_free. */ + * then makes one string and returns it, otherwise returns NULL. + * Returned string is usable to place directly into GtkHtml stream. + * Returned value should be freed with g_free. */ gchar * eab_parse_qp_email_to_html (const gchar *string) { @@ -731,7 +751,7 @@ country_to_ISO (const gchar *country) } /* If we get here, then no match was found in the map file and we - fallback to local system locales */ + * fallback to local system locales */ fclose (file); pair = get_locales (); @@ -748,8 +768,8 @@ country_to_ISO (const gchar *country) */ static gchar * get_key_file_locale_string (GKeyFile *key_file, - const gchar *key, - const gchar *locale) + const gchar *key, + const gchar *locale) { gchar *result; gchar *group; @@ -773,9 +793,9 @@ get_key_file_locale_string (GKeyFile *key_file, static void get_address_format (AddressFormat address_format, - const gchar *locale, - gchar **format, - gchar **country_position) + const gchar *locale, + gchar **format, + gchar **country_position) { GKeyFile *key_file; GError *error; @@ -858,7 +878,8 @@ find_balanced_bracket (const gchar *str) } static GString * -string_append_upper (GString *str, const gchar *c) +string_append_upper (GString *str, + const gchar *c) { gchar *up_c; @@ -876,10 +897,10 @@ string_append_upper (GString *str, const gchar *c) static gboolean parse_address_template_section (const gchar *format, - const gchar *realname, - const gchar *org_name, - EContactAddress *address, - gchar **result) + const gchar *realname, + const gchar *org_name, + EContactAddress *address, + gchar **result) { const gchar *pos, *old_pos; @@ -1026,7 +1047,7 @@ parse_address_template_section (const gchar *format, gchar * eab_format_address (EContact *contact, - EContactField address_type) + EContactField address_type) { gchar *result; gchar *format = NULL; @@ -1063,7 +1084,7 @@ eab_format_address (EContact *contact, } /* Expand all the variables in format. - Don't display organization in home address */ + * Don't display organization in home address */ parse_address_template_section (format, e_contact_get_const (contact, E_CONTACT_FULL_NAME), (address_type == E_CONTACT_ADDRESS_WORK) ? e_contact_get_const (contact, E_CONTACT_ORG): NULL, @@ -1071,7 +1092,7 @@ eab_format_address (EContact *contact, &result); /* Add the country line. In some countries, the address can be located above the - rest of the address */ + * rest of the address */ if (addr->country && country_position) { gchar *country_upper = g_utf8_strup (addr->country, -1); gchar *p = result; diff --git a/addressbook/gui/widgets/gal-view-minicard.c b/addressbook/gui/widgets/gal-view-minicard.c index 6033b34758..280ae7583f 100644 --- a/addressbook/gui/widgets/gal-view-minicard.c +++ b/addressbook/gui/widgets/gal-view-minicard.c @@ -236,8 +236,8 @@ gal_view_minicard_new (const gchar *title) * Returns: The GalViewMinicard. */ GalView * -gal_view_minicard_construct (GalViewMinicard *view, - const gchar *title) +gal_view_minicard_construct (GalViewMinicard *view, + const gchar *title) { view->title = g_strdup (title); diff --git a/addressbook/importers/evolution-addressbook-importers.h b/addressbook/importers/evolution-addressbook-importers.h index e4579cbc4e..0ba2c9b6f4 100644 --- a/addressbook/importers/evolution-addressbook-importers.h +++ b/addressbook/importers/evolution-addressbook-importers.h @@ -18,6 +18,8 @@ * */ +#include + struct _EImportImporter *evolution_ldif_importer_peek (void); struct _EImportImporter *evolution_vcard_importer_peek (void); struct _EImportImporter *evolution_csv_outlook_importer_peek (void); @@ -25,4 +27,4 @@ struct _EImportImporter *evolution_csv_mozilla_importer_peek (void); struct _EImportImporter *evolution_csv_evolution_importer_peek (void); /* private utility function for importers only */ -struct _GtkWidget *evolution_contact_importer_get_preview_widget (const GSList *contacts); +GtkWidget *evolution_contact_importer_get_preview_widget (const GSList *contacts); diff --git a/addressbook/importers/evolution-csv-importer.c b/addressbook/importers/evolution-csv-importer.c index 43e9339a81..f41a806940 100644 --- a/addressbook/importers/evolution-csv-importer.c +++ b/addressbook/importers/evolution-csv-importer.c @@ -270,7 +270,9 @@ static import_fields csv_fields_evolution[] = { }; static void -add_to_notes (EContact *contact, const gchar *field_text, gchar *val) +add_to_notes (EContact *contact, + const gchar *field_text, + gchar *val) { GString *new_text; @@ -289,32 +291,32 @@ add_to_notes (EContact *contact, const gchar *field_text, gchar *val) } /* @str: a date string in the format MM-DD-YYYY or MMDDYYYY */ -static EContactDate* +static EContactDate * date_from_string (const gchar *str) { - EContactDate* date; + EContactDate * date; gint i = 0; g_return_val_if_fail (str != NULL, NULL); date = e_contact_date_new (); - if (g_ascii_isdigit (str[i]) && g_ascii_isdigit (str[i+1])) { - date->month = str[i] * 10 + str[i+1] - '0' * 11; - i = i+3; + if (g_ascii_isdigit (str[i]) && g_ascii_isdigit (str[i + 1])) { + date->month = str[i] * 10 + str[i + 1] - '0' * 11; + i = i + 3; } else { date->month = str[i] - '0' * 1; - i = i+2; + i = i + 2; } - if (g_ascii_isdigit (str[i]) && g_ascii_isdigit (str[i+1])) { - date->day = str[i] * 10 + str[i+1] - '0' * 11; - i = i+3; + if (g_ascii_isdigit (str[i]) && g_ascii_isdigit (str[i + 1])) { + date->day = str[i] * 10 + str[i + 1] - '0' * 11; + i = i + 3; } else { date->day = str[i] - '0' * 1; - i = i+2; + i = i + 2; } date->year = str[i] * 1000 + str[i + 1] * 100 + str[i + 2] * 10 + str[i + 3] - '0' * 1111; @@ -364,7 +366,8 @@ parseNextValue (const gchar **pptr) } static GHashTable * -map_fields (const gchar *header_line, gint pimporter) +map_fields (const gchar *header_line, + gint pimporter) { import_fields *fields_array = NULL; gint n_fields = -1, idx, j; @@ -417,8 +420,10 @@ map_fields (const gchar *header_line, gint pimporter) } static gboolean -parseLine (CSVImporter *gci, EContact *contact, gchar *buf) { - +parseLine (CSVImporter *gci, + EContact *contact, + gchar *buf) +{ const gchar *pptr = buf, *field_text; gchar *do_free = NULL; GString *value; @@ -501,69 +506,69 @@ parseLine (CSVImporter *gci, EContact *contact, gchar *buf) { else { switch (flags) { - case FLAG_HOME_ADDRESS|FLAG_STREET: + case FLAG_HOME_ADDRESS | FLAG_STREET: if (strlen (home_street->str) != 0) { home_street = g_string_append(home_street, ",\n"); } home_street = g_string_append (home_street, value->str); break; - case FLAG_HOME_ADDRESS|FLAG_CITY: + case FLAG_HOME_ADDRESS | FLAG_CITY: home_address->locality = g_strdup (value->str); break; - case FLAG_HOME_ADDRESS|FLAG_STATE: + case FLAG_HOME_ADDRESS | FLAG_STATE: home_address->region = g_strdup (value->str); break; - case FLAG_HOME_ADDRESS|FLAG_POSTAL_CODE: + case FLAG_HOME_ADDRESS | FLAG_POSTAL_CODE: home_address->code = g_strdup (value->str); break; - case FLAG_HOME_ADDRESS|FLAG_POBOX: + case FLAG_HOME_ADDRESS | FLAG_POBOX: home_address->po = g_strdup (value->str); break; - case FLAG_HOME_ADDRESS|FLAG_COUNTRY: + case FLAG_HOME_ADDRESS | FLAG_COUNTRY: home_address->country = g_strdup (value->str); break; - case FLAG_WORK_ADDRESS|FLAG_STREET: + case FLAG_WORK_ADDRESS | FLAG_STREET: if (strlen (work_street->str) != 0) { work_street = g_string_append(work_street, ",\n"); } work_street = g_string_append (work_street, value->str); break; - case FLAG_WORK_ADDRESS|FLAG_CITY: + case FLAG_WORK_ADDRESS | FLAG_CITY: work_address->locality = g_strdup (value->str); break; - case FLAG_WORK_ADDRESS|FLAG_STATE: + case FLAG_WORK_ADDRESS | FLAG_STATE: work_address->region = g_strdup (value->str); break; - case FLAG_WORK_ADDRESS|FLAG_POSTAL_CODE: + case FLAG_WORK_ADDRESS | FLAG_POSTAL_CODE: work_address->code = g_strdup (value->str); break; - case FLAG_WORK_ADDRESS|FLAG_POBOX: + case FLAG_WORK_ADDRESS | FLAG_POBOX: work_address->po = g_strdup (value->str); break; - case FLAG_WORK_ADDRESS|FLAG_COUNTRY: + case FLAG_WORK_ADDRESS | FLAG_COUNTRY: work_address->country = g_strdup (value->str); break; - case FLAG_OTHER_ADDRESS|FLAG_STREET: + case FLAG_OTHER_ADDRESS | FLAG_STREET: if (strlen (other_street->str) != 0) { other_street = g_string_append(other_street, ",\n"); } other_street = g_string_append (other_street, value->str); break; - case FLAG_OTHER_ADDRESS|FLAG_CITY: + case FLAG_OTHER_ADDRESS | FLAG_CITY: other_address->locality = g_strdup (value->str); break; - case FLAG_OTHER_ADDRESS|FLAG_STATE: + case FLAG_OTHER_ADDRESS | FLAG_STATE: other_address->region = g_strdup (value->str); break; - case FLAG_OTHER_ADDRESS|FLAG_POSTAL_CODE: + case FLAG_OTHER_ADDRESS | FLAG_POSTAL_CODE: other_address->code = g_strdup (value->str); break; - case FLAG_OTHER_ADDRESS|FLAG_POBOX: + case FLAG_OTHER_ADDRESS | FLAG_POBOX: other_address->po = g_strdup (value->str); break; - case FLAG_OTHER_ADDRESS|FLAG_COUNTRY: + case FLAG_OTHER_ADDRESS | FLAG_COUNTRY: other_address->country = g_strdup (value->str); break; @@ -634,7 +639,9 @@ parseLine (CSVImporter *gci, EContact *contact, gchar *buf) { } static EContact * -getNextCSVEntry (CSVImporter *gci, FILE *f) { +getNextCSVEntry (CSVImporter *gci, + FILE *f) +{ EContact *contact = NULL; GString *line; GString *str; @@ -745,15 +752,19 @@ csv_import_contacts (gpointer d) } static void -primary_selection_changed_cb (ESourceSelector *selector, EImportTarget *target) +primary_selection_changed_cb (ESourceSelector *selector, + EImportTarget *target) { - g_datalist_set_data_full(&target->data, "csv-source", - g_object_ref (e_source_selector_get_primary_selection (selector)), - g_object_unref); + g_datalist_set_data_full ( + &target->data, "csv-source", + g_object_ref (e_source_selector_get_primary_selection (selector)), + g_object_unref); } static GtkWidget * -csv_getwidget (EImport *ei, EImportTarget *target, EImportImporter *im) +csv_getwidget (EImport *ei, + EImportTarget *target, + EImportImporter *im) { GtkWidget *vbox, *selector; ESource *primary; @@ -792,7 +803,9 @@ static const gchar *supported_extensions[4] = { }; static gboolean -csv_supported (EImport *ei, EImportTarget *target, EImportImporter *im) +csv_supported (EImport *ei, + EImportTarget *target, + EImportImporter *im) { gchar *ext; gint i; @@ -868,7 +881,9 @@ book_loaded_cb (GObject *source_object, } static void -csv_import (EImport *ei, EImportTarget *target, EImportImporter *im) +csv_import (EImport *ei, + EImportTarget *target, + EImportImporter *im) { CSVImporter *gci; ESource *source; @@ -909,28 +924,37 @@ csv_import (EImport *ei, EImportTarget *target, EImportImporter *im) } static void -outlook_csv_import (EImport *ei, EImportTarget *target, EImportImporter *im) +outlook_csv_import (EImport *ei, + EImportTarget *target, + EImportImporter *im) { importer = OUTLOOK_IMPORTER; csv_import (ei, target, im); } static void -mozilla_csv_import (EImport *ei, EImportTarget *target, EImportImporter *im) +mozilla_csv_import (EImport *ei, + EImportTarget *target, + EImportImporter *im) { importer = MOZILLA_IMPORTER; csv_import (ei, target, im); } static void -evolution_csv_import (EImport *ei, EImportTarget *target, EImportImporter *im) +evolution_csv_import (EImport *ei, + EImportTarget *target, + EImportImporter *im) { importer = EVOLUTION_IMPORTER; csv_import (ei, target, im); } static void -csv_cancel (EImport *ei, EImportTarget *target, EImportImporter *im) { +csv_cancel (EImport *ei, + EImportTarget *target, + EImportImporter *im) +{ CSVImporter *gci = g_datalist_get_data(&target->data, "csv-data"); if (gci) @@ -938,7 +962,9 @@ csv_cancel (EImport *ei, EImportTarget *target, EImportImporter *im) { } static GtkWidget * -csv_get_preview (EImport *ei, EImportTarget *target, EImportImporter *im) +csv_get_preview (EImport *ei, + EImportTarget *target, + EImportImporter *im) { GtkWidget *preview; GSList *contacts = NULL; @@ -984,21 +1010,27 @@ csv_get_preview (EImport *ei, EImportTarget *target, EImportImporter *im) } static GtkWidget * -outlook_csv_get_preview (EImport *ei, EImportTarget *target, EImportImporter *im) +outlook_csv_get_preview (EImport *ei, + EImportTarget *target, + EImportImporter *im) { importer = OUTLOOK_IMPORTER; return csv_get_preview (ei, target, im); } static GtkWidget * -mozilla_csv_get_preview (EImport *ei, EImportTarget *target, EImportImporter *im) +mozilla_csv_get_preview (EImport *ei, + EImportTarget *target, + EImportImporter *im) { importer = MOZILLA_IMPORTER; return csv_get_preview (ei, target, im); } static GtkWidget * -evolution_csv_get_preview (EImport *ei, EImportTarget *target, EImportImporter *im) +evolution_csv_get_preview (EImport *ei, + EImportTarget *target, + EImportImporter *im) { importer = EVOLUTION_IMPORTER; return csv_get_preview (ei, target, im); diff --git a/addressbook/importers/evolution-ldif-importer.c b/addressbook/importers/evolution-ldif-importer.c index 72776bf2a5..8eb0c57192 100644 --- a/addressbook/importers/evolution-ldif-importer.c +++ b/addressbook/importers/evolution-ldif-importer.c @@ -130,7 +130,7 @@ ldif_fields[] = { }; static GString * -getValue ( gchar **src ) +getValue (gchar **src) { GString *dest = g_string_new(""); gchar *s = *src; @@ -166,7 +166,9 @@ getValue ( gchar **src ) } static void -populate_contact_address (EContactAddress *address, gchar *attr, gchar *value) +populate_contact_address (EContactAddress *address, + gchar *attr, + gchar *value) { if (!g_ascii_strcasecmp (attr, "locality") || !g_ascii_strcasecmp (attr, "l") || @@ -222,9 +224,11 @@ populate_contact_address (EContactAddress *address, gchar *attr, gchar *value) } static gboolean -parseLine (GHashTable *dn_contact_hash, EContact *contact, - EContactAddress *work_address, EContactAddress *home_address, - gchar **buf) +parseLine (GHashTable *dn_contact_hash, + EContact *contact, + EContactAddress *work_address, + EContactAddress *home_address, + gchar **buf) { gchar *ptr; gchar *colon, *value; @@ -352,7 +356,8 @@ parseLine (GHashTable *dn_contact_hash, EContact *contact, } static EContact * -getNextLDIFEntry (GHashTable *dn_contact_hash, FILE *f ) +getNextLDIFEntry (GHashTable *dn_contact_hash, + FILE *f) { EContact *contact; EContactAddress *work_address, *home_address; @@ -410,14 +415,15 @@ getNextLDIFEntry (GHashTable *dn_contact_hash, FILE *f ) } static void -resolve_list_card (LDIFImporter *gci, EContact *contact) +resolve_list_card (LDIFImporter *gci, + EContact *contact) { GList *email, *l; GList *email_attrs = NULL; gchar *full_name; /* set file_as to full_name so we don't later try and figure - out a first/last name for the list. */ + * out a first/last name for the list. */ full_name = e_contact_get (contact, E_CONTACT_FULL_NAME); if (full_name) e_contact_set (contact, E_CONTACT_FILE_AS, full_name); @@ -456,7 +462,8 @@ resolve_list_card (LDIFImporter *gci, EContact *contact) } static void -add_to_notes (EContact *contact, EContactField field) +add_to_notes (EContact *contact, + EContactField field) { const gchar *old_text; const gchar *field_text; @@ -488,7 +495,7 @@ ldif_import_contacts (gpointer d) gint count = 0; /* We process all normal cards immediately and keep the list - ones till the end */ + * ones till the end */ if (gci->state == 0) { while (count < 50 && (contact = getNextLDIFEntry ( @@ -516,7 +523,7 @@ ldif_import_contacts (gpointer d) } } if (gci->state == 1) { - for (iter = gci->list_iterator;count < 50 && iter;iter=iter->next) { + for (iter = gci->list_iterator; count < 50 && iter; iter = iter->next) { gchar *uid = NULL; contact = iter->data; @@ -543,15 +550,19 @@ ldif_import_contacts (gpointer d) } static void -primary_selection_changed_cb (ESourceSelector *selector, EImportTarget *target) +primary_selection_changed_cb (ESourceSelector *selector, + EImportTarget *target) { - g_datalist_set_data_full(&target->data, "ldif-source", - g_object_ref (e_source_selector_get_primary_selection (selector)), - g_object_unref); + g_datalist_set_data_full ( + &target->data, "ldif-source", + g_object_ref (e_source_selector_get_primary_selection (selector)), + g_object_unref); } static GtkWidget * -ldif_getwidget (EImport *ei, EImportTarget *target, EImportImporter *im) +ldif_getwidget (EImport *ei, + EImportTarget *target, + EImportImporter *im) { GtkWidget *vbox, *selector; ESource *primary; @@ -593,7 +604,9 @@ static const gchar *supported_extensions[3] = { }; static gboolean -ldif_supported (EImport *ei, EImportTarget *target, EImportImporter *im) +ldif_supported (EImport *ei, + EImportTarget *target, + EImportImporter *im) { gchar *ext; gint i; @@ -662,7 +675,9 @@ book_loaded_cb (GObject *source_object, } static void -ldif_import (EImport *ei, EImportTarget *target, EImportImporter *im) +ldif_import (EImport *ei, + EImportTarget *target, + EImportImporter *im) { LDIFImporter *gci; ESource *source; @@ -702,7 +717,9 @@ ldif_import (EImport *ei, EImportTarget *target, EImportImporter *im) } static void -ldif_cancel (EImport *ei, EImportTarget *target, EImportImporter *im) +ldif_cancel (EImport *ei, + EImportTarget *target, + EImportImporter *im) { LDIFImporter *gci = g_datalist_get_data(&target->data, "ldif-data"); @@ -711,7 +728,9 @@ ldif_cancel (EImport *ei, EImportTarget *target, EImportImporter *im) } static GtkWidget * -ldif_get_preview (EImport *ei, EImportTarget *target, EImportImporter *im) +ldif_get_preview (EImport *ei, + EImportTarget *target, + EImportImporter *im) { GtkWidget *preview; GSList *contacts = NULL; diff --git a/addressbook/importers/evolution-vcard-importer.c b/addressbook/importers/evolution-vcard-importer.c index 59168d883b..cf3a429337 100644 --- a/addressbook/importers/evolution-vcard-importer.c +++ b/addressbook/importers/evolution-vcard-importer.c @@ -81,7 +81,8 @@ typedef struct { static void vcard_import_done (VCardImporter *gci); static void -add_to_notes (EContact *contact, EContactField field) +add_to_notes (EContact *contact, + EContactField field) { const gchar *old_text; const gchar *field_text; @@ -105,19 +106,20 @@ add_to_notes (EContact *contact, EContactField field) } static void -vcard_import_contact (VCardImporter *gci, EContact *contact) +vcard_import_contact (VCardImporter *gci, + EContact *contact) { EContactPhoto *photo; GList *attrs, *attr; gchar *uid = NULL; /* Apple's addressbook.app exports PHOTO's without a TYPE - param, so let's figure out the format here if there's a - PHOTO attribute missing a TYPE param. - - this is sort of a hack, as EContact sets the type for us if - we use the setter. so let's e_contact_get + e_contact_set - on E_CONTACT_PHOTO. + * param, so let's figure out the format here if there's a + * PHOTO attribute missing a TYPE param. + * + * this is sort of a hack, as EContact sets the type for us if + * we use the setter. so let's e_contact_get + e_contact_set + * on E_CONTACT_PHOTO. */ photo = e_contact_get (contact, E_CONTACT_PHOTO); if (photo) { @@ -144,12 +146,11 @@ vcard_import_contact (VCardImporter *gci, EContact *contact) } e_contact_set_attributes (contact, E_CONTACT_EMAIL, attrs); - /* - Deal with TEL attributes that don't conform to what we need. - - 1. if there's no location (HOME/WORK/OTHER), default to OTHER. - 2. if there's *only* a location specified, default to VOICE. - */ + /* Deal with TEL attributes that don't conform to what we need. + * + * 1. if there's no location (HOME/WORK/OTHER), default to OTHER. + * 2. if there's *only* a location specified, default to VOICE. + */ attrs = e_vcard_get_attributes (E_VCARD (contact)); for (attr = attrs; attr; attr = attr->next) { EVCardAttribute *a = attr->data; @@ -188,7 +189,7 @@ vcard_import_contact (VCardImporter *gci, EContact *contact) if (is_work_home) { /* only WORK and HOME phone numbers require locations, - the rest should be kept as is */ + * the rest should be kept as is */ if (location_only) { /* add VOICE */ e_vcard_attribute_add_param_with_value (a, @@ -204,11 +205,8 @@ vcard_import_contact (VCardImporter *gci, EContact *contact) } } - /* - Deal with ADR and EMAIL attributes that don't conform to what we need. - - if HOME or WORK isn't specified, add TYPE=OTHER. - */ + /* Deal with ADR and EMAIL attributes that don't conform to what + * we need. If HOME or WORK isn't specified, add TYPE=OTHER. */ attrs = e_vcard_get_attributes (E_VCARD (contact)); for (attr = attrs; attr; attr = attr->next) { EVCardAttribute *a = attr->data; @@ -361,8 +359,8 @@ guess_vcard_encoding (const gchar *filename) } fclose (handle); - if (has_bom ((gunichar2*) line)) { - gunichar2 *utf16 = (gunichar2*) line; + if (has_bom ((gunichar2 *) line)) { + gunichar2 *utf16 = (gunichar2 *) line; /* Check for a BOM to try to detect UTF-16 encoded vcards * (MacOSX address book creates such vcards for example) */ @@ -391,15 +389,19 @@ guess_vcard_encoding (const gchar *filename) } static void -primary_selection_changed_cb (ESourceSelector *selector, EImportTarget *target) +primary_selection_changed_cb (ESourceSelector *selector, + EImportTarget *target) { - g_datalist_set_data_full(&target->data, "vcard-source", - g_object_ref (e_source_selector_get_primary_selection (selector)), - g_object_unref); + g_datalist_set_data_full ( + &target->data, "vcard-source", + g_object_ref (e_source_selector_get_primary_selection (selector)), + g_object_unref); } static GtkWidget * -vcard_getwidget (EImport *ei, EImportTarget *target, EImportImporter *im) +vcard_getwidget (EImport *ei, + EImportTarget *target, + EImportImporter *im) { GtkWidget *vbox, *selector; ESource *primary; @@ -437,7 +439,9 @@ vcard_getwidget (EImport *ei, EImportTarget *target, EImportImporter *im) } static gboolean -vcard_supported (EImport *ei, EImportTarget *target, EImportImporter *im) +vcard_supported (EImport *ei, + EImportTarget *target, + EImportImporter *im) { EImportTargetURI *s; gchar *filename; @@ -498,7 +502,7 @@ book_loaded_cb (GObject *source_object, if (gci->encoding == VCARD_ENCODING_UTF16) { gchar *tmp; - gunichar2 *contents_utf16 = (gunichar2*) gci->contents; + gunichar2 *contents_utf16 = (gunichar2 *) gci->contents; tmp = utf16_to_utf8 (contents_utf16); g_free (gci->contents); gci->contents = tmp; @@ -523,7 +527,9 @@ book_loaded_cb (GObject *source_object, } static void -vcard_import (EImport *ei, EImportTarget *target, EImportImporter *im) +vcard_import (EImport *ei, + EImportTarget *target, + EImportImporter *im) { VCardImporter *gci; ESource *source; @@ -570,7 +576,9 @@ vcard_import (EImport *ei, EImportTarget *target, EImportImporter *im) } static void -vcard_cancel (EImport *ei, EImportTarget *target, EImportImporter *im) +vcard_cancel (EImport *ei, + EImportTarget *target, + EImportImporter *im) { VCardImporter *gci = g_datalist_get_data(&target->data, "vcard-data"); @@ -579,7 +587,9 @@ vcard_cancel (EImport *ei, EImportTarget *target, EImportImporter *im) } static GtkWidget * -vcard_get_preview (EImport *ei, EImportTarget *target, EImportImporter *im) +vcard_get_preview (EImport *ei, + EImportTarget *target, + EImportImporter *im) { GtkWidget *preview; GSList *contacts; @@ -653,7 +663,8 @@ evolution_vcard_importer_peek (void) /* utility functions shared between all contact importers */ static void -preview_contact (EWebViewPreview *preview, EContact *contact) +preview_contact (EWebViewPreview *preview, + EContact *contact) { gint idx; gboolean had_value = FALSE; @@ -888,7 +899,8 @@ preview_contact (EWebViewPreview *preview, EContact *contact) } static void -preview_selection_changed_cb (GtkTreeSelection *selection, EWebViewPreview *preview) +preview_selection_changed_cb (GtkTreeSelection *selection, + EWebViewPreview *preview) { GtkTreeIter iter; GtkTreeModel *model = NULL; diff --git a/addressbook/printing/e-contact-print.c b/addressbook/printing/e-contact-print.c index 7719533fdd..0aac4a7530 100644 --- a/addressbook/printing/e-contact-print.c +++ b/addressbook/printing/e-contact-print.c @@ -104,7 +104,9 @@ get_font_width (GtkPrintContext *context, static void e_contact_output (GtkPrintContext *context, PangoFontDescription *font, - gdouble x, gdouble y, gdouble width, + gdouble x, + gdouble y, + gdouble width, const gchar *text) { PangoLayout *layout; @@ -184,7 +186,7 @@ e_contact_print_letter_heading (EContactPrintContext *ctxt, if (ctxt->page_nr == -1 || ctxt->pages != ctxt->page_nr) { /* only calculating number of pages - or on page we do not want to print */ + * or on page we do not want to print */ ctxt->y += pango_units_to_double (height); return; @@ -319,7 +321,7 @@ e_contact_print_contact (EContact *contact, { const gchar *value; gchar *text; - gint wrapped_lines=0; + gint wrapped_lines = 0; if (ctxt->y > page_height) e_contact_start_new_column (ctxt); @@ -341,7 +343,7 @@ e_contact_print_contact (EContact *contact, wrapped_lines = (get_font_width (ctxt->context, ctxt->style->body_font, text) / - (ctxt->column_width+4)) + 1; + (ctxt->column_width + 4)) + 1; ctxt->y = ctxt->y + ((wrapped_lines + 1) * e_contact_text_height (ctxt->context, @@ -431,7 +433,8 @@ get_bool (gchar *data) } static void -get_string (gchar *data, gchar **variable) +get_string (gchar *data, + gchar **variable) { g_free (*variable); *variable = g_strdup ((data != NULL) ? data : ""); @@ -727,8 +730,8 @@ contact_page_draw_footer (GtkPrintOperation *operation, pango_layout_set_text (layout, text, -1); pango_layout_set_width (layout, -1); - x = page_width/2.0 - page_margin; - y = page_height - page_margin/2.0; + x = page_width / 2.0 - page_margin; + y = page_height - page_margin / 2.0; cr = gtk_print_context_get_cairo_context (context); diff --git a/addressbook/printing/test-print.c b/addressbook/printing/test-print.c index 7747318175..6f461959c3 100644 --- a/addressbook/printing/test-print.c +++ b/addressbook/printing/test-print.c @@ -29,7 +29,8 @@ #include "e-contact-print.h" gint -main (gint argc, gchar *argv[]) +main (gint argc, + gchar *argv[]) { GList *shown_fields = NULL; diff --git a/addressbook/tools/evolution-addressbook-export-list-cards.c b/addressbook/tools/evolution-addressbook-export-list-cards.c index b886b2cc32..41d2217ee1 100644 --- a/addressbook/tools/evolution-addressbook-export-list-cards.c +++ b/addressbook/tools/evolution-addressbook-export-list-cards.c @@ -281,7 +281,8 @@ e_contact_csv_get_name (EContactFieldCSV csv_field) } gchar * -e_contact_csv_get (EContact * contact, EContactFieldCSV csv_field) +e_contact_csv_get (EContact *contact, + EContactFieldCSV csv_field) { gint contact_field; gchar *field_value; @@ -399,7 +400,7 @@ e_contact_csv_get (EContact * contact, EContactFieldCSV csv_field) } gchar * -e_contact_csv_get_header_line (GSList * csv_all_fields) +e_contact_csv_get_header_line (GSList *csv_all_fields) { guint field_number; @@ -429,7 +430,8 @@ e_contact_csv_get_header_line (GSList * csv_all_fields) } gchar * -e_contact_to_csv (EContact * contact, GSList * csv_all_fields) +e_contact_to_csv (EContact *contact, + GSList *csv_all_fields) { guint field_number; gint csv_field; @@ -458,7 +460,8 @@ e_contact_to_csv (EContact * contact, GSList * csv_all_fields) } gchar * -e_contact_get_csv (EContact * contact, GSList * csv_all_fields) +e_contact_get_csv (EContact *contact, + GSList *csv_all_fields) { gchar *aline; @@ -467,7 +470,7 @@ e_contact_get_csv (EContact * contact, GSList * csv_all_fields) } gchar * -check_null_pointer (gchar * orig) +check_null_pointer (gchar *orig) { gchar *result; if (orig == NULL) @@ -478,7 +481,8 @@ check_null_pointer (gchar * orig) } gchar * -delivery_address_get_sub_field (const EContactAddress * address, DeliveryAddressField sub_field) +delivery_address_get_sub_field (const EContactAddress *address, + DeliveryAddressField sub_field) { gchar *sub_field_value; gchar *str_temp, *str_temp_a; @@ -563,7 +567,11 @@ escape_string (gchar *orig) } gint -output_n_cards_file (FILE * outputfile, GSList *contacts, gint size, gint begin_no, CARD_FORMAT format) +output_n_cards_file (FILE *outputfile, + GSList *contacts, + gint size, + gint begin_no, + CARD_FORMAT format) { gint i; if (format == CARD_FORMAT_VCARD) { @@ -617,7 +625,8 @@ fork_to_background (void) } static void -action_list_cards (GSList *contacts, ActionContext * p_actctx) +action_list_cards (GSList *contacts, + ActionContext *p_actctx) { FILE *outputfile; long length; @@ -711,7 +720,7 @@ action_list_cards (GSList *contacts, ActionContext * p_actctx) } void -set_pre_defined_field (GSList ** pre_defined_fields) +set_pre_defined_field (GSList **pre_defined_fields) { *pre_defined_fields = NULL; *pre_defined_fields = g_slist_append (*pre_defined_fields, GINT_TO_POINTER (E_CONTACT_CSV_GIVEN_NAME)); @@ -760,7 +769,7 @@ set_pre_defined_field (GSList ** pre_defined_fields) } guint -action_list_cards_init (ActionContext * p_actctx) +action_list_cards_init (ActionContext *p_actctx) { EBookClient *book_client; EBookQuery *query; diff --git a/addressbook/tools/evolution-addressbook-export-list-folders.c b/addressbook/tools/evolution-addressbook-export-list-folders.c index 82241f8f67..2628c9c499 100644 --- a/addressbook/tools/evolution-addressbook-export-list-folders.c +++ b/addressbook/tools/evolution-addressbook-export-list-folders.c @@ -32,7 +32,7 @@ #include "evolution-addressbook-export.h" guint -action_list_folders_init (ActionContext * p_actctx) +action_list_folders_init (ActionContext *p_actctx) { ESourceList *addressbooks = NULL; GSList *groups, *group; diff --git a/addressbook/tools/evolution-addressbook-export.c b/addressbook/tools/evolution-addressbook-export.c index 56a2b14a54..5460c5a8bd 100644 --- a/addressbook/tools/evolution-addressbook-export.c +++ b/addressbook/tools/evolution-addressbook-export.c @@ -80,7 +80,8 @@ static GOptionEntry entries[] = { }; gint -main (gint argc, gchar **argv) +main (gint argc, + gchar **argv) { ActionContext actctx; GOptionContext *context; @@ -107,7 +108,7 @@ main (gint argc, gchar **argv) p_SetProcessDEPPolicy = GetProcAddress (GetModuleHandle ("kernel32.dll"), "SetProcessDEPPolicy"); if (p_SetProcessDEPPolicy) - (*p_SetProcessDEPPolicy) (PROCESS_DEP_ENABLE|PROCESS_DEP_DISABLE_ATL_THUNK_EMULATION); + (*p_SetProcessDEPPolicy) (PROCESS_DEP_ENABLE | PROCESS_DEP_DISABLE_ATL_THUNK_EMULATION); } #endif #endif diff --git a/calendar/gui/alarm-notify/alarm-notify-dialog.c b/calendar/gui/alarm-notify/alarm-notify-dialog.c index e409432d3f..1e54ccf53c 100644 --- a/calendar/gui/alarm-notify/alarm-notify-dialog.c +++ b/calendar/gui/alarm-notify/alarm-notify-dialog.c @@ -80,21 +80,23 @@ typedef struct { } AlarmNotify; - -static void -tree_selection_changed_cb (GtkTreeSelection *selection, gpointer data); +static void tree_selection_changed_cb (GtkTreeSelection *selection, + gpointer data); +static void fill_in_labels (AlarmNotify *an, + const gchar *summary, + const gchar *description, + const gchar *location, + time_t occur_start, + time_t occur_end); + +static void edit_pressed_cb (GtkButton *button, + gpointer user_data); +static void snooze_pressed_cb (GtkButton *button, + gpointer user_data); static void -fill_in_labels (AlarmNotify *an, const gchar *summary, const gchar *description, - const gchar *location, time_t occur_start, time_t occur_end); -static void -edit_pressed_cb (GtkButton *button, gpointer user_data); - -static void -snooze_pressed_cb (GtkButton *button, gpointer user_data); - -static void -an_update_minutes_label (GtkSpinButton *sb, gpointer data) +an_update_minutes_label (GtkSpinButton *sb, + gpointer data) { AlarmNotify *an; gint snooze_timeout_min; @@ -106,7 +108,8 @@ an_update_minutes_label (GtkSpinButton *sb, gpointer data) } static void -an_update_hrs_label (GtkSpinButton *sb, gpointer data) +an_update_hrs_label (GtkSpinButton *sb, + gpointer data) { AlarmNotify *an; gint snooze_timeout_hrs; @@ -118,7 +121,8 @@ an_update_hrs_label (GtkSpinButton *sb, gpointer data) } static void -an_update_days_label (GtkSpinButton *sb, gpointer data) +an_update_days_label (GtkSpinButton *sb, + gpointer data) { AlarmNotify *an; gint snooze_timeout_days; @@ -130,7 +134,9 @@ an_update_days_label (GtkSpinButton *sb, gpointer data) } static void -dialog_response_cb (GtkDialog *dialog, guint response_id, gpointer user_data) +dialog_response_cb (GtkDialog *dialog, + guint response_id, + gpointer user_data) { AlarmNotify *an = user_data; GtkTreeIter iter; @@ -161,7 +167,8 @@ dialog_response_cb (GtkDialog *dialog, guint response_id, gpointer user_data) } static void -edit_pressed_cb (GtkButton *button, gpointer user_data) +edit_pressed_cb (GtkButton *button, + gpointer user_data) { AlarmNotify *an = user_data; AlarmFuncInfo *funcinfo = NULL; @@ -180,7 +187,8 @@ edit_pressed_cb (GtkButton *button, gpointer user_data) #define DEFAULT_SNOOZE_MINS 5 static void -snooze_pressed_cb (GtkButton *button, gpointer user_data) +snooze_pressed_cb (GtkButton *button, + gpointer user_data) { gint snooze_timeout; AlarmNotify *an = user_data; @@ -205,7 +213,8 @@ snooze_pressed_cb (GtkButton *button, gpointer user_data) } static void -dismiss_pressed_cb (GtkButton *button, gpointer user_data) +dismiss_pressed_cb (GtkButton *button, + gpointer user_data) { AlarmNotify *an = user_data; GtkTreeModel *model = gtk_tree_view_get_model (GTK_TREE_VIEW (an->treeview)); @@ -229,7 +238,8 @@ dismiss_pressed_cb (GtkButton *button, gpointer user_data) } static void -dialog_destroyed_cb (GtkWidget *dialog, gpointer user_data) +dialog_destroyed_cb (GtkWidget *dialog, + gpointer user_data) { AlarmNotify *an = user_data; @@ -265,7 +275,7 @@ notified_alarms_dialog_new (void) G_TYPE_POINTER, /* Start */ G_TYPE_POINTER, /* End */ - G_TYPE_POINTER /* FuncInfo*/)); + G_TYPE_POINTER /* FuncInfo */)); an->builder = gtk_builder_new (); e_load_ui_builder_definition (an->builder, "alarm-notify.ui"); @@ -310,7 +320,8 @@ notified_alarms_dialog_new (void) selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (an->treeview)); gtk_tree_selection_set_mode (selection, GTK_SELECTION_SINGLE); - g_signal_connect (G_OBJECT (selection), "changed", + g_signal_connect ( + selection, "changed", G_CALLBACK (tree_selection_changed_cb), an); gtk_widget_realize (an->dialog); @@ -328,8 +339,12 @@ notified_alarms_dialog_new (void) g_signal_connect (edit_btn, "clicked", G_CALLBACK (edit_pressed_cb), an); g_signal_connect (snooze_btn, "clicked", G_CALLBACK (snooze_pressed_cb), an); g_signal_connect (an->dismiss_btn, "clicked", G_CALLBACK (dismiss_pressed_cb), an); - g_signal_connect (G_OBJECT (an->dialog), "response", G_CALLBACK (dialog_response_cb), an); - g_signal_connect (G_OBJECT (an->dialog), "destroy", G_CALLBACK (dialog_destroyed_cb), an); + g_signal_connect ( + an->dialog, "response", + G_CALLBACK (dialog_response_cb), an); + g_signal_connect ( + an->dialog, "destroy", + G_CALLBACK (dialog_destroyed_cb), an); if (!gtk_widget_get_realized (an->dialog)) gtk_widget_realize (an->dialog); @@ -337,16 +352,19 @@ notified_alarms_dialog_new (void) gtk_window_set_icon_name (GTK_WINDOW (an->dialog), "stock_alarm"); /* Set callback for updating the snooze "minutes" label */ - g_signal_connect (G_OBJECT (an->snooze_time_min), "value_changed", - G_CALLBACK (an_update_minutes_label), an); + g_signal_connect ( + an->snooze_time_min, "value_changed", + G_CALLBACK (an_update_minutes_label), an); /* Set callback for updating the snooze "hours" label */ - g_signal_connect (G_OBJECT (an->snooze_time_hrs), "value_changed", - G_CALLBACK (an_update_hrs_label), an); + g_signal_connect ( + an->snooze_time_hrs, "value_changed", + G_CALLBACK (an_update_hrs_label), an); /* Set callback for updating the snooze "days" label */ - g_signal_connect (G_OBJECT (an->snooze_time_days), "value_changed", - G_CALLBACK (an_update_days_label), an); + g_signal_connect ( + an->snooze_time_days, "value_changed", + G_CALLBACK (an_update_days_label), an); na = g_new0 (AlarmNotificationsDialog, 1); @@ -376,11 +394,16 @@ notified_alarms_dialog_new (void) **/ GtkTreeIter -add_alarm_to_notified_alarms_dialog (AlarmNotificationsDialog *na, time_t trigger, - time_t occur_start, time_t occur_end, - ECalComponentVType vtype, const gchar *summary, - const gchar *description, const gchar *location, - AlarmNotifyFunc func, gpointer func_data) +add_alarm_to_notified_alarms_dialog (AlarmNotificationsDialog *na, + time_t trigger, + time_t occur_start, + time_t occur_end, + ECalComponentVType vtype, + const gchar *summary, + const gchar *description, + const gchar *location, + AlarmNotifyFunc func, + gpointer func_data) { GtkTreeIter iter; GtkTreeModel *model = gtk_tree_view_get_model (GTK_TREE_VIEW (na->treeview)); @@ -428,7 +451,8 @@ add_alarm_to_notified_alarms_dialog (AlarmNotificationsDialog *na, time_t trigge } static void -tree_selection_changed_cb (GtkTreeSelection *selection, gpointer user_data) +tree_selection_changed_cb (GtkTreeSelection *selection, + gpointer user_data) { GtkTreeModel *model; GtkTreeIter iter; @@ -454,8 +478,12 @@ tree_selection_changed_cb (GtkTreeSelection *selection, gpointer user_data) } static void -fill_in_labels (AlarmNotify *an, const gchar *summary, const gchar *description, - const gchar *location, time_t occur_start, time_t occur_end) +fill_in_labels (AlarmNotify *an, + const gchar *summary, + const gchar *description, + const gchar *location, + time_t occur_start, + time_t occur_end) { GtkTextTagTable *table = gtk_text_tag_table_new (); GtkTextBuffer *buffer = gtk_text_buffer_new (table); diff --git a/calendar/gui/alarm-notify/alarm-notify.c b/calendar/gui/alarm-notify/alarm-notify.c index 9a4a76aa46..8682011e21 100644 --- a/calendar/gui/alarm-notify/alarm-notify.c +++ b/calendar/gui/alarm-notify/alarm-notify.c @@ -42,7 +42,7 @@ struct _AlarmNotifyPrivate { /* Mapping from EUri's to LoadedClient structures */ /* FIXME do we need per source type uri hashes? or perhaps we - just need to hash based on source */ + * just need to hash based on source */ GHashTable *uri_client_hash[E_CAL_CLIENT_SOURCE_TYPE_LAST]; ESourceList *source_lists[E_CAL_CLIENT_SOURCE_TYPE_LAST]; ESourceList *selected_calendars; diff --git a/calendar/gui/alarm-notify/alarm-queue.c b/calendar/gui/alarm-notify/alarm-queue.c index c143429f8f..d7a1346a8e 100644 --- a/calendar/gui/alarm-notify/alarm-queue.c +++ b/calendar/gui/alarm-notify/alarm-queue.c @@ -180,10 +180,10 @@ static void message_proxy (Message *msg) { g_return_if_fail (msg->func != NULL); - + * msg->func (msg); } - + * static gpointer create_thread_pool (void) { @@ -344,7 +344,7 @@ remove_queued_alarm (CompQueuedAlarms *cqa, gboolean free_object, gboolean remove_alarm) { - QueuedAlarm *qa=NULL; + QueuedAlarm *qa = NULL; GSList *l; debug (("...")); @@ -576,7 +576,9 @@ add_component_alarms (ClientAlarms *ca, /* Loads the alarms of a client for a given range of time */ static void -load_alarms (ClientAlarms *ca, time_t start, time_t end) +load_alarms (ClientAlarms *ca, + time_t start, + time_t end) { gchar *str_query, *iso_start, *iso_end; GError *error = NULL; @@ -1609,10 +1611,12 @@ display_notification (time_t trigger, tray_icon = gtk_status_icon_new (); gtk_status_icon_set_from_icon_name ( tray_icon, "appointment-soon"); - g_signal_connect (G_OBJECT (tray_icon), "activate", - G_CALLBACK (icon_activated), NULL); - g_signal_connect (G_OBJECT (tray_icon), "popup-menu", - G_CALLBACK (popup_menu), NULL); + g_signal_connect ( + tray_icon, "activate", + G_CALLBACK (icon_activated), NULL); + g_signal_connect ( + tray_icon, "popup-menu", + G_CALLBACK (popup_menu), NULL); } current_zone = config_data_get_timezone (); @@ -1661,8 +1665,9 @@ display_notification (time_t trigger, g_free (time_str); g_free (str); - g_signal_connect (G_OBJECT (tray_data->view), "objects_removed", - G_CALLBACK (on_dialog_objs_removed_cb), tray_data); + g_signal_connect ( + tray_data->view, "objects_removed", + G_CALLBACK (on_dialog_objs_removed_cb), tray_data); /* FIXME: We should remove this check */ if (!config_data_get_notify_with_tray ()) { @@ -1864,7 +1869,8 @@ mail_notification (time_t trigger, /* Performs notification of a procedure alarm */ static gboolean -procedure_notification_dialog (const gchar *cmd, const gchar *url) +procedure_notification_dialog (const gchar *cmd, + const gchar *url) { GtkWidget *container; GtkWidget *dialog; @@ -2037,7 +2043,9 @@ alarm_queue_init (gpointer data) } static gboolean -free_client_alarms_cb (gpointer key, gpointer value, gpointer user_data) +free_client_alarms_cb (gpointer key, + gpointer value, + gpointer user_data) { ClientAlarms *ca = value; @@ -2101,7 +2109,8 @@ alarm_queue_done (void) } static gboolean -compare_ids (gpointer a, gpointer b) +compare_ids (gpointer a, + gpointer b) { ECalComponentId *id, *id1; @@ -2370,7 +2379,8 @@ update_cqa (CompQueuedAlarms *cqa, } static void -update_qa (ECalComponentAlarms *alarms, QueuedAlarm *qa) +update_qa (ECalComponentAlarms *alarms, + QueuedAlarm *qa) { ECalComponentAlarmInstance *al_inst; GSList *instance_list; diff --git a/calendar/gui/alarm-notify/alarm.c b/calendar/gui/alarm-notify/alarm.c index 95d1d7b5a2..968eb95959 100644 --- a/calendar/gui/alarm-notify/alarm.c +++ b/calendar/gui/alarm-notify/alarm.c @@ -167,7 +167,8 @@ setup_timeout (void) /* Used from g_list_insert_sorted(); compares the * trigger times of two AlarmRecord structures. */ static gint -compare_alarm_by_time (gconstpointer a, gconstpointer b) +compare_alarm_by_time (gconstpointer a, + gconstpointer b) { const AlarmRecord *ara = a; const AlarmRecord *arb = b; @@ -187,7 +188,7 @@ queue_alarm (AlarmRecord *ar) old_head = alarms; /* Insert the new alarm in order if the alarm's trigger time is - after the current time */ + * after the current time */ alarms = g_list_insert_sorted (alarms, ar, compare_alarm_by_time); /* If there first item on the list didn't change, the time out is fine */ @@ -215,8 +216,10 @@ queue_alarm (AlarmRecord *ar) * the alarm will not be queued and the function will return NULL. **/ gpointer -alarm_add (time_t trigger, AlarmFunction alarm_fn, gpointer data, - AlarmDestroyNotify destroy_notify_fn) +alarm_add (time_t trigger, + AlarmFunction alarm_fn, + gpointer data, + AlarmDestroyNotify destroy_notify_fn) { AlarmRecord *ar; diff --git a/calendar/gui/alarm-notify/config-data.c b/calendar/gui/alarm-notify/config-data.c index 31425c5985..d056131280 100644 --- a/calendar/gui/alarm-notify/config-data.c +++ b/calendar/gui/alarm-notify/config-data.c @@ -124,7 +124,7 @@ config_data_get_calendars (const gchar *key) state = gconf_client_get_bool (conf_client, "/apps/evolution/calendar/notify/notify_with_tray", NULL); - if (!state) /* Should be old client*/ { + if (!state) /* Should be old client */ { GSList *source; gconf_client_set_bool (conf_client, "/apps/evolution/calendar/notify/notify_with_tray", @@ -158,8 +158,8 @@ config_data_get_calendars (const gchar *key) void config_data_replace_string_list (const gchar *key, - const gchar *old, - const gchar *new) + const gchar *old, + const gchar *new) { GSList *source, *tmp; @@ -259,7 +259,8 @@ config_data_get_notify_with_tray (void) * triggered while it was not running. **/ void -config_data_set_last_notification_time (ECalClient *cal, time_t t) +config_data_set_last_notification_time (ECalClient *cal, + time_t t) { GConfClient *client; time_t current_t, now = time (NULL); @@ -287,7 +288,7 @@ config_data_set_last_notification_time (ECalClient *cal, time_t t) return; /* we only store the new notification time if it is bigger - than the already stored one */ + * than the already stored one */ current_t = gconf_client_get_int (client, KEY_LAST_NOTIFICATION_TIME, NULL); if (t > current_t || current_t > now) gconf_client_set_int (client, KEY_LAST_NOTIFICATION_TIME, t, NULL); diff --git a/calendar/gui/alarm-notify/notify-main.c b/calendar/gui/alarm-notify/notify-main.c index a420074c4d..225dde4c26 100644 --- a/calendar/gui/alarm-notify/notify-main.c +++ b/calendar/gui/alarm-notify/notify-main.c @@ -45,7 +45,8 @@ #include "e-util/e-util-private.h" gint -main (gint argc, gchar **argv) +main (gint argc, + gchar **argv) { AlarmNotify *alarm_notify_service; gint exit_status; @@ -68,7 +69,7 @@ main (gint argc, gchar **argv) p_SetProcessDEPPolicy = GetProcAddress (GetModuleHandle ("kernel32.dll"), "SetProcessDEPPolicy"); if (p_SetProcessDEPPolicy) - (*p_SetProcessDEPPolicy) (PROCESS_DEP_ENABLE|PROCESS_DEP_DISABLE_ATL_THUNK_EMULATION); + (*p_SetProcessDEPPolicy) (PROCESS_DEP_ENABLE | PROCESS_DEP_DISABLE_ATL_THUNK_EMULATION); } #endif #endif diff --git a/calendar/gui/alarm-notify/util.c b/calendar/gui/alarm-notify/util.c index d5c6678cc4..891ea131bc 100644 --- a/calendar/gui/alarm-notify/util.c +++ b/calendar/gui/alarm-notify/util.c @@ -34,7 +34,8 @@ /* Converts a time_t to a string, relative to the specified timezone */ gchar * -timet_to_str_with_zone (time_t t, icaltimezone *zone) +timet_to_str_with_zone (time_t t, + icaltimezone *zone) { struct icaltimetype itt; struct tm tm; @@ -52,7 +53,8 @@ timet_to_str_with_zone (time_t t, icaltimezone *zone) } gchar * -calculate_time (time_t start, time_t end) +calculate_time (time_t start, + time_t end) { time_t difference = end - start; gchar *str; diff --git a/calendar/gui/calendar-config.c b/calendar/gui/calendar-config.c index 29fdb4b2cb..6d97cdf8cf 100644 --- a/calendar/gui/calendar-config.c +++ b/calendar/gui/calendar-config.c @@ -70,7 +70,7 @@ calendar_config_remove_notification (guint id) } /* Returns TRUE if the locale has 'am' and 'pm' strings defined, in which - case the user can choose between 12 and 24-hour time formats. */ + * case the user can choose between 12 and 24-hour time formats. */ gboolean calendar_config_locale_supports_12_hour_format (void) { @@ -133,14 +133,14 @@ calendar_config_get_icaltimezone (void) /* Whether we use 24-hour format or 12-hour format (AM/PM). */ gboolean -calendar_config_get_24_hour_format (void) +calendar_config_get_24_hour_format (void) { calendar_config_init (); /* If the locale defines 'am' and 'pm' strings then the user has the - choice of 12-hour or 24-hour time format, with 12-hour as the - default. If the locale doesn't have 'am' and 'pm' strings we have - to use 24-hour format, or strftime ()/strptime () won't work. */ + * choice of 12-hour or 24-hour time format, with 12-hour as the + * default. If the locale doesn't have 'am' and 'pm' strings we have + * to use 24-hour format, or strftime ()/strptime () won't work. */ if (calendar_config_locale_supports_12_hour_format ()) return gconf_client_get_bool (config, CALENDAR_CONFIG_24HOUR, NULL); @@ -157,7 +157,8 @@ calendar_config_get_month_scroll_by_week (void) } guint -calendar_config_add_notification_month_scroll_by_week (GConfClientNotifyFunc func, gpointer data) +calendar_config_add_notification_month_scroll_by_week (GConfClientNotifyFunc func, + gpointer data) { guint id; @@ -172,7 +173,7 @@ calendar_config_add_notification_month_scroll_by_week (GConfClientNotifyFunc fun /* The working days of the week, a bit-wise combination of flags. */ CalWeekdays -calendar_config_get_working_days (void) +calendar_config_get_working_days (void) { calendar_config_init (); @@ -181,7 +182,7 @@ calendar_config_get_working_days (void) /* Settings to hide completed tasks. */ gboolean -calendar_config_get_hide_completed_tasks (void) +calendar_config_get_hide_completed_tasks (void) { calendar_config_init (); @@ -189,7 +190,7 @@ calendar_config_get_hide_completed_tasks (void) } static EDurationType -calendar_config_get_hide_completed_tasks_units (void) +calendar_config_get_hide_completed_tasks_units (void) { gchar *units; EDurationType cu; @@ -232,7 +233,7 @@ calendar_config_get_hide_completed_tasks_sexp (gboolean get_completed) if (value == 0) { /* If the value is 0, we want to hide completed tasks - immediately, so we filter out all complete/incomplete tasks.*/ + * immediately, so we filter out all complete/incomplete tasks.*/ if (!get_completed) sexp = g_strdup ("(not is-completed?)"); else @@ -244,7 +245,7 @@ calendar_config_get_hide_completed_tasks_sexp (gboolean get_completed) time_t t; /* Get the current time, and subtract the appropriate - number of days/hours/minutes. */ + * number of days/hours/minutes. */ zone = calendar_config_get_icaltimezone (); tt = icaltime_current_time_with_zone (zone); @@ -265,7 +266,7 @@ calendar_config_get_hide_completed_tasks_sexp (gboolean get_completed) t = icaltime_as_timet_with_zone (tt, zone); /* Convert the time to an ISO date string, and build - the query sub-expression. */ + * the query sub-expression. */ isodate = isodate_from_time_t (t); if (!get_completed) sexp = g_strdup_printf ("(not (completed-before? (make-time \"%s\")))", isodate); @@ -299,7 +300,7 @@ calendar_config_get_dir_path (void) } /* contains list of strings, locations, recently used as the second timezone in a day view. - Free with calendar_config_free_day_second_zones. */ + * Free with calendar_config_free_day_second_zones. */ GSList * calendar_config_get_day_second_zones (void) { @@ -424,7 +425,8 @@ calendar_config_select_day_second_zone (void) } guint -calendar_config_add_notification_day_second_zone (GConfClientNotifyFunc func, gpointer data) +calendar_config_add_notification_day_second_zone (GConfClientNotifyFunc func, + gpointer data) { guint id; diff --git a/calendar/gui/calendar-config.h b/calendar/gui/calendar-config.h index 61e92efae4..0be1e203c9 100644 --- a/calendar/gui/calendar-config.h +++ b/calendar/gui/calendar-config.h @@ -34,8 +34,8 @@ #include /* These are used to get/set the working days in the week. The bit-flags are - combined together. The bits must be from 0 (Sun) to 6 (Sat) to match the - day values used by localtime etc. */ + * combined together. The bits must be from 0 (Sun) to 6 (Sat) to match the + * day values used by localtime etc. */ typedef enum { CAL_SUNDAY = 1 << 0, @@ -68,7 +68,7 @@ gboolean calendar_config_get_hide_completed_tasks (void); gchar * calendar_config_get_hide_completed_tasks_sexp (gboolean get_completed); /* Returns TRUE if the locale has 'am' and 'pm' strings defined, i.e. it - supports 12-hour time format. */ + * supports 12-hour time format. */ gboolean calendar_config_locale_supports_12_hour_format (void); void calendar_config_set_dir_path (const gchar *); diff --git a/calendar/gui/calendar-view-factory.c b/calendar/gui/calendar-view-factory.c index 67736985ce..b1d4a4fd72 100644 --- a/calendar/gui/calendar-view-factory.c +++ b/calendar/gui/calendar-view-factory.c @@ -159,7 +159,8 @@ calendar_view_factory_get_type_code (GalViewFactory *factory) /* new_view method for the calendar view factory */ static GalView * -calendar_view_factory_new_view (GalViewFactory *factory, const gchar *name) +calendar_view_factory_new_view (GalViewFactory *factory, + const gchar *name) { CalendarViewFactory *cal_view_factory; CalendarViewFactoryPrivate *priv; @@ -186,7 +187,7 @@ calendar_view_factory_new_view (GalViewFactory *factory, const gchar *name) **/ GalViewFactory * calendar_view_factory_construct (CalendarViewFactory *cal_view_factory, - GnomeCalendarViewType view_type) + GnomeCalendarViewType view_type) { CalendarViewFactoryPrivate *priv; diff --git a/calendar/gui/calendar-view.c b/calendar/gui/calendar-view.c index 78b0b15716..0931a4b189 100644 --- a/calendar/gui/calendar-view.c +++ b/calendar/gui/calendar-view.c @@ -114,14 +114,16 @@ calendar_view_finalize (GObject *object) /* load method of the calendar view */ static void -calendar_view_load (GalView *view, const gchar *filename) +calendar_view_load (GalView *view, + const gchar *filename) { /* nothing */ } /* save method of the calendar view */ static void -calendar_view_save (GalView *view, const gchar *filename) +calendar_view_save (GalView *view, + const gchar *filename) { /* nothing */ } @@ -141,7 +143,8 @@ calendar_view_get_title (GalView *view) /* set_title method of the calendar view */ static void -calendar_view_set_title (GalView *view, const gchar *title) +calendar_view_set_title (GalView *view, + const gchar *title) { CalendarView *cal_view; CalendarViewPrivate *priv; @@ -218,8 +221,8 @@ calendar_view_clone (GalView *view) **/ CalendarView * calendar_view_construct (CalendarView *cal_view, - GnomeCalendarViewType view_type, - const gchar *title) + GnomeCalendarViewType view_type, + const gchar *title) { CalendarViewPrivate *priv; @@ -245,7 +248,8 @@ calendar_view_construct (CalendarView *cal_view, * Return value: A newly-created calendar view. **/ CalendarView * -calendar_view_new (GnomeCalendarViewType view_type, const gchar *title) +calendar_view_new (GnomeCalendarViewType view_type, + const gchar *title) { CalendarView *cal_view; diff --git a/calendar/gui/comp-util.c b/calendar/gui/comp-util.c index 43f87f7fa1..9405f24b5a 100644 --- a/calendar/gui/comp-util.c +++ b/calendar/gui/comp-util.c @@ -50,7 +50,9 @@ * component object. **/ void -cal_comp_util_add_exdate (ECalComponent *comp, time_t t, icaltimezone *zone) +cal_comp_util_add_exdate (ECalComponent *comp, + time_t t, + icaltimezone *zone) { GSList *list; ECalComponentDateTime *cdt; @@ -72,7 +74,8 @@ cal_comp_util_add_exdate (ECalComponent *comp, time_t t, icaltimezone *zone) /* Returns TRUE if the TZIDs are equivalent, i.e. both NULL or the same. */ static gboolean -e_cal_component_compare_tzid (const gchar *tzid1, const gchar *tzid2) +e_cal_component_compare_tzid (const gchar *tzid1, + const gchar *tzid2) { gboolean retval = TRUE; @@ -101,8 +104,8 @@ e_cal_component_compare_tzid (const gchar *tzid1, const gchar *tzid2) **/ gboolean cal_comp_util_compare_event_timezones (ECalComponent *comp, - ECalClient *client, - icaltimezone *zone) + ECalClient *client, + icaltimezone *zone) { ECalComponentDateTime start_datetime, end_datetime; const gchar *tzid; @@ -116,8 +119,8 @@ cal_comp_util_compare_event_timezones (ECalComponent *comp, e_cal_component_get_dtend (comp, &end_datetime); /* If either the DTSTART or the DTEND is a DATE value, we return TRUE. - Maybe if one was a DATE-TIME we should check that, but that should - not happen often. */ + * Maybe if one was a DATE-TIME we should check that, but that should + * not happen often. */ if ((start_datetime.value && start_datetime.value->is_date) || (end_datetime.value && end_datetime.value->is_date)) { retval = TRUE; @@ -125,8 +128,8 @@ cal_comp_util_compare_event_timezones (ECalComponent *comp, } /* If the event uses UTC for DTSTART & DTEND, return TRUE. Outlook - will send single events as UTC, so we don't want to mark all of - these. */ + * will send single events as UTC, so we don't want to mark all of + * these. */ if ((!start_datetime.value || start_datetime.value->is_utc) && (!end_datetime.value || end_datetime.value->is_utc)) { retval = TRUE; @@ -134,8 +137,8 @@ cal_comp_util_compare_event_timezones (ECalComponent *comp, } /* If the event uses floating time for DTSTART & DTEND, return TRUE. - Imported vCalendar files will use floating times, so we don't want - to mark all of these. */ + * Imported vCalendar files will use floating times, so we don't want + * to mark all of these. */ if (!start_datetime.tzid && !end_datetime.tzid) { retval = TRUE; goto out; @@ -145,12 +148,12 @@ cal_comp_util_compare_event_timezones (ECalComponent *comp, if (e_cal_component_compare_tzid (tzid, start_datetime.tzid) && e_cal_component_compare_tzid (tzid, end_datetime.tzid)) { /* If both TZIDs are the same as the given zone's TZID, then - we know the timezones are the same so we return TRUE. */ + * we know the timezones are the same so we return TRUE. */ retval = TRUE; } else { /* If the TZIDs differ, we have to compare the UTC offsets - of the start and end times, using their own timezones and - the given timezone. */ + * of the start and end times, using their own timezones and + * the given timezone. */ if (!e_cal_client_get_timezone_sync (client, start_datetime.tzid, &start_zone, NULL, NULL)) goto out; @@ -211,7 +214,8 @@ cal_comp_util_compare_event_timezones (ECalComponent *comp, * user cancelled the deletion. **/ gboolean -cal_comp_is_on_server (ECalComponent *comp, ECalClient *client) +cal_comp_is_on_server (ECalComponent *comp, + ECalClient *client) { const gchar *uid; gchar *rid = NULL; @@ -260,7 +264,8 @@ cal_comp_is_on_server (ECalComponent *comp, ECalClient *client) * icalcomponent, not the ECalComponent. **/ gboolean -is_icalcomp_on_the_server (icalcomponent *icalcomp, ECalClient *client) +is_icalcomp_on_the_server (icalcomponent *icalcomp, + ECalClient *client) { gboolean on_server; ECalComponent *comp; @@ -435,7 +440,8 @@ cal_comp_memo_new_with_defaults (ECalClient *client) } void -cal_comp_update_time_by_active_window (ECalComponent *comp, EShell *shell) +cal_comp_update_time_by_active_window (ECalComponent *comp, + EShell *shell) { GtkWindow *window; @@ -502,7 +508,8 @@ cal_comp_update_time_by_active_window (ECalComponent *comp, EShell *shell) * Returns: the number of icons owned by the component. **/ gint -cal_comp_util_get_n_icons (ECalComponent *comp, GSList **pixbufs) +cal_comp_util_get_n_icons (ECalComponent *comp, + GSList **pixbufs) { GSList *categories_list, *elem; gint num_icons = 0; @@ -543,7 +550,8 @@ cal_comp_util_get_n_icons (ECalComponent *comp, GSList **pixbufs) * cal_comp_selection_get_string_list() to get this list from target data. **/ void -cal_comp_selection_set_string_list (GtkSelectionData *data, GSList *str_list) +cal_comp_selection_set_string_list (GtkSelectionData *data, + GSList *str_list) { /* format is "str1\0str2\0...strN\0" */ GSList *p; @@ -612,7 +620,9 @@ cal_comp_selection_get_string_list (GtkSelectionData *selection_data) } static void -datetime_to_zone (ECalClient *client, ECalComponentDateTime *date, const gchar *tzid) +datetime_to_zone (ECalClient *client, + ECalComponentDateTime *date, + const gchar *tzid) { icaltimezone *from, *to; @@ -783,7 +793,8 @@ comp_util_sanitize_recurrence_master (ECalComponent *comp, } gchar * -icalcomp_suggest_filename (icalcomponent *icalcomp, const gchar *default_name) +icalcomp_suggest_filename (icalcomponent *icalcomp, + const gchar *default_name) { icalproperty *prop; const gchar *summary = NULL; diff --git a/calendar/gui/comp-util.h b/calendar/gui/comp-util.h index 1f69ddb107..12508da42e 100644 --- a/calendar/gui/comp-util.h +++ b/calendar/gui/comp-util.h @@ -35,8 +35,8 @@ struct _EShell; void cal_comp_util_add_exdate (ECalComponent *comp, time_t t, icaltimezone *zone); /* Returns TRUE if the component uses the given timezone for both DTSTART - and DTEND, or if the UTC offsets of the start and end times are the same - as in the given zone. */ + * and DTEND, or if the UTC offsets of the start and end times are the same + * as in the given zone. */ gboolean cal_comp_util_compare_event_timezones (ECalComponent *comp, ECalClient *client, icaltimezone *zone); diff --git a/calendar/gui/dialogs/alarm-dialog.c b/calendar/gui/dialogs/alarm-dialog.c index ab50520d5c..59cdb4515b 100644 --- a/calendar/gui/dialogs/alarm-dialog.c +++ b/calendar/gui/dialogs/alarm-dialog.c @@ -246,7 +246,8 @@ alarm_to_dialog (Dialog *dialog) } static void -alarm_to_repeat_widgets (Dialog *dialog, ECalComponentAlarm *alarm) +alarm_to_repeat_widgets (Dialog *dialog, + ECalComponentAlarm *alarm) { ECalComponentAlarmRepeat repeat; @@ -284,7 +285,8 @@ alarm_to_repeat_widgets (Dialog *dialog, ECalComponentAlarm *alarm) } static void -repeat_widgets_to_alarm (Dialog *dialog, ECalComponentAlarm *alarm) +repeat_widgets_to_alarm (Dialog *dialog, + ECalComponentAlarm *alarm) { ECalComponentAlarmRepeat repeat; @@ -325,7 +327,8 @@ repeat_widgets_to_alarm (Dialog *dialog, ECalComponentAlarm *alarm) /* Fills the audio alarm data with the values from the widgets */ static void -aalarm_widgets_to_alarm (Dialog *dialog, ECalComponentAlarm *alarm) +aalarm_widgets_to_alarm (Dialog *dialog, + ECalComponentAlarm *alarm) { gchar *url; icalattach *attach; @@ -344,7 +347,8 @@ aalarm_widgets_to_alarm (Dialog *dialog, ECalComponentAlarm *alarm) /* Fills the widgets with audio alarm data */ static void -alarm_to_aalarm_widgets (Dialog *dialog, ECalComponentAlarm *alarm) +alarm_to_aalarm_widgets (Dialog *dialog, + ECalComponentAlarm *alarm) { const gchar *url; icalattach *attach; @@ -364,7 +368,8 @@ alarm_to_aalarm_widgets (Dialog *dialog, ECalComponentAlarm *alarm) /* Fills the widgets with display alarm data */ static void -alarm_to_dalarm_widgets (Dialog *dialog, ECalComponentAlarm *alarm ) +alarm_to_dalarm_widgets (Dialog *dialog, + ECalComponentAlarm *alarm) { ECalComponentText description; GtkTextBuffer *text_buffer; @@ -381,7 +386,8 @@ alarm_to_dalarm_widgets (Dialog *dialog, ECalComponentAlarm *alarm ) /* Fills the display alarm data with the values from the widgets */ static void -dalarm_widgets_to_alarm (Dialog *dialog, ECalComponentAlarm *alarm) +dalarm_widgets_to_alarm (Dialog *dialog, + ECalComponentAlarm *alarm) { gchar *str; ECalComponentText description; @@ -423,7 +429,8 @@ dalarm_widgets_to_alarm (Dialog *dialog, ECalComponentAlarm *alarm) /* Fills the mail alarm data with the values from the widgets */ static void -malarm_widgets_to_alarm (Dialog *dialog, ECalComponentAlarm *alarm) +malarm_widgets_to_alarm (Dialog *dialog, + ECalComponentAlarm *alarm) { gchar *str; ECalComponentText description; @@ -497,7 +504,8 @@ malarm_widgets_to_alarm (Dialog *dialog, ECalComponentAlarm *alarm) /* Fills the widgets from mail alarm data */ static void -alarm_to_malarm_widgets (Dialog *dialog, ECalComponentAlarm *alarm ) +alarm_to_malarm_widgets (Dialog *dialog, + ECalComponentAlarm *alarm) { ENameSelectorModel *name_selector_model; EDestinationStore *destination_store; @@ -543,7 +551,8 @@ alarm_to_malarm_widgets (Dialog *dialog, ECalComponentAlarm *alarm ) /* Fills the widgets from procedure alarm data */ static void -alarm_to_palarm_widgets (Dialog *dialog, ECalComponentAlarm *alarm) +alarm_to_palarm_widgets (Dialog *dialog, + ECalComponentAlarm *alarm) { ECalComponentText description; const gchar *url; @@ -564,7 +573,8 @@ alarm_to_palarm_widgets (Dialog *dialog, ECalComponentAlarm *alarm) /* Fills the procedure alarm data with the values from the widgets */ static void -palarm_widgets_to_alarm (Dialog *dialog, ECalComponentAlarm *alarm) +palarm_widgets_to_alarm (Dialog *dialog, + ECalComponentAlarm *alarm) { gchar *program; icalattach *attach; @@ -820,7 +830,7 @@ get_widgets (Dialog *dialog) N_("Send an email") }; - GtkComboBox *combo = (GtkComboBox*) dialog->action_combo; + GtkComboBox *combo = (GtkComboBox *) dialog->action_combo; GtkCellRenderer *cell; GtkListStore *store; gint i; @@ -881,13 +891,16 @@ get_widgets (Dialog *dialog) } static void -addressbook_clicked_cb (GtkWidget *widget, Dialog *dialog) +addressbook_clicked_cb (GtkWidget *widget, + Dialog *dialog) { e_name_selector_show_dialog (dialog->name_selector, dialog->toplevel); } static void -addressbook_response_cb (GtkWidget *widget, gint response, gpointer data) +addressbook_response_cb (GtkWidget *widget, + gint response, + gpointer data) { Dialog *dialog = data; ENameSelectorDialog *name_selector_dialog; @@ -913,8 +926,9 @@ setup_select_names (Dialog *dialog) gtk_widget_show (dialog->malarm_addresses); gtk_box_pack_end (GTK_BOX (dialog->malarm_address_group), dialog->malarm_addresses, TRUE, TRUE, 0); - g_signal_connect (G_OBJECT (dialog->malarm_addressbook), "clicked", - G_CALLBACK (addressbook_clicked_cb), dialog); + g_signal_connect ( + dialog->malarm_addressbook, "clicked", + G_CALLBACK (addressbook_clicked_cb), dialog); name_selector_dialog = e_name_selector_peek_dialog (dialog->name_selector); g_signal_connect (name_selector_dialog, "response", @@ -927,7 +941,8 @@ setup_select_names (Dialog *dialog) * repeat group options as appropriate. */ static void -repeat_toggle_toggled_cb (GtkToggleButton *toggle, gpointer data) +repeat_toggle_toggled_cb (GtkToggleButton *toggle, + gpointer data) { Dialog *dialog = data; gboolean active; @@ -960,7 +975,8 @@ check_custom_sound (Dialog *dialog) } static void -aalarm_sound_toggled_cb (GtkToggleButton *toggle, gpointer data) +aalarm_sound_toggled_cb (GtkToggleButton *toggle, + gpointer data) { Dialog *dialog = data; gboolean active; @@ -972,7 +988,8 @@ aalarm_sound_toggled_cb (GtkToggleButton *toggle, gpointer data) } static void -aalarm_attach_changed_cb (GtkWidget *widget, gpointer data) +aalarm_attach_changed_cb (GtkWidget *widget, + gpointer data) { Dialog *dialog = data; @@ -999,7 +1016,8 @@ check_custom_message (Dialog *dialog) } static void -dalarm_message_toggled_cb (GtkToggleButton *toggle, gpointer data) +dalarm_message_toggled_cb (GtkToggleButton *toggle, + gpointer data) { Dialog *dialog = data; gboolean active; @@ -1011,7 +1029,8 @@ dalarm_message_toggled_cb (GtkToggleButton *toggle, gpointer data) } static void -dalarm_description_changed_cb (GtkWidget *widget, gpointer data) +dalarm_description_changed_cb (GtkWidget *widget, + gpointer data) { Dialog *dialog = data; @@ -1031,7 +1050,8 @@ check_custom_program (Dialog *dialog) } static void -palarm_program_changed_cb (GtkWidget *widget, gpointer data) +palarm_program_changed_cb (GtkWidget *widget, + gpointer data) { Dialog *dialog = data; @@ -1074,7 +1094,8 @@ malarm_addresses_changed_cb (GtkWidget *editable, } static void -malarm_message_toggled_cb (GtkToggleButton *toggle, gpointer data) +malarm_message_toggled_cb (GtkToggleButton *toggle, + gpointer data) { Dialog *dialog = data; gboolean active; @@ -1086,7 +1107,8 @@ malarm_message_toggled_cb (GtkToggleButton *toggle, gpointer data) } static void -malarm_description_changed_cb (GtkWidget *widget, gpointer data) +malarm_description_changed_cb (GtkWidget *widget, + gpointer data) { Dialog *dialog = data; @@ -1094,7 +1116,8 @@ malarm_description_changed_cb (GtkWidget *widget, gpointer data) } static void -action_changed_cb (GtkWidget *action_combo, gpointer data) +action_changed_cb (GtkWidget *action_combo, + gpointer data) { Dialog *dialog = data; gchar *dir; @@ -1146,43 +1169,53 @@ init_widgets (Dialog *dialog) { GtkTextBuffer *text_buffer; - g_signal_connect (dialog->action_combo, "changed", - G_CALLBACK (action_changed_cb), - dialog); + g_signal_connect ( + dialog->action_combo, "changed", + G_CALLBACK (action_changed_cb), dialog); - g_signal_connect (G_OBJECT (dialog->repeat_toggle), "toggled", - G_CALLBACK (repeat_toggle_toggled_cb), dialog); + g_signal_connect ( + dialog->repeat_toggle, "toggled", + G_CALLBACK (repeat_toggle_toggled_cb), dialog); /* Handle custom sounds */ - g_signal_connect (G_OBJECT (dialog->aalarm_sound), "toggled", - G_CALLBACK (aalarm_sound_toggled_cb), dialog); - g_signal_connect (G_OBJECT (dialog->aalarm_file_chooser), "selection-changed", - G_CALLBACK (aalarm_attach_changed_cb), dialog); + g_signal_connect ( + dialog->aalarm_sound, "toggled", + G_CALLBACK (aalarm_sound_toggled_cb), dialog); + g_signal_connect ( + dialog->aalarm_file_chooser, "selection-changed", + G_CALLBACK (aalarm_attach_changed_cb), dialog); /* Handle custom messages */ - g_signal_connect (G_OBJECT (dialog->dalarm_message), "toggled", - G_CALLBACK (dalarm_message_toggled_cb), dialog); + g_signal_connect ( + dialog->dalarm_message, "toggled", + G_CALLBACK (dalarm_message_toggled_cb), dialog); text_buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (dialog->dalarm_description)); - g_signal_connect (G_OBJECT (text_buffer), "changed", - G_CALLBACK (dalarm_description_changed_cb), dialog); + g_signal_connect ( + text_buffer, "changed", + G_CALLBACK (dalarm_description_changed_cb), dialog); /* Handle program */ - g_signal_connect (G_OBJECT (dialog->palarm_program), "changed", - G_CALLBACK (palarm_program_changed_cb), dialog); + g_signal_connect ( + dialog->palarm_program, "changed", + G_CALLBACK (palarm_program_changed_cb), dialog); /* Handle custom email */ - g_signal_connect (G_OBJECT (dialog->malarm_message), "toggled", - G_CALLBACK (malarm_message_toggled_cb), dialog); + g_signal_connect ( + dialog->malarm_message, "toggled", + G_CALLBACK (malarm_message_toggled_cb), dialog); text_buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (dialog->malarm_description)); - g_signal_connect (G_OBJECT (text_buffer), "changed", - G_CALLBACK (malarm_description_changed_cb), dialog); + g_signal_connect ( + text_buffer, "changed", + G_CALLBACK (malarm_description_changed_cb), dialog); g_signal_connect (dialog->malarm_addresses, "changed", G_CALLBACK (malarm_addresses_changed_cb), dialog); } gboolean -alarm_dialog_run (GtkWidget *parent, ECalClient *cal_client, ECalComponentAlarm *alarm) +alarm_dialog_run (GtkWidget *parent, + ECalClient *cal_client, + ECalComponentAlarm *alarm) { Dialog dialog; GtkWidget *container; diff --git a/calendar/gui/dialogs/alarm-list-dialog.c b/calendar/gui/dialogs/alarm-list-dialog.c index c83dde429d..48503c1023 100644 --- a/calendar/gui/dialogs/alarm-list-dialog.c +++ b/calendar/gui/dialogs/alarm-list-dialog.c @@ -110,7 +110,8 @@ sensitize_buttons (Dialog *dialog) /* Callback used for the "add reminder" button */ static void -add_clicked_cb (GtkButton *button, gpointer data) +add_clicked_cb (GtkButton *button, + gpointer data) { Dialog *dialog = data; ECalComponentAlarm *alarm; @@ -140,7 +141,8 @@ add_clicked_cb (GtkButton *button, gpointer data) /* Callback used for the "edit reminder" button */ static void -edit_clicked_cb (GtkButton *button, gpointer data) +edit_clicked_cb (GtkButton *button, + gpointer data) { Dialog *dialog = data; GtkTreeSelection *selection; @@ -168,7 +170,8 @@ edit_clicked_cb (GtkButton *button, gpointer data) /* Callback used for the "delete reminder" button */ static void -delete_clicked_cb (GtkButton *button, gpointer data) +delete_clicked_cb (GtkButton *button, + gpointer data) { Dialog *dialog = data; GtkTreeSelection *selection; @@ -203,7 +206,8 @@ delete_clicked_cb (GtkButton *button, gpointer data) } static void -selection_changed_cb (GtkTreeSelection *selection, gpointer data) +selection_changed_cb (GtkTreeSelection *selection, + gpointer data) { Dialog *dialog = data; @@ -211,7 +215,8 @@ selection_changed_cb (GtkTreeSelection *selection, gpointer data) } void -alarm_list_dialog_set_client (GtkWidget *dlg_box, ECalClient *cal_client) +alarm_list_dialog_set_client (GtkWidget *dlg_box, + ECalClient *cal_client) { Dialog *dialog; @@ -310,7 +315,8 @@ alarm_list_dialog_run (GtkWidget *parent, } GtkWidget * -alarm_list_dialog_peek (ECalClient *cal_client, EAlarmList *list_store) +alarm_list_dialog_peek (ECalClient *cal_client, + EAlarmList *list_store) { Dialog *dialog; diff --git a/calendar/gui/dialogs/calendar-setup.c b/calendar/gui/dialogs/calendar-setup.c index 3894061eb0..0ffdb4cf1f 100644 --- a/calendar/gui/dialogs/calendar-setup.c +++ b/calendar/gui/dialogs/calendar-setup.c @@ -59,7 +59,9 @@ struct _CalendarSourceDialog { }; static gboolean -eccp_check_complete (EConfig *ec, const gchar *pageid, gpointer data) +eccp_check_complete (EConfig *ec, + const gchar *pageid, + gpointer data) { CalendarSourceDialog *sdialog = data; gboolean valid = TRUE; @@ -101,7 +103,9 @@ eccp_commit (EConfig *ec, } static void -eccp_free (EConfig *ec, GSList *items, gpointer data) +eccp_free (EConfig *ec, + GSList *items, + gpointer data) { CalendarSourceDialog *sdialog = data; @@ -117,7 +121,8 @@ eccp_free (EConfig *ec, GSList *items, gpointer data) } static void -eccp_type_changed (GtkComboBox *dropdown, CalendarSourceDialog *sdialog) +eccp_type_changed (GtkComboBox *dropdown, + CalendarSourceDialog *sdialog) { gint id = gtk_combo_box_get_active (dropdown); GtkTreeModel *model; @@ -169,7 +174,7 @@ eccp_get_source_type (EConfig *ec, gtk_label_set_markup (GTK_LABEL (type), markup); gtk_misc_set_alignment (GTK_MISC (type), 0.0, 0.5); g_free (markup); - gtk_table_attach (GTK_TABLE (parent), type, 1, 2, row, row+1, GTK_EXPAND | GTK_FILL, 0, 0, 0); + gtk_table_attach (GTK_TABLE (parent), type, 1, 2, row, row + 1, GTK_EXPAND | GTK_FILL, 0, 0, 0); } else { GtkCellRenderer *cell; GtkListStore *store; @@ -203,19 +208,20 @@ eccp_get_source_type (EConfig *ec, gtk_combo_box_set_active ((GtkComboBox *) type, active); g_signal_connect (type, "changed", G_CALLBACK (eccp_type_changed), sdialog); gtk_widget_show (type); - gtk_table_attach (GTK_TABLE (parent), type, 1, 2, row, row+1, GTK_EXPAND | GTK_FILL, 0, 0, 0); + gtk_table_attach (GTK_TABLE (parent), type, 1, 2, row, row + 1, GTK_EXPAND | GTK_FILL, 0, 0, 0); gtk_label_set_mnemonic_widget (GTK_LABEL (label), type); } gtk_widget_show (label); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); - gtk_table_attach (GTK_TABLE (parent), label, 0, 1, row, row+1, GTK_FILL, 0, 0, 0); + gtk_table_attach (GTK_TABLE (parent), label, 0, 1, row, row + 1, GTK_FILL, 0, 0, 0); return type; } static void -name_changed (GtkEntry *entry, ECalConfigTargetSource *t) +name_changed (GtkEntry *entry, + ECalConfigTargetSource *t) { ESource *source = t->source; e_source_set_name (source, gtk_entry_get_text (GTK_ENTRY (entry))); @@ -242,13 +248,15 @@ eccp_get_source_name (EConfig *ec, label = gtk_label_new_with_mnemonic (_("_Name:")); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_widget_show (label); - gtk_table_attach (GTK_TABLE (parent), label, 0, 1, row, row+1, GTK_FILL, 0, 0, 0); + gtk_table_attach (GTK_TABLE (parent), label, 0, 1, row, row + 1, GTK_FILL, 0, 0, 0); entry = gtk_entry_new (); gtk_widget_show (entry); - gtk_table_attach (GTK_TABLE (parent), entry, 1, 2, row, row+1, GTK_EXPAND | GTK_FILL, 0, 0, 0); + gtk_table_attach (GTK_TABLE (parent), entry, 1, 2, row, row + 1, GTK_EXPAND | GTK_FILL, 0, 0, 0); gtk_label_set_mnemonic_widget (GTK_LABEL (label), entry); - g_signal_connect (G_OBJECT (entry), "changed", G_CALLBACK (name_changed), (gpointer) t); + g_signal_connect ( + entry, "changed", + G_CALLBACK (name_changed), (gpointer) t); if (source) gtk_entry_set_text (GTK_ENTRY (entry), e_source_peek_name (source)); @@ -257,7 +265,8 @@ eccp_get_source_name (EConfig *ec, } static void -offline_status_changed_cb (GtkWidget *widget, CalendarSourceDialog *sdialog) +offline_status_changed_cb (GtkWidget *widget, + CalendarSourceDialog *sdialog) { if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget))) @@ -296,7 +305,7 @@ eccp_general_offline (EConfig *ec, gtk_widget_show (offline_setting); g_signal_connect (offline_setting, "toggled", G_CALLBACK (offline_status_changed_cb), sdialog); - gtk_table_attach (GTK_TABLE (parent), offline_setting, 1, 2, row, row+1, GTK_EXPAND | GTK_FILL, 0, 0, 0); + gtk_table_attach (GTK_TABLE (parent), offline_setting, 1, 2, row, row + 1, GTK_EXPAND | GTK_FILL, 0, 0, 0); } @@ -307,7 +316,8 @@ eccp_general_offline (EConfig *ec, } static void -alarm_status_changed_cb (GtkWidget *widget, CalendarSourceDialog *sdialog) +alarm_status_changed_cb (GtkWidget *widget, + CalendarSourceDialog *sdialog) { if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget))) e_source_set_property (sdialog->source, "alarm", "true"); @@ -317,11 +327,11 @@ alarm_status_changed_cb (GtkWidget *widget, CalendarSourceDialog *sdialog) static GtkWidget * eccp_notify_reminders (EConfig *ec, - EConfigItem *item, - GtkWidget *parent, - GtkWidget *old, - gint position, - gpointer data) + EConfigItem *item, + GtkWidget *parent, + GtkWidget *old, + gint position, + gpointer data) { CalendarSourceDialog *sdialog = data; GtkWidget *reminder_setting = NULL; @@ -342,20 +352,22 @@ eccp_notify_reminders (EConfig *ec, gtk_widget_show (reminder_setting); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (reminder_setting), alarm && g_str_equal (alarm, "true")); g_signal_connect (reminder_setting, "toggled", G_CALLBACK (alarm_status_changed_cb), sdialog); - gtk_table_attach (GTK_TABLE (parent), reminder_setting, 1, 2, row, row+1, GTK_EXPAND | GTK_FILL, 0, 0, 0); + gtk_table_attach (GTK_TABLE (parent), reminder_setting, 1, 2, row, row + 1, GTK_EXPAND | GTK_FILL, 0, 0, 0); return reminder_setting; } static void -color_changed (GtkColorButton *color_button, ECalConfigTargetSource *target) +color_changed (GtkColorButton *color_button, + ECalConfigTargetSource *target) { ESource *source = target->source; gchar color_spec[16]; GdkColor color; gtk_color_button_get_color (color_button, &color); - g_snprintf (color_spec, sizeof (color_spec), "#%04x%04x%04x", + g_snprintf ( + color_spec, sizeof (color_spec), "#%04x%04x%04x", color.red, color.green, color.blue); e_source_set_color_spec (source, color_spec); } @@ -475,7 +487,9 @@ static ECalConfigItem ecmp_items[] = { */ static void -cs_load_sources (CalendarSourceDialog *sdialog, const gchar *conf_key, ESourceGroup *group) +cs_load_sources (CalendarSourceDialog *sdialog, + const gchar *conf_key, + ESourceGroup *group) { GConfClient *gconf; @@ -501,7 +515,9 @@ cs_load_sources (CalendarSourceDialog *sdialog, const gchar *conf_key, ESourceGr * Show calendar properties for @source. **/ void -calendar_setup_edit_calendar (GtkWindow *parent, ESource *source, ESourceGroup *group) +calendar_setup_edit_calendar (GtkWindow *parent, + ESource *source, + ESourceGroup *group) { CalendarSourceDialog *sdialog = g_new0 (CalendarSourceDialog, 1); gchar *xml; @@ -561,7 +577,8 @@ calendar_setup_new_calendar (GtkWindow *parent) } void -calendar_setup_edit_task_list (GtkWindow *parent, ESource *source) +calendar_setup_edit_task_list (GtkWindow *parent, + ESource *source) { CalendarSourceDialog *sdialog = g_new0 (CalendarSourceDialog, 1); gchar *xml; @@ -620,7 +637,8 @@ calendar_setup_new_task_list (GtkWindow *parent) } void -calendar_setup_edit_memo_list (GtkWindow *parent, ESource *source) +calendar_setup_edit_memo_list (GtkWindow *parent, + ESource *source) { CalendarSourceDialog *sdialog = g_new0 (CalendarSourceDialog, 1); gchar *xml; diff --git a/calendar/gui/dialogs/changed-comp.c b/calendar/gui/dialogs/changed-comp.c index 5fb0240037..78928795f6 100644 --- a/calendar/gui/dialogs/changed-comp.c +++ b/calendar/gui/dialogs/changed-comp.c @@ -44,7 +44,10 @@ * Return value: TRUE if the user clicked Yes, FALSE otherwise. **/ gboolean -changed_component_dialog (GtkWindow *parent, ECalComponent *comp, gboolean deleted, gboolean changed) +changed_component_dialog (GtkWindow *parent, + ECalComponent *comp, + gboolean deleted, + gboolean changed) { GtkWidget *dialog; ECalComponentVType vtype; diff --git a/calendar/gui/dialogs/comp-editor-page.c b/calendar/gui/dialogs/comp-editor-page.c index 89adf7c491..3d8af28153 100644 --- a/calendar/gui/dialogs/comp-editor-page.c +++ b/calendar/gui/dialogs/comp-editor-page.c @@ -329,7 +329,8 @@ comp_editor_page_fill_widgets (CompEditorPage *page, * Returns: TRUE if the component could be filled, FALSE otherwise **/ gboolean -comp_editor_page_fill_component (CompEditorPage *page, ECalComponent *comp) +comp_editor_page_fill_component (CompEditorPage *page, + ECalComponent *comp) { CompEditorPageClass *class; @@ -355,7 +356,8 @@ comp_editor_page_fill_component (CompEditorPage *page, ECalComponent *comp) * Returns: TRUE if the timezones were added, FALSE otherwise. */ gboolean -comp_editor_page_fill_timezones (CompEditorPage *page, GHashTable *timezones) +comp_editor_page_fill_timezones (CompEditorPage *page, + GHashTable *timezones) { CompEditorPageClass *class; @@ -378,7 +380,8 @@ comp_editor_page_fill_timezones (CompEditorPage *page, GHashTable *timezones) * Sets the date values for this group of widgets **/ void -comp_editor_page_set_dates (CompEditorPage *page, CompEditorPageDates *dates) +comp_editor_page_set_dates (CompEditorPage *page, + CompEditorPageDates *dates) { CompEditorPageClass *class; @@ -421,7 +424,7 @@ comp_editor_page_add_attendee (CompEditorPage *page, **/ void comp_editor_page_notify_dates_changed (CompEditorPage *page, - CompEditorPageDates *dates) + CompEditorPageDates *dates) { g_return_if_fail (IS_COMP_EDITOR_PAGE (page)); @@ -442,8 +445,8 @@ comp_editor_page_notify_dates_changed (CompEditorPage *page, */ void comp_editor_page_display_validation_error (CompEditorPage *page, - const gchar *msg, - GtkWidget *field) + const gchar *msg, + GtkWidget *field) { GtkWidget *dialog; diff --git a/calendar/gui/dialogs/comp-editor-page.h b/calendar/gui/dialogs/comp-editor-page.h index a33d83810d..f8ab87de63 100644 --- a/calendar/gui/dialogs/comp-editor-page.h +++ b/calendar/gui/dialogs/comp-editor-page.h @@ -71,9 +71,9 @@ struct _CompEditorPage { GObject object; /* The GtkAccelGroup for the page. We install this when the page is - mapped, and uninstall when it is unmapped. libglade would do this - normally, but we create our pages individually so have to do it - ourselves. */ + * mapped, and uninstall when it is unmapped. libglade would do this + * normally, but we create our pages individually so have to do it + * ourselves. */ GtkAccelGroup *accel_group; CompEditorPagePrivate *priv; diff --git a/calendar/gui/dialogs/comp-editor-util.c b/calendar/gui/dialogs/comp-editor-util.c index a98314b389..cbc34cb108 100644 --- a/calendar/gui/dialogs/comp-editor-util.c +++ b/calendar/gui/dialogs/comp-editor-util.c @@ -49,7 +49,8 @@ * results. **/ void -comp_editor_dates (CompEditorPageDates *dates, ECalComponent *comp) +comp_editor_dates (CompEditorPageDates *dates, + ECalComponent *comp) { ECalComponentDateTime dt; @@ -59,8 +60,8 @@ comp_editor_dates (CompEditorPageDates *dates, ECalComponent *comp) dates->complete = NULL; /* Note that the ECalComponentDateTime's returned contain allocated - icaltimetype and tzid values, so we just take over ownership of - those. */ + * icaltimetype and tzid values, so we just take over ownership of + * those. */ e_cal_component_get_dtstart (comp, &dt); if (dt.value) { dates->start = g_new (ECalComponentDateTime, 1); @@ -89,7 +90,7 @@ void comp_editor_free_dates (CompEditorPageDates *dates) { /* Note that e_cal_component_free_datetime() only frees the fields in - the struct. It doesn't free the struct itself, so we do that. */ + * the struct. It doesn't free the struct itself, so we do that. */ if (dates->start) { e_cal_component_free_datetime (dates->start); g_free (dates->start); @@ -142,9 +143,9 @@ comp_editor_new_date_edit (gboolean show_date, } /* Returns the current time, for EDateEdit widgets and ECalendar items in the - dialogs. - FIXME: Should probably use the timezone from somewhere in the component - rather than the current timezone. */ + * dialogs. + * FIXME: Should probably use the timezone from somewhere in the component + * rather than the current timezone. */ struct tm comp_editor_get_current_time (EDateEdit *date_edit, CompEditor *editor) @@ -242,7 +243,9 @@ comp_editor_strip_categories (const gchar *categories) } static GSList * -manage_new_attendees (const GSList *lst, const gchar *eml, gboolean add) +manage_new_attendees (const GSList *lst, + const gchar *eml, + gboolean add) { GSList *copy = NULL; const GSList *l; @@ -328,7 +331,8 @@ comp_editor_manage_new_attendees (ECalComponent *comp, * Copies "new-attendees" information from @src to @des component. **/ void -comp_editor_copy_new_attendees (ECalComponent *des, ECalComponent *src) +comp_editor_copy_new_attendees (ECalComponent *des, + ECalComponent *src) { GSList *copy = NULL, *l; @@ -350,7 +354,8 @@ comp_editor_copy_new_attendees (ECalComponent *des, ECalComponent *src) * Returns: Whether @ma is present in the list of new attendees of the comp. **/ gboolean -comp_editor_have_in_new_attendees (ECalComponent *comp, EMeetingAttendee *ma) +comp_editor_have_in_new_attendees (ECalComponent *comp, + EMeetingAttendee *ma) { const gchar *eml; diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c index c94b2f5016..1d5a45af31 100644 --- a/calendar/gui/dialogs/comp-editor.c +++ b/calendar/gui/dialogs/comp-editor.c @@ -107,7 +107,7 @@ struct _CompEditorPrivate { guint32 attachment_bar_visible : 1; /* TODO use this flags for setting all the boolean variables - below */ + * below */ CompEditorFlags flags; icaltimezone *zone; @@ -238,7 +238,7 @@ static void attachment_store_changed_cb (CompEditor *editor) { /* Mark the editor as changed so it prompts about unsaved - changes on close */ + * changes on close */ comp_editor_set_changed (editor, TRUE); } @@ -348,8 +348,8 @@ get_attachment_list (CompEditor *editor) } /* This sets the focus to the toplevel, so any field being edited is committed. - FIXME: In future we may also want to check some of the fields are valid, - e.g. the EDateEdit fields. */ + * FIXME: In future we may also want to check some of the fields are valid, + * e.g. the EDateEdit fields. */ static void commit_all_fields (CompEditor *editor) { @@ -443,7 +443,9 @@ listen_for_changes (CompEditor *editor) } static void -send_timezone (gpointer key, gpointer value, gpointer user_data) +send_timezone (gpointer key, + gpointer value, + gpointer user_data) { icaltimezone *zone = value; CompEditor *editor = user_data; @@ -885,8 +887,8 @@ action_print_preview_cb (GtkAction *action, static gboolean remove_event_dialog (ECalClient *client, - ECalComponent *comp, - GtkWindow *parent) + ECalComponent *comp, + GtkWindow *parent) { GtkWidget *dialog; gboolean ret; @@ -1508,7 +1510,8 @@ comp_editor_get_property (GObject *object, } static void -unref_page_cb (gpointer editor_page, gpointer comp_editor) +unref_page_cb (gpointer editor_page, + gpointer comp_editor) { if (IS_COMP_EDITOR_PAGE (editor_page)) { GtkWidget *page_widget; @@ -1568,25 +1571,26 @@ comp_editor_dispose (GObject *object) } if (priv->view) { - g_signal_handlers_disconnect_matched (G_OBJECT (priv->view), - G_SIGNAL_MATCH_DATA, - 0, 0, NULL, NULL, - object); - + g_signal_handlers_disconnect_matched ( + G_OBJECT (priv->view), G_SIGNAL_MATCH_DATA, + 0, 0, NULL, NULL, object); g_object_unref (priv->view); priv->view = NULL; } if (priv->attachment_view) { - g_signal_handlers_disconnect_matched (G_OBJECT (e_attachment_view_get_store (E_ATTACHMENT_VIEW (priv->attachment_view))), - G_SIGNAL_MATCH_DATA, - 0, 0, NULL, NULL, - object); + EAttachmentStore *store; + + store = e_attachment_view_get_store ( + E_ATTACHMENT_VIEW (priv->attachment_view)); + g_signal_handlers_disconnect_matched ( + G_OBJECT (store), G_SIGNAL_MATCH_DATA, + 0, 0, NULL, NULL, object); } /* We want to destroy the pages after the widgets get destroyed, - since they have lots of signal handlers connected to the widgets - with the pages as the data. */ + * since they have lots of signal handlers connected to the widgets + * with the pages as the data. */ g_list_foreach (priv->pages, (GFunc) unref_page_cb, object); g_list_free (priv->pages); priv->pages = NULL; @@ -2050,7 +2054,7 @@ comp_editor_init (CompEditor *editor) /* Fine Tuning */ action = comp_editor_get_action (editor, "attach"); - g_object_set (G_OBJECT (action), "short-label", _("Attach"), NULL); + g_object_set (action, "short-label", _("Attach"), NULL); /* Desensitize the "save" action. */ action = comp_editor_get_action (editor, "save"); @@ -2175,7 +2179,8 @@ comp_editor_init (CompEditor *editor) } static gboolean -prompt_and_save_changes (CompEditor *editor, gboolean send) +prompt_and_save_changes (CompEditor *editor, + gboolean send) { CompEditorPrivate *priv; gboolean correct = FALSE; @@ -2254,8 +2259,8 @@ close_dialog (CompEditor *editor) g_signal_emit_by_name (editor, "comp_closed", priv->saved); /* FIXME Unfortunately we do this here because otherwise corba - calls happen during destruction and we might get a change - notification back when we are in an inconsistent state */ + * calls happen during destruction and we might get a change + * notification back when we are in an inconsistent state */ if (priv->view) g_signal_handlers_disconnect_matched (G_OBJECT (priv->view), G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, editor); @@ -2275,7 +2280,8 @@ comp_editor_compare (CompEditor *editor_a, } void -comp_editor_set_existing_org (CompEditor *editor, gboolean existing_org) +comp_editor_set_existing_org (CompEditor *editor, + gboolean existing_org) { g_return_if_fail (IS_COMP_EDITOR (editor)); @@ -2745,9 +2751,9 @@ page_unmapped_cb (GtkWidget *page_widget, **/ void comp_editor_append_widget (CompEditor *editor, - GtkWidget *page, - const gchar *label, - gboolean add) + GtkWidget *page, + const gchar *label, + gboolean add) { CompEditorPrivate *priv; GtkWidget *label_widget = NULL; @@ -2771,7 +2777,7 @@ comp_editor_append_widget (CompEditor *editor, } /* Listen for when the page is mapped/unmapped so we can - install/uninstall the appropriate GtkAccelGroup. + * install/uninstall the appropriate GtkAccelGroup. g_signal_connect ( page, "map", G_CALLBACK (page_mapped_cb), page); @@ -2794,9 +2800,9 @@ comp_editor_append_widget (CompEditor *editor, **/ void comp_editor_append_page (CompEditor *editor, - CompEditorPage *page, - const gchar *label, - gboolean add) + CompEditorPage *page, + const gchar *label, + gboolean add) { CompEditorPrivate *priv; GtkWidget *page_widget; @@ -2843,7 +2849,7 @@ comp_editor_append_page (CompEditor *editor, G_CALLBACK (page_dates_changed_cb), editor); /* Listen for when the page is mapped/unmapped so we can - install/uninstall the appropriate GtkAccelGroup. */ + * install/uninstall the appropriate GtkAccelGroup. */ g_signal_connect ( page_widget, "map", G_CALLBACK (page_mapped_cb), page); @@ -2866,7 +2872,8 @@ comp_editor_append_page (CompEditor *editor, * Removes the page from the component editor **/ void -comp_editor_remove_page (CompEditor *editor, CompEditorPage *page) +comp_editor_remove_page (CompEditor *editor, + CompEditorPage *page) { CompEditorPrivate *priv; GtkWidget *page_widget; @@ -2902,7 +2909,8 @@ comp_editor_remove_page (CompEditor *editor, CompEditorPage *page) * **/ void -comp_editor_show_page (CompEditor *editor, CompEditorPage *page) +comp_editor_show_page (CompEditor *editor, + CompEditorPage *page) { CompEditorPrivate *priv; GtkWidget *page_widget; @@ -3009,7 +3017,8 @@ attachment_loaded_cb (EAttachment *attachment, } static void -set_attachment_list (CompEditor *editor, GSList *uri_list) +set_attachment_list (CompEditor *editor, + GSList *uri_list) { EAttachmentStore *store; EAttachmentView *view; @@ -3090,7 +3099,8 @@ fill_widgets (CompEditor *editor) } static void -real_edit_comp (CompEditor *editor, ECalComponent *comp) +real_edit_comp (CompEditor *editor, + ECalComponent *comp) { CompEditorPrivate *priv; @@ -3152,7 +3162,8 @@ set_attendees_for_delegation (ECalComponent *comp, } static void -get_users_from_memo_comp (ECalComponent *comp, GSList **users) +get_users_from_memo_comp (ECalComponent *comp, + GSList **users) { icalcomponent *icalcomp; icalproperty *icalprop; @@ -3298,7 +3309,8 @@ real_send_comp (CompEditor *editor, * Starts the editor editing the given component **/ void -comp_editor_edit_comp (CompEditor *editor, ECalComponent *comp) +comp_editor_edit_comp (CompEditor *editor, + ECalComponent *comp) { CompEditorClass *class; @@ -3328,7 +3340,8 @@ comp_editor_get_comp (CompEditor *editor) * Returns: Newly allocated component, should be unref-ed by g_object_unref(). **/ ECalComponent * -comp_editor_get_current_comp (CompEditor *editor, gboolean *correct) +comp_editor_get_current_comp (CompEditor *editor, + gboolean *correct) { CompEditorPrivate *priv; ECalComponent *comp; @@ -3361,7 +3374,8 @@ comp_editor_get_current_comp (CompEditor *editor, gboolean *correct) * **/ gboolean -comp_editor_save_comp (CompEditor *editor, gboolean send) +comp_editor_save_comp (CompEditor *editor, + gboolean send) { return prompt_and_save_changes (editor, send); } @@ -3516,7 +3530,7 @@ comp_editor_get_mime_attach_list (CompEditor *editor) static void page_dates_changed_cb (CompEditor *editor, - CompEditorPageDates *dates, + CompEditorPageDates *dates, CompEditorPage *page) { CompEditorPrivate *priv = editor->priv; diff --git a/calendar/gui/dialogs/comp-editor.h b/calendar/gui/dialogs/comp-editor.h index aca5c8ef11..c2a3082a31 100644 --- a/calendar/gui/dialogs/comp-editor.h +++ b/calendar/gui/dialogs/comp-editor.h @@ -91,11 +91,11 @@ struct _CompEditorClass { }; typedef enum { - COMP_EDITOR_NEW_ITEM = 1<<0, - COMP_EDITOR_MEETING = 1<<1, - COMP_EDITOR_DELEGATE = 1<<2, - COMP_EDITOR_USER_ORG = 1<<3, - COMP_EDITOR_IS_ASSIGNED = 1<<4, + COMP_EDITOR_NEW_ITEM = 1 << 0, + COMP_EDITOR_MEETING = 1 << 1, + COMP_EDITOR_DELEGATE = 1 << 2, + COMP_EDITOR_USER_ORG = 1 << 3, + COMP_EDITOR_IS_ASSIGNED = 1 << 4, COMP_EDITOR_IS_SHARED = 1 << 5, COMP_EDITOR_SEND_TO_NEW_ATTENDEES_ONLY = 1 << 6 } CompEditorFlags; diff --git a/calendar/gui/dialogs/copy-source-dialog.c b/calendar/gui/dialogs/copy-source-dialog.c index 31e7cef1b5..e247f13264 100644 --- a/calendar/gui/dialogs/copy-source-dialog.c +++ b/calendar/gui/dialogs/copy-source-dialog.c @@ -41,7 +41,9 @@ typedef struct { } CopySourceDialogData; static void -show_error (CopySourceDialogData *csdd, const gchar *msg, const GError *error) +show_error (CopySourceDialogData *csdd, + const gchar *msg, + const GError *error) { GtkWidget *dialog; @@ -59,7 +61,8 @@ struct ForeachTzidData }; static void -add_timezone_to_cal_cb (icalparameter *param, gpointer data) +add_timezone_to_cal_cb (icalparameter *param, + gpointer data) { struct ForeachTzidData *ftd = data; icaltimezone *tz = NULL; @@ -231,7 +234,9 @@ copy_source (const CopySourceDialogData *const_csdd) * source to copy to. */ void -copy_source_dialog (GtkWindow *parent, ESource *source, ECalClientSourceType obj_type) +copy_source_dialog (GtkWindow *parent, + ESource *source, + ECalClientSourceType obj_type) { CopySourceDialogData csdd; diff --git a/calendar/gui/dialogs/delete-comp.c b/calendar/gui/dialogs/delete-comp.c index f5ac9c9ce4..a28fa00221 100644 --- a/calendar/gui/dialogs/delete-comp.c +++ b/calendar/gui/dialogs/delete-comp.c @@ -162,7 +162,8 @@ delete_component_dialog (ECalComponent *comp, } static void -cb_toggled_cb (GtkToggleButton *toggle, gpointer data) +cb_toggled_cb (GtkToggleButton *toggle, + gpointer data) { gboolean active = FALSE; GtkWidget *entry = (GtkWidget *) data; @@ -172,7 +173,10 @@ cb_toggled_cb (GtkToggleButton *toggle, gpointer data) } gboolean -prompt_retract_dialog (ECalComponent *comp, gchar **retract_text, GtkWidget *parent, gboolean *retract) +prompt_retract_dialog (ECalComponent *comp, + gchar **retract_text, + GtkWidget *parent, + gboolean *retract) { gchar *message = NULL; ECalComponentVType type = E_CAL_COMPONENT_NO_TYPE; diff --git a/calendar/gui/dialogs/delete-error.c b/calendar/gui/dialogs/delete-error.c index cd461c7858..a5cc6a1b02 100644 --- a/calendar/gui/dialogs/delete-error.c +++ b/calendar/gui/dialogs/delete-error.c @@ -39,7 +39,8 @@ * **/ void -delete_error_dialog (const GError *error, ECalComponentVType vtype) +delete_error_dialog (const GError *error, + ECalComponentVType vtype) { GtkWidget *dialog; const gchar *str; diff --git a/calendar/gui/dialogs/e-delegate-dialog.c b/calendar/gui/dialogs/e-delegate-dialog.c index da6eeea05d..af61f807a8 100644 --- a/calendar/gui/dialogs/e-delegate-dialog.c +++ b/calendar/gui/dialogs/e-delegate-dialog.c @@ -114,7 +114,9 @@ e_delegate_dialog_finalize (GObject *object) } EDelegateDialog * -e_delegate_dialog_construct (EDelegateDialog *edd, const gchar *name, const gchar *address) +e_delegate_dialog_construct (EDelegateDialog *edd, + const gchar *name, + const gchar *address) { EDelegateDialogPrivate *priv; EDestinationStore *destination_store; @@ -157,7 +159,7 @@ e_delegate_dialog_construct (EDelegateDialog *edd, const gchar *name, const gcha e_destination_store_append_destination (destination_store, dest); g_object_unref (dest); - g_signal_connect((priv->addressbook), "clicked", + g_signal_connect ((priv->addressbook), "clicked", G_CALLBACK (addressbook_clicked_cb), edd); name_selector_dialog = e_name_selector_peek_dialog (priv->name_selector); @@ -188,7 +190,8 @@ get_widgets (EDelegateDialog *edd) } static void -addressbook_clicked_cb (GtkWidget *widget, gpointer data) +addressbook_clicked_cb (GtkWidget *widget, + gpointer data) { EDelegateDialog *edd = data; @@ -197,7 +200,9 @@ addressbook_clicked_cb (GtkWidget *widget, gpointer data) } static void -addressbook_response_cb (GtkWidget *widget, gint response, gpointer data) +addressbook_response_cb (GtkWidget *widget, + gint response, + gpointer data) { EDelegateDialog *edd = data; EDelegateDialogPrivate *priv; @@ -218,7 +223,8 @@ addressbook_response_cb (GtkWidget *widget, gint response, gpointer data) * editor could not be created. **/ EDelegateDialog * -e_delegate_dialog_new (const gchar *name, const gchar *address) +e_delegate_dialog_new (const gchar *name, + const gchar *address) { EDelegateDialog *edd; @@ -227,7 +233,7 @@ e_delegate_dialog_new (const gchar *name, const gchar *address) } gchar * -e_delegate_dialog_get_delegate (EDelegateDialog *edd) +e_delegate_dialog_get_delegate (EDelegateDialog *edd) { EDelegateDialogPrivate *priv; ENameSelectorModel *name_selector_model; @@ -258,7 +264,7 @@ e_delegate_dialog_get_delegate (EDelegateDialog *edd) } gchar * -e_delegate_dialog_get_delegate_name (EDelegateDialog *edd) +e_delegate_dialog_get_delegate_name (EDelegateDialog *edd) { EDelegateDialogPrivate *priv; ENameSelectorModel *name_selector_model; @@ -288,8 +294,8 @@ e_delegate_dialog_get_delegate_name (EDelegateDialog *edd) return g_strdup (priv->name); } -GtkWidget* -e_delegate_dialog_get_toplevel (EDelegateDialog *edd) +GtkWidget * +e_delegate_dialog_get_toplevel (EDelegateDialog *edd) { EDelegateDialogPrivate *priv; diff --git a/calendar/gui/dialogs/e-delegate-dialog.h b/calendar/gui/dialogs/e-delegate-dialog.h index 5e1c9f0e5b..032901c8bc 100644 --- a/calendar/gui/dialogs/e-delegate-dialog.h +++ b/calendar/gui/dialogs/e-delegate-dialog.h @@ -52,11 +52,11 @@ struct _EDelegateDialogClass { GType e_delegate_dialog_get_type (void); -EDelegateDialog* e_delegate_dialog_construct (EDelegateDialog *etd, +EDelegateDialog * e_delegate_dialog_construct (EDelegateDialog *etd, const gchar *name, const gchar *address); -EDelegateDialog* e_delegate_dialog_new (const gchar *name, +EDelegateDialog * e_delegate_dialog_new (const gchar *name, const gchar *address); gchar * e_delegate_dialog_get_delegate (EDelegateDialog *etd); @@ -66,7 +66,7 @@ gchar * e_delegate_dialog_get_delegate_name (EDelegateDialog *etd); void e_delegate_dialog_set_delegate (EDelegateDialog *etd, const gchar *address); -GtkWidget* e_delegate_dialog_get_toplevel (EDelegateDialog *etd); +GtkWidget * e_delegate_dialog_get_toplevel (EDelegateDialog *etd); diff --git a/calendar/gui/dialogs/e-send-options-utils.c b/calendar/gui/dialogs/e-send-options-utils.c index d85e821d91..f8e933574c 100644 --- a/calendar/gui/dialogs/e-send-options-utils.c +++ b/calendar/gui/dialogs/e-send-options-utils.c @@ -31,7 +31,9 @@ #include void -e_send_options_utils_set_default_data (ESendOptionsDialog *sod, ESource *source, const gchar *type) +e_send_options_utils_set_default_data (ESendOptionsDialog *sod, + ESource *source, + const gchar *type) { ESendOptionsGeneral *gopts = NULL; ESendOptionsStatusTracking *sopts; diff --git a/calendar/gui/dialogs/event-editor.c b/calendar/gui/dialogs/event-editor.c index 0529e90286..f89b67056d 100644 --- a/calendar/gui/dialogs/event-editor.c +++ b/calendar/gui/dialogs/event-editor.c @@ -377,7 +377,7 @@ event_editor_constructor (GType type, } event_page_set_meeting (priv->event_page, TRUE); - priv->meeting_shown=TRUE; + priv->meeting_shown = TRUE; if (e_shell_get_express_mode (shell)) { attendee_page = event_page_get_attendee_page (priv->event_page); @@ -597,7 +597,8 @@ event_editor_init (EventEditor *ee) } static void -event_editor_edit_comp (CompEditor *editor, ECalComponent *comp) +event_editor_edit_comp (CompEditor *editor, + ECalComponent *comp) { EventEditorPrivate *priv; ECalComponentOrganizer organizer; diff --git a/calendar/gui/dialogs/event-page.c b/calendar/gui/dialogs/event-page.c index 0ecb18393c..653f0215ac 100644 --- a/calendar/gui/dialogs/event-page.c +++ b/calendar/gui/dialogs/event-page.c @@ -183,8 +183,8 @@ struct _EventPagePrivate { gint alarm_interval; /* This is TRUE if both the start & end timezone are the same. If the - start timezone is then changed, we updated the end timezone to the - same value, since 99% of events start and end in one timezone. */ + * start timezone is then changed, we updated the end timezone to the + * same value, since 99% of events start and end in one timezone. */ gboolean sync_timezones; gboolean is_meeting; @@ -645,7 +645,7 @@ sensitize_widgets (EventPage *epage) alarm = e_dialog_combo_box_get (priv->alarm_time_combo, priv->alarm_map) != ALARM_NONE; custom = is_custom_alarm_store (priv->alarm_list_store, priv->old_summary, priv->alarm_units, priv->alarm_interval, NULL) || - e_dialog_combo_box_get (priv->alarm_time_combo, priv->alarm_map) == ALARM_CUSTOM ? TRUE:FALSE; + e_dialog_combo_box_get (priv->alarm_time_combo, priv->alarm_map) == ALARM_CUSTOM ? TRUE : FALSE; if (alarm && !priv->alarm_icon) { priv->alarm_icon = create_alarm_image_button ("stock_bell", _("This event has reminders"), epage); @@ -729,7 +729,7 @@ update_time (EventPage *epage, GtkAction *action; struct icaltimetype *start_tt, *end_tt, implied_tt; icaltimezone *start_zone = NULL, *def_zone = NULL; - gboolean all_day_event, homezone=TRUE; + gboolean all_day_event, homezone = TRUE; gboolean show_timezone; editor = comp_editor_page_get_editor (COMP_EDITOR_PAGE (epage)); @@ -737,8 +737,8 @@ update_time (EventPage *epage, if (start_date->tzid) { /* Note that if we are creating a new event, the timezones may not be - on the server, so we try to get the builtin timezone with the TZID - first. */ + * on the server, so we try to get the builtin timezone with the TZID + * first. */ start_zone = icaltimezone_get_builtin_timezone_from_tzid (start_date->tzid); if (!start_zone) { /* FIXME: Handle error better. */ @@ -753,7 +753,7 @@ update_time (EventPage *epage, } /* If both times are DATE values, we set the 'All Day Event' checkbox. - Also, if DTEND is after DTSTART, we subtract 1 day from it. */ + * Also, if DTEND is after DTSTART, we subtract 1 day from it. */ all_day_event = FALSE; start_tt = start_date->value; end_tt = end_date->value; @@ -774,8 +774,8 @@ update_time (EventPage *epage, set_all_day (epage, all_day_event); /* If it is an all day event, we set both timezones to the current - timezone, so that if the user toggles the 'All Day Event' checkbox - the event uses the current timezone rather than none at all. */ + * timezone, so that if the user toggles the 'All Day Event' checkbox + * the event uses the current timezone rather than none at all. */ if (all_day_event) start_zone = e_meeting_store_get_timezone ( epage->priv->meeting_store); @@ -809,7 +809,7 @@ update_time (EventPage *epage, 0, 0, NULL, NULL, epage); /* Set the timezones, and set sync_timezones to TRUE if both timezones - are the same. */ + * are the same. */ g_signal_handlers_block_matched ( epage->priv->start_timezone, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, epage); @@ -843,7 +843,8 @@ update_time (EventPage *epage, } static void -organizer_changed_cb (GtkEntry *entry, EventPage *epage) +organizer_changed_cb (GtkEntry *entry, + EventPage *epage) { gchar *name; gchar *mailto; @@ -949,7 +950,7 @@ event_page_focus_main_widget (CompEditorPage *page) static void event_page_load_locations_list (CompEditorPage *page, - ECalComponent *comp) + ECalComponent *comp) { EShell *shell; EShellBackend *backend; @@ -1008,7 +1009,7 @@ event_page_load_locations_list (CompEditorPage *page, static void event_page_save_locations_list (CompEditorPage *page, - ECalComponent *comp) + ECalComponent *comp) { EShell *shell; EShellBackend *backend; @@ -1455,7 +1456,7 @@ event_page_fill_component (CompEditorPage *page, g_return_val_if_fail (end_date_set, FALSE); /* If the all_day toggle is set, we use DATE values for DTSTART and - DTEND. If not, we fetch the hour & minute from the widgets. */ + * DTEND. If not, we fetch the hour & minute from the widgets. */ all_day_event = priv->all_day_event; if (all_day_event) { @@ -1806,28 +1807,32 @@ event_page_init (EventPage *epage) } void -event_page_set_view_role (EventPage *epage, gboolean state) +event_page_set_view_role (EventPage *epage, + gboolean state) { e_meeting_list_view_column_set_visible ( epage->priv->list_view, E_MEETING_STORE_ROLE_COL, state); } void -event_page_set_view_status (EventPage *epage, gboolean state) +event_page_set_view_status (EventPage *epage, + gboolean state) { e_meeting_list_view_column_set_visible ( epage->priv->list_view, E_MEETING_STORE_STATUS_COL, state); } void -event_page_set_view_type (EventPage *epage, gboolean state) +event_page_set_view_type (EventPage *epage, + gboolean state) { e_meeting_list_view_column_set_visible ( epage->priv->list_view, E_MEETING_STORE_TYPE_COL, state); } void -event_page_set_view_rsvp (EventPage *epage, gboolean state) +event_page_set_view_rsvp (EventPage *epage, + gboolean state) { e_meeting_list_view_column_set_visible ( epage->priv->list_view, E_MEETING_STORE_RSVP_COL, state); @@ -1860,7 +1865,8 @@ event_page_show_options (EventPage *page) } void -event_page_set_meeting (EventPage *page, gboolean set) +event_page_set_meeting (EventPage *page, + gboolean set) { g_return_if_fail (IS_EVENT_PAGE (page)); @@ -1870,7 +1876,8 @@ event_page_set_meeting (EventPage *page, gboolean set) } void -event_page_set_delegate (EventPage *page, gboolean set) +event_page_set_delegate (EventPage *page, + gboolean set) { g_return_if_fail (IS_EVENT_PAGE (page)); @@ -1881,7 +1888,8 @@ event_page_set_delegate (EventPage *page, gboolean set) } static void -time_sel_changed (GtkComboBox *combo, EventPage *epage) +time_sel_changed (GtkComboBox *combo, + EventPage *epage) { EventPagePrivate *priv; gint selection = gtk_combo_box_get_active (combo); @@ -1932,20 +1940,22 @@ void update_end_time_combo (EventPage *epage) end_timet -= start_timet; hours = end_timet / ( 60 * 60 ); - minutes = (end_timet/60) - ( hours * 60 ); + minutes = (end_timet / 60) - ( hours * 60 ); gtk_spin_button_set_value (GTK_SPIN_BUTTON (priv->hour_selector), hours); gtk_spin_button_set_value (GTK_SPIN_BUTTON (priv->minute_selector), minutes); } static void -hour_sel_changed (GtkSpinButton *widget, EventPage *epage) +hour_sel_changed (GtkSpinButton *widget, + EventPage *epage) { hour_minute_changed (epage); } static void -minute_sel_changed (GtkSpinButton *widget, EventPage *epage) +minute_sel_changed (GtkSpinButton *widget, + EventPage *epage) { hour_minute_changed (epage); } @@ -1981,7 +1991,8 @@ hour_minute_changed (EventPage *epage) } static void -edit_clicked_cb (GtkButton *btn, EventPage *epage) +edit_clicked_cb (GtkButton *btn, + EventPage *epage) { EventPagePrivate *priv; GtkTreePath *path = NULL; @@ -2001,7 +2012,8 @@ edit_clicked_cb (GtkButton *btn, EventPage *epage) } static void -add_clicked_cb (GtkButton *btn, EventPage *epage) +add_clicked_cb (GtkButton *btn, + EventPage *epage) { CompEditor *editor; CompEditorFlags flags; @@ -2020,7 +2032,8 @@ add_clicked_cb (GtkButton *btn, EventPage *epage) } static gboolean -existing_attendee (EMeetingAttendee *ia, ECalComponent *comp) +existing_attendee (EMeetingAttendee *ia, + ECalComponent *comp) { GSList *attendees, *l; const gchar *ia_address; @@ -2056,7 +2069,8 @@ existing_attendee (EMeetingAttendee *ia, ECalComponent *comp) } static void -remove_attendee (EventPage *epage, EMeetingAttendee *ia) +remove_attendee (EventPage *epage, + EMeetingAttendee *ia) { EventPagePrivate *priv = epage->priv; CompEditor *editor; @@ -2070,7 +2084,7 @@ remove_attendee (EventPage *epage, EMeetingAttendee *ia) delegate = (flags & COMP_EDITOR_DELEGATE); /* If the user deletes the organizer attendee explicitly, - assume they no longer want the organizer showing up */ + * assume they no longer want the organizer showing up */ if (ia == priv->ia) { g_object_unref (priv->ia); priv->ia = NULL; @@ -2113,7 +2127,8 @@ remove_attendee (EventPage *epage, EMeetingAttendee *ia) } static void -remove_clicked_cb (GtkButton *btn, EventPage *epage) +remove_clicked_cb (GtkButton *btn, + EventPage *epage) { EventPagePrivate *priv; EMeetingAttendee *ia; @@ -2135,7 +2150,7 @@ remove_clicked_cb (GtkButton *btn, EventPage *epage) } paths = g_list_reverse (paths); - for (tmp = paths; tmp; tmp=tmp->next) { + for (tmp = paths; tmp; tmp = tmp->next) { path = tmp->data; gtk_tree_model_get_iter (GTK_TREE_MODEL (priv->meeting_store), &iter, path); @@ -2214,8 +2229,10 @@ attendee_added_cb (EMeetingListView *emlv, } static gboolean -list_view_event (EMeetingListView *list_view, GdkEvent *event, EventPage *epage) { - +list_view_event (EMeetingListView *list_view, + GdkEvent *event, + EventPage *epage) +{ EventPagePrivate *priv = epage->priv; CompEditor *editor; CompEditorFlags flags; @@ -2240,7 +2257,9 @@ list_view_event (EMeetingListView *list_view, GdkEvent *event, EventPage *epage) } static gboolean -list_key_press (EMeetingListView *list_view, GdkEventKey *event, EventPage *epage) +list_key_press (EMeetingListView *list_view, + GdkEventKey *event, + EventPage *epage) { if (event->keyval == GDK_KEY_Delete) { @@ -2257,7 +2276,8 @@ list_key_press (EMeetingListView *list_view, GdkEventKey *event, EventPage *epag } void -event_page_set_all_day_event (EventPage *epage, gboolean all_day) +event_page_set_all_day_event (EventPage *epage, + gboolean all_day) { EventPagePrivate *priv = epage->priv; struct icaltimetype start_tt = icaltime_null_time (); @@ -2309,7 +2329,7 @@ event_page_set_all_day_event (EventPage *epage, gboolean all_day) start_tt.is_date = TRUE; /* Round down to the start of the day, or the start of the - previous day if it is midnight. */ + * previous day if it is midnight. */ icaltime_adjust (&end_tt, 0, 0, 0, -1); end_tt.hour = 0; end_tt.minute = 0; @@ -2322,8 +2342,8 @@ event_page_set_all_day_event (EventPage *epage, gboolean all_day) && end_tt.month == start_tt.month && end_tt.day == start_tt.day) { /* The event is within one day, so we set the event - start to the start of the working day, and the end - to one hour later. */ + * start to the start of the working day, and the end + * to one hour later. */ start_tt.hour = comp_editor_get_work_day_start_hour (editor); start_tt.minute = @@ -2334,8 +2354,8 @@ event_page_set_all_day_event (EventPage *epage, gboolean all_day) icaltime_adjust (&end_tt, 0, 1, 0, 0); } else { /* The event is longer than 1 day, so we keep exactly - the same times, just using DATE-TIME rather than - DATE. */ + * the same times, just using DATE-TIME rather than + * DATE. */ icaltime_adjust (&end_tt, 1, 0, 0, 0); } @@ -2373,7 +2393,8 @@ event_page_set_all_day_event (EventPage *epage, gboolean all_day) } void -event_page_set_show_time_busy (EventPage *epage, gboolean state) +event_page_set_show_time_busy (EventPage *epage, + gboolean state) { epage->priv->show_time_as_busy = state; comp_editor_page_changed (COMP_EDITOR_PAGE (epage)); @@ -2386,7 +2407,8 @@ event_page_show_alarm (EventPage *epage) } void -event_page_set_show_timezone (EventPage *epage, gboolean state) +event_page_set_show_timezone (EventPage *epage, + gboolean state) { if (state) { gtk_widget_show_all (epage->priv->start_timezone); @@ -2399,7 +2421,8 @@ event_page_set_show_timezone (EventPage *epage, gboolean state) } void -event_page_set_show_categories (EventPage *epage, gboolean state) +event_page_set_show_categories (EventPage *epage, + gboolean state) { if (state) { gtk_widget_show (epage->priv->categories_btn); @@ -2412,7 +2435,9 @@ event_page_set_show_categories (EventPage *epage, gboolean state) /*If the msg has some value set, the icon should always be set */ void -event_page_set_info_string (EventPage *epage, const gchar *icon, const gchar *msg) +event_page_set_info_string (EventPage *epage, + const gchar *icon, + const gchar *msg) { EventPagePrivate *priv; @@ -2454,7 +2479,7 @@ get_widgets (EventPage *epage) return FALSE; /* Get the GtkAccelGroup from the toplevel window, so we can install - it when the notebook page is mapped. */ + * it when the notebook page is mapped. */ toplevel = gtk_widget_get_toplevel (priv->main); accel_groups = gtk_accel_groups_from_object (G_OBJECT (toplevel)); if (accel_groups) @@ -2572,11 +2597,12 @@ summary_changed_cb (GtkEditable *editable, } /* Note that this assumes that the start_tt and end_tt passed to it are the - dates visible to the user. For DATE values, we have to add 1 day to the - end_tt before emitting the signal. */ + * dates visible to the user. For DATE values, we have to add 1 day to the + * end_tt before emitting the signal. */ static void -notify_dates_changed (EventPage *epage, struct icaltimetype *start_tt, - struct icaltimetype *end_tt) +notify_dates_changed (EventPage *epage, + struct icaltimetype *start_tt, + struct icaltimetype *end_tt) { EventPagePrivate *priv; CompEditorPageDates dates; @@ -2592,7 +2618,7 @@ notify_dates_changed (EventPage *epage, struct icaltimetype *start_tt, if (all_day_event) { /* The actual DTEND is 1 day after the displayed date for - DATE values. */ + * DATE values. */ icaltime_adjust (end_tt, 1, 0, 0, 0); } else { start_zone = e_timezone_entry_get_timezone (E_TIMEZONE_ENTRY (priv->start_timezone)); @@ -2615,10 +2641,10 @@ notify_dates_changed (EventPage *epage, struct icaltimetype *start_tt, static gboolean check_start_before_end (struct icaltimetype *start_tt, - icaltimezone *start_zone, - struct icaltimetype *end_tt, - icaltimezone *end_zone, - gboolean adjust_end_time) + icaltimezone *start_zone, + struct icaltimetype *end_tt, + icaltimezone *end_zone, + gboolean adjust_end_time) { struct icaltimetype end_tt_copy; gint cmp; @@ -2628,7 +2654,7 @@ check_start_before_end (struct icaltimetype *start_tt, icaltimezone_convert_time (&end_tt_copy, end_zone, start_zone); /* Now check if the start time is after the end time. If it is, - we need to modify one of the times. */ + * we need to modify one of the times. */ cmp = icaltime_compare (*start_tt, end_tt_copy); if (cmp > 0) { if (adjust_end_time) { @@ -2660,7 +2686,8 @@ check_start_before_end (struct icaltimetype *start_tt, * start or end time, the other time is adjusted to make it valid. */ static void -times_updated (EventPage *epage, gboolean adjust_end_time) +times_updated (EventPage *epage, + gboolean adjust_end_time) { EventPagePrivate *priv; struct icaltimetype start_tt = icaltime_null_time (); @@ -2691,7 +2718,7 @@ times_updated (EventPage *epage, gboolean adjust_end_time) if (all_day_event) { /* All Day Events are simple. We just compare the dates and if - start > end we copy one of them to the other. */ + * start > end we copy one of them to the other. */ gint cmp = icaltime_compare_date_only (start_tt, end_tt); if (cmp > 0) { if (adjust_end_time) { @@ -2707,7 +2734,7 @@ times_updated (EventPage *epage, gboolean adjust_end_time) end_tt.is_date = TRUE; } else { /* For DATE-TIME events, we have to convert to the same - timezone before comparing. */ + * timezone before comparing. */ e_date_edit_get_time_of_day (E_DATE_EDIT (priv->start_time), &start_tt.hour, &start_tt.minute); @@ -2858,7 +2885,9 @@ event_page_send_options_clicked_cb (EventPage *epage) } static void -epage_client_opened_cb (GObject *source_object, GAsyncResult *result, gpointer user_data) +epage_client_opened_cb (GObject *source_object, + GAsyncResult *result, + gpointer user_data) { ESource *source = E_SOURCE (source_object); EClient *client = NULL; @@ -2928,7 +2957,8 @@ epage_client_opened_cb (GObject *source_object, GAsyncResult *result, gpointer u } static void -source_changed_cb (ESourceComboBox *source_combo_box, EventPage *epage) +source_changed_cb (ESourceComboBox *source_combo_box, + EventPage *epage) { EventPagePrivate *priv = epage->priv; ESource *source; @@ -2950,7 +2980,8 @@ source_changed_cb (ESourceComboBox *source_combo_box, EventPage *epage) } static void -set_subscriber_info_string (EventPage *epage, const gchar *backend_address) +set_subscriber_info_string (EventPage *epage, + const gchar *backend_address) { CompEditor *editor; ECalClient *client; @@ -2963,7 +2994,7 @@ set_subscriber_info_string (EventPage *epage, const gchar *backend_address) if (e_source_get_property (source, "subscriber")) { g_free (epage->priv->subscriber_info_text); /* Translators: This string is used when we are creating an Event - (meeting or appointment) on behalf of some other user */ + * (meeting or appointment) on behalf of some other user */ epage->priv->subscriber_info_text = g_markup_printf_escaped (_("You are acting on behalf of %s"), backend_address); } else { g_free (epage->priv->subscriber_info_text); @@ -3131,7 +3162,7 @@ init_widgets (EventPage *epage) client = comp_editor_get_client (editor); /* Make sure the EDateEdit widgets use our timezones to get the - current time. */ + * current time. */ e_date_edit_set_get_time_callback ( E_DATE_EDIT (priv->start_time), (EDateEditGetTimeCallback) comp_editor_get_current_time, @@ -3147,7 +3178,7 @@ init_widgets (EventPage *epage) gtk_widget_hide (priv->info_hbox); /* Summary */ - g_signal_connect((priv->summary), "changed", + g_signal_connect ((priv->summary), "changed", G_CALLBACK (summary_changed_cb), epage); /* Description */ @@ -3164,11 +3195,11 @@ init_widgets (EventPage *epage) G_CALLBACK (end_date_changed_cb), epage); /* Categories */ - g_signal_connect((priv->categories_btn), "clicked", + g_signal_connect ((priv->categories_btn), "clicked", G_CALLBACK (categories_clicked_cb), epage); /* Source selector */ - g_signal_connect((priv->source_selector), "changed", + g_signal_connect ((priv->source_selector), "changed", G_CALLBACK (source_changed_cb), epage); /* Alarms */ priv->alarm_list_store = e_alarm_list_new (); @@ -3183,7 +3214,7 @@ init_widgets (EventPage *epage) G_CALLBACK (comp_editor_page_changed), epage); /* Timezone changed */ - g_signal_connect((priv->start_timezone), "changed", + g_signal_connect ((priv->start_timezone), "changed", G_CALLBACK (start_timezone_changed_cb), epage); e_meeting_list_view_column_set_visible ( @@ -3212,24 +3243,40 @@ init_widgets (EventPage *epage) selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->list_view)); gtk_tree_selection_set_mode (selection, GTK_SELECTION_MULTIPLE); - g_signal_connect (G_OBJECT (priv->list_view), "event", G_CALLBACK (list_view_event), epage); - g_signal_connect (priv->list_view, "key_press_event", G_CALLBACK (list_key_press), epage); + g_signal_connect ( + priv->list_view, "event", + G_CALLBACK (list_view_event), epage); + g_signal_connect ( + priv->list_view, "key_press_event", + G_CALLBACK (list_key_press), epage); /* Add attendee button */ - g_signal_connect (priv->add, "clicked", G_CALLBACK (add_clicked_cb), epage); + g_signal_connect ( + priv->add, "clicked", + G_CALLBACK (add_clicked_cb), epage); /* Remove attendee button */ - g_signal_connect (priv->remove, "clicked", G_CALLBACK (remove_clicked_cb), epage); + g_signal_connect ( + priv->remove, "clicked", + G_CALLBACK (remove_clicked_cb), epage); /* Edit attendee button */ - g_signal_connect (priv->edit, "clicked", G_CALLBACK (edit_clicked_cb), epage); + g_signal_connect ( + priv->edit, "clicked", + G_CALLBACK (edit_clicked_cb), epage); /* Contacts button */ - g_signal_connect(priv->invite, "clicked", G_CALLBACK (invite_cb), epage); + g_signal_connect ( + priv->invite, "clicked", + G_CALLBACK (invite_cb), epage); /* Alarm dialog */ - g_signal_connect (GTK_DIALOG (priv->alarm_dialog), "response", G_CALLBACK (gtk_widget_hide), priv->alarm_dialog); - g_signal_connect (GTK_DIALOG (priv->alarm_dialog), "delete-event", G_CALLBACK (gtk_widget_hide), priv->alarm_dialog); + g_signal_connect ( + priv->alarm_dialog, "response", + G_CALLBACK (gtk_widget_hide), priv->alarm_dialog); + g_signal_connect ( + priv->alarm_dialog, "delete-event", + G_CALLBACK (gtk_widget_hide), priv->alarm_dialog); priv->alarm_list_dlg_widget = alarm_list_dialog_peek (client, priv->alarm_list_store); gtk_widget_reparent (priv->alarm_list_dlg_widget, priv->alarm_box); gtk_widget_show_all (priv->alarm_list_dlg_widget); @@ -3259,7 +3306,7 @@ init_widgets (EventPage *epage) update_end_time_combo ( epage); /* Hour and Minute selector */ - gtk_spin_button_set_range ( (GtkSpinButton*) priv->hour_selector, 0, G_MAXINT); + gtk_spin_button_set_range ( (GtkSpinButton *) priv->hour_selector, 0, G_MAXINT); g_signal_connect (priv->hour_selector, "value-changed", G_CALLBACK (hour_sel_changed), epage); g_signal_connect (priv->minute_selector, "value-changed", G_CALLBACK (minute_sel_changed), epage); @@ -3363,7 +3410,8 @@ init_widgets (EventPage *epage) static void -event_page_select_organizer (EventPage *epage, const gchar *backend_address) +event_page_select_organizer (EventPage *epage, + const gchar *backend_address) { EventPagePrivate *priv = epage->priv; CompEditor *editor; @@ -3505,7 +3553,8 @@ event_page_new (EMeetingStore *meeting_store, } static void -set_attendees (ECalComponent *comp, const GPtrArray *attendees) +set_attendees (ECalComponent *comp, + const GPtrArray *attendees) { GSList *comp_attendees = NULL, *l; gint i; diff --git a/calendar/gui/dialogs/goto-dialog.c b/calendar/gui/dialogs/goto-dialog.c index 7b8fffa430..4a77c87554 100644 --- a/calendar/gui/dialogs/goto-dialog.c +++ b/calendar/gui/dialogs/goto-dialog.c @@ -59,7 +59,8 @@ static GoToDialog *dlg = NULL; /* Callback used when the year adjustment is changed */ static void -year_changed (GtkAdjustment *adj, gpointer data) +year_changed (GtkAdjustment *adj, + gpointer data) { GtkSpinButton *spin_button; GoToDialog *dlg = data; @@ -73,7 +74,8 @@ year_changed (GtkAdjustment *adj, gpointer data) /* Callback used when a month button is toggled */ static void -month_changed (GtkToggleButton *toggle, gpointer data) +month_changed (GtkToggleButton *toggle, + gpointer data) { GtkComboBox *combo_box; GoToDialog *dlg = data; @@ -86,7 +88,8 @@ month_changed (GtkToggleButton *toggle, gpointer data) } static void -ecal_date_range_changed (ECalendarItem *calitem, gpointer user_data) +ecal_date_range_changed (ECalendarItem *calitem, + gpointer user_data) { GoToDialog *dlg = user_data; ECalModel *model; @@ -101,7 +104,8 @@ ecal_date_range_changed (ECalendarItem *calitem, gpointer user_data) /* Event handler for day groups in the month item. A button press makes * the calendar jump to the selected day and destroys the Go-to dialog box. */ static void -ecal_event (ECalendarItem *calitem, gpointer user_data) +ecal_event (ECalendarItem *calitem, + gpointer user_data) { GoToDialog *dlg = user_data; GDate start_date, end_date; @@ -127,7 +131,8 @@ ecal_event (ECalendarItem *calitem, gpointer user_data) /* Returns the current time, for the ECalendarItem. */ static struct tm -get_current_time (ECalendarItem *calitem, gpointer data) +get_current_time (ECalendarItem *calitem, + gpointer data) { icaltimezone *zone; struct tm tmp_tm = { 0 }; @@ -224,7 +229,8 @@ goto_dialog_init_widgets (GoToDialog *dlg) /* Creates a "goto date" dialog and runs it */ void -goto_dialog (GtkWindow *parent, GnomeCalendar *gcal) +goto_dialog (GtkWindow *parent, + GnomeCalendar *gcal) { ECalModel *model; time_t start_time; diff --git a/calendar/gui/dialogs/memo-page.c b/calendar/gui/dialogs/memo-page.c index 9c14fccd0a..cf1e879d1d 100644 --- a/calendar/gui/dialogs/memo-page.c +++ b/calendar/gui/dialogs/memo-page.c @@ -503,7 +503,8 @@ get_recipients (ECalComponent *comp) } static gboolean -fill_comp_with_recipients (ENameSelector *name_selector, ECalComponent *comp) +fill_comp_with_recipients (ENameSelector *name_selector, + ECalComponent *comp) { EDestinationStore *destination_store; GString *str = NULL; @@ -678,7 +679,7 @@ memo_page_fill_component (CompEditorPage *page, gunichar uc; for (i = 0, p = str, uc = g_utf8_get_char_validated (p, -1); - i < 50 && p && uc < (gunichar)-2; + i < 50 && p && uc < (gunichar) - 2; i++, p = g_utf8_next_char (p), uc = g_utf8_get_char_validated (p, -1)) { if (uc == '\n' || !uc) { p = NULL; @@ -784,7 +785,8 @@ memo_page_fill_component (CompEditorPage *page, } void -memo_page_set_show_categories (MemoPage *page, gboolean state) +memo_page_set_show_categories (MemoPage *page, + gboolean state) { if (state) { gtk_widget_show (page->priv->categories_btn); @@ -797,7 +799,9 @@ memo_page_set_show_categories (MemoPage *page, gboolean state) /*If the msg has some value set, the icon should always be set */ void -memo_page_set_info_string (MemoPage *mpage, const gchar *icon, const gchar *msg) +memo_page_set_info_string (MemoPage *mpage, + const gchar *icon, + const gchar *msg) { MemoPagePrivate *priv; @@ -834,7 +838,7 @@ get_widgets (MemoPage *mpage) } /* Get the GtkAccelGroup from the toplevel window, so we can install - it when the notebook page is mapped. */ + * it when the notebook page is mapped. */ toplevel = gtk_widget_get_toplevel (priv->main); accel_groups = gtk_accel_groups_from_object (G_OBJECT (toplevel)); if (accel_groups) @@ -896,7 +900,9 @@ categories_clicked_cb (GtkWidget *button, } static void -mpage_client_opened_cb (GObject *source_object, GAsyncResult *result, gpointer user_data) +mpage_client_opened_cb (GObject *source_object, + GAsyncResult *result, + gpointer user_data) { ESource *source = E_SOURCE (source_object); EClient *client = NULL; @@ -1002,7 +1008,7 @@ set_subscriber_info_string (MemoPage *mpage, if (e_source_get_property (source, "subscriber")) { g_free (mpage->priv->subscriber_info_text); /* Translators: This string is used when we are creating a Memo - on behalf of some other user */ + * on behalf of some other user */ mpage->priv->subscriber_info_text = g_markup_printf_escaped (_("You are acting on behalf of %s"), backend_address); } else { g_free (mpage->priv->subscriber_info_text); @@ -1082,7 +1088,7 @@ init_widgets (MemoPage *mpage) G_CALLBACK (source_changed_cb), mpage); /* Connect the default signal handler to use to make sure the "changed" - field gets set whenever a field is changed. */ + * field gets set whenever a field is changed. */ /* Belongs to priv->memo_content */ g_signal_connect_swapped ( @@ -1142,7 +1148,8 @@ get_to_entry (ENameSelector *name_selector) } static void -memo_page_select_organizer (MemoPage *mpage, const gchar *backend_address) +memo_page_select_organizer (MemoPage *mpage, + const gchar *backend_address) { MemoPagePrivate *priv; CompEditor *editor; diff --git a/calendar/gui/dialogs/recur-comp.c b/calendar/gui/dialogs/recur-comp.c index 3514c03dbf..e9a941998d 100644 --- a/calendar/gui/dialogs/recur-comp.c +++ b/calendar/gui/dialogs/recur-comp.c @@ -33,9 +33,10 @@ gboolean recur_component_dialog (ECalClient *client, - ECalComponent *comp, - CalObjModType *mod, - GtkWindow *parent, gboolean delegated) + ECalComponent *comp, + CalObjModType *mod, + GtkWindow *parent, + gboolean delegated) { gchar *str; GtkWidget *dialog, *rb_this, *rb_prior, *rb_future, *rb_all, *hbox; diff --git a/calendar/gui/dialogs/recurrence-page.c b/calendar/gui/dialogs/recurrence-page.c index fa18e0d9f1..6f201b596f 100644 --- a/calendar/gui/dialogs/recurrence-page.c +++ b/calendar/gui/dialogs/recurrence-page.c @@ -463,7 +463,8 @@ clear_widgets (RecurrencePage *rpage) /* Appends an exception date to the list */ static void -append_exception (RecurrencePage *rpage, ECalComponentDateTime *datetime) +append_exception (RecurrencePage *rpage, + ECalComponentDateTime *datetime) { RecurrencePagePrivate *priv; GtkTreeView *view; @@ -478,7 +479,8 @@ append_exception (RecurrencePage *rpage, ECalComponentDateTime *datetime) /* Fills in the exception widgets with the data from the calendar component */ static void -fill_exception_widgets (RecurrencePage *rpage, ECalComponent *comp) +fill_exception_widgets (RecurrencePage *rpage, + ECalComponent *comp) { GSList *list, *l; @@ -588,7 +590,8 @@ sensitize_recur_widgets (RecurrencePage *rpage) } static void -update_with_readonly (RecurrencePage *rpage, gboolean read_only) +update_with_readonly (RecurrencePage *rpage, + gboolean read_only) { RecurrencePagePrivate *priv = rpage->priv; CompEditor *editor; @@ -617,7 +620,9 @@ update_with_readonly (RecurrencePage *rpage, gboolean read_only) } static void -rpage_get_objects_for_uid_cb (GObject *source_object, GAsyncResult *result, gpointer user_data) +rpage_get_objects_for_uid_cb (GObject *source_object, + GAsyncResult *result, + gpointer user_data) { ECalClient *client = E_CAL_CLIENT (source_object); RecurrencePage *rpage = user_data; @@ -639,7 +644,9 @@ rpage_get_objects_for_uid_cb (GObject *source_object, GAsyncResult *result, gpoi } static void -rpage_get_object_cb (GObject *source_object, GAsyncResult *result, gpointer user_data) +rpage_get_object_cb (GObject *source_object, + GAsyncResult *result, + gpointer user_data) { ECalClient *client = E_CAL_CLIENT (source_object); RecurrencePage *rpage = user_data; @@ -711,24 +718,12 @@ sensitize_buttons (RecurrencePage *rpage) } } -#if 0 -/* Encondes a position/weekday pair into the proper format for - * icalrecurrencetype.by_day. Not needed at present. - */ -static short -nth_weekday (gint pos, icalrecurrencetype_weekday weekday) -{ - g_assert (pos > 0 && pos <= 5); - - return (pos << 3) | (gint) weekday; -} -#endif - /* Gets the simple recurrence data from the recurrence widgets and stores it in * the calendar component. */ static void -simple_recur_to_comp (RecurrencePage *rpage, ECalComponent *comp) +simple_recur_to_comp (RecurrencePage *rpage, + ECalComponent *comp) { RecurrencePagePrivate *priv; struct icalrecurrencetype r; @@ -820,8 +815,8 @@ simple_recur_to_comp (RecurrencePage *rpage, ECalComponent *comp) break; /* Outlook 2000 uses BYDAY=TU;BYSETPOS=2, and will not - accept BYDAY=2TU. So we now use the same as Outlook - by default. */ + * accept BYDAY=2TU. So we now use the same as Outlook + * by default. */ case MONTH_DAY_MON: r.by_day[0] = ICAL_MONDAY_WEEKDAY; r.by_set_pos[0] = month_num; @@ -890,7 +885,7 @@ simple_recur_to_comp (RecurrencePage *rpage, ECalComponent *comp) g_return_if_fail (E_IS_DATE_EDIT (priv->ending_date_edit)); /* We only allow a DATE value to be set for the UNTIL property, - since we don't support sub-day recurrences. */ + * since we don't support sub-day recurrences. */ date_set = e_date_edit_get_date (E_DATE_EDIT (priv->ending_date_edit), &r.until.year, &r.until.month, @@ -921,7 +916,8 @@ simple_recur_to_comp (RecurrencePage *rpage, ECalComponent *comp) * custom recurrence, it leaves it intact. */ static gboolean -fill_component (RecurrencePage *rpage, ECalComponent *comp) +fill_component (RecurrencePage *rpage, + ECalComponent *comp) { RecurrencePagePrivate *priv; gboolean recurs; @@ -1058,7 +1054,11 @@ make_weekly_special (RecurrencePage *rpage) /* Creates the subtree for the monthly recurrence number */ static void -make_recur_month_num_subtree (GtkTreeStore *store, GtkTreeIter *par, const gchar *title, gint start, gint end) +make_recur_month_num_subtree (GtkTreeStore *store, + GtkTreeIter *par, + const gchar *title, + gint start, + gint end) { GtkTreeIter iter, parent; gint i; @@ -1071,12 +1071,13 @@ make_recur_month_num_subtree (GtkTreeStore *store, GtkTreeIter *par, const gchar gtk_tree_store_set (store, &iter, 0, _(e_cal_recur_nth[i]), 1, i + 1, -1); } } + static void -only_leaf_sensitive (GtkCellLayout *cell_layout, - GtkCellRenderer *cell, - GtkTreeModel *tree_model, - GtkTreeIter *iter, - gpointer data) +only_leaf_sensitive (GtkCellLayout *cell_layout, + GtkCellRenderer *cell, + GtkTreeModel *tree_model, + GtkTreeIter *iter, + gpointer data) { gboolean sensitive; @@ -1184,8 +1185,8 @@ make_recur_month_combobox (void) { static const gchar *options[] = { /* For Translator : 'day' is part of the sentence of the form 'appointment recurs/Every [x] month(s) on the [first] [day] [forever]' - (dropdown menu options are in[square brackets]). This means that after 'first', either the string 'day' or - the name of a week day (like 'Monday' or 'Friday') always follow. */ + * (dropdown menu options are in[square brackets]). This means that after 'first', either the string 'day' or + * the name of a week day (like 'Monday' or 'Friday') always follow. */ N_("day"), N_("Monday"), N_("Tuesday"), @@ -1209,7 +1210,8 @@ make_recur_month_combobox (void) } static void -month_num_combo_changed_cb (GtkComboBox *combo, RecurrencePage *rpage) +month_num_combo_changed_cb (GtkComboBox *combo, + RecurrencePage *rpage) { GtkTreeIter iter; RecurrencePagePrivate *priv; @@ -1269,7 +1271,8 @@ month_num_combo_changed_cb (GtkComboBox *combo, RecurrencePage *rpage) * are 1-31 while a Sunday is the 1st through 5th. */ static void -month_day_combo_changed_cb (GtkComboBox *combo, RecurrencePage *rpage) +month_day_combo_changed_cb (GtkComboBox *combo, + RecurrencePage *rpage) { RecurrencePagePrivate *priv; enum month_num_options month_num; @@ -1403,7 +1406,8 @@ make_recurrence_special (RecurrencePage *rpage) /* Counts the elements in the by_xxx fields of an icalrecurrencetype */ static gint -count_by_xxx (gshort *field, gint max_elements) +count_by_xxx (gshort *field, + gint max_elements) { gint i; @@ -1456,7 +1460,7 @@ make_ending_until_special (RecurrencePage *rpage) G_CALLBACK (comp_editor_page_changed), rpage); /* Make sure the EDateEdit widget uses our timezones to get the - current time. */ + * current time. */ e_date_edit_set_get_time_callback ( de, (EDateEditGetTimeCallback) comp_editor_get_current_time, @@ -1554,7 +1558,8 @@ make_ending_special (RecurrencePage *rpage) * component. */ static void -fill_ending_date (RecurrencePage *rpage, struct icalrecurrencetype *r) +fill_ending_date (RecurrencePage *rpage, + struct icalrecurrencetype *r) { RecurrencePagePrivate *priv = rpage->priv; CompEditor *editor; @@ -1635,7 +1640,8 @@ fill_ending_date (RecurrencePage *rpage, struct icalrecurrencetype *r) * no rdates or exrules (exdates are handled just fine elsewhere). */ static gboolean -recurrence_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) +recurrence_page_fill_widgets (CompEditorPage *page, + ECalComponent *comp) { RecurrencePage *rpage; RecurrencePagePrivate *priv; @@ -1867,8 +1873,8 @@ recurrence_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) enum month_day_options month_day; /* Outlook 2000 uses BYDAY=TU;BYSETPOS=2, and will not - accept BYDAY=2TU. So we now use the same as Outlook - by default. */ + * accept BYDAY=2TU. So we now use the same as Outlook + * by default. */ weekday = icalrecurrencetype_day_day_of_week (r->by_day[0]); pos = icalrecurrencetype_day_position (r->by_day[0]); @@ -1988,7 +1994,8 @@ recurrence_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) /* fill_component handler for the recurrence page */ static gboolean -recurrence_page_fill_component (CompEditorPage *page, ECalComponent *comp) +recurrence_page_fill_component (CompEditorPage *page, + ECalComponent *comp) { RecurrencePage *rpage; @@ -1998,7 +2005,8 @@ recurrence_page_fill_component (CompEditorPage *page, ECalComponent *comp) /* set_dates handler for the recurrence page */ static void -recurrence_page_set_dates (CompEditorPage *page, CompEditorPageDates *dates) +recurrence_page_set_dates (CompEditorPage *page, + CompEditorPageDates *dates) { RecurrencePage *rpage; RecurrencePagePrivate *priv; @@ -2088,7 +2096,7 @@ get_widgets (RecurrencePage *rpage) return FALSE; /* Get the GtkAccelGroup from the toplevel window, so we can install - it when the notebook page is mapped. */ + * it when the notebook page is mapped. */ toplevel = gtk_widget_get_toplevel (priv->main); accel_groups = gtk_accel_groups_from_object (G_OBJECT (toplevel)); if (accel_groups) @@ -2170,7 +2178,9 @@ type_toggled_cb (GtkToggleButton *toggle, } static GtkWidget * -create_exception_dialog (RecurrencePage *rpage, const gchar *title, GtkWidget **date_edit) +create_exception_dialog (RecurrencePage *rpage, + const gchar *title, + GtkWidget **date_edit) { RecurrencePagePrivate *priv; GtkWidget *dialog, *toplevel; @@ -2357,7 +2367,7 @@ init_widgets (RecurrencePage *rpage) priv->preview_calendar = e_calendar_new (); ecal = E_CALENDAR (priv->preview_calendar); - g_signal_connect((ecal->calitem), "date_range_changed", + g_signal_connect ((ecal->calitem), "date_range_changed", G_CALLBACK (preview_date_range_changed_cb), rpage); e_calendar_item_set_max_days_sel (ecal->calitem, 0); @@ -2373,7 +2383,7 @@ init_widgets (RecurrencePage *rpage) /* Recurrence types */ - g_signal_connect(priv->recurs, "toggled", G_CALLBACK (type_toggled_cb), rpage); + g_signal_connect (priv->recurs, "toggled", G_CALLBACK (type_toggled_cb), rpage); /* Recurrence interval */ @@ -2402,11 +2412,11 @@ init_widgets (RecurrencePage *rpage) /* Exception buttons */ - g_signal_connect((priv->exception_add), "clicked", + g_signal_connect ((priv->exception_add), "clicked", G_CALLBACK (exception_add_cb), rpage); - g_signal_connect((priv->exception_modify), "clicked", + g_signal_connect ((priv->exception_modify), "clicked", G_CALLBACK (exception_modify_cb), rpage); - g_signal_connect((priv->exception_delete), "clicked", + g_signal_connect ((priv->exception_delete), "clicked", G_CALLBACK (exception_delete_cb), rpage); gtk_widget_set_sensitive (priv->exception_modify, FALSE); diff --git a/calendar/gui/dialogs/save-comp.c b/calendar/gui/dialogs/save-comp.c index 0f9a6fba8e..459ff9a4c6 100644 --- a/calendar/gui/dialogs/save-comp.c +++ b/calendar/gui/dialogs/save-comp.c @@ -41,7 +41,8 @@ **/ GtkResponseType -save_component_dialog (GtkWindow *parent, ECalComponent *comp) +save_component_dialog (GtkWindow *parent, + ECalComponent *comp) { ECalComponentVType vtype = e_cal_component_get_vtype (comp); CompEditorFlags flags; diff --git a/calendar/gui/dialogs/schedule-page.c b/calendar/gui/dialogs/schedule-page.c index 0b78f55c7b..3b96fbd2bc 100644 --- a/calendar/gui/dialogs/schedule-page.c +++ b/calendar/gui/dialogs/schedule-page.c @@ -54,8 +54,8 @@ struct _SchedulePagePrivate { EMeetingTimeSelector *sel; /* The timezone we use. Note that we use the same timezone for the - start and end date. We convert the end date if it is passed in in - another timezone. */ + * start and end date. We convert the end date if it is passed in in + * another timezone. */ icaltimezone *zone; }; @@ -95,8 +95,8 @@ update_time (SchedulePage *spage, if (start_date->tzid) { /* Note that if we are creating a new event, the timezones may not be - on the server, so we try to get the builtin timezone with the TZID - first. */ + * on the server, so we try to get the builtin timezone with the TZID + * first. */ start_zone = icaltimezone_get_builtin_timezone_from_tzid (start_date->tzid); if (!start_zone) { GError *error = NULL; @@ -145,7 +145,7 @@ update_time (SchedulePage *spage, all_day = (start_tt.is_date && end_tt.is_date) ? TRUE : FALSE; /* For All Day Events, if DTEND is after DTSTART, we subtract 1 day - from it. */ + * from it. */ if (all_day) { if (icaltime_compare_date_only (end_tt, start_tt) > 0) { icaltime_adjust (&end_tt, -1, 0, 0, 0); @@ -215,7 +215,8 @@ schedule_page_focus_main_widget (CompEditorPage *page) } static gboolean -schedule_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) +schedule_page_fill_widgets (CompEditorPage *page, + ECalComponent *comp) { SchedulePage *spage; ECalComponentDateTime start_date, end_date; @@ -242,13 +243,15 @@ schedule_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) } static gboolean -schedule_page_fill_component (CompEditorPage *page, ECalComponent *comp) +schedule_page_fill_component (CompEditorPage *page, + ECalComponent *comp) { return TRUE; } static void -schedule_page_set_dates (CompEditorPage *page, CompEditorPageDates *dates) +schedule_page_set_dates (CompEditorPage *page, + CompEditorPageDates *dates) { SchedulePage *spage; @@ -304,7 +307,7 @@ get_widgets (SchedulePage *spage) return FALSE; /* Get the GtkAccelGroup from the toplevel window, so we can install - it when the notebook page is mapped. */ + * it when the notebook page is mapped. */ toplevel = gtk_widget_get_toplevel (priv->main); accel_groups = gtk_accel_groups_from_object (G_OBJECT (toplevel)); if (accel_groups) @@ -368,7 +371,8 @@ schedule_page_set_meeting_time (SchedulePage *spage, * be created. **/ SchedulePage * -schedule_page_construct (SchedulePage *spage, EMeetingStore *ems) +schedule_page_construct (SchedulePage *spage, + EMeetingStore *ems) { SchedulePagePrivate *priv = spage->priv; CompEditor *editor; @@ -450,7 +454,8 @@ schedule_page_update_free_busy (SchedulePage *spage) } void -schedule_page_set_name_selector (SchedulePage *spage, ENameSelector *name_selector) +schedule_page_set_name_selector (SchedulePage *spage, + ENameSelector *name_selector) { SchedulePagePrivate *priv; @@ -504,7 +509,7 @@ times_changed_cb (GtkWidget *widget, end_dt.tzid = start_dt.tzid; } else { /* For All-Day Events, we set the timezone to NULL, and add - 1 day to DTEND. */ + * 1 day to DTEND. */ start_dt.value->is_date = TRUE; start_dt.tzid = NULL; end_dt.value->is_date = TRUE; diff --git a/calendar/gui/dialogs/select-source-dialog.c b/calendar/gui/dialogs/select-source-dialog.c index 4ae9f0a0d8..6a768e5b7a 100644 --- a/calendar/gui/dialogs/select-source-dialog.c +++ b/calendar/gui/dialogs/select-source-dialog.c @@ -35,7 +35,9 @@ * Implements dialog for allowing user to select a destination source. */ ESource * -select_source_dialog (GtkWindow *parent, ECalClientSourceType obj_type, ESource *except_source) +select_source_dialog (GtkWindow *parent, + ECalClientSourceType obj_type, + ESource *except_source) { GtkWidget *dialog; ESourceList *source_list; @@ -78,7 +80,7 @@ select_source_dialog (GtkWindow *parent, ECalClientSourceType obj_type, ESource gchar *absolute_uri; /* set the absolute URI on the source we keep around, since the group - will be unrefed */ + * will be unrefed */ absolute_uri = e_source_build_absolute_uri (selected_source); e_source_set_absolute_uri (selected_source, (const gchar *) absolute_uri); diff --git a/calendar/gui/dialogs/send-comp.c b/calendar/gui/dialogs/send-comp.c index bf016403ec..3752db372b 100644 --- a/calendar/gui/dialogs/send-comp.c +++ b/calendar/gui/dialogs/send-comp.c @@ -106,7 +106,8 @@ have_nonprocedural_alarm (ECalComponent *comp) } static GtkWidget * -add_checkbox (GtkBox *where, const gchar *caption) +add_checkbox (GtkBox *where, + const gchar *caption) { GtkWidget *checkbox, *align; @@ -133,7 +134,12 @@ add_checkbox (GtkBox *where, const gchar *caption) * Return value: TRUE if the user clicked Yes, FALSE otherwise. **/ gboolean -send_component_dialog (GtkWindow *parent, ECalClient *client, ECalComponent *comp, gboolean new, gboolean *strip_alarms, gboolean *only_new_attendees) +send_component_dialog (GtkWindow *parent, + ECalClient *client, + ECalComponent *comp, + gboolean new, + gboolean *strip_alarms, + gboolean *only_new_attendees) { ECalComponentVType vtype; const gchar *id; @@ -173,7 +179,7 @@ send_component_dialog (GtkWindow *parent, ECalClient *client, ECalComponent *com if (only_new_attendees && !component_has_new_attendees (comp)) { /* do not show the check if there is no new attendee and - set as all attendees are required to be notified */ + * set as all attendees are required to be notified */ *only_new_attendees = FALSE; /* pretend it as being passed NULL to simplify code below */ @@ -206,7 +212,9 @@ send_component_dialog (GtkWindow *parent, ECalClient *client, ECalComponent *com } gboolean -send_component_prompt_subject (GtkWindow *parent, ECalClient *client, ECalComponent *comp) +send_component_prompt_subject (GtkWindow *parent, + ECalClient *client, + ECalComponent *comp) { ECalComponentVType vtype; const gchar *id; diff --git a/calendar/gui/dialogs/task-details-page.c b/calendar/gui/dialogs/task-details-page.c index bc828cf431..de30baca77 100644 --- a/calendar/gui/dialogs/task-details-page.c +++ b/calendar/gui/dialogs/task-details-page.c @@ -269,7 +269,7 @@ task_details_page_fill_widgets (CompEditorPage *page, icaltimezone *utc_zone, *zone; /* Completed is in UTC, but that would confuse the user, so - we convert it to local time. */ + * we convert it to local time. */ utc_zone = icaltimezone_get_utc_timezone (); zone = comp_editor_get_timezone (editor); @@ -376,11 +376,11 @@ task_details_page_fill_component (CompEditorPage *page, } /* COMPLETED must be in UTC, so we assume that the date in the - dialog is in the current timezone, and we now convert it - to UTC. FIXME: We should really use one timezone for the - entire time the dialog is shown. Otherwise if the user - changes the timezone, the COMPLETED date may get changed - as well. */ + * dialog is in the current timezone, and we now convert it + * to UTC. FIXME: We should really use one timezone for the + * entire time the dialog is shown. Otherwise if the user + * changes the timezone, the COMPLETED date may get changed + * as well. */ icaltimezone_convert_time (&icalcomplete, zone, icaltimezone_get_utc_timezone ()); e_cal_component_set_completed (comp, &icalcomplete); @@ -461,7 +461,7 @@ get_widgets (TaskDetailsPage *tdpage) return FALSE; /* Get the GtkAccelGroup from the toplevel window, so we can install - it when the notebook page is mapped. */ + * it when the notebook page is mapped. */ toplevel = gtk_widget_get_toplevel (priv->main); accel_groups = gtk_accel_groups_from_object (G_OBJECT (toplevel)); if (accel_groups) @@ -499,7 +499,9 @@ get_widgets (TaskDetailsPage *tdpage) } static void -complete_date_changed (TaskDetailsPage *tdpage, time_t ctime, gboolean complete) +complete_date_changed (TaskDetailsPage *tdpage, + time_t ctime, + gboolean complete) { CompEditorPageDates dates = {NULL, NULL, NULL, NULL}; icaltimezone *zone; @@ -573,7 +575,8 @@ date_changed_cb (EDateEdit *dedit, } static void -status_changed (GtkWidget *combo, TaskDetailsPage *tdpage) +status_changed (GtkWidget *combo, + TaskDetailsPage *tdpage) { TaskDetailsPagePrivate *priv; icalproperty_status status; @@ -618,7 +621,8 @@ status_changed (GtkWidget *combo, TaskDetailsPage *tdpage) } static void -percent_complete_changed (GtkAdjustment *adj, TaskDetailsPage *tdpage) +percent_complete_changed (GtkAdjustment *adj, + TaskDetailsPage *tdpage) { TaskDetailsPagePrivate *priv; gint percent; @@ -673,7 +677,7 @@ init_widgets (TaskDetailsPage *tdpage) editor = comp_editor_page_get_editor (COMP_EDITOR_PAGE (tdpage)); /* Make sure the EDateEdit widgets use our timezones to get the - current time. */ + * current time. */ e_date_edit_set_get_time_callback ( E_DATE_EDIT (priv->completed_date), (EDateEditGetTimeCallback) comp_editor_get_current_time, @@ -689,8 +693,8 @@ init_widgets (TaskDetailsPage *tdpage) priv->url_entry); /* Connect signals. The Status, Percent Complete & Date Completed - properties are closely related so whenever one changes we may need - to update the other 2. */ + * properties are closely related so whenever one changes we may need + * to update the other 2. */ g_signal_connect ( GTK_COMBO_BOX (priv->status_combo), "changed", G_CALLBACK (status_changed), tdpage); diff --git a/calendar/gui/dialogs/task-editor.c b/calendar/gui/dialogs/task-editor.c index ee31eb0a1c..31593e0a04 100644 --- a/calendar/gui/dialogs/task-editor.c +++ b/calendar/gui/dialogs/task-editor.c @@ -377,7 +377,8 @@ task_editor_init (TaskEditor *te) } static void -task_editor_edit_comp (CompEditor *editor, ECalComponent *comp) +task_editor_edit_comp (CompEditor *editor, + ECalComponent *comp) { TaskEditorPrivate *priv; ECalComponentOrganizer organizer; diff --git a/calendar/gui/dialogs/task-page.c b/calendar/gui/dialogs/task-page.c index 958eac682b..d88976be75 100644 --- a/calendar/gui/dialogs/task-page.c +++ b/calendar/gui/dialogs/task-page.c @@ -546,14 +546,14 @@ task_page_fill_widgets (CompEditorPage *page, e_date_edit_set_time (E_DATE_EDIT (priv->due_date), -1); /* If no time is set, we use the default timezone, so the - user usually doesn't have to set this when they set the - date. */ + * user usually doesn't have to set this when they set the + * date. */ zone = NULL; } /* Note that if we are creating a new task, the timezones may not be - on the server, so we try to get the builtin timezone with the TZID - first. */ + * on the server, so we try to get the builtin timezone with the TZID + * first. */ if (!zone && d.tzid) { GError *error = NULL; if (!e_cal_client_get_timezone_sync (client, d.tzid, &zone, NULL, &error)) @@ -1018,7 +1018,8 @@ task_page_init (TaskPage *tpage) } void -task_page_set_view_role (TaskPage *page, gboolean state) +task_page_set_view_role (TaskPage *page, + gboolean state) { TaskPagePrivate *priv = page->priv; @@ -1026,7 +1027,8 @@ task_page_set_view_role (TaskPage *page, gboolean state) } void -task_page_set_view_status (TaskPage *page, gboolean state) +task_page_set_view_status (TaskPage *page, + gboolean state) { TaskPagePrivate *priv = page->priv; @@ -1034,7 +1036,8 @@ task_page_set_view_status (TaskPage *page, gboolean state) } void -task_page_set_view_type (TaskPage *page, gboolean state) +task_page_set_view_type (TaskPage *page, + gboolean state) { TaskPagePrivate *priv = page->priv; @@ -1042,7 +1045,8 @@ task_page_set_view_type (TaskPage *page, gboolean state) } void -task_page_set_view_rsvp (TaskPage *page, gboolean state) +task_page_set_view_rsvp (TaskPage *page, + gboolean state) { TaskPagePrivate *priv = page->priv; @@ -1076,7 +1080,8 @@ task_page_show_options (TaskPage *page) } void -task_page_set_assignment (TaskPage *page, gboolean set) +task_page_set_assignment (TaskPage *page, + gboolean set) { g_return_if_fail (IS_TASK_PAGE (page)); @@ -1085,7 +1090,8 @@ task_page_set_assignment (TaskPage *page, gboolean set) } static void -add_clicked_cb (GtkButton *btn, TaskPage *page) +add_clicked_cb (GtkButton *btn, + TaskPage *page) { EMeetingAttendee *attendee; CompEditor *editor; @@ -1120,7 +1126,8 @@ static void edit_clicked_cb (GtkButton *btn, TaskPage *tpage) } static gboolean -existing_attendee (EMeetingAttendee *ia, ECalComponent *comp) +existing_attendee (EMeetingAttendee *ia, + ECalComponent *comp) { GSList *attendees, *l; const gchar *ia_address; @@ -1156,7 +1163,8 @@ existing_attendee (EMeetingAttendee *ia, ECalComponent *comp) } static void -remove_attendee (TaskPage *page, EMeetingAttendee *ia) +remove_attendee (TaskPage *page, + EMeetingAttendee *ia) { TaskPagePrivate *priv = page->priv; CompEditor *editor; @@ -1167,7 +1175,7 @@ remove_attendee (TaskPage *page, EMeetingAttendee *ia) flags = comp_editor_get_flags (editor); /* If the user deletes the organizer attendee explicitly, - assume they no longer want the organizer showing up */ + * assume they no longer want the organizer showing up */ if (ia == priv->ia) { g_object_unref (priv->ia); priv->ia = NULL; @@ -1209,7 +1217,8 @@ remove_attendee (TaskPage *page, EMeetingAttendee *ia) } static void -remove_clicked_cb (GtkButton *btn, TaskPage *page) +remove_clicked_cb (GtkButton *btn, + TaskPage *page) { TaskPagePrivate *priv; EMeetingAttendee *ia; @@ -1231,7 +1240,7 @@ remove_clicked_cb (GtkButton *btn, TaskPage *page) } paths = g_list_reverse (paths); - for (tmp = paths; tmp; tmp=tmp->next) { + for (tmp = paths; tmp; tmp = tmp->next) { path = tmp->data; gtk_tree_model_get_iter (GTK_TREE_MODEL (priv->meeting_store), &iter, path); @@ -1310,8 +1319,10 @@ attendee_added_cb (EMeetingListView *emlv, } static gboolean -list_view_event (EMeetingListView *list_view, GdkEvent *event, TaskPage *page) { - +list_view_event (EMeetingListView *list_view, + GdkEvent *event, + TaskPage *page) +{ TaskPagePrivate *priv= page->priv; CompEditor *editor; CompEditorFlags flags; @@ -1336,7 +1347,9 @@ list_view_event (EMeetingListView *list_view, GdkEvent *event, TaskPage *page) { } static gboolean -list_key_press (EMeetingListView *list_view, GdkEventKey *event, TaskPage *page) +list_key_press (EMeetingListView *list_view, + GdkEventKey *event, + TaskPage *page) { if (event->keyval == GDK_KEY_Delete) { @@ -1353,7 +1366,8 @@ list_key_press (EMeetingListView *list_view, GdkEventKey *event, TaskPage *page) } void -task_page_set_show_timezone (TaskPage *page, gboolean state) +task_page_set_show_timezone (TaskPage *page, + gboolean state) { if (state) { gtk_widget_show_all (page->priv->timezone); @@ -1366,7 +1380,8 @@ task_page_set_show_timezone (TaskPage *page, gboolean state) } void -task_page_set_show_categories (TaskPage *page, gboolean state) +task_page_set_show_categories (TaskPage *page, + gboolean state) { if (state) { gtk_widget_show (page->priv->categories_btn); @@ -1379,7 +1394,9 @@ task_page_set_show_categories (TaskPage *page, gboolean state) /*If the msg has some value set, the icon should always be set */ void -task_page_set_info_string (TaskPage *tpage, const gchar *icon, const gchar *msg) +task_page_set_info_string (TaskPage *tpage, + const gchar *icon, + const gchar *msg) { TaskPagePrivate *priv; @@ -1414,7 +1431,7 @@ get_widgets (TaskPage *tpage) return FALSE; /* Get the GtkAccelGroup from the toplevel window, so we can install - it when the notebook page is mapped. */ + * it when the notebook page is mapped. */ toplevel = gtk_widget_get_toplevel (priv->main); accel_groups = gtk_accel_groups_from_object (G_OBJECT (toplevel)); if (accel_groups) @@ -1585,11 +1602,11 @@ categories_clicked_cb (GtkWidget *button, static gboolean check_start_before_end (struct icaltimetype *start_tt, - icaltimezone *start_zone, - struct icaltimetype *end_tt, - icaltimezone *end_zone, - gboolean adjust_end_time, - gboolean adjust_by_hour) + icaltimezone *start_zone, + struct icaltimetype *end_tt, + icaltimezone *end_zone, + gboolean adjust_end_time, + gboolean adjust_by_hour) { struct icaltimetype end_tt_copy; gint cmp; @@ -1599,7 +1616,7 @@ check_start_before_end (struct icaltimetype *start_tt, icaltimezone_convert_time (&end_tt_copy, end_zone, start_zone); /* Now check if the start time is after the end time. If it is, - we need to modify one of the times. */ + * we need to modify one of the times. */ cmp = icaltime_compare (*start_tt, end_tt_copy); if (cmp > 0) { if (adjust_end_time) { @@ -1634,7 +1651,8 @@ check_start_before_end (struct icaltimetype *start_tt, * otherwise times will differ one hour. */ static void -times_updated (TaskPage *tpage, gboolean adjust_end_time) +times_updated (TaskPage *tpage, + gboolean adjust_end_time) { TaskPagePrivate *priv; struct icaltimetype start_tt = icaltime_null_time (); @@ -1704,7 +1722,9 @@ due_date_changed_cb (TaskPage *tpage) } static void -tpage_client_opened_cb (GObject *source_object, GAsyncResult *result, gpointer user_data) +tpage_client_opened_cb (GObject *source_object, + GAsyncResult *result, + gpointer user_data) { ESource *source = E_SOURCE (source_object); EClient *client = NULL; @@ -1775,7 +1795,8 @@ tpage_client_opened_cb (GObject *source_object, GAsyncResult *result, gpointer u } static void -source_changed_cb (ESourceComboBox *source_combo_box, TaskPage *tpage) +source_changed_cb (ESourceComboBox *source_combo_box, + TaskPage *tpage) { TaskPagePrivate *priv = tpage->priv; ESource *source; @@ -1791,13 +1812,16 @@ source_changed_cb (ESourceComboBox *source_combo_box, TaskPage *tpage) } priv->open_cancellable = g_cancellable_new (); - e_client_utils_open_new (source, E_CLIENT_SOURCE_TYPE_TASKS, FALSE, priv->open_cancellable, - e_client_utils_authenticate_handler, NULL, - tpage_client_opened_cb, tpage); + e_client_utils_open_new ( + source, E_CLIENT_SOURCE_TYPE_TASKS, + FALSE, priv->open_cancellable, + e_client_utils_authenticate_handler, NULL, + tpage_client_opened_cb, tpage); } static void -set_subscriber_info_string (TaskPage *tpage, const gchar *backend_address) +set_subscriber_info_string (TaskPage *tpage, + const gchar *backend_address) { CompEditor *editor; ECalClient *client; @@ -1810,7 +1834,7 @@ set_subscriber_info_string (TaskPage *tpage, const gchar *backend_address) if (e_source_get_property (source, "subscriber")) { g_free (tpage->priv->subscriber_info_text); /* Translators: This string is used when we are creating a Task - on behalf of some other user */ + * on behalf of some other user */ tpage->priv->subscriber_info_text = g_markup_printf_escaped (_("You are acting on behalf of %s"), backend_address); } else { g_free (tpage->priv->subscriber_info_text); @@ -1865,7 +1889,7 @@ init_widgets (TaskPage *tpage) editor = comp_editor_page_get_editor (COMP_EDITOR_PAGE (tpage)); /* Make sure the EDateEdit widgets use our timezones to get the - current time. */ + * current time. */ e_date_edit_set_get_time_callback ( E_DATE_EDIT (priv->start_date), (EDateEditGetTimeCallback) comp_editor_get_current_time, @@ -1881,7 +1905,7 @@ init_widgets (TaskPage *tpage) gtk_widget_hide (priv->info_hbox); /* Summary */ - g_signal_connect((priv->summary), "changed", + g_signal_connect ((priv->summary), "changed", G_CALLBACK (summary_changed_cb), tpage); /* Description */ @@ -1892,23 +1916,23 @@ init_widgets (TaskPage *tpage) e_buffer_tagger_connect (GTK_TEXT_VIEW (priv->description)); /* Dates */ - g_signal_connect((priv->start_date), "changed", + g_signal_connect ((priv->start_date), "changed", G_CALLBACK (date_changed_cb), tpage); - g_signal_connect((priv->due_date), "changed", + g_signal_connect ((priv->due_date), "changed", G_CALLBACK (date_changed_cb), tpage); /* time zone changed */ g_signal_connect (priv->timezone, "changed", G_CALLBACK(timezone_changed_cb), tpage); /* Categories button */ - g_signal_connect((priv->categories_btn), "clicked", + g_signal_connect ((priv->categories_btn), "clicked", G_CALLBACK (categories_clicked_cb), tpage); /* Source selector */ g_signal_connect (priv->source_selector, "changed", G_CALLBACK (source_changed_cb), tpage); /* Connect the default signal handler to use to make sure the "changed" - field gets set whenever a field is changed. */ + * field gets set whenever a field is changed. */ /* Belongs to priv->description */ g_signal_connect_swapped ( @@ -1953,7 +1977,7 @@ init_widgets (TaskPage *tpage) g_signal_connect (priv->remove, "clicked", G_CALLBACK (remove_clicked_cb), tpage); /* Contacts button */ - g_signal_connect(priv->invite, "clicked", G_CALLBACK (invite_cb), tpage); + g_signal_connect (priv->invite, "clicked", G_CALLBACK (invite_cb), tpage); /* Meeting List View */ g_signal_connect (priv->list_view, "attendee_added", G_CALLBACK (attendee_added_cb), tpage); @@ -1999,7 +2023,8 @@ init_widgets (TaskPage *tpage) static void -task_page_select_organizer (TaskPage *tpage, const gchar *backend_address) +task_page_select_organizer (TaskPage *tpage, + const gchar *backend_address) { TaskPagePrivate *priv = tpage->priv; CompEditor *editor; @@ -2117,7 +2142,8 @@ task_page_construct (TaskPage *tpage, * not be created. **/ TaskPage * -task_page_new (EMeetingStore *model, CompEditor *editor) +task_page_new (EMeetingStore *model, + CompEditor *editor) { TaskPage *tpage; ECalClient *client; diff --git a/calendar/gui/e-alarm-list.c b/calendar/gui/e-alarm-list.c index 3a1efc3333..35c3484c13 100644 --- a/calendar/gui/e-alarm-list.c +++ b/calendar/gui/e-alarm-list.c @@ -176,7 +176,8 @@ all_rows_deleted (EAlarmList *alarm_list) } static void -row_deleted (EAlarmList *alarm_list, gint n) +row_deleted (EAlarmList *alarm_list, + gint n) { GtkTreePath *path; @@ -187,7 +188,8 @@ row_deleted (EAlarmList *alarm_list, gint n) } static void -row_added (EAlarmList *alarm_list, gint n) +row_added (EAlarmList *alarm_list, + gint n) { GtkTreePath *path; GtkTreeIter iter; @@ -202,7 +204,8 @@ row_added (EAlarmList *alarm_list, gint n) } static void -row_updated (EAlarmList *alarm_list, gint n) +row_updated (EAlarmList *alarm_list, + gint n) { GtkTreePath *path; GtkTreeIter iter; @@ -238,7 +241,7 @@ e_alarm_list_get_n_columns (GtkTreeModel *tree_model) static GType e_alarm_list_get_column_type (GtkTreeModel *tree_model, - gint index) + gint index) { EAlarmList *alarm_list = (EAlarmList *) tree_model; @@ -251,7 +254,8 @@ e_alarm_list_get_column_type (GtkTreeModel *tree_model, } const ECalComponentAlarm * -e_alarm_list_get_alarm (EAlarmList *alarm_list, GtkTreeIter *iter) +e_alarm_list_get_alarm (EAlarmList *alarm_list, + GtkTreeIter *iter) { g_return_val_if_fail (IS_VALID_ITER (alarm_list, iter), NULL); @@ -271,8 +275,9 @@ copy_alarm (const ECalComponentAlarm *alarm) } void -e_alarm_list_set_alarm (EAlarmList *alarm_list, GtkTreeIter *iter, - const ECalComponentAlarm *alarm) +e_alarm_list_set_alarm (EAlarmList *alarm_list, + GtkTreeIter *iter, + const ECalComponentAlarm *alarm) { ECalComponentAlarm *alarm_old; @@ -285,8 +290,9 @@ e_alarm_list_set_alarm (EAlarmList *alarm_list, GtkTreeIter *iter, } void -e_alarm_list_append (EAlarmList *alarm_list, GtkTreeIter *iter, - const ECalComponentAlarm *alarm) +e_alarm_list_append (EAlarmList *alarm_list, + GtkTreeIter *iter, + const ECalComponentAlarm *alarm) { g_return_if_fail (alarm != NULL); @@ -300,7 +306,8 @@ e_alarm_list_append (EAlarmList *alarm_list, GtkTreeIter *iter, } void -e_alarm_list_remove (EAlarmList *alarm_list, GtkTreeIter *iter) +e_alarm_list_remove (EAlarmList *alarm_list, + GtkTreeIter *iter) { gint n; @@ -328,7 +335,9 @@ e_alarm_list_clear (EAlarmList *alarm_list) } static gboolean -e_alarm_list_get_iter (GtkTreeModel *tree_model, GtkTreeIter *iter, GtkTreePath *path) +e_alarm_list_get_iter (GtkTreeModel *tree_model, + GtkTreeIter *iter, + GtkTreePath *path) { EAlarmList *alarm_list = (EAlarmList *) tree_model; GList *l; @@ -354,7 +363,7 @@ e_alarm_list_get_iter (GtkTreeModel *tree_model, GtkTreeIter *iter, GtkTreePath static GtkTreePath * e_alarm_list_get_path (GtkTreeModel *tree_model, - GtkTreeIter *iter) + GtkTreeIter *iter) { EAlarmList *alarm_list = (EAlarmList *) tree_model; GtkTreePath *retval; @@ -539,9 +548,9 @@ get_alarm_string (ECalComponentAlarm *alarm) static void e_alarm_list_get_value (GtkTreeModel *tree_model, - GtkTreeIter *iter, - gint column, - GValue *value) + GtkTreeIter *iter, + gint column, + GValue *value) { EAlarmList *alarm_list = E_ALARM_LIST (tree_model); ECalComponentAlarm *alarm; @@ -574,8 +583,8 @@ e_alarm_list_get_value (GtkTreeModel *tree_model, } static gboolean -e_alarm_list_iter_next (GtkTreeModel *tree_model, - GtkTreeIter *iter) +e_alarm_list_iter_next (GtkTreeModel *tree_model, + GtkTreeIter *iter) { GList *l; @@ -597,8 +606,8 @@ e_alarm_list_iter_next (GtkTreeModel *tree_model, static gboolean e_alarm_list_iter_children (GtkTreeModel *tree_model, - GtkTreeIter *iter, - GtkTreeIter *parent) + GtkTreeIter *iter, + GtkTreeIter *parent) { EAlarmList *alarm_list = E_ALARM_LIST (tree_model); @@ -619,7 +628,7 @@ e_alarm_list_iter_children (GtkTreeModel *tree_model, static gboolean e_alarm_list_iter_has_child (GtkTreeModel *tree_model, - GtkTreeIter *iter) + GtkTreeIter *iter) { g_return_val_if_fail (IS_VALID_ITER (E_ALARM_LIST (tree_model), iter), FALSE); return FALSE; @@ -627,7 +636,7 @@ e_alarm_list_iter_has_child (GtkTreeModel *tree_model, static gint e_alarm_list_iter_n_children (GtkTreeModel *tree_model, - GtkTreeIter *iter) + GtkTreeIter *iter) { EAlarmList *alarm_list = E_ALARM_LIST (tree_model); @@ -642,9 +651,9 @@ e_alarm_list_iter_n_children (GtkTreeModel *tree_model, static gboolean e_alarm_list_iter_nth_child (GtkTreeModel *tree_model, - GtkTreeIter *iter, - GtkTreeIter *parent, - gint n) + GtkTreeIter *iter, + GtkTreeIter *parent, + gint n) { EAlarmList *alarm_list = E_ALARM_LIST (tree_model); @@ -670,8 +679,8 @@ e_alarm_list_iter_nth_child (GtkTreeModel *tree_model, static gboolean e_alarm_list_iter_parent (GtkTreeModel *tree_model, - GtkTreeIter *iter, - GtkTreeIter *child) + GtkTreeIter *iter, + GtkTreeIter *child) { return FALSE; } diff --git a/calendar/gui/e-cal-component-preview.c b/calendar/gui/e-cal-component-preview.c index f5b8322fa7..ec4f817042 100644 --- a/calendar/gui/e-cal-component-preview.c +++ b/calendar/gui/e-cal-component-preview.c @@ -40,7 +40,7 @@ struct _ECalComponentPreviewPrivate { /* information about currently showing component in a preview; - if it didn't change then the preview is not updated */ + * if it didn't change then the preview is not updated */ gchar *cal_uid; gchar *comp_uid; struct icaltimetype comp_last_modified; @@ -67,7 +67,7 @@ clear_comp_info (ECalComponentPreview *preview) } /* Stores information about actually shown component and - returns whether component in the preview changed */ + * returns whether component in the preview changed */ static gboolean update_comp_info (ECalComponentPreview *preview, ECalClient *client, @@ -457,7 +457,7 @@ e_cal_component_preview_display (ECalComponentPreview *preview, g_return_if_fail (E_IS_CAL_COMPONENT (comp)); /* do not update preview when setting the same component as last time, - which even didn't change */ + * which even didn't change */ if (!update_comp_info (preview, client, comp)) return; diff --git a/calendar/gui/e-cal-config.c b/calendar/gui/e-cal-config.c index 804af17e91..8269a1067e 100644 --- a/calendar/gui/e-cal-config.c +++ b/calendar/gui/e-cal-config.c @@ -41,7 +41,8 @@ ecp_init (ECalConfig *cfg) } static void -ecp_target_free (EConfig *ec, EConfigTarget *t) +ecp_target_free (EConfig *ec, + EConfigTarget *t) { struct _ECalConfigPrivate *p = E_CAL_CONFIG (ec)->priv; @@ -78,13 +79,15 @@ ecp_target_free (EConfig *ec, EConfigTarget *t) } static void -ecp_source_changed (struct _ESource *source, EConfig *ec) +ecp_source_changed (ESource *source, + EConfig *ec) { e_config_target_changed (ec, E_CONFIG_TARGET_CHANGED_STATE); } static void -ecp_set_target (EConfig *ec, EConfigTarget *t) +ecp_set_target (EConfig *ec, + EConfigTarget *t) { struct _ECalConfigPrivate *p = E_CAL_CONFIG (ec)->priv; @@ -139,7 +142,8 @@ e_cal_config_get_type (void) } ECalConfig * -e_cal_config_new (gint type, const gchar *menuid) +e_cal_config_new (gint type, + const gchar *menuid) { ECalConfig *ecp = g_object_new (e_cal_config_get_type (), NULL); e_config_construct (&ecp->config, type, menuid); @@ -147,7 +151,8 @@ e_cal_config_new (gint type, const gchar *menuid) } ECalConfigTargetSource * -e_cal_config_target_new_source (ECalConfig *ecp, ESource *source) +e_cal_config_target_new_source (ECalConfig *ecp, + ESource *source) { ECalConfigTargetSource *t; diff --git a/calendar/gui/e-cal-config.h b/calendar/gui/e-cal-config.h index f803e99285..582bdf6a53 100644 --- a/calendar/gui/e-cal-config.h +++ b/calendar/gui/e-cal-config.h @@ -73,7 +73,7 @@ typedef struct _ECalConfigTargetPrefs ECalConfigTargetPrefs; struct _ECalConfigTargetSource { EConfigTarget target; - struct _ESource *source; + ESource *source; ECalClientSourceType source_type; }; diff --git a/calendar/gui/e-cal-event.c b/calendar/gui/e-cal-event.c index af84e9e865..176e2923b3 100644 --- a/calendar/gui/e-cal-event.c +++ b/calendar/gui/e-cal-event.c @@ -40,7 +40,8 @@ ece_finalize (GObject *o) } static void -ece_target_free (EEvent *ev, EEventTarget *t) +ece_target_free (EEvent *ev, + EEventTarget *t) { switch (t->type) { case E_CAL_EVENT_TARGET_BACKEND: { diff --git a/calendar/gui/e-cal-list-view.c b/calendar/gui/e-cal-list-view.c index c287b7a6ca..48458e6123 100644 --- a/calendar/gui/e-cal-list-view.c +++ b/calendar/gui/e-cal-list-view.c @@ -109,7 +109,8 @@ e_cal_list_view_init (ECalListView *cal_list_view) /* Returns the current time, for the ECellDateEdit items. */ static struct tm -get_current_time_cb (ECellDateEdit *ecde, gpointer data) +get_current_time_cb (ECellDateEdit *ecde, + gpointer data) { ECalListView *cal_list_view = data; icaltimezone *zone; @@ -132,7 +133,8 @@ get_current_time_cb (ECellDateEdit *ecde, gpointer data) } void -e_cal_list_view_load_state (ECalListView *cal_list_view, gchar *filename) +e_cal_list_view_load_state (ECalListView *cal_list_view, + gchar *filename) { struct stat st; @@ -145,7 +147,8 @@ e_cal_list_view_load_state (ECalListView *cal_list_view, gchar *filename) } void -e_cal_list_view_save_state (ECalListView *cal_list_view, gchar *filename) +e_cal_list_view_save_state (ECalListView *cal_list_view, + gchar *filename) { g_return_if_fail (cal_list_view != NULL); g_return_if_fail (E_IS_CAL_LIST_VIEW (cal_list_view)); @@ -176,7 +179,7 @@ setup_e_table (ECalListView *cal_list_view) /* Normal string fields */ cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT); - g_object_set (G_OBJECT (cell), + g_object_set (cell, "bg_color_column", E_CAL_MODEL_FIELD_COLOR, NULL); @@ -186,7 +189,7 @@ setup_e_table (ECalListView *cal_list_view) /* Date fields */ cell = e_cell_date_edit_text_new (NULL, GTK_JUSTIFY_LEFT); - g_object_set (G_OBJECT (cell), + g_object_set (cell, "bg_color_column", E_CAL_MODEL_FIELD_COLOR, NULL); @@ -225,7 +228,7 @@ setup_e_table (ECalListView *cal_list_view) /* Combo fields */ cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT); - g_object_set (G_OBJECT (cell), + g_object_set (cell, "bg_color_column", E_CAL_MODEL_FIELD_COLOR, "editable", FALSE, NULL); @@ -366,8 +369,11 @@ e_cal_list_view_popup_menu (GtkWidget *widget) } static gboolean -e_cal_list_view_on_table_double_click (GtkWidget *table, gint row, gint col, GdkEvent *event, - gpointer data) +e_cal_list_view_on_table_double_click (GtkWidget *table, + gint row, + gint col, + GdkEvent *event, + gpointer data) { ECalListView *cal_list_view = E_CAL_LIST_VIEW (data); ECalModelComponent *comp_data; @@ -379,8 +385,11 @@ e_cal_list_view_on_table_double_click (GtkWidget *table, gint row, gint col, Gdk } static gboolean -e_cal_list_view_on_table_right_click (GtkWidget *table, gint row, gint col, GdkEvent *event, - gpointer data) +e_cal_list_view_on_table_right_click (GtkWidget *table, + gint row, + gint col, + GdkEvent *event, + gpointer data) { ECalListView *cal_list_view = E_CAL_LIST_VIEW (data); @@ -389,7 +398,9 @@ e_cal_list_view_on_table_right_click (GtkWidget *table, gint row, gint col, GdkE } static void -e_cal_list_view_cursor_change_cb (ETable *etable, gint row, gpointer data) +e_cal_list_view_cursor_change_cb (ETable *etable, + gint row, + gpointer data) { ECalListView *cal_list_view = E_CAL_LIST_VIEW (data); @@ -397,7 +408,9 @@ e_cal_list_view_cursor_change_cb (ETable *etable, gint row, gpointer data) } static gboolean -e_cal_list_view_get_selected_time_range (ECalendarView *cal_view, time_t *start_time, time_t *end_time) +e_cal_list_view_get_selected_time_range (ECalendarView *cal_view, + time_t *start_time, + time_t *end_time) { GList *selected; icaltimezone *zone; @@ -471,7 +484,10 @@ e_cal_list_view_get_selected_events (ECalendarView *cal_view) } static void -adjust_range (icaltimetype icaltime, time_t *earliest, time_t *latest, gboolean *set) +adjust_range (icaltimetype icaltime, + time_t *earliest, + time_t *latest, + gboolean *set) { time_t t; @@ -485,11 +501,13 @@ adjust_range (icaltimetype icaltime, time_t *earliest, time_t *latest, gboolean *set = TRUE; } -/* NOTE: Time use for this function increases linearly with number of events. This is not - * ideal, since it's used in a couple of places. We could probably be smarter about it, - * and use do it less frequently... */ +/* NOTE: Time use for this function increases linearly with number of events. + * This is not ideal, since it's used in a couple of places. We could probably + * be smarter about it, and use do it less frequently... */ static gboolean -e_cal_list_view_get_visible_time_range (ECalendarView *cal_view, time_t *start_time, time_t *end_time) +e_cal_list_view_get_visible_time_range (ECalendarView *cal_view, + time_t *start_time, + time_t *end_time) { time_t earliest = G_MAXINT, latest = 0; gboolean set = FALSE; @@ -532,7 +550,9 @@ e_cal_list_view_get_visible_time_range (ECalendarView *cal_view, time_t *start_t } gboolean -e_cal_list_view_get_range_shown (ECalListView *cal_list_view, GDate *start_date, gint *days_shown) +e_cal_list_view_get_range_shown (ECalListView *cal_list_view, + GDate *start_date, + gint *days_shown) { time_t first, last; GDate end_date; diff --git a/calendar/gui/e-cal-model-calendar.c b/calendar/gui/e-cal-model-calendar.c index ea8dd7bba7..1254a8711b 100644 --- a/calendar/gui/e-cal-model-calendar.c +++ b/calendar/gui/e-cal-model-calendar.c @@ -114,7 +114,8 @@ ecmc_column_count (ETableModel *etm) } static ECellDateEditValue * -get_dtend (ECalModelCalendar *model, ECalModelComponent *comp_data) +get_dtend (ECalModelCalendar *model, + ECalModelComponent *comp_data) { struct icaltimetype tt_end; @@ -194,7 +195,9 @@ get_transparency (ECalModelComponent *comp_data) } static gpointer -ecmc_value_at (ETableModel *etm, gint col, gint row) +ecmc_value_at (ETableModel *etm, + gint col, + gint row) { ECalModelComponent *comp_data; ECalModelCalendar *model = (ECalModelCalendar *) etm; @@ -224,13 +227,16 @@ ecmc_value_at (ETableModel *etm, gint col, gint row) } static void -set_dtend (ECalModel* model, ECalModelComponent *comp_data, gconstpointer value) +set_dtend (ECalModel *model, + ECalModelComponent *comp_data, + gconstpointer value) { e_cal_model_update_comp_time (model, comp_data, value, ICAL_DTEND_PROPERTY, icalproperty_set_dtend, icalproperty_new_dtend); } static void -set_location (ECalModelComponent *comp_data, gconstpointer value) +set_location (ECalModelComponent *comp_data, + gconstpointer value) { icalproperty *prop; @@ -252,7 +258,8 @@ set_location (ECalModelComponent *comp_data, gconstpointer value) } static void -set_transparency (ECalModelComponent *comp_data, gconstpointer value) +set_transparency (ECalModelComponent *comp_data, + gconstpointer value) { icalproperty *prop; @@ -289,7 +296,10 @@ set_transparency (ECalModelComponent *comp_data, gconstpointer value) } static void -ecmc_set_value_at (ETableModel *etm, gint col, gint row, gconstpointer value) +ecmc_set_value_at (ETableModel *etm, + gint col, + gint row, + gconstpointer value) { ECalModelComponent *comp_data; CalObjModType mod = CALOBJ_MOD_ALL; @@ -377,7 +387,9 @@ ecmc_set_value_at (ETableModel *etm, gint col, gint row, gconstpointer value) } static gboolean -ecmc_is_cell_editable (ETableModel *etm, gint col, gint row) +ecmc_is_cell_editable (ETableModel *etm, + gint col, + gint row) { ECalModelCalendar *model = (ECalModelCalendar *) etm; @@ -402,7 +414,9 @@ ecmc_is_cell_editable (ETableModel *etm, gint col, gint row) } static gpointer -ecmc_duplicate_value (ETableModel *etm, gint col, gconstpointer value) +ecmc_duplicate_value (ETableModel *etm, + gint col, + gconstpointer value) { g_return_val_if_fail (col >= 0 && col < E_CAL_MODEL_CALENDAR_FIELD_LAST, NULL); @@ -430,7 +444,9 @@ ecmc_duplicate_value (ETableModel *etm, gint col, gconstpointer value) } static void -ecmc_free_value (ETableModel *etm, gint col, gpointer value) +ecmc_free_value (ETableModel *etm, + gint col, + gpointer value) { g_return_if_fail (col >= 0 && col < E_CAL_MODEL_CALENDAR_FIELD_LAST); @@ -450,7 +466,8 @@ ecmc_free_value (ETableModel *etm, gint col, gpointer value) } static gpointer -ecmc_initialize_value (ETableModel *etm, gint col) +ecmc_initialize_value (ETableModel *etm, + gint col) { g_return_val_if_fail (col >= 0 && col < E_CAL_MODEL_CALENDAR_FIELD_LAST, NULL); @@ -469,7 +486,9 @@ ecmc_initialize_value (ETableModel *etm, gint col) } static gboolean -ecmc_value_is_empty (ETableModel *etm, gint col, gconstpointer value) +ecmc_value_is_empty (ETableModel *etm, + gint col, + gconstpointer value) { g_return_val_if_fail (col >= 0 && col < E_CAL_MODEL_CALENDAR_FIELD_LAST, TRUE); @@ -488,7 +507,9 @@ ecmc_value_is_empty (ETableModel *etm, gint col, gconstpointer value) } static gchar * -ecmc_value_to_string (ETableModel *etm, gint col, gconstpointer value) +ecmc_value_to_string (ETableModel *etm, + gint col, + gconstpointer value) { g_return_val_if_fail (col >= 0 && col < E_CAL_MODEL_CALENDAR_FIELD_LAST, g_strdup ("")); @@ -509,8 +530,10 @@ ecmc_value_to_string (ETableModel *etm, gint col, gconstpointer value) /* ECalModel class methods */ static void -ecmc_fill_component_from_model (ECalModel *model, ECalModelComponent *comp_data, - ETableModel *source_model, gint row) +ecmc_fill_component_from_model (ECalModel *model, + ECalModelComponent *comp_data, + ETableModel *source_model, + gint row) { g_return_if_fail (E_IS_CAL_MODEL_CALENDAR (model)); g_return_if_fail (comp_data != NULL); diff --git a/calendar/gui/e-cal-model-calendar.h b/calendar/gui/e-cal-model-calendar.h index 6e3b3fe617..f29d7d413d 100644 --- a/calendar/gui/e-cal-model-calendar.h +++ b/calendar/gui/e-cal-model-calendar.h @@ -55,7 +55,7 @@ typedef struct _ECalModelCalendarPrivate ECalModelCalendarPrivate; typedef enum { /* If you add new items here or reorder them, you have to update the - .etspec files for the tables using this model */ + * .etspec files for the tables using this model */ E_CAL_MODEL_CALENDAR_FIELD_DTEND = E_CAL_MODEL_FIELD_LAST, E_CAL_MODEL_CALENDAR_FIELD_LOCATION, E_CAL_MODEL_CALENDAR_FIELD_TRANSPARENCY, diff --git a/calendar/gui/e-cal-model-memos.c b/calendar/gui/e-cal-model-memos.c index 59a48d031c..261cdda058 100644 --- a/calendar/gui/e-cal-model-memos.c +++ b/calendar/gui/e-cal-model-memos.c @@ -115,7 +115,9 @@ ecmm_column_count (ETableModel *etm) } static gpointer -ecmm_value_at (ETableModel *etm, gint col, gint row) +ecmm_value_at (ETableModel *etm, + gint col, + gint row) { ECalModelComponent *comp_data; ECalModelMemos *model = (ECalModelMemos *) etm; @@ -136,7 +138,10 @@ ecmm_value_at (ETableModel *etm, gint col, gint row) } static void -ecmm_set_value_at (ETableModel *etm, gint col, gint row, gconstpointer value) +ecmm_set_value_at (ETableModel *etm, + gint col, + gint row, + gconstpointer value) { ECalModelComponent *comp_data; ECalModelMemos *model = (ECalModelMemos *) etm; @@ -168,7 +173,9 @@ ecmm_set_value_at (ETableModel *etm, gint col, gint row, gconstpointer value) } static gboolean -ecmm_is_cell_editable (ETableModel *etm, gint col, gint row) +ecmm_is_cell_editable (ETableModel *etm, + gint col, + gint row) { ECalModelMemos *model = (ECalModelMemos *) etm; gboolean retval = FALSE; @@ -187,7 +194,9 @@ ecmm_is_cell_editable (ETableModel *etm, gint col, gint row) } static gpointer -ecmm_duplicate_value (ETableModel *etm, gint col, gconstpointer value) +ecmm_duplicate_value (ETableModel *etm, + gint col, + gconstpointer value) { g_return_val_if_fail (col >= 0 && col < E_CAL_MODEL_MEMOS_FIELD_LAST, NULL); @@ -198,7 +207,9 @@ ecmm_duplicate_value (ETableModel *etm, gint col, gconstpointer value) } static void -ecmm_free_value (ETableModel *etm, gint col, gpointer value) +ecmm_free_value (ETableModel *etm, + gint col, + gpointer value) { g_return_if_fail (col >= 0 && col < E_CAL_MODEL_MEMOS_FIELD_LAST); @@ -209,7 +220,8 @@ ecmm_free_value (ETableModel *etm, gint col, gpointer value) } static gpointer -ecmm_initialize_value (ETableModel *etm, gint col) +ecmm_initialize_value (ETableModel *etm, + gint col) { g_return_val_if_fail (col >= 0 && col < E_CAL_MODEL_MEMOS_FIELD_LAST, NULL); @@ -220,7 +232,9 @@ ecmm_initialize_value (ETableModel *etm, gint col) } static gboolean -ecmm_value_is_empty (ETableModel *etm, gint col, gconstpointer value) +ecmm_value_is_empty (ETableModel *etm, + gint col, + gconstpointer value) { g_return_val_if_fail (col >= 0 && col < E_CAL_MODEL_MEMOS_FIELD_LAST, TRUE); @@ -231,7 +245,9 @@ ecmm_value_is_empty (ETableModel *etm, gint col, gconstpointer value) } static gchar * -ecmm_value_to_string (ETableModel *etm, gint col, gconstpointer value) +ecmm_value_to_string (ETableModel *etm, + gint col, + gconstpointer value) { g_return_val_if_fail (col >= 0 && col < E_CAL_MODEL_MEMOS_FIELD_LAST, g_strdup ("")); @@ -244,8 +260,10 @@ ecmm_value_to_string (ETableModel *etm, gint col, gconstpointer value) /* ECalModel class methods */ static void -ecmm_fill_component_from_model (ECalModel *model, ECalModelComponent *comp_data, - ETableModel *source_model, gint row) +ecmm_fill_component_from_model (ECalModel *model, + ECalModelComponent *comp_data, + ETableModel *source_model, + gint row) { icaltimetype start; g_return_if_fail (E_IS_CAL_MODEL_MEMOS (model)); diff --git a/calendar/gui/e-cal-model-memos.h b/calendar/gui/e-cal-model-memos.h index 3977bbe0cb..2be1e4d97c 100644 --- a/calendar/gui/e-cal-model-memos.h +++ b/calendar/gui/e-cal-model-memos.h @@ -56,7 +56,7 @@ typedef struct _ECalModelMemosPrivate ECalModelMemosPrivate; typedef enum { /* If you add new items here or reorder them, you have to update the - .etspec files for the tables using this model */ + * .etspec files for the tables using this model */ E_CAL_MODEL_MEMOS_FIELD_LAST = E_CAL_MODEL_FIELD_LAST } ECalModelMemoField; diff --git a/calendar/gui/e-cal-model-tasks.c b/calendar/gui/e-cal-model-tasks.c index 51811c783f..8602ce58cf 100644 --- a/calendar/gui/e-cal-model-tasks.c +++ b/calendar/gui/e-cal-model-tasks.c @@ -195,13 +195,14 @@ ecmt_column_count (ETableModel *etm) } /* This makes sure a task is marked as complete. - It makes sure the "Date Completed" property is set. If the completed_date - is not -1, then that is used, otherwise if the "Date Completed" property - is not already set it is set to the current time. - It makes sure the percent is set to 100, and that the status is "Completed". - Note that this doesn't update the component on the server. */ + * It makes sure the "Date Completed" property is set. If the completed_date + * is not -1, then that is used, otherwise if the "Date Completed" property + * is not already set it is set to the current time. + * It makes sure the percent is set to 100, and that the status is "Completed". + * Note that this doesn't update the component on the server. */ static void -ensure_task_complete (ECalModelComponent *comp_data, time_t completed_date) +ensure_task_complete (ECalModelComponent *comp_data, + time_t completed_date) { icalproperty *prop; gboolean set_completed = TRUE; @@ -276,9 +277,9 @@ ensure_task_partially_complete (ECalModelComponent *comp_data) } /* This makes sure a task is marked as incomplete. It clears the - "Date Completed" property. If the percent is set to 100 it removes it, - and if the status is "Completed" it sets it to "Needs Action". - Note that this doesn't update the component on the client. */ + * "Date Completed" property. If the percent is set to 100 it removes it, + * and if the status is "Completed" it sets it to "Needs Action". + * Note that this doesn't update the component on the client. */ static void ensure_task_not_complete (ECalModelComponent *comp_data) { @@ -486,7 +487,8 @@ typedef enum { } ECalModelTasksDueStatus; static ECalModelTasksDueStatus -get_due_status (ECalModelTasks *model, ECalModelComponent *comp_data) +get_due_status (ECalModelTasks *model, + ECalModelComponent *comp_data) { icalproperty *prop; @@ -542,7 +544,8 @@ get_due_status (ECalModelTasks *model, ECalModelComponent *comp_data) } static gboolean -is_overdue (ECalModelTasks *model, ECalModelComponent *comp_data) +is_overdue (ECalModelTasks *model, + ECalModelComponent *comp_data) { switch (get_due_status (model, comp_data)) { case E_CAL_MODEL_TASKS_DUE_NEVER: @@ -558,7 +561,9 @@ is_overdue (ECalModelTasks *model, ECalModelComponent *comp_data) } static gpointer -ecmt_value_at (ETableModel *etm, gint col, gint row) +ecmt_value_at (ETableModel *etm, + gint col, + gint row) { ECalModelComponent *comp_data; ECalModelTasks *model = (ECalModelTasks *) etm; @@ -602,7 +607,9 @@ ecmt_value_at (ETableModel *etm, gint col, gint row) } static void -set_completed (ECalModelTasks *model, ECalModelComponent *comp_data, gconstpointer value) +set_completed (ECalModelTasks *model, + ECalModelComponent *comp_data, + gconstpointer value) { ECellDateEditValue *dv = (ECellDateEditValue *) value; @@ -613,12 +620,12 @@ set_completed (ECalModelTasks *model, ECalModelComponent *comp_data, gconstpoint if (dv->tt.is_date) { /* if it's a date, it will be floating, - but completed needs a date time value */ + * but completed needs a date time value */ dv->tt.is_date = FALSE; t = icaltime_as_timet_with_zone (dv->tt, e_cal_model_get_timezone (E_CAL_MODEL (model))); } else { /* we assume that COMPLETED is entered in the current timezone, - even though it gets stored in UTC */ + * even though it gets stored in UTC */ t = icaltime_as_timet_with_zone (dv->tt, dv->zone); } @@ -627,7 +634,8 @@ set_completed (ECalModelTasks *model, ECalModelComponent *comp_data, gconstpoint } static void -set_complete (ECalModelComponent *comp_data, gconstpointer value) +set_complete (ECalModelComponent *comp_data, + gconstpointer value) { gint state = GPOINTER_TO_INT (value); @@ -638,7 +646,9 @@ set_complete (ECalModelComponent *comp_data, gconstpointer value) } static void -set_due (ECalModel* model, ECalModelComponent *comp_data, gconstpointer value) +set_due (ECalModel *model, + ECalModelComponent *comp_data, + gconstpointer value) { e_cal_model_update_comp_time (model, comp_data, value, ICAL_DUE_PROPERTY, icalproperty_set_due, icalproperty_new_due); } @@ -658,7 +668,8 @@ show_geo_warning (void) } static void -set_geo (ECalModelComponent *comp_data, const gchar *value) +set_geo (ECalModelComponent *comp_data, + const gchar *value) { gdouble latitude, longitude; gint matched; @@ -690,7 +701,8 @@ set_geo (ECalModelComponent *comp_data, const gchar *value) } static void -set_status (ECalModelComponent *comp_data, const gchar *value) +set_status (ECalModelComponent *comp_data, + const gchar *value) { icalproperty_status status; icalproperty *prop; @@ -748,7 +760,8 @@ set_status (ECalModelComponent *comp_data, const gchar *value) } static void -set_percent (ECalModelComponent *comp_data, gconstpointer value) +set_percent (ECalModelComponent *comp_data, + gconstpointer value) { icalproperty *prop; gint percent = GPOINTER_TO_INT (value); @@ -790,7 +803,8 @@ set_percent (ECalModelComponent *comp_data, gconstpointer value) } static void -set_priority (ECalModelComponent *comp_data, const gchar *value) +set_priority (ECalModelComponent *comp_data, + const gchar *value) { icalproperty *prop; gint priority; @@ -812,7 +826,8 @@ set_priority (ECalModelComponent *comp_data, const gchar *value) } static void -set_url (ECalModelComponent *comp_data, const gchar *value) +set_url (ECalModelComponent *comp_data, + const gchar *value) { icalproperty *prop; @@ -834,7 +849,10 @@ set_url (ECalModelComponent *comp_data, const gchar *value) } static void -ecmt_set_value_at (ETableModel *etm, gint col, gint row, gconstpointer value) +ecmt_set_value_at (ETableModel *etm, + gint col, + gint row, + gconstpointer value) { ECalModelComponent *comp_data; ECalModelTasks *model = (ECalModelTasks *) etm; @@ -861,7 +879,7 @@ ecmt_set_value_at (ETableModel *etm, gint col, gint row, gconstpointer value) set_complete (comp_data, value); break; case E_CAL_MODEL_TASKS_FIELD_DUE : - set_due ((ECalModel*) model, comp_data, value); + set_due ((ECalModel *) model, comp_data, value); break; case E_CAL_MODEL_TASKS_FIELD_GEO : set_geo (comp_data, value); @@ -884,7 +902,9 @@ ecmt_set_value_at (ETableModel *etm, gint col, gint row, gconstpointer value) } static gboolean -ecmt_is_cell_editable (ETableModel *etm, gint col, gint row) +ecmt_is_cell_editable (ETableModel *etm, + gint col, + gint row) { ECalModelTasks *model = (ECalModelTasks *) etm; @@ -915,7 +935,9 @@ ecmt_is_cell_editable (ETableModel *etm, gint col, gint row) } static gpointer -ecmt_duplicate_value (ETableModel *etm, gint col, gconstpointer value) +ecmt_duplicate_value (ETableModel *etm, + gint col, + gconstpointer value) { g_return_val_if_fail (col >= 0 && col < E_CAL_MODEL_TASKS_FIELD_LAST, NULL); @@ -951,7 +973,9 @@ ecmt_duplicate_value (ETableModel *etm, gint col, gconstpointer value) } static void -ecmt_free_value (ETableModel *etm, gint col, gpointer value) +ecmt_free_value (ETableModel *etm, + gint col, + gpointer value) { g_return_if_fail (col >= 0 && col < E_CAL_MODEL_TASKS_FIELD_LAST); @@ -978,7 +1002,8 @@ ecmt_free_value (ETableModel *etm, gint col, gpointer value) } static gpointer -ecmt_initialize_value (ETableModel *etm, gint col) +ecmt_initialize_value (ETableModel *etm, + gint col) { ECalModelTasks *model = (ECalModelTasks *) etm; @@ -1007,7 +1032,9 @@ ecmt_initialize_value (ETableModel *etm, gint col) } static gboolean -ecmt_value_is_empty (ETableModel *etm, gint col, gconstpointer value) +ecmt_value_is_empty (ETableModel *etm, + gint col, + gconstpointer value) { ECalModelTasks *model = (ECalModelTasks *) etm; @@ -1037,7 +1064,9 @@ ecmt_value_is_empty (ETableModel *etm, gint col, gconstpointer value) } static gchar * -ecmt_value_to_string (ETableModel *etm, gint col, gconstpointer value) +ecmt_value_to_string (ETableModel *etm, + gint col, + gconstpointer value) { ECalModelTasks *model = (ECalModelTasks *) etm; @@ -1099,8 +1128,10 @@ ecmt_get_color_for_component (ECalModel *model, } static void -ecmt_fill_component_from_model (ECalModel *model, ECalModelComponent *comp_data, - ETableModel *source_model, gint row) +ecmt_fill_component_from_model (ECalModel *model, + ECalModelComponent *comp_data, + ETableModel *source_model, + gint row) { gpointer value; diff --git a/calendar/gui/e-cal-model-tasks.h b/calendar/gui/e-cal-model-tasks.h index c0ceaaa2c5..f35f8dd28c 100644 --- a/calendar/gui/e-cal-model-tasks.h +++ b/calendar/gui/e-cal-model-tasks.h @@ -55,7 +55,7 @@ typedef struct _ECalModelTasksPrivate ECalModelTasksPrivate; typedef enum { /* If you add new items here or reorder them, you have to update the - .etspec files for the tables using this model */ + * .etspec files for the tables using this model */ E_CAL_MODEL_TASKS_FIELD_COMPLETED = E_CAL_MODEL_FIELD_LAST, E_CAL_MODEL_TASKS_FIELD_COMPLETE, E_CAL_MODEL_TASKS_FIELD_DUE, diff --git a/calendar/gui/e-cal-model.c b/calendar/gui/e-cal-model.c index 7a00fdb7dd..9bb8235d6e 100644 --- a/calendar/gui/e-cal-model.c +++ b/calendar/gui/e-cal-model.c @@ -778,7 +778,8 @@ get_classification (ECalModelComponent *comp_data) } static const gchar * -get_color (ECalModel *model, ECalModelComponent *comp_data) +get_color (ECalModel *model, + ECalModelComponent *comp_data) { g_return_val_if_fail (E_IS_CAL_MODEL (model), NULL); @@ -809,8 +810,9 @@ get_description (ECalModelComponent *comp_data) return (gpointer) ""; } -static ECellDateEditValue* -get_dtstart (ECalModel *model, ECalModelComponent *comp_data) +static ECellDateEditValue * +get_dtstart (ECalModel *model, + ECalModelComponent *comp_data) { ECalModelPrivate *priv; struct icaltimetype tt_start; @@ -857,8 +859,12 @@ get_dtstart (ECalModel *model, ECalModelComponent *comp_data) return comp_data->dtstart; } -static ECellDateEditValue* -get_datetime_from_utc (ECalModel *model, ECalModelComponent *comp_data, icalproperty_kind propkind, struct icaltimetype (*get_value)(const icalproperty* prop), ECellDateEditValue **buffer) +static ECellDateEditValue * +get_datetime_from_utc (ECalModel *model, + ECalModelComponent *comp_data, + icalproperty_kind propkind, + struct icaltimetype (*get_value) (const icalproperty *prop), + ECellDateEditValue **buffer) { ECalModelPrivate *priv; struct icaltimetype tt_value; @@ -913,7 +919,9 @@ get_uid (ECalModelComponent *comp_data) } static gpointer -ecm_value_at (ETableModel *etm, gint col, gint row) +ecm_value_at (ETableModel *etm, + gint col, + gint row) { ECalModelPrivate *priv; ECalModelComponent *comp_data; @@ -1005,7 +1013,8 @@ ecm_value_at (ETableModel *etm, gint col, gint row) } static void -set_categories (ECalModelComponent *comp_data, const gchar *value) +set_categories (ECalModelComponent *comp_data, + const gchar *value) { icalproperty *prop; @@ -1025,7 +1034,8 @@ set_categories (ECalModelComponent *comp_data, const gchar *value) } static void -set_classification (ECalModelComponent *comp_data, const gchar *value) +set_classification (ECalModelComponent *comp_data, + const gchar *value) { icalproperty *prop; @@ -1056,7 +1066,8 @@ set_classification (ECalModelComponent *comp_data, const gchar *value) } static void -set_description (ECalModelComponent *comp_data, const gchar *value) +set_description (ECalModelComponent *comp_data, + const gchar *value) { icalproperty *prop; @@ -1082,7 +1093,10 @@ set_description (ECalModelComponent *comp_data, const gchar *value) } static void -datetime_to_zone (ECalClient *client, struct icaltimetype *tt, icaltimezone *tt_zone, const gchar *tzid) +datetime_to_zone (ECalClient *client, + struct icaltimetype *tt, + icaltimezone *tt_zone, + const gchar *tzid) { icaltimezone *from, *to; const gchar *tt_tzid = NULL; @@ -1108,7 +1122,13 @@ datetime_to_zone (ECalClient *client, struct icaltimetype *tt, icaltimezone *tt_ /* updates time in a component, and keeps the timezone used in it, if exists */ void -e_cal_model_update_comp_time (ECalModel *model, ECalModelComponent *comp_data, gconstpointer time_value, icalproperty_kind kind, void (*set_func)(icalproperty *prop, struct icaltimetype v), icalproperty * (*new_func)(struct icaltimetype v)) +e_cal_model_update_comp_time (ECalModel *model, + ECalModelComponent *comp_data, + gconstpointer time_value, + icalproperty_kind kind, + void (*set_func) (icalproperty *prop, + struct icaltimetype v), + icalproperty * (*new_func) (struct icaltimetype v)) { ECellDateEditValue *dv = (ECellDateEditValue *) time_value; icalproperty *prop; @@ -1127,7 +1147,7 @@ e_cal_model_update_comp_time (ECalModel *model, ECalModelComponent *comp_data, g param = NULL; /* If we are setting the property to NULL (i.e. removing it), then - we remove it if it exists. */ + * we remove it if it exists. */ if (!dv) { if (prop) { icalcomponent_remove_property (comp_data->icalcomp, prop); @@ -1165,17 +1185,25 @@ e_cal_model_update_comp_time (ECalModel *model, ECalModelComponent *comp_data, g } static void -set_dtstart (ECalModel *model, ECalModelComponent *comp_data, gconstpointer value) +set_dtstart (ECalModel *model, + ECalModelComponent *comp_data, + gconstpointer value) { - e_cal_model_update_comp_time (model, comp_data, value, ICAL_DTSTART_PROPERTY, icalproperty_set_dtstart, icalproperty_new_dtstart); + e_cal_model_update_comp_time ( + model, comp_data, value, + ICAL_DTSTART_PROPERTY, + icalproperty_set_dtstart, + icalproperty_new_dtstart); } static void -set_summary (ECalModelComponent *comp_data, const gchar *value) +set_summary (ECalModelComponent *comp_data, + const gchar *value) { icalproperty *prop; - prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_SUMMARY_PROPERTY); + prop = icalcomponent_get_first_property ( + comp_data->icalcomp, ICAL_SUMMARY_PROPERTY); if (string_is_empty (value)) { if (prop) { @@ -1193,7 +1221,10 @@ set_summary (ECalModelComponent *comp_data, const gchar *value) } static void -ecm_set_value_at (ETableModel *etm, gint col, gint row, gconstpointer value) +ecm_set_value_at (ETableModel *etm, + gint col, + gint row, + gconstpointer value) { ECalModelPrivate *priv; ECalModelComponent *comp_data; @@ -1250,7 +1281,8 @@ ecm_set_value_at (ETableModel *etm, gint col, gint row, gconstpointer value) * Returns: Whether @row is editable or not. **/ gboolean -e_cal_model_test_row_editable (ECalModel *model, gint row) +e_cal_model_test_row_editable (ECalModel *model, + gint row) { gboolean readonly; ECalClient *client = NULL; @@ -1276,7 +1308,9 @@ e_cal_model_test_row_editable (ECalModel *model, gint row) } static gboolean -ecm_is_cell_editable (ETableModel *etm, gint col, gint row) +ecm_is_cell_editable (ETableModel *etm, + gint col, + gint row) { ECalModelPrivate *priv; ECalModel *model = (ECalModel *) etm; @@ -1304,7 +1338,9 @@ ecm_is_cell_editable (ETableModel *etm, gint col, gint row) } static void -ecm_append_row (ETableModel *etm, ETableModel *source, gint row) +ecm_append_row (ETableModel *etm, + ETableModel *source, + gint row) { ECalModelClass *model_class; ECalModelComponent *comp_data; @@ -1377,7 +1413,9 @@ ecm_append_row (ETableModel *etm, ETableModel *source, gint row) } static gpointer -ecm_duplicate_value (ETableModel *etm, gint col, gconstpointer value) +ecm_duplicate_value (ETableModel *etm, + gint col, + gconstpointer value) { g_return_val_if_fail (col >= 0 && col < E_CAL_MODEL_FIELD_LAST, NULL); @@ -1412,7 +1450,9 @@ ecm_duplicate_value (ETableModel *etm, gint col, gconstpointer value) } static void -ecm_free_value (ETableModel *etm, gint col, gpointer value) +ecm_free_value (ETableModel *etm, + gint col, + gpointer value) { g_return_if_fail (col >= 0 && col < E_CAL_MODEL_FIELD_LAST); @@ -1442,7 +1482,8 @@ ecm_free_value (ETableModel *etm, gint col, gpointer value) } static gpointer -ecm_initialize_value (ETableModel *etm, gint col) +ecm_initialize_value (ETableModel *etm, + gint col) { ECalModelPrivate *priv; ECalModel *model = (ECalModel *) etm; @@ -1473,7 +1514,9 @@ ecm_initialize_value (ETableModel *etm, gint col) } static gboolean -ecm_value_is_empty (ETableModel *etm, gint col, gconstpointer value) +ecm_value_is_empty (ETableModel *etm, + gint col, + gconstpointer value) { ECalModelPrivate *priv; ECalModel *model = (ECalModel *) etm; @@ -1514,7 +1557,9 @@ ecm_value_is_empty (ETableModel *etm, gint col, gconstpointer value) } static gchar * -ecm_value_to_string (ETableModel *etm, gint col, gconstpointer value) +ecm_value_to_string (ETableModel *etm, + gint col, + gconstpointer value) { g_return_val_if_fail (col >= 0 && col < E_CAL_MODEL_FIELD_LAST, g_strdup ("")); @@ -1553,7 +1598,8 @@ typedef struct { } AssignedColorData; static const gchar * -ecm_get_color_for_component (ECalModel *model, ECalModelComponent *comp_data) +ecm_get_color_for_component (ECalModel *model, + ECalModelComponent *comp_data) { ESource *source; const gchar *color_spec; @@ -1633,7 +1679,8 @@ e_cal_model_get_component_kind (ECalModel *model) } void -e_cal_model_set_component_kind (ECalModel *model, icalcomponent_kind kind) +e_cal_model_set_component_kind (ECalModel *model, + icalcomponent_kind kind) { g_return_if_fail (E_IS_CAL_MODEL (model)); @@ -1649,7 +1696,8 @@ e_cal_model_get_flags (ECalModel *model) } void -e_cal_model_set_flags (ECalModel *model, ECalModelFlags flags) +e_cal_model_set_flags (ECalModel *model, + ECalModelFlags flags) { g_return_if_fail (E_IS_CAL_MODEL (model)); @@ -1679,7 +1727,7 @@ e_cal_model_set_timezone (ECalModel *model, model->priv->zone = zone; /* the timezone affects the times shown for date fields, - so we need to redisplay everything */ + * so we need to redisplay everything */ e_table_model_changed (E_TABLE_MODEL (model)); g_object_notify (G_OBJECT (model), "timezone"); @@ -1925,7 +1973,8 @@ e_cal_model_get_default_client (ECalModel *model) } void -e_cal_model_set_default_client (ECalModel *model, ECalClient *client) +e_cal_model_set_default_client (ECalModel *model, + ECalClient *client) { ECalModelPrivate *priv; ECalModelClient *client_data; @@ -1988,7 +2037,8 @@ e_cal_model_get_client_list (ECalModel *model) * @uri: Uri for the client to get. */ ECalClient * -e_cal_model_get_client_for_uri (ECalModel *model, const gchar *uri) +e_cal_model_get_client_for_uri (ECalModel *model, + const gchar *uri) { GList *l; @@ -2006,7 +2056,8 @@ e_cal_model_get_client_for_uri (ECalModel *model, const gchar *uri) } static ECalModelClient * -find_client_data (ECalModel *model, ECalClient *client) +find_client_data (ECalModel *model, + ECalClient *client) { ECalModelPrivate *priv; GList *l; @@ -2024,7 +2075,9 @@ find_client_data (ECalModel *model, ECalClient *client) } static ECalModelComponent * -search_by_id_and_client (ECalModelPrivate *priv, ECalClient *client, const ECalComponentId *id) +search_by_id_and_client (ECalModelPrivate *priv, + ECalClient *client, + const ECalComponentId *id) { gint i; @@ -2070,7 +2123,10 @@ typedef struct { } RecurrenceExpansionData; static gboolean -add_instance_cb (ECalComponent *comp, time_t instance_start, time_t instance_end, gpointer user_data) +add_instance_cb (ECalComponent *comp, + time_t instance_start, + time_t instance_end, + gpointer user_data) { ECalModelComponent *comp_data; ECalModelPrivate *priv; @@ -2145,7 +2201,8 @@ ensure_dates_are_in_default_zone (ECalModel *model, } static gint -place_master_object_first_cb (gconstpointer p1, gconstpointer p2) +place_master_object_first_cb (gconstpointer p1, + gconstpointer p2) { icalcomponent *c1 = (icalcomponent *) p1, *c2 = (icalcomponent *) p2; const gchar *uid1, *uid2; @@ -2180,7 +2237,9 @@ place_master_object_first_cb (gconstpointer p1, gconstpointer p2) static void client_view_objects_added_cb (ECalClientView *view, const GSList *objects, ECalModel *model); static void -process_added (ECalClientView *view, const GSList *objects, ECalModel *model) +process_added (ECalClientView *view, + const GSList *objects, + ECalModel *model) { ECalModelPrivate *priv; const GSList *l; @@ -2260,7 +2319,9 @@ process_added (ECalClientView *view, const GSList *objects, ECalModel *model) } static void -process_modified (ECalClientView *view, const GSList *objects, ECalModel *model) +process_modified (ECalClientView *view, + const GSList *objects, + ECalModel *model) { ECalModelPrivate *priv; const GSList *l; @@ -2343,7 +2404,9 @@ process_modified (ECalClientView *view, const GSList *objects, ECalModel *model) } static void -process_removed (ECalClientView *view, const GSList *ids, ECalModel *model) +process_removed (ECalClientView *view, + const GSList *ids, + ECalModel *model) { ECalModelPrivate *priv; const GSList *l; @@ -2406,9 +2469,16 @@ free_comp_id (gpointer id) } static void -process_event (ECalClientView *view, const GSList *objects, ECalModel *model, - void (*process_fn) (ECalClientView *view, const GSList *objects, ECalModel *model), - gboolean *in, GSList **save_list, gpointer (*copy_fn) (gpointer data), void (*free_fn)(gpointer data)) +process_event (ECalClientView *view, + const GSList *objects, + ECalModel *model, + void (*process_fn) (ECalClientView *view, + const GSList *objects, + ECalModel *model), + gboolean *in, + GSList **save_list, + gpointer (*copy_fn) (gpointer data), + void (*free_fn) (gpointer data)) { gboolean skip = FALSE; const GSList *l; @@ -2456,43 +2526,63 @@ process_event (ECalClientView *view, const GSList *objects, ECalModel *model, } static void -client_view_objects_added_cb (ECalClientView *view, const GSList *objects, ECalModel *model) +client_view_objects_added_cb (ECalClientView *view, + const GSList *objects, + ECalModel *model) { - process_event (view, objects, model, - process_added, &model->priv->in_added, &model->priv->notify_added, - (gpointer (*)(gpointer)) icalcomponent_new_clone, (void (*)(gpointer)) icalcomponent_free); + process_event ( + view, objects, model, process_added, + &model->priv->in_added, + &model->priv->notify_added, + (gpointer (*)(gpointer)) icalcomponent_new_clone, + (void (*)(gpointer)) icalcomponent_free); } static void -client_view_objects_modified_cb (ECalClientView *view, const GSList *objects, ECalModel *model) +client_view_objects_modified_cb (ECalClientView *view, + const GSList *objects, + ECalModel *model) { - process_event (view, objects, model, - process_modified, &model->priv->in_modified, &model->priv->notify_modified, - (gpointer (*)(gpointer)) icalcomponent_new_clone, (void (*)(gpointer)) icalcomponent_free); + process_event ( + view, objects, model, process_modified, + &model->priv->in_modified, + &model->priv->notify_modified, + (gpointer (*)(gpointer)) icalcomponent_new_clone, + (void (*)(gpointer)) icalcomponent_free); } static void -client_view_objects_removed_cb (ECalClientView *view, const GSList *ids, ECalModel *model) -{ - process_event (view, ids, model, - process_removed, &model->priv->in_removed, &model->priv->notify_removed, +client_view_objects_removed_cb (ECalClientView *view, + const GSList *ids, + ECalModel *model) +{ + process_event ( + view, ids, model, process_removed, + &model->priv->in_removed, + &model->priv->notify_removed, copy_comp_id, free_comp_id); } static void -client_view_progress_cb (ECalClientView *view, gint percent, const gchar *message, gpointer user_data) +client_view_progress_cb (ECalClientView *view, + gint percent, + const gchar *message, + gpointer user_data) { ECalModel *model = (ECalModel *) user_data; ECalClient *client = e_cal_client_view_get_client (view); g_return_if_fail (E_IS_CAL_MODEL (model)); - g_signal_emit (G_OBJECT (model), signals[CAL_VIEW_PROGRESS], 0, message, - percent, e_cal_client_get_source_type (client)); + g_signal_emit ( + model, signals[CAL_VIEW_PROGRESS], 0, message, + percent, e_cal_client_get_source_type (client)); } static void -client_view_complete_cb (ECalClientView *view, const GError *error, gpointer user_data) +client_view_complete_cb (ECalClientView *view, + const GError *error, + gpointer user_data) { ECalModel *model = (ECalModel *) user_data; ECalClient *client = e_cal_client_view_get_client (view); @@ -2524,7 +2614,9 @@ free_get_view_data (struct get_view_data *gvd) static gboolean retry_get_view_timeout_cb (gpointer user_data); static void -get_view_cb (GObject *source_object, GAsyncResult *result, gpointer user_data) +get_view_cb (GObject *source_object, + GAsyncResult *result, + gpointer user_data) { struct get_view_data *gvd = user_data; GError *error = NULL; @@ -2590,7 +2682,8 @@ retry_get_view_timeout_cb (gpointer user_data) } static void -update_e_cal_view_for_client (ECalModel *model, ECalModelClient *client_data) +update_e_cal_view_for_client (ECalModel *model, + ECalModelClient *client_data) { ECalModelPrivate *priv; struct get_view_data *gvd; @@ -2633,7 +2726,9 @@ update_e_cal_view_for_client (ECalModel *model, ECalModelClient *client_data) } void -e_cal_model_update_status_message (ECalModel *model, const gchar *message, gdouble percent) +e_cal_model_update_status_message (ECalModel *model, + const gchar *message, + gdouble percent) { g_return_if_fail (model != NULL); @@ -2641,7 +2736,8 @@ e_cal_model_update_status_message (ECalModel *model, const gchar *message, gdoub } static void -backend_died_cb (ECalClient *client, gpointer user_data) +backend_died_cb (ECalClient *client, + gpointer user_data) { ECalModel *model; @@ -2769,7 +2865,9 @@ cal_model_retry_open_timeout_cb (gpointer user_data) } static ECalModelClient * -add_new_client (ECalModel *model, ECalClient *client, gboolean do_query) +add_new_client (ECalModel *model, + ECalClient *client, + gboolean do_query) { ECalModelPrivate *priv; ECalModelClient *client_data; @@ -2799,8 +2897,9 @@ add_new_client (ECalModel *model, ECalClient *client, gboolean do_query) priv->clients = g_list_append (priv->clients, client_data); - g_signal_connect (G_OBJECT (client_data->client), "backend_died", - G_CALLBACK (backend_died_cb), model); + g_signal_connect ( + client_data->client, "backend_died", + G_CALLBACK (backend_died_cb), model); load: if (e_client_is_opened (E_CLIENT (client))) { @@ -2824,7 +2923,8 @@ add_new_client (ECalModel *model, ECalClient *client, gboolean do_query) * e_cal_model_add_client */ void -e_cal_model_add_client (ECalModel *model, ECalClient *client) +e_cal_model_add_client (ECalModel *model, + ECalClient *client) { g_return_if_fail (E_IS_CAL_MODEL (model)); g_return_if_fail (E_IS_CAL_CLIENT (client)); @@ -2833,7 +2933,8 @@ e_cal_model_add_client (ECalModel *model, ECalClient *client) } static void -remove_client_objects (ECalModel *model, ECalModelClient *client_data) +remove_client_objects (ECalModel *model, + ECalModelClient *client_data) { gint i; @@ -2864,7 +2965,8 @@ remove_client_objects (ECalModel *model, ECalModelClient *client_data) } static void -remove_client (ECalModel *model, ECalModelClient *client_data) +remove_client (ECalModel *model, + ECalModelClient *client_data) { /* FIXME We might not want to disconnect the open signal for the default client */ g_signal_handlers_disconnect_matched (client_data->client, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, model); @@ -2898,7 +3000,8 @@ remove_client (ECalModel *model, ECalModelClient *client_data) * e_cal_model_remove_client */ void -e_cal_model_remove_client (ECalModel *model, ECalClient *client) +e_cal_model_remove_client (ECalModel *model, + ECalClient *client) { ECalModelClient *client_data; @@ -3029,7 +3132,7 @@ redo_queries (ECalModel *model) } /* clean up the current contents, which should be done - always from the main thread, because of gtk calls during removal */ + * always from the main thread, because of gtk calls during removal */ data.model = model; data.eflag = e_flag_new (); @@ -3053,7 +3156,9 @@ redo_queries (ECalModel *model) } void -e_cal_model_get_time_range (ECalModel *model, time_t *start, time_t *end) +e_cal_model_get_time_range (ECalModel *model, + time_t *start, + time_t *end) { ECalModelPrivate *priv; @@ -3070,7 +3175,9 @@ e_cal_model_get_time_range (ECalModel *model, time_t *start, time_t *end) } void -e_cal_model_set_time_range (ECalModel *model, time_t start, time_t end) +e_cal_model_set_time_range (ECalModel *model, + time_t start, + time_t end) { ECalModelPrivate *priv; @@ -3108,7 +3215,8 @@ e_cal_model_get_search_query (ECalModel *model) * e_cal_model_set_query */ void -e_cal_model_set_search_query (ECalModel *model, const gchar *sexp) +e_cal_model_set_search_query (ECalModel *model, + const gchar *sexp) { ECalModelPrivate *priv; @@ -3131,7 +3239,10 @@ e_cal_model_set_search_query (ECalModel *model, const gchar *sexp) * e_cal_model_set_query */ void -e_cal_model_set_search_query_with_time_range (ECalModel *model, const gchar *sexp, time_t start, time_t end) +e_cal_model_set_search_query_with_time_range (ECalModel *model, + const gchar *sexp, + time_t start, + time_t end) { ECalModelPrivate *priv; gboolean do_query = FALSE; @@ -3164,7 +3275,8 @@ e_cal_model_set_search_query_with_time_range (ECalModel *model, const gchar *sex * e_cal_model_create_component_with_defaults */ icalcomponent * -e_cal_model_create_component_with_defaults (ECalModel *model, gboolean all_day) +e_cal_model_create_component_with_defaults (ECalModel *model, + gboolean all_day) { ECalModelPrivate *priv; ECalComponent *comp; @@ -3222,7 +3334,8 @@ e_cal_model_create_component_with_defaults (ECalModel *model, gboolean all_day) * e_cal_model_get_color_for_component */ const gchar * -e_cal_model_get_color_for_component (ECalModel *model, ECalModelComponent *comp_data) +e_cal_model_get_color_for_component (ECalModel *model, + ECalModelComponent *comp_data) { ECalModelClass *model_class; const gchar *color = NULL; @@ -3244,7 +3357,11 @@ e_cal_model_get_color_for_component (ECalModel *model, ECalModelComponent *comp_ * e_cal_model_get_rgb_color_for_component */ gboolean -e_cal_model_get_rgb_color_for_component (ECalModel *model, ECalModelComponent *comp_data, double *red, double *green, double *blue) +e_cal_model_get_rgb_color_for_component (ECalModel *model, + ECalModelComponent *comp_data, + gdouble *red, + gdouble *green, + gdouble *blue) { GdkColor gdk_color; const gchar *color; @@ -3269,7 +3386,8 @@ e_cal_model_get_rgb_color_for_component (ECalModel *model, ECalModelComponent *c * e_cal_model_get_component_at */ ECalModelComponent * -e_cal_model_get_component_at (ECalModel *model, gint row) +e_cal_model_get_component_at (ECalModel *model, + gint row) { ECalModelPrivate *priv; @@ -3283,7 +3401,8 @@ e_cal_model_get_component_at (ECalModel *model, gint row) } ECalModelComponent * -e_cal_model_get_component_for_uid (ECalModel *model, const ECalComponentId *id) +e_cal_model_get_component_for_uid (ECalModel *model, + const ECalComponentId *id) { ECalModelPrivate *priv; @@ -3298,7 +3417,8 @@ e_cal_model_get_component_for_uid (ECalModel *model, const ECalComponentId *id) * e_cal_model_date_value_to_string */ gchar * -e_cal_model_date_value_to_string (ECalModel *model, gconstpointer value) +e_cal_model_date_value_to_string (ECalModel *model, + gconstpointer value) { ECalModelPrivate *priv; ECellDateEditValue *dv = (ECellDateEditValue *) value; @@ -3339,11 +3459,11 @@ static ECellDateEditValue * copy_ecdv (ECellDateEditValue *ecdv) { ECellDateEditValue *new_ecdv; - + * new_ecdv = g_new0 (ECellDateEditValue, 1); new_ecdv->tt = ecdv ? ecdv->tt : icaltime_null_time (); new_ecdv->zone = ecdv ? ecdv->zone : NULL; - + * return new_ecdv; } */ @@ -3455,8 +3575,11 @@ e_cal_model_component_get_type (void) * cb function is not called with cb_data, but with ECalModelGenerateInstancesData which contains cb_data */ void -e_cal_model_generate_instances_sync (ECalModel *model, time_t start, time_t end, - ECalRecurInstanceFn cb, gpointer cb_data) +e_cal_model_generate_instances_sync (ECalModel *model, + time_t start, + time_t end, + ECalRecurInstanceFn cb, + gpointer cb_data) { ECalModelGenerateInstancesData mdata; gint i, n; @@ -3485,7 +3608,8 @@ e_cal_model_get_object_array (ECalModel *model) } void -e_cal_model_set_instance_times (ECalModelComponent *comp_data, const icaltimezone *zone) +e_cal_model_set_instance_times (ECalModelComponent *comp_data, + const icaltimezone *zone) { struct icaltimetype start_time, end_time; icalcomponent_kind kind; @@ -3506,9 +3630,9 @@ e_cal_model_set_instance_times (ECalModelComponent *comp_data, const icaltimezon } else if (start_time.is_date && end_time.is_date && (icaltime_compare_date_only (start_time, end_time) == 0)) { /* If both DTSTART and DTEND are DATE values, and they are the - same day, we add 1 day to DTEND. This means that most - events created with the old Evolution behavior will still - work OK. */ + * same day, we add 1 day to DTEND. This means that most + * events created with the old Evolution behavior will still + * work OK. */ icaltime_adjust (&end_time, 1, 0, 0, 0); icalcomponent_set_dtend (comp_data->icalcomp, end_time); } @@ -3571,7 +3695,9 @@ e_cal_model_set_instance_times (ECalModelComponent *comp_data, const icaltimezon * when user didn't fill a start date there. **/ void -e_cal_model_set_default_time_func (ECalModel *model, ECalModelDefaultTimeFunc func, gpointer user_data) +e_cal_model_set_default_time_func (ECalModel *model, + ECalModelDefaultTimeFunc func, + gpointer user_data) { g_return_if_fail (E_IS_CAL_MODEL (model)); diff --git a/calendar/gui/e-cal-model.h b/calendar/gui/e-cal-model.h index 33ffcff52d..a514c95ab2 100644 --- a/calendar/gui/e-cal-model.h +++ b/calendar/gui/e-cal-model.h @@ -73,7 +73,7 @@ G_BEGIN_DECLS typedef enum { /* If you add new items here or reorder them, you have to update the - .etspec files for the tables using this model */ + * .etspec files for the tables using this model */ E_CAL_MODEL_FIELD_CATEGORIES, E_CAL_MODEL_FIELD_CLASSIFICATION, E_CAL_MODEL_FIELD_COLOR, /* not a real field */ diff --git a/calendar/gui/e-calendar-view.c b/calendar/gui/e-calendar-view.c index 8f87026f65..82bbea2f79 100644 --- a/calendar/gui/e-calendar-view.c +++ b/calendar/gui/e-calendar-view.c @@ -509,7 +509,9 @@ calendar_view_cut_clipboard (ESelectable *selectable) } static void -add_related_timezones (icalcomponent *des_icalcomp, icalcomponent *src_icalcomp, ECalClient *client) +add_related_timezones (icalcomponent *des_icalcomp, + icalcomponent *src_icalcomp, + ECalClient *client) { icalproperty_kind look_in[] = { ICAL_DTSTART_PROPERTY, @@ -944,8 +946,12 @@ e_calendar_view_popup_event (ECalendarView *calendar_view, } void -e_calendar_view_add_event (ECalendarView *cal_view, ECalClient *client, time_t dtstart, - icaltimezone *default_zone, icalcomponent *icalcomp, gboolean in_top_canvas) +e_calendar_view_add_event (ECalendarView *cal_view, + ECalClient *client, + time_t dtstart, + icaltimezone *default_zone, + icalcomponent *icalcomp, + gboolean in_top_canvas) { ECalComponent *comp; struct icaltimetype itime, old_dtstart, old_dtend; @@ -966,7 +972,7 @@ e_calendar_view_add_event (ECalendarView *cal_view, ECalClient *client, time_t d tt_end = icaltime_as_timet (old_dtend); ic_dur = icaldurationtype_from_int (tt_end - tt_start); - if (icaldurationtype_as_int (ic_dur) > 60*60*24) { + if (icaldurationtype_as_int (ic_dur) > 60 *60 *24) { /* This is a long event */ start_offset = old_dtstart.hour * 60 + old_dtstart.minute; end_offset = old_dtstart.hour * 60 + old_dtend.minute; @@ -985,7 +991,7 @@ e_calendar_view_add_event (ECalendarView *cal_view, ECalClient *client, time_t d if (all_day_event) { ic_dur = ic_oneday; - } else if (icaldurationtype_as_int (ic_dur) >= 60*60*24 + } else if (icaldurationtype_as_int (ic_dur) >= 60 *60 *24 && !in_top_canvas) { /* copy & paste from top canvas to main canvas */ gint time_divisions; @@ -1076,7 +1082,8 @@ e_calendar_view_get_calendar (ECalendarView *cal_view) } void -e_calendar_view_set_calendar (ECalendarView *cal_view, GnomeCalendar *calendar) +e_calendar_view_set_calendar (ECalendarView *cal_view, + GnomeCalendar *calendar) { g_return_if_fail (E_IS_CALENDAR_VIEW (cal_view)); @@ -1099,7 +1106,8 @@ e_calendar_view_get_timezone (ECalendarView *cal_view) } void -e_calendar_view_set_timezone (ECalendarView *cal_view, icaltimezone *zone) +e_calendar_view_set_timezone (ECalendarView *cal_view, + icaltimezone *zone) { icaltimezone *old_zone; @@ -1398,9 +1406,10 @@ e_calendar_view_open_event (ECalendarView *cal_view) */ void e_calendar_view_new_appointment_for (ECalendarView *cal_view, - time_t dtstart, time_t dtend, - gboolean all_day, - gboolean meeting) + time_t dtstart, + time_t dtend, + gboolean all_day, + gboolean meeting) { ECalendarViewPrivate *priv; struct icaltimetype itt; @@ -1458,7 +1467,7 @@ e_calendar_view_new_appointment_for (ECalendarView *cal_view, itt = icaltime_from_timet_with_zone (dtend, FALSE, e_cal_model_get_timezone (cal_view->priv->model)); if (all_day) { /* We round it up to the end of the day, unless it is - already set to midnight */ + * already set to midnight */ if (itt.hour != 0 || itt.minute != 0 || itt.second != 0) { icaltime_adjust (&itt, 1, 0, 0, 0); } @@ -1575,13 +1584,17 @@ e_calendar_view_new_appointment (ECalendarView *cal_view) /* Ensures the calendar is selected */ static void -object_created_cb (CompEditor *ce, ECalendarView *cal_view) +object_created_cb (CompEditor *ce, + ECalendarView *cal_view) { e_calendar_view_emit_user_created (cal_view); } CompEditor * -e_calendar_view_open_event_with_flags (ECalendarView *cal_view, ECalClient *client, icalcomponent *icalcomp, guint32 flags) +e_calendar_view_open_event_with_flags (ECalendarView *cal_view, + ECalClient *client, + icalcomponent *icalcomp, + guint32 flags) { CompEditor *ce; const gchar *uid; @@ -1624,7 +1637,10 @@ e_calendar_view_open_event_with_flags (ECalendarView *cal_view, ECalClient *clie * object. */ void -e_calendar_view_edit_appointment (ECalendarView *cal_view, ECalClient *client, icalcomponent *icalcomp, EEditEventMode mode) +e_calendar_view_edit_appointment (ECalendarView *cal_view, + ECalClient *client, + icalcomponent *icalcomp, + EEditEventMode mode) { guint32 flags = 0; @@ -1647,10 +1663,10 @@ e_calendar_view_edit_appointment (ECalendarView *cal_view, ECalClient *client, i void e_calendar_view_modify_and_send (ECalComponent *comp, - ECalClient *client, - CalObjModType mod, - GtkWindow *toplevel, - gboolean new) + ECalClient *client, + CalObjModType mod, + GtkWindow *toplevel, + gboolean new) { gboolean only_new_attendees = FALSE; GError *error = NULL; @@ -1697,7 +1713,9 @@ e_calendar_view_modify_and_send (ECalComponent *comp, } static gboolean -tooltip_grab (GtkWidget *tooltip, GdkEventKey *event, ECalendarView *view) +tooltip_grab (GtkWidget *tooltip, + GdkEventKey *event, + ECalendarView *view) { GtkWidget *widget = (GtkWidget *) g_object_get_data (G_OBJECT (view), "tooltip-window"); @@ -1712,7 +1730,9 @@ tooltip_grab (GtkWidget *tooltip, GdkEventKey *event, ECalendarView *view) } static gchar * -get_label (struct icaltimetype *tt, icaltimezone *f_zone, icaltimezone *t_zone) +get_label (struct icaltimetype *tt, + icaltimezone *f_zone, + icaltimezone *t_zone) { struct tm tmp_tm; @@ -1722,7 +1742,9 @@ get_label (struct icaltimetype *tt, icaltimezone *f_zone, icaltimezone *t_zone) } void -e_calendar_view_move_tip (GtkWidget *widget, gint x, gint y) +e_calendar_view_move_tip (GtkWidget *widget, + gint x, + gint y) { GtkAllocation allocation; GtkRequisition requisition; @@ -1768,7 +1790,8 @@ e_calendar_view_move_tip (GtkWidget *widget, gint x, gint y) * Free returned pointer with g_free. **/ gchar * -e_calendar_view_get_attendees_status_info (ECalComponent *comp, ECalClient *client) +e_calendar_view_get_attendees_status_info (ECalComponent *comp, + ECalClient *client) { struct _values { icalparameter_partstat status; @@ -1827,7 +1850,7 @@ e_calendar_view_get_attendees_status_info (ECalComponent *comp, ECalClient *clie g_string_prepend (str, ": "); /* To Translators: 'Status' here means the state of the attendees, the resulting string will be in a form: - Status: Accepted: X Declined: Y ... */ + * Status: Accepted: X Declined: Y ... */ g_string_prepend (str, _("Status")); res = g_string_free (str, FALSE); @@ -2016,13 +2039,13 @@ e_calendar_view_get_tooltips (const ECalendarViewEventData *data) gtk_frame_set_shadow_type ((GtkFrame *) frame, GTK_SHADOW_IN); gtk_window_set_type_hint (GTK_WINDOW (pevent->tooltip), GDK_WINDOW_TYPE_HINT_TOOLTIP); - gtk_window_move ((GtkWindow *) pevent->tooltip, pevent->x +16, pevent->y+16); + gtk_window_move ((GtkWindow *) pevent->tooltip, pevent->x +16, pevent->y + 16); gtk_container_add ((GtkContainer *) frame, box); gtk_container_add ((GtkContainer *) pevent->tooltip, frame); gtk_widget_show_all (pevent->tooltip); - e_calendar_view_move_tip (pevent->tooltip, pevent->x +16, pevent->y+16); + e_calendar_view_move_tip (pevent->tooltip, pevent->x +16, pevent->y + 16); window = gtk_widget_get_window (pevent->tooltip); gdk_keyboard_grab (window, FALSE, GDK_CURRENT_TIME); @@ -2036,7 +2059,8 @@ e_calendar_view_get_tooltips (const ECalendarViewEventData *data) } static gboolean -icalcomp_contains_category (icalcomponent *icalcomp, const gchar *category) +icalcomp_contains_category (icalcomponent *icalcomp, + const gchar *category) { icalproperty *property; @@ -2065,7 +2089,9 @@ icalcomp_contains_category (icalcomponent *icalcomp, const gchar *category) */ const gchar * -e_calendar_view_get_icalcomponent_summary (ECalClient *client, icalcomponent *icalcomp, gboolean *free_text) +e_calendar_view_get_icalcomponent_summary (ECalClient *client, + icalcomponent *icalcomp, + gboolean *free_text) { const gchar *summary; @@ -2108,9 +2134,12 @@ e_calendar_view_emit_user_created (ECalendarView *cal_view) } void -draw_curved_rectangle (cairo_t *cr, double x0, double y0, - gdouble rect_width, double rect_height, - gdouble radius) +draw_curved_rectangle (cairo_t *cr, + gdouble x0, + gdouble y0, + gdouble rect_width, + gdouble rect_height, + gdouble radius) { gdouble x1, y1; @@ -2121,28 +2150,28 @@ draw_curved_rectangle (cairo_t *cr, double x0, double y0, return; if (rect_width / 2 < radius) { if (rect_height / 2 < radius) { - cairo_move_to (cr, x0, (y0 + y1)/2); - cairo_curve_to (cr, x0 ,y0, x0, y0, (x0 + x1)/2, y0); - cairo_curve_to (cr, x1, y0, x1, y0, x1, (y0 + y1)/2); - cairo_curve_to (cr, x1, y1, x1, y1, (x1 + x0)/2, y1); - cairo_curve_to (cr, x0, y1, x0, y1, x0, (y0 + y1)/2); + cairo_move_to (cr, x0, (y0 + y1) / 2); + cairo_curve_to (cr, x0 ,y0, x0, y0, (x0 + x1) / 2, y0); + cairo_curve_to (cr, x1, y0, x1, y0, x1, (y0 + y1) / 2); + cairo_curve_to (cr, x1, y1, x1, y1, (x1 + x0) / 2, y1); + cairo_curve_to (cr, x0, y1, x0, y1, x0, (y0 + y1) / 2); } else { cairo_move_to (cr, x0, y0 + radius); - cairo_curve_to (cr, x0 ,y0, x0, y0, (x0 + x1)/2, y0); + cairo_curve_to (cr, x0 ,y0, x0, y0, (x0 + x1) / 2, y0); cairo_curve_to (cr, x1, y0, x1, y0, x1, y0 + radius); cairo_line_to (cr, x1 , y1 - radius); - cairo_curve_to (cr, x1, y1, x1, y1, (x1 + x0)/2, y1); + cairo_curve_to (cr, x1, y1, x1, y1, (x1 + x0) / 2, y1); cairo_curve_to (cr, x0, y1, x0, y1, x0, y1- radius); } } else { if (rect_height / 2 < radius) { - cairo_move_to (cr, x0, (y0 + y1)/2); + cairo_move_to (cr, x0, (y0 + y1) / 2); cairo_curve_to (cr, x0 , y0, x0 , y0, x0 + radius, y0); cairo_line_to (cr, x1 - radius, y0); - cairo_curve_to (cr, x1, y0, x1, y0, x1, (y0 + y1)/2); + cairo_curve_to (cr, x1, y0, x1, y0, x1, (y0 + y1) / 2); cairo_curve_to (cr, x1, y1, x1, y1, x1 - radius, y1); cairo_line_to (cr, x0 + radius, y1); - cairo_curve_to (cr, x0, y1, x0, y1, x0, (y0 + y1)/2); + cairo_curve_to (cr, x0, y1, x0, y1, x0, (y0 + y1) / 2); } else { cairo_move_to (cr, x0, y0 + radius); cairo_curve_to (cr, x0 , y0, x0 , y0, x0 + radius, y0); @@ -2158,7 +2187,7 @@ draw_curved_rectangle (cairo_t *cr, double x0, double y0, } /* returns either light or dark yellow, based on the base_background, - which is the default background color */ + * which is the default background color */ GdkColor get_today_background (const GdkColor base_background) { @@ -2180,7 +2209,8 @@ get_today_background (const GdkColor base_background) } gboolean -is_comp_data_valid_func (ECalendarViewEvent *event, const gchar *location) +is_comp_data_valid_func (ECalendarViewEvent *event, + const gchar *location) { g_return_val_if_fail (location != NULL, FALSE); @@ -2198,7 +2228,9 @@ is_comp_data_valid_func (ECalendarViewEvent *event, const gchar *location) } gboolean -is_array_index_in_bounds_func (GArray *array, gint index, const gchar *location) +is_array_index_in_bounds_func (GArray *array, + gint index, + const gchar *location) { g_return_val_if_fail (location != NULL, FALSE); diff --git a/calendar/gui/e-cell-date-edit-text.c b/calendar/gui/e-cell-date-edit-text.c index 57c2d855d8..61f6d9a3fd 100644 --- a/calendar/gui/e-cell-date-edit-text.c +++ b/calendar/gui/e-cell-date-edit-text.c @@ -120,9 +120,9 @@ cell_date_edit_text_get_text (ECellText *cell, timezone = e_cell_date_edit_text_get_timezone (ecd); /* Note that although the property may be in a different - timezone, we convert it to the current timezone to display - it in the table. If the user actually edits the value, - it will be set to the current timezone. See set_value (). */ + * timezone, we convert it to the current timezone to display + * it in the table. If the user actually edits the value, + * it will be set to the current timezone. See set_value (). */ tmp_tm = icaltimetype_to_tm_with_zone (&dv->tt, dv->zone, timezone); return e_datetime_format_format_tm ( @@ -148,7 +148,7 @@ show_date_warning (ECellDateEditText *ecd) t = time (NULL); /* We are only using this as an example, so the timezone doesn't - matter. */ + * matter. */ tmp_tm = localtime (&t); if (e_cell_date_edit_text_get_use_24_hour_format (ecd)) @@ -184,7 +184,7 @@ cell_date_edit_text_set_value (ECellText *cell, gboolean is_date = TRUE; /* Try to parse just a date first. If the value is only a date, we - use a DATE value. */ + * use a DATE value. */ status = e_time_parse_date (text, &tmp_tm); if (status == E_TIME_PARSE_INVALID) { is_date = FALSE; @@ -212,7 +212,7 @@ cell_date_edit_text_set_value (ECellText *cell, dv.tt.is_date = is_date; /* FIXME: We assume it is being set to the current timezone. - Is that OK? */ + * Is that OK? */ if (is_date) { dv.zone = NULL; } else { @@ -310,7 +310,7 @@ e_cell_date_edit_text_get_type (void) */ ECell * e_cell_date_edit_text_new (const gchar *fontname, - GtkJustification justify) + GtkJustification justify) { ECell *cell; @@ -330,7 +330,7 @@ e_cell_date_edit_text_get_timezone (ECellDateEditText *ecd) void e_cell_date_edit_text_set_timezone (ECellDateEditText *ecd, - icaltimezone *timezone) + icaltimezone *timezone) { g_return_if_fail (E_IS_CELL_DATE_EDIT_TEXT (ecd)); @@ -349,7 +349,7 @@ e_cell_date_edit_text_get_use_24_hour_format (ECellDateEditText *ecd) void e_cell_date_edit_text_set_use_24_hour_format (ECellDateEditText *ecd, - gboolean use_24_hour) + gboolean use_24_hour) { g_return_if_fail (E_IS_CELL_DATE_EDIT_TEXT (ecd)); @@ -359,7 +359,9 @@ e_cell_date_edit_text_set_use_24_hour_format (ECellDateEditText *ecd, } gint -e_cell_date_edit_compare_cb (gconstpointer a, gconstpointer b, gpointer cmp_cache) +e_cell_date_edit_compare_cb (gconstpointer a, + gconstpointer b, + gpointer cmp_cache) { ECellDateEditValue *dv1 = (ECellDateEditValue *) a; ECellDateEditValue *dv2 = (ECellDateEditValue *) b; diff --git a/calendar/gui/e-date-time-list.c b/calendar/gui/e-date-time-list.c index 404fac9c99..1342c0e5d7 100644 --- a/calendar/gui/e-date-time-list.c +++ b/calendar/gui/e-date-time-list.c @@ -108,7 +108,8 @@ all_rows_deleted (EDateTimeList *date_time_list) } static void -row_deleted (EDateTimeList *date_time_list, gint n) +row_deleted (EDateTimeList *date_time_list, + gint n) { GtkTreePath *path; @@ -119,7 +120,8 @@ row_deleted (EDateTimeList *date_time_list, gint n) } static void -row_added (EDateTimeList *date_time_list, gint n) +row_added (EDateTimeList *date_time_list, + gint n) { GtkTreePath *path; GtkTreeIter iter; @@ -134,7 +136,8 @@ row_added (EDateTimeList *date_time_list, gint n) } static void -row_updated (EDateTimeList *date_time_list, gint n) +row_updated (EDateTimeList *date_time_list, + gint n) { GtkTreePath *path; GtkTreeIter iter; @@ -276,7 +279,7 @@ date_time_list_get_iter (GtkTreeModel *tree_model, static GtkTreePath * date_time_list_get_path (GtkTreeModel *tree_model, - GtkTreeIter *iter) + GtkTreeIter *iter) { EDateTimeList *date_time_list = (EDateTimeList *) tree_model; GtkTreePath *retval; @@ -372,7 +375,7 @@ date_time_list_iter_children (GtkTreeModel *tree_model, static gboolean date_time_list_iter_has_child (GtkTreeModel *tree_model, - GtkTreeIter *iter) + GtkTreeIter *iter) { g_return_val_if_fail (IS_VALID_ITER (E_DATE_TIME_LIST (tree_model), iter), FALSE); return FALSE; @@ -483,7 +486,8 @@ e_date_time_list_new (void) } const ECalComponentDateTime * -e_date_time_list_get_date_time (EDateTimeList *date_time_list, GtkTreeIter *iter) +e_date_time_list_get_date_time (EDateTimeList *date_time_list, + GtkTreeIter *iter) { g_return_val_if_fail (IS_VALID_ITER (date_time_list, iter), NULL); @@ -491,8 +495,9 @@ e_date_time_list_get_date_time (EDateTimeList *date_time_list, GtkTreeIter *iter } void -e_date_time_list_set_date_time (EDateTimeList *date_time_list, GtkTreeIter *iter, - const ECalComponentDateTime *datetime) +e_date_time_list_set_date_time (EDateTimeList *date_time_list, + GtkTreeIter *iter, + const ECalComponentDateTime *datetime) { ECalComponentDateTime *datetime_old; @@ -526,8 +531,9 @@ e_date_time_list_set_use_24_hour_format (EDateTimeList *date_time_list, } void -e_date_time_list_append (EDateTimeList *date_time_list, GtkTreeIter *iter, - const ECalComponentDateTime *datetime) +e_date_time_list_append (EDateTimeList *date_time_list, + GtkTreeIter *iter, + const ECalComponentDateTime *datetime) { g_return_if_fail (datetime != NULL); @@ -546,7 +552,8 @@ e_date_time_list_append (EDateTimeList *date_time_list, GtkTreeIter *iter, } void -e_date_time_list_remove (EDateTimeList *date_time_list, GtkTreeIter *iter) +e_date_time_list_remove (EDateTimeList *date_time_list, + GtkTreeIter *iter) { gint n; diff --git a/calendar/gui/e-day-view-layout.c b/calendar/gui/e-day-view-layout.c index a4cdece5c0..d1957b95e7 100644 --- a/calendar/gui/e-day-view-layout.c +++ b/calendar/gui/e-day-view-layout.c @@ -55,27 +55,27 @@ static void e_day_view_recalc_cols_per_row (gint rows, guint16 *group_starts); void -e_day_view_layout_long_events (GArray *events, - gint days_shown, - time_t *day_starts, - gint *rows_in_top_display) +e_day_view_layout_long_events (GArray *events, + gint days_shown, + time_t *day_starts, + gint *rows_in_top_display) { EDayViewEvent *event; gint event_num; guint8 *grid; /* This is a temporary 2-d grid which is used to place events. - Each element is 0 if the position is empty, or 1 if occupied. - We allocate the maximum size possible here, assuming that each - event will need its own row. */ + * Each element is 0 if the position is empty, or 1 if occupied. + * We allocate the maximum size possible here, assuming that each + * event will need its own row. */ grid = g_new0 (guint8, events->len * E_DAY_VIEW_MAX_DAYS); /* Reset the number of rows in the top display to 0. It will be - updated as events are layed out below. */ + * updated as events are layed out below. */ *rows_in_top_display = 0; /* Iterate over the events, finding which days they cover, and putting - them in the first free row available. */ + * them in the first free row available. */ for (event_num = 0; event_num < events->len; event_num++) { event = &g_array_index (events, EDayViewEvent, event_num); e_day_view_layout_long_event (event, grid, @@ -89,10 +89,10 @@ e_day_view_layout_long_events (GArray *events, static void e_day_view_layout_long_event (EDayViewEvent *event, - guint8 *grid, - gint days_shown, - time_t *day_starts, - gint *rows_in_top_display) + guint8 *grid, + gint days_shown, + time_t *day_starts, + gint *rows_in_top_display) { gint start_day, end_day, free_row, day, row; @@ -130,31 +130,31 @@ e_day_view_layout_long_event (EDayViewEvent *event, /* returns maximum number of columns among all rows */ gint -e_day_view_layout_day_events (GArray *events, - gint rows, - gint mins_per_row, - guint8 *cols_per_row, - gint max_cols) +e_day_view_layout_day_events (GArray *events, + gint rows, + gint mins_per_row, + guint8 *cols_per_row, + gint max_cols) { EDayViewEvent *event; gint row, event_num, res; EBitArray **grid; /* This is a temporary array which keeps track of rows which are - connected. When an appointment spans multiple rows then the number - of columns in each of these rows must be the same (i.e. the maximum - of all of them). Each element in the array corresponds to one row - and contains the index of the first row in the group of connected - rows. */ + * connected. When an appointment spans multiple rows then the number + * of columns in each of these rows must be the same (i.e. the maximum + * of all of them). Each element in the array corresponds to one row + * and contains the index of the first row in the group of connected + * rows. */ guint16 group_starts[12 * 24]; /* This is a temporary 2-d grid which is used to place events. - Each element is 0 if the position is empty, or 1 if occupied. */ + * Each element is 0 if the position is empty, or 1 if occupied. */ grid = g_new0 (EBitArray *, rows); /* Reset the cols_per_row array, and initialize the connected rows so - that all rows are not connected - each row is the start of a new - group. */ + * that all rows are not connected - each row is the start of a new + * group. */ for (row = 0; row < rows; row++) { cols_per_row[row] = 0; group_starts[row] = row; @@ -164,9 +164,9 @@ e_day_view_layout_day_events (GArray *events, } /* Iterate over the events, finding which rows they cover, and putting - them in the first free column available. Increment the number of - events in each of the rows it covers, and make sure they are all - in one group. */ + * them in the first free column available. Increment the number of + * events in each of the rows it covers, and make sure they are all + * in one group. */ for (event_num = 0; event_num < events->len; event_num++) { event = &g_array_index (events, EDayViewEvent, event_num); @@ -178,7 +178,7 @@ e_day_view_layout_day_events (GArray *events, e_day_view_recalc_cols_per_row (rows, cols_per_row, group_starts); /* Iterate over the events again, trying to expand events horizontally - if there is enough space. */ + * if there is enough space. */ for (event_num = 0; event_num < events->len; event_num++) { event = &g_array_index (events, EDayViewEvent, event_num); e_day_view_expand_day_event (event, grid, cols_per_row, @@ -197,16 +197,16 @@ e_day_view_layout_day_events (GArray *events, } /* Finds the first free position to place the event in. - Increments the number of events in each of the rows it covers, and makes - sure they are all in one group. */ + * Increments the number of events in each of the rows it covers, and makes + * sure they are all in one group. */ static void e_day_view_layout_day_event (EDayViewEvent *event, - EBitArray **grid, - guint16 *group_starts, - guint8 *cols_per_row, - gint rows, - gint mins_per_row, - gint max_cols) + EBitArray **grid, + guint16 *group_starts, + guint8 *cols_per_row, + gint rows, + gint mins_per_row, + gint max_cols) { gint start_row, end_row, free_col, col, row, group_start; @@ -252,9 +252,9 @@ e_day_view_layout_day_event (EDayViewEvent *event, group_start = group_starts[start_row]; /* Increment number of events in each of the rows the event covers. - We use the cols_per_row array for this. It will be sorted out after - all the events have been layed out. Also make sure all the rows that - the event covers are in one group. */ + * We use the cols_per_row array for this. It will be sorted out after + * all the events have been layed out. Also make sure all the rows that + * the event covers are in one group. */ for (row = start_row; row <= end_row; row++) { /* resize the array if necessary */ if (e_bit_array_bit_count (grid[row]) <= free_col) @@ -276,11 +276,11 @@ e_day_view_layout_day_event (EDayViewEvent *event, } /* For each group of rows, find the max number of events in all the - rows, and set the number of cols in each of the rows to that. */ + * rows, and set the number of cols in each of the rows to that. */ static void -e_day_view_recalc_cols_per_row (gint rows, - guint8 *cols_per_row, - guint16 *group_starts) +e_day_view_recalc_cols_per_row (gint rows, + guint8 *cols_per_row, + guint16 *group_starts) { gint start_row = 0, row, next_start_row, max_events; @@ -301,9 +301,9 @@ e_day_view_recalc_cols_per_row (gint rows, /* Expands the event horizontally to fill any free space. */ static void e_day_view_expand_day_event (EDayViewEvent *event, - EBitArray **grid, - guint8 *cols_per_row, - gint mins_per_row) + EBitArray **grid, + guint8 *cols_per_row, + gint mins_per_row) { gint start_row, end_row, col, row; gboolean clashed; @@ -333,11 +333,11 @@ e_day_view_expand_day_event (EDayViewEvent *event, /* Find the start and end days for the event. */ gboolean -e_day_view_find_long_event_days (EDayViewEvent *event, - gint days_shown, - time_t *day_starts, - gint *start_day_return, - gint *end_day_return) +e_day_view_find_long_event_days (EDayViewEvent *event, + gint days_shown, + time_t *day_starts, + gint *start_day_return, + gint *end_day_return) { gint day, start_day, end_day; diff --git a/calendar/gui/e-day-view-layout.h b/calendar/gui/e-day-view-layout.h index c169a06b59..5dae66244b 100644 --- a/calendar/gui/e-day-view-layout.h +++ b/calendar/gui/e-day-view-layout.h @@ -29,7 +29,7 @@ G_BEGIN_DECLS /* I've split these functions away from EDayView so we can use them for - printing. */ + * printing. */ void e_day_view_layout_long_events (GArray *events, gint days_shown, diff --git a/calendar/gui/e-day-view-main-item.c b/calendar/gui/e-day-view-main-item.c index 98ce4ff335..c379f2aecb 100644 --- a/calendar/gui/e-day-view-main-item.c +++ b/calendar/gui/e-day-view-main-item.c @@ -52,7 +52,11 @@ enum { static gpointer parent_class; static gboolean -can_draw_in_region (cairo_region_t *draw_region, gint x, gint y, gint width, gint height) +can_draw_in_region (cairo_region_t *draw_region, + gint x, + gint y, + gint width, + gint height) { GdkRectangle rect; @@ -212,7 +216,7 @@ day_view_main_item_draw_day_event (EDayViewMainItem *main_item, time_divisions = e_calendar_view_get_time_divisions (cal_view); /* If the event is currently being dragged, don't draw it. It will - be drawn in the special drag items. */ + * be drawn in the special drag items. */ if (day_view->drag_event_day == day && day_view->drag_event_num == event_num) return; @@ -241,10 +245,10 @@ day_view_main_item_draw_day_event (EDayViewMainItem *main_item, return; /* Fill in the event background. Note that for events in the first - column of the day, we might not want to paint over the vertical bar, - since that is used for multiple events. But then you can't see - where the event in the first column finishes. The border is drawn - along with the event using cairo*/ + * column of the day, we might not want to paint over the vertical bar, + * since that is used for multiple events. But then you can't see + * where the event in the first column finishes. The border is drawn + * along with the event using cairo */ red = day_view->colors[E_DAY_VIEW_COLOR_EVENT_BACKGROUND].red; green = day_view->colors[E_DAY_VIEW_COLOR_EVENT_BACKGROUND].green; @@ -260,7 +264,7 @@ day_view_main_item_draw_day_event (EDayViewMainItem *main_item, is_editing = day_view->editing_event_day == day && day_view->editing_event_num == event_num; if (event->canvas_item) - g_object_get (G_OBJECT (event->canvas_item), "x_offset", &text_x_offset, NULL); + g_object_get (event->canvas_item, "x_offset", &text_x_offset, NULL); /* Draw shadow around the event when selected */ if (is_editing && (gtk_widget_has_focus (day_view->main_canvas))) { @@ -432,7 +436,7 @@ day_view_main_item_draw_day_event (EDayViewMainItem *main_item, draw_curved_rectangle (cr, x0, y0, rect_width,rect_height, radius); cairo_set_line_width (cr, 2.); - cairo_set_source_rgb (cr, red/cc, green/cc, blue/cc); + cairo_set_source_rgb (cr, red / cc, green / cc, blue / cc); cairo_stroke (cr); cairo_restore (cr); @@ -468,19 +472,19 @@ day_view_main_item_draw_day_event (EDayViewMainItem *main_item, pat = cairo_pattern_create_linear (item_x + E_DAY_VIEW_BAR_WIDTH + 1.75, item_y + 7.75, item_x + E_DAY_VIEW_BAR_WIDTH + 1.75, item_y + item_h - 7.75); if (!short_event) { - cairo_pattern_add_color_stop_rgba (pat, 1, red/cc, green/cc, blue/cc, 0.8); - cairo_pattern_add_color_stop_rgba (pat, 1/(date_fraction + (rect_height/18)), red/cc, green/cc, blue/cc, 0.8); - cairo_pattern_add_color_stop_rgba (pat, 1/(date_fraction + (rect_height/18)), red/cc, green/cc, blue/cc, 0.4); - cairo_pattern_add_color_stop_rgba (pat, 1, red/cc, green/cc, blue/cc, 0.8); + cairo_pattern_add_color_stop_rgba (pat, 1, red / cc, green / cc, blue / cc, 0.8); + cairo_pattern_add_color_stop_rgba (pat, 1 / (date_fraction + (rect_height / 18)), red / cc, green / cc, blue / cc, 0.8); + cairo_pattern_add_color_stop_rgba (pat, 1 / (date_fraction + (rect_height / 18)), red / cc, green / cc, blue / cc, 0.4); + cairo_pattern_add_color_stop_rgba (pat, 1, red / cc, green / cc, blue / cc, 0.8); } else { - cairo_pattern_add_color_stop_rgba (pat, 1, red/cc, green/cc, blue/cc, 0.8); - cairo_pattern_add_color_stop_rgba (pat, 0, red/cc, green/cc, blue/cc, 0.4); + cairo_pattern_add_color_stop_rgba (pat, 1, red / cc, green / cc, blue / cc, 0.8); + cairo_pattern_add_color_stop_rgba (pat, 0, red / cc, green / cc, blue / cc, 0.4); } cairo_set_source (cr, pat); cairo_fill_preserve (cr); cairo_pattern_destroy (pat); - cairo_set_source_rgba (cr, red/cc, green/cc, blue/cc, 0.2); + cairo_set_source_rgba (cr, red / cc, green / cc, blue / cc, 0.2); cairo_set_line_width (cr, 0.5); cairo_stroke (cr); cairo_restore (cr); @@ -499,7 +503,7 @@ day_view_main_item_draw_day_event (EDayViewMainItem *main_item, &day_view->colors[E_DAY_VIEW_COLOR_EVENT_VBAR]); /* Draw the vertical colored bar showing when the appointment - begins & ends. */ + * begins & ends. */ bar_y1 = event->start_minute * day_view->row_height / time_divisions - y; bar_y2 = event->end_minute * day_view->row_height / time_divisions - y; @@ -546,7 +550,7 @@ day_view_main_item_draw_day_event (EDayViewMainItem *main_item, end_resize_suffix); } cairo_set_font_size (cr, 14); - if ((red/cc > 0.7) || (green/cc > 0.7) || (blue/cc > 0.7 )) + if ((red / cc > 0.7) || (green / cc > 0.7) || (blue / cc > 0.7 )) cairo_set_source_rgb (cr, 0, 0, 0); else cairo_set_source_rgb (cr, 1, 1, 1); @@ -570,9 +574,9 @@ day_view_main_item_draw_day_event (EDayViewMainItem *main_item, cairo_save (cr); pat = cairo_pattern_create_linear (item_x + E_DAY_VIEW_BAR_WIDTH, item_y + 1, item_x + E_DAY_VIEW_BAR_WIDTH, item_y + item_h - 1); - cairo_pattern_add_color_stop_rgba (pat, 1, red/cc, green/cc, blue/cc, 0.7); - cairo_pattern_add_color_stop_rgba (pat, 0.5, red/cc, green/cc, blue/cc, 0.7); - cairo_pattern_add_color_stop_rgba (pat, 0, red/cc, green/cc, blue/cc, 0.2); + cairo_pattern_add_color_stop_rgba (pat, 1, red / cc, green / cc, blue / cc, 0.7); + cairo_pattern_add_color_stop_rgba (pat, 0.5, red / cc, green / cc, blue / cc, 0.7); + cairo_pattern_add_color_stop_rgba (pat, 0, red / cc, green / cc, blue / cc, 0.2); cairo_rectangle (cr, item_x + 1, bar_y1, E_DAY_VIEW_BAR_WIDTH - 2, bar_y2 - bar_y1); @@ -623,7 +627,7 @@ day_view_main_item_draw_day_event (EDayViewMainItem *main_item, num_icons++; } /* If the DTSTART or DTEND are in a different timezone to our current - timezone, we display the timezone icon. */ + * timezone, we display the timezone icon. */ if (event->different_timezone) { draw_timezone_icon = TRUE; num_icons++; @@ -780,7 +784,7 @@ day_view_main_item_draw_day_event (EDayViewMainItem *main_item, cairo_move_to (cr, item_x + E_DAY_VIEW_BAR_WIDTH + 10, item_y + 13); else cairo_move_to (cr, icon_x, item_y + 13); - if ((red/cc > 0.7) || (green/cc > 0.7) || (blue/cc > 0.7 )) + if ((red / cc > 0.7) || (green / cc > 0.7) || (blue / cc > 0.7 )) cairo_set_source_rgb (cr, 0, 0, 0); else cairo_set_source_rgb (cr, 1, 1, 1); @@ -849,7 +853,7 @@ day_view_main_item_draw_events_in_vbars (EDayViewMainItem *main_item, continue; /* We can skip the events in the first column since they will - draw over this anyway. */ + * draw over this anyway. */ if (event->num_columns > 0 && event->start_row_or_col == 0) { continue; } @@ -936,8 +940,8 @@ day_view_main_item_dispose (GObject *object) static void day_view_main_item_update (GnomeCanvasItem *item, - const cairo_matrix_t *i2c, - gint flags) + const cairo_matrix_t *i2c, + gint flags) { GnomeCanvasItemClass *canvas_item_class; @@ -1155,12 +1159,12 @@ day_view_main_item_draw (GnomeCanvasItem *canvas_item, } /* Fill in the vertical bars corresponding to the busy times from the - long events. */ + * long events. */ day_view_main_item_draw_long_events_in_vbars ( main_item, cr, x, y, width, height, draw_region); /* Draw the event borders and backgrounds, and the vertical bars - down the left edges. */ + * down the left edges. */ for (day = 0; day < day_view->days_shown; day++) day_view_main_item_draw_day_events ( main_item, cr, x, y, diff --git a/calendar/gui/e-day-view-time-item.c b/calendar/gui/e-day-view-time-item.c index e65dc4d617..928a91bbfb 100644 --- a/calendar/gui/e-day-view-time-item.c +++ b/calendar/gui/e-day-view-time-item.c @@ -35,17 +35,17 @@ #include /* The spacing between items in the time column. GRID_X_PAD is the space down - either side of the column, i.e. outside the main horizontal grid lines. - HOUR_L_PAD & HOUR_R_PAD are the spaces on the left & right side of the - big hour number (this is inside the horizontal grid lines). - MIN_X_PAD is the spacing either side of the minute number. The smaller - horizontal grid lines match with this. - 60_MIN_X_PAD is the space either side of the HH:MM display used when - we are displaying 60 mins per row (inside the main grid lines). - LARGE_HOUR_Y_PAD is the offset of the large hour string from the top of the - row. - SMALL_FONT_Y_PAD is the offset of the small time/minute string from the top - of the row. */ + * either side of the column, i.e. outside the main horizontal grid lines. + * HOUR_L_PAD & HOUR_R_PAD are the spaces on the left & right side of the + * big hour number (this is inside the horizontal grid lines). + * MIN_X_PAD is the spacing either side of the minute number. The smaller + * horizontal grid lines match with this. + * 60_MIN_X_PAD is the space either side of the HH:MM display used when + * we are displaying 60 mins per row (inside the main grid lines). + * LARGE_HOUR_Y_PAD is the offset of the large hour string from the top of the + * row. + * SMALL_FONT_Y_PAD is the offset of the small time/minute string from the top + * of the row. */ #define E_DVTMI_TIME_GRID_X_PAD 4 #define E_DVTMI_HOUR_L_PAD 4 #define E_DVTMI_HOUR_R_PAD 2 @@ -272,8 +272,8 @@ e_day_view_time_item_get_type (void) static void e_day_view_time_item_update (GnomeCanvasItem *item, - const cairo_matrix_t *i2c, - gint flags) + const cairo_matrix_t *i2c, + gint flags) { if (GNOME_CANVAS_ITEM_CLASS (parent_class)->update) (* GNOME_CANVAS_ITEM_CLASS (parent_class)->update) (item, i2c, flags); @@ -348,11 +348,11 @@ edvti_draw_zone (GnomeCanvasItem *canvas_item, if (time_divisions == 60) { /* The right edge of the complete time string in 60-min - divisions, e.g. "14:00" or "2 pm". */ + * divisions, e.g. "14:00" or "2 pm". */ minute_x2 = long_line_x2 - E_DVTMI_60_MIN_X_PAD; /* These aren't used for 60-minute divisions, but we initialize - them to keep gcc happy. */ + * them to keep gcc happy. */ short_line_x1 = 0; large_hour_x2 = 0; } else { @@ -363,7 +363,7 @@ edvti_draw_zone (GnomeCanvasItem *canvas_item, day_view->max_minute_width); /* The start of the short horizontal line between the periods - within each hour. */ + * within each hour. */ short_line_x1 = long_line_x2 - E_DVTMI_MIN_X_PAD * 2 - max_minute_or_suffix_width; @@ -434,8 +434,8 @@ edvti_draw_zone (GnomeCanvasItem *canvas_item, small_font_y_offset = E_DVTMI_SMALL_FONT_Y_PAD; /* Calculate the minimum y position of the first row we need to draw. - This is normally one row height above the 0 position, but if we - are using the large font we may have to go back a bit further. */ + * This is normally one row height above the 0 position, but if we + * are using the large font we may have to go back a bit further. */ start_y = 0 - MAX (day_view->row_height, (pango_font_metrics_get_ascent (large_font_metrics) + pango_font_metrics_get_descent (large_font_metrics)) / PANGO_SCALE + @@ -484,7 +484,7 @@ edvti_draw_zone (GnomeCanvasItem *canvas_item, } /* Step through each row, drawing the times and the horizontal lines - between them. */ + * between them. */ for (row = 0, row_y = 0 - y; row < day_view->rows && row_y < height; row++, row_y += day_view->row_height) { @@ -496,7 +496,7 @@ edvti_draw_zone (GnomeCanvasItem *canvas_item, midnight_day && midnight_month; /* If the row is above the first row we want to draw just - increment the time and skip to the next row. */ + * increment the time and skip to the next row. */ if (row_y < start_y) { e_day_view_time_item_increment_time ( &hour, &minute, time_divisions); @@ -504,15 +504,15 @@ edvti_draw_zone (GnomeCanvasItem *canvas_item, } /* Calculate the actual hour number to display. For 12-hour - format we convert 0-23 to 12-11am/12-11pm. */ + * format we convert 0-23 to 12-11am / 12 - 11pm. */ e_day_view_convert_time_to_display (day_view, hour, &display_hour, &suffix, &suffix_width); if (time_divisions == 60) { /* 60 minute intervals - draw a long horizontal line - between hours and display as one long string, - e.g. "14:00" or "2 pm". */ + * between hours and display as one long string, + * e.g. "14:00" or "2 pm". */ cairo_save (cr); gdk_cairo_set_source_color (cr, &dark); cairo_save (cr); @@ -555,8 +555,8 @@ edvti_draw_zone (GnomeCanvasItem *canvas_item, if (minute == 0) { /* On the hour - draw a long horizontal line - before the hour and display the hour in the - large font. */ + * before the hour and display the hour in the + * large font. */ cairo_save (cr); gdk_cairo_set_source_color (cr, &dark); @@ -591,7 +591,7 @@ edvti_draw_zone (GnomeCanvasItem *canvas_item, g_object_unref (layout); } else { /* Within the hour - draw a short line before - the time. */ + * the time. */ cairo_save (cr); gdk_cairo_set_source_color (cr, &dark); cairo_set_line_width (cr, 0.7); @@ -602,11 +602,11 @@ edvti_draw_zone (GnomeCanvasItem *canvas_item, } /* Normally we display the minute in each - interval, but when using 30-minute intervals - we don't display the '30'. */ + * interval, but when using 30-minute intervals + * we don't display the '30'. */ if (time_divisions != 30 || minute != 30) { /* In 12-hour format we display 'am' or 'pm' - instead of '00'. */ + * instead of '00'. */ if (show_midnight_date) strcpy (buffer, midnight_month); else if (minute == 0 @@ -671,32 +671,35 @@ e_day_view_time_item_draw (GnomeCanvasItem *canvas_item, } /* Increment the time by the 5/10/15/30/60 minute interval. - Note that time_divisions is never > 60, so we never have to - worry about adding more than 60 minutes. */ + * Note that time_divisions is never > 60, so we never have to + * worry about adding more than 60 minutes. */ static void -e_day_view_time_item_increment_time (gint *hour, - gint *minute, - gint time_divisions) +e_day_view_time_item_increment_time (gint *hour, + gint *minute, + gint time_divisions) { *minute += time_divisions; if (*minute >= 60) { *minute -= 60; /* Currently we never wrap around to the next day, but - we may do if we display extra timezones. */ + * we may do if we display extra timezones. */ *hour = (*hour + 1) % 24; } } static GnomeCanvasItem * -e_day_view_time_item_point (GnomeCanvasItem *item, double x, double y, - gint cx, gint cy) +e_day_view_time_item_point (GnomeCanvasItem *item, + gdouble x, + gdouble y, + gint cx, + gint cy) { return item; } static gint e_day_view_time_item_event (GnomeCanvasItem *item, - GdkEvent *event) + GdkEvent *event) { EDayViewTimeItem *time_item; @@ -885,7 +888,7 @@ e_day_view_time_item_show_popup_menu (EDayViewTimeItem *time_item, static void e_day_view_time_item_on_set_divisions (GtkWidget *item, - EDayViewTimeItem *time_item) + EDayViewTimeItem *time_item) { EDayView *day_view; ECalendarView *cal_view; @@ -905,7 +908,7 @@ e_day_view_time_item_on_set_divisions (GtkWidget *item, static void e_day_view_time_item_on_button_press (EDayViewTimeItem *time_item, - GdkEvent *event) + GdkEvent *event) { GdkWindow *window; EDayView *day_view; @@ -939,7 +942,7 @@ e_day_view_time_item_on_button_press (EDayViewTimeItem *time_item, static void e_day_view_time_item_on_button_release (EDayViewTimeItem *time_item, - GdkEvent *event) + GdkEvent *event) { EDayView *day_view; @@ -957,7 +960,7 @@ e_day_view_time_item_on_button_release (EDayViewTimeItem *time_item, static void e_day_view_time_item_on_motion_notify (EDayViewTimeItem *time_item, - GdkEvent *event) + GdkEvent *event) { EDayView *day_view; GnomeCanvas *canvas; @@ -986,7 +989,7 @@ e_day_view_time_item_on_motion_notify (EDayViewTimeItem *time_item, /* Returns the row corresponding to the y position, or -1. */ static gint e_day_view_time_item_convert_position_to_row (EDayViewTimeItem *time_item, - gint y) + gint y) { EDayView *day_view; gint row; @@ -1028,8 +1031,8 @@ e_day_view_time_item_set_day_view (EDayViewTimeItem *time_item, } /* Returns the minimum width needed for the column, by adding up all the - maximum widths of the strings. The string widths are all calculated in - the style_set handlers of EDayView and EDayViewTimeCanvas. */ + * maximum widths of the strings. The string widths are all calculated in + * the style_set handlers of EDayView and EDayViewTimeCanvas. */ gint e_day_view_time_item_get_column_width (EDayViewTimeItem *time_item) { @@ -1066,8 +1069,8 @@ e_day_view_time_item_get_column_width (EDayViewTimeItem *time_item) } /* Calculate the width of each time column, using the maximum of the - default format with large hour numbers, and the 60-min divisions - format which uses small text. */ + * default format with large hour numbers, and the 60-min divisions + * format which uses small text. */ max_suffix_width = MAX (day_view->am_string_width, day_view->pm_string_width); diff --git a/calendar/gui/e-day-view-top-item.c b/calendar/gui/e-day-view-top-item.c index 201d10394b..9b22fbe339 100644 --- a/calendar/gui/e-day-view-top-item.c +++ b/calendar/gui/e-day-view-top-item.c @@ -53,10 +53,10 @@ enum { static gpointer parent_class; /* This draws a little triangle to indicate that an event extends past - the days visible on screen. */ + * the days visible on screen. */ static void day_view_top_item_draw_triangle (EDayViewTopItem *top_item, - cairo_t *cr, + cairo_t *cr, gint x, gint y, gint w, @@ -79,7 +79,7 @@ day_view_top_item_draw_triangle (EDayViewTopItem *top_item, points[2].y = y + h - 1; /* If the height is odd we can use the same central point for both - lines. If it is even we use different end-points. */ + * lines. If it is even we use different end-points. */ c1 = c2 = y + (h / 2); if (h % 2 == 0) c1--; @@ -128,7 +128,7 @@ day_view_top_item_draw_triangle (EDayViewTopItem *top_item, static void day_view_top_item_draw_long_event (EDayViewTopItem *top_item, gint event_num, - cairo_t *cr, + cairo_t *cr, gint x, gint y, gint width, @@ -159,7 +159,7 @@ day_view_top_item_draw_long_event (EDayViewTopItem *top_item, model = e_calendar_view_get_model (E_CALENDAR_VIEW (day_view)); /* If the event is currently being dragged, don't draw it. It will - be drawn in the special drag items. */ + * be drawn in the special drag items. */ if (day_view->drag_event_day == E_DAY_VIEW_LONG_EVENT && day_view->drag_event_num == event_num) return; @@ -225,7 +225,7 @@ day_view_top_item_draw_long_event (EDayViewTopItem *top_item, draw_curved_rectangle (cr, x0, y0, rect_width, rect_height, radius); - cairo_set_source_rgb (cr, red/cc, green/cc, blue/cc); + cairo_set_source_rgb (cr, red / cc, green / cc, blue / cc); cairo_set_line_width (cr, 1.5); cairo_stroke (cr); cairo_restore (cr); @@ -245,13 +245,13 @@ day_view_top_item_draw_long_event (EDayViewTopItem *top_item, pat = cairo_pattern_create_linear (item_x - x + 5.5, item_y + 2.5 - y, item_x - x + 5, item_y - y + item_h + 7.5); - cairo_pattern_add_color_stop_rgba (pat, 1, red/cc, green/cc, blue/cc, 0.8); - cairo_pattern_add_color_stop_rgba (pat, 0, red/cc, green/cc, blue/cc, 0.4); + cairo_pattern_add_color_stop_rgba (pat, 1, red / cc, green / cc, blue / cc, 0.8); + cairo_pattern_add_color_stop_rgba (pat, 0, red / cc, green / cc, blue / cc, 0.4); cairo_set_source (cr, pat); cairo_fill_preserve (cr); cairo_pattern_destroy (pat); - cairo_set_source_rgba (cr, red/cc, green/cc, blue/cc, 0); + cairo_set_source_rgba (cr, red / cc, green / cc, blue / cc, 0); cairo_set_line_width (cr, 0.5); cairo_stroke (cr); cairo_restore (cr); @@ -287,7 +287,7 @@ day_view_top_item_draw_long_event (EDayViewTopItem *top_item, } /* If we are editing the event we don't show the icons or the start - & end times. */ + * & end times. */ if (day_view->editing_event_day == E_DAY_VIEW_LONG_EVENT && day_view->editing_event_num == event_num) { g_object_unref (comp); @@ -295,8 +295,8 @@ day_view_top_item_draw_long_event (EDayViewTopItem *top_item, } /* Determine the position of the label, so we know where to place the - icons. Note that since the top canvas never scrolls we don't need - to take the scroll offset into account. It will always be 0. */ + * icons. Note that since the top canvas never scrolls we don't need + * to take the scroll offset into account. It will always be 0. */ text_x = event->canvas_item->x1; /* Draw the start & end times, if necessary. */ @@ -312,7 +312,7 @@ day_view_top_item_draw_long_event (EDayViewTopItem *top_item, hour = offset / 60; minute = offset % 60; /* Calculate the actual hour number to display. For 12-hour - format we convert 0-23 to 12-11am/12-11pm. */ + * format we convert 0-23 to 12-11am/12-11pm. */ e_day_view_convert_time_to_display (day_view, hour, &display_hour, &suffix, &suffix_width); @@ -658,7 +658,7 @@ day_view_top_item_draw (GnomeCanvasItem *canvas_item, if (show_dates) { /* Draw the date. Set a clipping rectangle so we don't draw over the - next day. */ + * next day. */ for (day = 0; day < day_view->days_shown; day++) { e_day_view_top_item_get_day_label (day_view, day, buffer, sizeof (buffer)); clip_rect.x = day_view->day_offsets[day] - x; @@ -844,15 +844,15 @@ e_day_view_top_item_get_day_label (EDayView *day_view, if (day_view->date_format == E_DAY_VIEW_DATE_FULL) /* strftime format %A = full weekday name, %d = day of month, - %B = full month name. Don't use any other specifiers. */ + * %B = full month name. Don't use any other specifiers. */ format = _("%A %d %B"); else if (day_view->date_format == E_DAY_VIEW_DATE_ABBREVIATED) /* strftime format %a = abbreviated weekday name, %d = day of month, - %b = abbreviated month name. Don't use any other specifiers. */ + * %b = abbreviated month name. Don't use any other specifiers. */ format = _("%a %d %b"); else if (day_view->date_format == E_DAY_VIEW_DATE_NO_WEEKDAY) /* strftime format %d = day of month, %b = abbreviated month name. - Don't use any other specifiers. */ + * Don't use any other specifiers. */ format = _("%d %b"); else format = "%d"; diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c index 11378cc25a..efad7dbc6f 100644 --- a/calendar/gui/e-day-view.c +++ b/calendar/gui/e-day-view.c @@ -76,23 +76,23 @@ #define E_DAY_VIEW_AUTO_SCROLL_DELAY 5 /* The number of pixels the mouse has to be moved with the button down before - we start a drag. */ + * we start a drag. */ #define E_DAY_VIEW_DRAG_START_OFFSET 4 /* The amount we scroll the main canvas when the Page Up/Down keys are pressed, - as a fraction of the page size. */ + * as a fraction of the page size. */ #define E_DAY_VIEW_PAGE_STEP 0.5 /* The amount we scroll the main canvas when the mouse wheel buttons are - pressed, as a fraction of the page size. */ + * pressed, as a fraction of the page size. */ #define E_DAY_VIEW_WHEEL_MOUSE_STEP_SIZE 0.25 /* The timeout before we do a layout, so we don't do a layout for each event - we get from the server. */ + * we get from the server. */ #define E_DAY_VIEW_LAYOUT_TIMEOUT 100 /* How many rows can be shown at a top_canvas; there will be always + 2 for - caption item and DnD space */ + * caption item and DnD space */ #define E_DAY_VIEW_MAX_ROWS_AT_TOP 6 typedef struct { @@ -449,12 +449,12 @@ day_view_notify_time_divisions_cb (EDayView *day_view) day_view->need_layout[day] = TRUE; /* We need to update all the day event labels since the start & end - times may or may not be on row boundaries any more. */ + * times may or may not be on row boundaries any more. */ e_day_view_foreach_event (day_view, e_day_view_set_show_times_cb, NULL); /* We must layout the events before updating the scroll region, since - that will result in a redraw which would crash otherwise. */ + * that will result in a redraw which would crash otherwise. */ e_day_view_check_layout (day_view); gtk_widget_queue_draw (day_view->time_canvas); gtk_widget_queue_draw (day_view->main_canvas); @@ -664,7 +664,10 @@ e_day_view_class_init (EDayViewClass *class) } static void -time_range_changed_cb (ECalModel *model, time_t start_time, time_t end_time, gpointer user_data) +time_range_changed_cb (ECalModel *model, + time_t start_time, + time_t end_time, + gpointer user_data) { EDayView *day_view = E_DAY_VIEW (user_data); EDayViewTimeItem *eti; @@ -673,9 +676,9 @@ time_range_changed_cb (ECalModel *model, time_t start_time, time_t end_time, gpo g_return_if_fail (E_IS_DAY_VIEW (day_view)); /* Calculate the first day that should be shown, based on start_time - and the days_shown setting. If we are showing 1 day it is just the - start of the day given by start_time, otherwise it is the previous - work-week start day. */ + * and the days_shown setting. If we are showing 1 day it is just the + * start of the day given by start_time, otherwise it is the previous + * work-week start day. */ if (!day_view->work_week_view) { lower = time_day_begin_with_zone (start_time, e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); } else { @@ -706,7 +709,8 @@ time_range_changed_cb (ECalModel *model, time_t start_time, time_t end_time, gpo } static void -process_component (EDayView *day_view, ECalModelComponent *comp_data) +process_component (EDayView *day_view, + ECalModelComponent *comp_data) { const gchar *uid; gchar *rid = NULL; @@ -742,7 +746,8 @@ process_component (EDayView *day_view, ECalModelComponent *comp_data) } static void -update_row (EDayView *day_view, gint row) +update_row (EDayView *day_view, + gint row) { ECalModelComponent *comp_data; ECalModel *model; @@ -778,7 +783,9 @@ update_row (EDayView *day_view, gint row) } static void -model_row_changed_cb (ETableModel *etm, gint row, gpointer user_data) +model_row_changed_cb (ETableModel *etm, + gint row, + gpointer user_data) { EDayView *day_view = E_DAY_VIEW (user_data); @@ -792,7 +799,10 @@ model_row_changed_cb (ETableModel *etm, gint row, gpointer user_data) } static void -model_cell_changed_cb (ETableModel *etm, gint col, gint row, gpointer user_data) +model_cell_changed_cb (ETableModel *etm, + gint col, + gint row, + gpointer user_data) { EDayView *day_view = E_DAY_VIEW (user_data); @@ -806,7 +816,10 @@ model_cell_changed_cb (ETableModel *etm, gint col, gint row, gpointer user_data) } static void -model_rows_inserted_cb (ETableModel *etm, gint row, gint count, gpointer user_data) +model_rows_inserted_cb (ETableModel *etm, + gint row, + gint count, + gpointer user_data) { EDayView *day_view = E_DAY_VIEW (user_data); ECalModel *model; @@ -839,7 +852,9 @@ model_rows_inserted_cb (ETableModel *etm, gint row, gint count, gpointer user_da } static void -model_comps_deleted_cb (ETableModel *etm, gpointer data, gpointer user_data) +model_comps_deleted_cb (ETableModel *etm, + gpointer data, + gpointer user_data) { EDayView *day_view = E_DAY_VIEW (user_data); GSList *l, *list = data; @@ -879,8 +894,10 @@ model_comps_deleted_cb (ETableModel *etm, gpointer data, gpointer user_data) } static void -timezone_changed_cb (ECalModel *cal_model, icaltimezone *old_zone, - icaltimezone *new_zone, gpointer user_data) +timezone_changed_cb (ECalModel *cal_model, + icaltimezone *old_zone, + icaltimezone *new_zone, + gpointer user_data) { struct icaltimetype tt; time_t lower; @@ -900,7 +917,7 @@ timezone_changed_cb (ECalModel *cal_model, icaltimezone *old_zone, return; /* Recalculate the new start of the first day. We just use exactly - the same time, but with the new timezone. */ + * the same time, but with the new timezone. */ tt = icaltime_from_timet_with_zone (day_view->lower, FALSE, old_zone); @@ -948,8 +965,8 @@ e_day_view_init (EDayView *day_view) day_view->rows_in_top_display = 0; /* Note that these don't work yet. It would need a few fixes to the - way event->start_minute and event->end_minute are used, and there - may be problems with events that go outside the visible times. */ + * way event->start_minute and event->end_minute are used, and there + * may be problems with events that go outside the visible times. */ day_view->first_hour_shown = 0; day_view->first_minute_shown = 0; day_view->last_hour_shown = 24; @@ -1236,28 +1253,35 @@ e_day_view_init (EDayView *day_view) } static void -init_model (EDayView *day_view, ECalModel *model) +init_model (EDayView *day_view, + ECalModel *model) { /* connect to ECalModel's signals */ - g_signal_connect (G_OBJECT (model), "time_range_changed", - G_CALLBACK (time_range_changed_cb), day_view); - g_signal_connect (G_OBJECT (model), "model_row_changed", - G_CALLBACK (model_row_changed_cb), day_view); - g_signal_connect (G_OBJECT (model), "model_cell_changed", - G_CALLBACK (model_cell_changed_cb), day_view); - g_signal_connect (G_OBJECT (model), "model_rows_inserted", - G_CALLBACK (model_rows_inserted_cb), day_view); - g_signal_connect (G_OBJECT (model), "comps_deleted", - G_CALLBACK (model_comps_deleted_cb), day_view); - g_signal_connect (G_OBJECT (model), "timezone_changed", - G_CALLBACK (timezone_changed_cb), day_view); + g_signal_connect ( + model, "time_range_changed", + G_CALLBACK (time_range_changed_cb), day_view); + g_signal_connect ( + model, "model_row_changed", + G_CALLBACK (model_row_changed_cb), day_view); + g_signal_connect ( + model, "model_cell_changed", + G_CALLBACK (model_cell_changed_cb), day_view); + g_signal_connect ( + model, "model_rows_inserted", + G_CALLBACK (model_rows_inserted_cb), day_view); + g_signal_connect ( + model, "comps_deleted", + G_CALLBACK (model_comps_deleted_cb), day_view); + g_signal_connect ( + model, "timezone_changed", + G_CALLBACK (timezone_changed_cb), day_view); } /* Turn off the background of the canvas windows. This reduces flicker - considerably when scrolling. (Why isn't it in GnomeCanvas?). */ + * considerably when scrolling. (Why isn't it in GnomeCanvas?). */ static void e_day_view_on_canvas_realized (GtkWidget *widget, - EDayView *day_view) + EDayView *day_view) { GdkWindow *window; @@ -1379,7 +1403,8 @@ e_day_view_realize (GtkWidget *widget) } static void -e_day_view_set_colors (EDayView *day_view, GtkWidget *widget) +e_day_view_set_colors (EDayView *day_view, + GtkWidget *widget) { GtkStyle *style; @@ -1425,7 +1450,9 @@ e_day_view_unrealize (GtkWidget *widget) } static GdkColor -e_day_view_get_text_color (EDayView *day_view, EDayViewEvent *event, GtkWidget *widget) +e_day_view_get_text_color (EDayView *day_view, + EDayViewEvent *event, + GtkWidget *widget) { GtkStyle *style; GdkColor bg_color; @@ -1445,21 +1472,22 @@ e_day_view_get_text_color (EDayView *day_view, EDayViewEvent *event, GtkWidget * style = gtk_widget_get_style (widget); - if ((red/cc > 0.7) || (green/cc > 0.7) || (blue/cc > 0.7 )) + if ((red / cc > 0.7) || (green / cc > 0.7) || (blue / cc > 0.7 )) return style->black; else return style->white; } static void -e_day_view_update_top_scroll (EDayView *day_view, gboolean scroll_to_top) +e_day_view_update_top_scroll (EDayView *day_view, + gboolean scroll_to_top) { GtkAllocation allocation; gint top_rows, top_canvas_height; gdouble old_x2, old_y2, new_x2, new_y2; /* Set the height of the top canvas based on the row height and the - number of rows needed (min 1 + 1 for the dates + 1 space for DnD).*/ + * number of rows needed (min 1 + 1 for the dates + 1 space for DnD).*/ top_rows = MAX (1, day_view->rows_in_top_display); top_canvas_height = (top_rows + 1) * day_view->top_row_height; if (top_rows <= E_DAY_VIEW_MAX_ROWS_AT_TOP) { @@ -1494,7 +1522,7 @@ e_day_view_update_top_scroll (EDayView *day_view, gboolean scroll_to_top) static void e_day_view_style_set (GtkWidget *widget, - GtkStyle *previous_style) + GtkStyle *previous_style) { EDayView *day_view; gint hour; @@ -1699,7 +1727,7 @@ e_day_view_recalc_main_canvas_size (EDayView *day_view) e_day_view_recalc_cell_sizes (day_view); /* Scroll to the start of the working day, if this is the initial - allocation. */ + * allocation. */ if (day_view->scroll_to_work_day) { scroll_y = e_day_view_convert_time_to_position ( day_view, work_day_start_hour, work_day_start_minute); @@ -1709,7 +1737,7 @@ e_day_view_recalc_main_canvas_size (EDayView *day_view) } /* Flag that we need to reshape the events. Note that changes in height - don't matter, since the rows are always the same height. */ + * don't matter, since the rows are always the same height. */ if (need_reshape) { day_view->long_events_need_reshape = TRUE; for (day = 0; day < E_DAY_VIEW_MAX_DAYS; day++) @@ -1721,21 +1749,19 @@ e_day_view_recalc_main_canvas_size (EDayView *day_view) /* This recalculates the sizes of each column. */ static void -e_day_view_size_allocate (GtkWidget *widget, GtkAllocation *allocation) +e_day_view_size_allocate (GtkWidget *widget, + GtkAllocation *allocation) { -#if 0 - g_print ("In e_day_view_size_allocate\n"); -#endif (*GTK_WIDGET_CLASS (e_day_view_parent_class)->size_allocate) (widget, allocation); e_day_view_recalc_main_canvas_size (E_DAY_VIEW (widget)); } static void -e_day_view_recalc_cell_sizes (EDayView *day_view) +e_day_view_recalc_cell_sizes (EDayView *day_view) { /* An array of dates, one for each month in the year 2000. They must - all be Sundays. */ + * all be Sundays. */ static const gint days[12] = { 23, 20, 19, 23, 21, 18, 23, 20, 17, 22, 19, 24 }; gfloat width, offset; @@ -1756,8 +1782,8 @@ e_day_view_recalc_cell_sizes (EDayView *day_view) layout = pango_layout_new (pango_context); /* Calculate the column sizes, using floating point so that pixels - get divided evenly. Note that we use one more element than the - number of columns, to make it easy to get the column widths. */ + * get divided evenly. Note that we use one more element than the + * number of columns, to make it easy to get the column widths. */ width = allocation.width; if (day_view->days_shown == 1) width = MAX (width, day_view->max_cols * (E_DAY_VIEW_MIN_DAY_COL_WIDTH + E_DAY_VIEW_GAP_WIDTH) - E_DAY_VIEW_MIN_DAY_COL_WIDTH - 1); @@ -1774,9 +1800,9 @@ e_day_view_recalc_cell_sizes (EDayView *day_view) } /* Determine which date format to use, based on the column widths. - We want to check the widths using the longest full or abbreviated - month name and the longest full or abbreviated weekday name, as - appropriate. */ + * We want to check the widths using the longest full or abbreviated + * month name and the longest full or abbreviated weekday name, as + * appropriate. */ max_width = day_view->day_widths[0]; memset (&date_tm, 0, sizeof (date_tm)); @@ -1789,7 +1815,7 @@ e_day_view_recalc_cell_sizes (EDayView *day_view) date_tm.tm_wday = day_view->longest_weekday_name; date_tm.tm_isdst = -1; /* strftime format %A = full weekday name, %d = day of month, - %B = full month name. Don't use any other specifiers. */ + * %B = full month name. Don't use any other specifiers. */ e_utf8_strftime (buffer, sizeof (buffer), _("%A %d %B"), &date_tm); pango_layout_set_text (layout, buffer, -1); pango_layout_get_pixel_size (layout, &pango_width, NULL); @@ -1806,7 +1832,7 @@ e_day_view_recalc_cell_sizes (EDayView *day_view) date_tm.tm_wday = day_view->longest_abbreviated_weekday_name; date_tm.tm_isdst = -1; /* strftime format %a = abbreviated weekday name, %d = day of month, - %b = abbreviated month name. Don't use any other specifiers. */ + * %b = abbreviated month name. Don't use any other specifiers. */ e_utf8_strftime (buffer, sizeof (buffer), _("%a %d %b"), &date_tm); pango_layout_set_text (layout, buffer, -1); pango_layout_get_pixel_size (layout, &pango_width, NULL); @@ -1822,7 +1848,7 @@ e_day_view_recalc_cell_sizes (EDayView *day_view) date_tm.tm_wday = 0; date_tm.tm_isdst = -1; /* strftime format %d = day of month, %b = abbreviated month name. - Don't use any other specifiers. */ + * Don't use any other specifiers. */ e_utf8_strftime (buffer, sizeof (buffer), _("%d %b"), &date_tm); pango_layout_set_text (layout, buffer, -1); pango_layout_get_pixel_size (layout, &pango_width, NULL); @@ -1837,7 +1863,8 @@ exit: } static gint -e_day_view_focus_in (GtkWidget *widget, GdkEventFocus *event) +e_day_view_focus_in (GtkWidget *widget, + GdkEventFocus *event) { EDayView *day_view; @@ -1863,7 +1890,7 @@ e_day_view_focus_in (GtkWidget *widget, GdkEventFocus *event) if (e_calendar_view_get_visible_time_range (E_CALENDAR_VIEW (day_view), &my_start, &my_end) && model_start == my_start && model_end == my_end) { /* update only when the same time range is set in a view and in a model; - otherwise time range change invokes also query update */ + * otherwise time range change invokes also query update */ e_day_view_recalc_day_starts (day_view, day_view->lower); e_day_view_update_query (day_view); } @@ -1876,7 +1903,8 @@ e_day_view_focus_in (GtkWidget *widget, GdkEventFocus *event) } static gint -e_day_view_focus_out (GtkWidget *widget, GdkEventFocus *event) +e_day_view_focus_out (GtkWidget *widget, + GdkEventFocus *event) { EDayView *day_view; @@ -1899,13 +1927,13 @@ e_day_view_focus_out (GtkWidget *widget, GdkEventFocus *event) } /* This calls a given function for each event instance (in both views). - If the callback returns FALSE the iteration is stopped. - Note that it is safe for the callback to remove the event (since we - step backwards through the arrays). */ + * If the callback returns FALSE the iteration is stopped. + * Note that it is safe for the callback to remove the event (since we + * step backwards through the arrays). */ static void -e_day_view_foreach_event (EDayView *day_view, - EDayViewForeachEventCallback callback, - gpointer data) +e_day_view_foreach_event (EDayView *day_view, + EDayViewForeachEventCallback callback, + gpointer data) { gint day, event_num; @@ -1928,14 +1956,14 @@ e_day_view_foreach_event (EDayView *day_view, } /* This calls a given function for each event instance that matches the given - uid. If the callback returns FALSE the iteration is stopped. - Note that it is safe for the callback to remove the event (since we - step backwards through the arrays). */ + * uid. If the callback returns FALSE the iteration is stopped. + * Note that it is safe for the callback to remove the event (since we + * step backwards through the arrays). */ static void e_day_view_foreach_event_with_uid (EDayView *day_view, - const gchar *uid, - EDayViewForeachEventCallback callback, - gpointer data) + const gchar *uid, + EDayViewForeachEventCallback callback, + gpointer data) { EDayViewEvent *event; gint day, event_num; @@ -1978,9 +2006,9 @@ e_day_view_foreach_event_with_uid (EDayView *day_view, static gboolean e_day_view_remove_event_cb (EDayView *day_view, - gint day, - gint event_num, - gpointer data) + gint day, + gint event_num, + gpointer data) { EDayViewEvent *event; @@ -2007,7 +2035,7 @@ e_day_view_remove_event_cb (EDayView *day_view, return TRUE; /* If we were editing this event, set editing_event_day to -1 so - on_editing_stopped doesn't try to update the event. */ + * on_editing_stopped doesn't try to update the event. */ if (day_view->editing_event_num == event_num && day_view->editing_event_day == day) { day_view->editing_event_num = -1; day_view->editing_event_day = -1; @@ -2064,8 +2092,8 @@ set_text_as_bold (EDayViewEvent *event) } /* The attendee has not yet accepted the meeting, display the summary as bolded. - If the attendee is not present, it might have come through a mailing list. - In that case, we never show the meeting as bold even if it is unaccepted. */ + * If the attendee is not present, it might have come through a mailing list. + * In that case, we never show the meeting as bold even if it is unaccepted. */ if (at && (at->status == ICAL_PARTSTAT_NEEDSACTION)) gnome_canvas_item_set (event->canvas_item, "bold", TRUE, NULL); @@ -2075,11 +2103,11 @@ set_text_as_bold (EDayViewEvent *event) } /* This updates the text shown for an event. If the event start or end do not - lie on a row boundary, the time is displayed before the summary. */ + * lie on a row boundary, the time is displayed before the summary. */ static void e_day_view_update_event_label (EDayView *day_view, - gint day, - gint event_num) + gint day, + gint event_num) { EDayViewEvent *event; ECalendarView *cal_view; @@ -2147,7 +2175,7 @@ e_day_view_update_event_label (EDayView *day_view, static void e_day_view_update_long_event_label (EDayView *day_view, - gint event_num) + gint event_num) { EDayViewEvent *event; const gchar *summary; @@ -2178,13 +2206,13 @@ e_day_view_update_long_event_label (EDayView *day_view, } /* Finds the day and index of the event with the given canvas item. - If is is a long event, -1 is returned as the day. - Returns TRUE if the event was found. */ + * If is is a long event, -1 is returned as the day. + * Returns TRUE if the event was found. */ gboolean e_day_view_find_event_from_item (EDayView *day_view, - GnomeCanvasItem *item, - gint *day_return, - gint *event_num_return) + GnomeCanvasItem *item, + gint *day_return, + gint *event_num_return) { EDayViewEvent *event; gint day, event_num; @@ -2217,19 +2245,19 @@ e_day_view_find_event_from_item (EDayView *day_view, } /* Finds the day and index of the event with the given uid. - If is is a long event, E_DAY_VIEW_LONG_EVENT is returned as the day. - Returns TRUE if an event with the uid was found. - Note that for recurring events there may be several EDayViewEvents, one - for each instance, all with the same iCalObject and uid. So only use this - function if you know the event doesn't recur or you are just checking to - see if any events with the uid exist. */ + * If is is a long event, E_DAY_VIEW_LONG_EVENT is returned as the day. + * Returns TRUE if an event with the uid was found. + * Note that for recurring events there may be several EDayViewEvents, one + * for each instance, all with the same iCalObject and uid. So only use this + * function if you know the event doesn't recur or you are just checking to + * see if any events with the uid exist. */ static gboolean e_day_view_find_event_from_uid (EDayView *day_view, - ECalClient *client, - const gchar *uid, - const gchar *rid, - gint *day_return, - gint *event_num_return) + ECalClient *client, + const gchar *uid, + const gchar *rid, + gint *day_return, + gint *event_num_return) { EDayViewEvent *event; gint day, event_num; @@ -2294,9 +2322,9 @@ e_day_view_find_event_from_uid (EDayView *day_view, } static void -e_day_view_set_selected_time_range_in_top_visible (EDayView *day_view, - time_t start_time, - time_t end_time) +e_day_view_set_selected_time_range_in_top_visible (EDayView *day_view, + time_t start_time, + time_t end_time) { gint start_row, start_col, end_row, end_col; gboolean need_redraw = FALSE, start_in_grid, end_in_grid; @@ -2342,9 +2370,9 @@ e_day_view_set_selected_time_range_in_top_visible (EDayView *day_view, } static void -e_day_view_set_selected_time_range_visible (EDayView *day_view, - time_t start_time, - time_t end_time) +e_day_view_set_selected_time_range_visible (EDayView *day_view, + time_t start_time, + time_t end_time) { ECalModel *model; gint work_day_start_hour; @@ -2369,8 +2397,8 @@ e_day_view_set_selected_time_range_visible (EDayView *day_view, &end_row); /* If either of the times isn't in the grid, or the selection covers - an entire day, we set the selection to 1 row from the start of the - working day, in the day corresponding to the start time. */ + * an entire day, we set the selection to 1 row from the start of the + * working day, in the day corresponding to the start time. */ if (!start_in_grid || !end_in_grid || (start_row == 0 && end_row == day_view->rows - 1)) { end_col = start_col; @@ -2406,8 +2434,8 @@ e_day_view_set_selected_time_range_visible (EDayView *day_view, /* Finds the start of the working week which includes the given time. */ static time_t -e_day_view_find_work_week_start (EDayView *day_view, - time_t start_time) +e_day_view_find_work_week_start (EDayView *day_view, + time_t start_time) { GDate date; ECalModel *model; @@ -2422,14 +2450,14 @@ e_day_view_find_work_week_start (EDayView *day_view, time_to_gdate_with_zone (&date, start_time, e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); /* The start of the work-week is the first working day after the - week start day. */ + * week start day. */ /* Get the weekday corresponding to start_time, 0 (Sun) to 6 (Sat). */ weekday = g_date_get_weekday (&date) % 7; /* Calculate the first working day of the week, 0 (Sun) to 6 (Sat). - It will automatically default to the week start day if no days - are set as working days. */ + * It will automatically default to the week start day if no days + * are set as working days. */ day = (week_start_day + 1) % 7; for (i = 0; i < 7; i++) { if (day_view->working_days & (1 << day)) @@ -2454,12 +2482,12 @@ e_day_view_find_work_week_start (EDayView *day_view, } /* This sets the selected time range. If the start_time & end_time are not equal - and are both visible in the view, then the selection is set to those times, - otherwise it is set to 1 hour from the start of the working day. */ + * and are both visible in the view, then the selection is set to those times, + * otherwise it is set to 1 hour from the start of the working day. */ static void -e_day_view_set_selected_time_range (ECalendarView *cal_view, - time_t start_time, - time_t end_time) +e_day_view_set_selected_time_range (ECalendarView *cal_view, + time_t start_time, + time_t end_time) { ECalModel *model; EDayView *day_view; @@ -2484,8 +2512,8 @@ e_day_view_set_selected_time_range (ECalendarView *cal_view, &end_row); /* If either of the times isn't in the grid, or the selection covers - an entire day, we set the selection to 1 row from the start of the - working day, in the day corresponding to the start time. */ + * an entire day, we set the selection to 1 row from the start of the + * working day, in the day corresponding to the start time. */ if (!start_in_grid || !end_in_grid || (start_row == 0 && end_row == day_view->rows - 1)) { end_col = start_col; @@ -2521,7 +2549,9 @@ e_day_view_set_selected_time_range (ECalendarView *cal_view, /* Returns the selected time range. */ static gboolean -e_day_view_get_selected_time_range (ECalendarView *cal_view, time_t *start_time, time_t *end_time) +e_day_view_get_selected_time_range (ECalendarView *cal_view, + time_t *start_time, + time_t *end_time) { gint start_col, start_row, end_col, end_row; time_t start, end; @@ -2540,7 +2570,7 @@ e_day_view_get_selected_time_range (ECalendarView *cal_view, time_t *start_time, } /* Check if the selection is only in the top canvas, in which case - we can simply use the day_starts array. */ + * we can simply use the day_starts array. */ if (day_view->selection_in_top_canvas) { start = day_view->day_starts[start_col]; end = day_view->day_starts[end_col + 1]; @@ -2561,9 +2591,9 @@ e_day_view_get_selected_time_range (ECalendarView *cal_view, time_t *start_time, /* Gets the visible time range. Returns FALSE if no time range has been set. */ static gboolean -e_day_view_get_visible_time_range (ECalendarView *cal_view, - time_t *start_time, - time_t *end_time) +e_day_view_get_visible_time_range (ECalendarView *cal_view, + time_t *start_time, + time_t *end_time) { EDayView *day_view = E_DAY_VIEW (cal_view); @@ -2579,7 +2609,7 @@ e_day_view_get_visible_time_range (ECalendarView *cal_view, static void e_day_view_recalc_day_starts (EDayView *day_view, - time_t start_time) + time_t start_time) { gint day; gchar *str; @@ -2612,9 +2642,9 @@ e_day_view_recalc_day_starts (EDayView *day_view, } /* Whether we are displaying a work-week, in which case the display always - starts on the first day of the working week. */ + * starts on the first day of the working week. */ gboolean -e_day_view_get_work_week_view (EDayView *day_view) +e_day_view_get_work_week_view (EDayView *day_view) { g_return_val_if_fail (E_IS_DAY_VIEW (day_view), FALSE); @@ -2622,8 +2652,8 @@ e_day_view_get_work_week_view (EDayView *day_view) } void -e_day_view_set_work_week_view (EDayView *day_view, - gboolean work_week_view) +e_day_view_set_work_week_view (EDayView *day_view, + gboolean work_week_view) { g_return_if_fail (E_IS_DAY_VIEW (day_view)); @@ -2637,7 +2667,7 @@ e_day_view_set_work_week_view (EDayView *day_view, } gint -e_day_view_get_days_shown (EDayView *day_view) +e_day_view_get_days_shown (EDayView *day_view) { g_return_val_if_fail (E_IS_DAY_VIEW (day_view), -1); @@ -2645,8 +2675,8 @@ e_day_view_get_days_shown (EDayView *day_view) } void -e_day_view_set_days_shown (EDayView *day_view, - gint days_shown) +e_day_view_set_days_shown (EDayView *day_view, + gint days_shown) { g_return_if_fail (E_IS_DAY_VIEW (day_view)); g_return_if_fail (days_shown >= 1); @@ -2668,7 +2698,7 @@ e_day_view_set_days_shown (EDayView *day_view, } /* This specifies the working days in the week. The value is a bitwise - combination of day flags. Defaults to Mon-Fri. */ + * combination of day flags. Defaults to Mon-Fri. */ EDayViewDays e_day_view_get_working_days (EDayView *day_view) { @@ -2692,14 +2722,14 @@ e_day_view_set_working_days (EDayView *day_view, e_day_view_recalc_work_week (day_view); /* We have to do this, as the new working days may have no effect on - the days shown, but we still want the background color to change. */ + * the days shown, but we still want the background color to change. */ gtk_widget_queue_draw (day_view->main_canvas); g_object_notify (G_OBJECT (day_view), "working-days"); } static void -e_day_view_recalc_work_week_days_shown (EDayView *day_view) +e_day_view_recalc_work_week_days_shown (EDayView *day_view) { ECalModel *model; gint week_start_day; @@ -2728,7 +2758,7 @@ e_day_view_recalc_work_week_days_shown (EDayView *day_view) last_day = (last_day + 6) % 7; } /* Now calculate the days we need to show to include all the - working days in the week. Add 1 to make it inclusive. */ + * working days in the week. Add 1 to make it inclusive. */ days_shown = (last_day + 7 - first_day) % 7 + 1; } else { /* If no working days are set, just use 7. */ @@ -2814,7 +2844,7 @@ e_day_view_marcus_bains_set_time_bar_color (EDayView *day_view, /* Whether we display event end times in the main canvas. */ gboolean -e_day_view_get_show_event_end_times (EDayView *day_view) +e_day_view_get_show_event_end_times (EDayView *day_view) { g_return_val_if_fail (E_IS_DAY_VIEW (day_view), TRUE); @@ -2822,8 +2852,8 @@ e_day_view_get_show_event_end_times (EDayView *day_view) } void -e_day_view_set_show_event_end_times (EDayView *day_view, - gboolean show) +e_day_view_set_show_event_end_times (EDayView *day_view, + gboolean show) { g_return_if_fail (E_IS_DAY_VIEW (day_view)); @@ -2836,10 +2866,10 @@ e_day_view_set_show_event_end_times (EDayView *day_view, /* This is a callback used to update all day event labels. */ static gboolean -e_day_view_set_show_times_cb (EDayView *day_view, - gint day, - gint event_num, - gpointer data) +e_day_view_set_show_times_cb (EDayView *day_view, + gint day, + gint event_num, + gpointer data) { if (day != E_DAY_VIEW_LONG_EVENT) { e_day_view_update_event_label (day_view, day, event_num); @@ -2849,7 +2879,7 @@ e_day_view_set_show_times_cb (EDayView *day_view, } static void -e_day_view_recalc_work_week (EDayView *day_view) +e_day_view_recalc_work_week (EDayView *day_view) { time_t lower; @@ -2890,7 +2920,7 @@ e_day_view_update_scroll_regions (EDayView *day_view) day_view->time_canvas, &time_canvas_allocation); /* Set the scroll region of the time canvas to its allocated width, - but with the height the same as the main canvas. */ + * but with the height the same as the main canvas. */ gnome_canvas_get_scroll_region ( GNOME_CANVAS (day_view->time_canvas), NULL, NULL, &old_x2, &old_y2); @@ -2902,7 +2932,7 @@ e_day_view_update_scroll_regions (EDayView *day_view) 0, 0, new_x2, new_y2); /* Set the scroll region of the main canvas to its allocated width, - but with the height depending on the number of rows needed. */ + * but with the height depending on the number of rows needed. */ gnome_canvas_get_scroll_region ( GNOME_CANVAS (day_view->main_canvas), NULL, NULL, &old_x2, &old_y2); @@ -2926,9 +2956,9 @@ e_day_view_update_scroll_regions (EDayView *day_view) } /* This recalculates the number of rows to display, based on the time range - shown and the minutes per row. */ + * shown and the minutes per row. */ static void -e_day_view_recalc_num_rows (EDayView *day_view) +e_day_view_recalc_num_rows (EDayView *day_view) { ECalendarView *cal_view; gint time_divisions; @@ -2945,12 +2975,12 @@ e_day_view_recalc_num_rows (EDayView *day_view) } /* Converts an hour and minute to a row in the canvas. Note that if we aren't - showing all 24 hours of the day, the returned row may be negative or - greater than day_view->rows. */ + * showing all 24 hours of the day, the returned row may be negative or + * greater than day_view->rows. */ gint -e_day_view_convert_time_to_row (EDayView *day_view, - gint hour, - gint minute) +e_day_view_convert_time_to_row (EDayView *day_view, + gint hour, + gint minute) { ECalendarView *cal_view; gint time_divisions; @@ -2971,9 +3001,9 @@ e_day_view_convert_time_to_row (EDayView *day_view, /* Converts an hour and minute to a y coordinate in the canvas. */ gint -e_day_view_convert_time_to_position (EDayView *day_view, - gint hour, - gint minute) +e_day_view_convert_time_to_position (EDayView *day_view, + gint hour, + gint minute) { ECalendarView *cal_view; gint time_divisions; @@ -2992,8 +3022,8 @@ e_day_view_convert_time_to_position (EDayView *day_view, static gboolean e_day_view_on_top_canvas_button_press (GtkWidget *widget, - GdkEventButton *event, - EDayView *day_view) + GdkEventButton *event, + EDayView *day_view) { gint event_x, event_y, day, event_num; ECalendarViewPosition pos; @@ -3010,9 +3040,9 @@ e_day_view_on_top_canvas_button_press (GtkWidget *widget, day_view->drag_event_num = -1; /* Convert the coords to the main canvas window, or return if the - window is not found. */ + * window is not found. */ if (!e_day_view_convert_event_coords ( - day_view, (GdkEvent*) event, window, &event_x, &event_y)) + day_view, (GdkEvent *) event, window, &event_x, &event_y)) return FALSE; pos = e_day_view_convert_position_in_top_canvas (day_view, @@ -3076,10 +3106,10 @@ e_day_view_on_top_canvas_button_press (GtkWidget *widget, static gboolean e_day_view_convert_event_coords (EDayView *day_view, - GdkEvent *event, - GdkWindow *window, - gint *x_return, - gint *y_return) + GdkEvent *event, + GdkWindow *window, + gint *x_return, + gint *y_return) { gint event_x, event_y, win_x, win_y; GdkWindow *event_window;; @@ -3126,8 +3156,8 @@ e_day_view_convert_event_coords (EDayView *day_view, static gboolean e_day_view_on_main_canvas_button_press (GtkWidget *widget, - GdkEventButton *event, - EDayView *day_view) + GdkEventButton *event, + EDayView *day_view) { gint event_x, event_y, row, day, event_num; ECalendarViewPosition pos; @@ -3148,9 +3178,9 @@ e_day_view_on_main_canvas_button_press (GtkWidget *widget, day_view->drag_event_num = -1; /* Convert the coords to the main canvas window, or return if the - window is not found. */ + * window is not found. */ if (!e_day_view_convert_event_coords ( - day_view, (GdkEvent*) event, window, &event_x, &event_y)) + day_view, (GdkEvent *) event, window, &event_x, &event_y)) return FALSE; /* Find out where the mouse is. */ @@ -3218,8 +3248,8 @@ e_day_view_on_main_canvas_button_press (GtkWidget *widget, static gboolean e_day_view_on_main_canvas_scroll (GtkWidget *widget, - GdkEventScroll *scroll, - EDayView *day_view) + GdkEventScroll *scroll, + EDayView *day_view) { switch (scroll->direction) { case GDK_SCROLL_UP: @@ -3237,8 +3267,8 @@ e_day_view_on_main_canvas_scroll (GtkWidget *widget, static gboolean e_day_view_on_top_canvas_scroll (GtkWidget *widget, - GdkEventScroll *scroll, - EDayView *day_view) + GdkEventScroll *scroll, + EDayView *day_view) { switch (scroll->direction) { case GDK_SCROLL_UP: @@ -3253,9 +3283,9 @@ e_day_view_on_top_canvas_scroll (GtkWidget *widget, } static gboolean -e_day_view_on_time_canvas_scroll (GtkWidget *widget, - GdkEventScroll *scroll, - EDayView *day_view) +e_day_view_on_time_canvas_scroll (GtkWidget *widget, + GdkEventScroll *scroll, + EDayView *day_view) { GtkWidget *tool_window = g_object_get_data ((GObject *)day_view, "tooltip-window"); @@ -3277,12 +3307,12 @@ e_day_view_on_time_canvas_scroll (GtkWidget *widget, } static gboolean -e_day_view_on_long_event_button_press (EDayView *day_view, - gint event_num, - GdkEventButton *event, - ECalendarViewPosition pos, - gint event_x, - gint event_y) +e_day_view_on_long_event_button_press (EDayView *day_view, + gint event_num, + GdkEventButton *event, + ECalendarViewPosition pos, + gint event_x, + gint event_y) { if (event->button == 1) { if (event->type == GDK_BUTTON_PRESS) { @@ -3316,13 +3346,13 @@ e_day_view_on_long_event_button_press (EDayView *day_view, } static gboolean -e_day_view_on_event_button_press (EDayView *day_view, - gint day, - gint event_num, - GdkEventButton *event, - ECalendarViewPosition pos, - gint event_x, - gint event_y) +e_day_view_on_event_button_press (EDayView *day_view, + gint day, + gint event_num, + GdkEventButton *event, + ECalendarViewPosition pos, + gint event_x, + gint event_y) { if (event->button == 1) { if (event->type == GDK_BUTTON_PRESS) { @@ -3357,11 +3387,11 @@ e_day_view_on_event_button_press (EDayView *day_view, static void e_day_view_on_long_event_click (EDayView *day_view, - gint event_num, - GdkEventButton *bevent, - ECalendarViewPosition pos, - gint event_x, - gint event_y) + gint event_num, + GdkEventButton *bevent, + ECalendarViewPosition pos, + gint event_x, + gint event_y) { EDayViewEvent *event; GtkLayout *layout; @@ -3381,7 +3411,7 @@ e_day_view_on_long_event_click (EDayView *day_view, /* Ignore clicks on the EText while editing. */ if (pos == E_CALENDAR_VIEW_POS_EVENT && E_TEXT (event->canvas_item)->editing) { - GNOME_CANVAS_ITEM_GET_CLASS (event->canvas_item)->event (event->canvas_item, (GdkEvent*) bevent); + GNOME_CANVAS_ITEM_GET_CLASS (event->canvas_item)->event (event->canvas_item, (GdkEvent *) bevent); return; } @@ -3396,7 +3426,7 @@ e_day_view_on_long_event_click (EDayView *day_view, return; /* Grab the keyboard focus, so the event being edited is saved - and we can use the Escape key to abort the resize. */ + * and we can use the Escape key to abort the resize. */ if (!gtk_widget_has_focus (GTK_WIDGET (day_view))) gtk_widget_grab_focus (GTK_WIDGET (day_view)); @@ -3422,7 +3452,7 @@ e_day_view_on_long_event_click (EDayView *day_view, &item_x, &item_y, &item_w, &item_h)) { /* Remember the item clicked and the mouse position, - so we can start a drag if the mouse moves. */ + * so we can start a drag if the mouse moves. */ day_view->pressed_event_day = E_DAY_VIEW_LONG_EVENT; day_view->pressed_event_num = event_num; @@ -3438,12 +3468,12 @@ e_day_view_on_long_event_click (EDayView *day_view, static void e_day_view_on_event_click (EDayView *day_view, - gint day, - gint event_num, - GdkEventButton *bevent, - ECalendarViewPosition pos, - gint event_x, - gint event_y) + gint day, + gint event_num, + GdkEventButton *bevent, + ECalendarViewPosition pos, + gint event_x, + gint event_y) { EDayViewEvent *event; ECalendarView *cal_view; @@ -3467,7 +3497,7 @@ e_day_view_on_event_click (EDayView *day_view, /* Ignore clicks on the EText while editing. */ if (pos == E_CALENDAR_VIEW_POS_EVENT && E_TEXT (event->canvas_item)->editing) { - GNOME_CANVAS_ITEM_GET_CLASS (event->canvas_item)->event (event->canvas_item, (GdkEvent*) bevent); + GNOME_CANVAS_ITEM_GET_CLASS (event->canvas_item)->event (event->canvas_item, (GdkEvent *) bevent); return; } @@ -3480,7 +3510,7 @@ e_day_view_on_event_click (EDayView *day_view, } /* Grab the keyboard focus, so the event being edited is saved - and we can use the Escape key to abort the resize. */ + * and we can use the Escape key to abort the resize. */ if (!gtk_widget_has_focus (GTK_WIDGET (day_view))) gtk_widget_grab_focus (GTK_WIDGET (day_view)); @@ -3511,7 +3541,7 @@ e_day_view_on_event_click (EDayView *day_view, } else { /* Remember the item clicked and the mouse position, - so we can start a drag if the mouse moves. */ + * so we can start a drag if the mouse moves. */ day_view->pressed_event_day = day; day_view->pressed_event_num = event_num; @@ -3529,8 +3559,8 @@ e_day_view_on_event_click (EDayView *day_view, static void e_day_view_on_event_double_click (EDayView *day_view, - gint day, - gint event_num) + gint day, + gint event_num) { EDayViewEvent *event; @@ -3556,9 +3586,9 @@ e_day_view_on_event_double_click (EDayView *day_view, static void e_day_view_show_popup_menu (EDayView *day_view, - GdkEventButton *event, - gint day, - gint event_num) + GdkEventButton *event, + gint day, + gint event_num) { day_view->popup_event_day = day; day_view->popup_event_num = event_num; @@ -3660,17 +3690,17 @@ e_day_view_update_query (EDayView *day_view) static void e_day_view_on_event_right_click (EDayView *day_view, - GdkEventButton *bevent, - gint day, - gint event_num) + GdkEventButton *bevent, + gint day, + gint event_num) { e_day_view_show_popup_menu (day_view, bevent, day, event_num); } static gboolean e_day_view_on_top_canvas_button_release (GtkWidget *widget, - GdkEventButton *event, - EDayView *day_view) + GdkEventButton *event, + EDayView *day_view) { if (day_view->selection_is_being_dragged) { gdk_pointer_ungrab (event->time); @@ -3692,8 +3722,8 @@ e_day_view_on_top_canvas_button_release (GtkWidget *widget, static gboolean e_day_view_on_main_canvas_button_release (GtkWidget *widget, - GdkEventButton *event, - EDayView *day_view) + GdkEventButton *event, + EDayView *day_view) { #if 0 g_print ("In e_day_view_on_main_canvas_button_release\n"); @@ -3742,8 +3772,8 @@ e_day_view_update_calendar_selection_time (EDayView *day_view) static gboolean e_day_view_on_top_canvas_motion (GtkWidget *widget, - GdkEventMotion *mevent, - EDayView *day_view) + GdkEventMotion *mevent, + EDayView *day_view) { EDayViewEvent *event = NULL; ECalendarViewPosition pos; @@ -3759,9 +3789,9 @@ e_day_view_on_top_canvas_motion (GtkWidget *widget, window = gtk_layout_get_bin_window (GTK_LAYOUT (widget)); /* Convert the coords to the main canvas window, or return if the - window is not found. */ + * window is not found. */ if (!e_day_view_convert_event_coords ( - day_view, (GdkEvent*) mevent, window, &event_x, &event_y)) + day_view, (GdkEvent *) mevent, window, &event_x, &event_y)) return FALSE; canvas_x = event_x; @@ -3818,7 +3848,7 @@ e_day_view_on_top_canvas_motion (GtkWidget *widget, e_target_list_add_calendar_targets (target_list, 0); gtk_drag_begin (widget, target_list, GDK_ACTION_COPY | GDK_ACTION_MOVE, - 1, (GdkEvent*) mevent); + 1, (GdkEvent *) mevent); gtk_target_list_unref (target_list); } } else { @@ -3847,7 +3877,7 @@ e_day_view_on_top_canvas_motion (GtkWidget *widget, } if (event && E_IS_TEXT (event->canvas_item) && E_TEXT (event->canvas_item)->editing) { - GNOME_CANVAS_ITEM_GET_CLASS (event->canvas_item)->event (event->canvas_item, (GdkEvent*) mevent); + GNOME_CANVAS_ITEM_GET_CLASS (event->canvas_item)->event (event->canvas_item, (GdkEvent *) mevent); } } @@ -3856,8 +3886,8 @@ e_day_view_on_top_canvas_motion (GtkWidget *widget, static gboolean e_day_view_on_main_canvas_motion (GtkWidget *widget, - GdkEventMotion *mevent, - EDayView *day_view) + GdkEventMotion *mevent, + EDayView *day_view) { EDayViewEvent *event = NULL; ECalendarViewPosition pos; @@ -3873,9 +3903,9 @@ e_day_view_on_main_canvas_motion (GtkWidget *widget, window = gtk_layout_get_bin_window (GTK_LAYOUT (widget)); /* Convert the coords to the main canvas window, or return if the - window is not found. */ + * window is not found. */ if (!e_day_view_convert_event_coords ( - day_view, (GdkEvent*) mevent, window, &event_x, &event_y)) + day_view, (GdkEvent *) mevent, window, &event_x, &event_y)) return FALSE; canvas_x = event_x; @@ -3930,7 +3960,7 @@ e_day_view_on_main_canvas_motion (GtkWidget *widget, e_target_list_add_calendar_targets (target_list, 0); gtk_drag_begin (widget, target_list, GDK_ACTION_COPY | GDK_ACTION_MOVE, - 1, (GdkEvent*) mevent); + 1, (GdkEvent *) mevent); gtk_target_list_unref (target_list); } } else { @@ -3963,7 +3993,7 @@ e_day_view_on_main_canvas_motion (GtkWidget *widget, } if (event && E_IS_TEXT (event->canvas_item) && E_TEXT (event->canvas_item)->editing) { - GNOME_CANVAS_ITEM_GET_CLASS (event->canvas_item)->event (event->canvas_item, (GdkEvent*) mevent); + GNOME_CANVAS_ITEM_GET_CLASS (event->canvas_item)->event (event->canvas_item, (GdkEvent *) mevent); } } @@ -3971,12 +4001,12 @@ e_day_view_on_main_canvas_motion (GtkWidget *widget, } /* This sets the selection to a single cell. If day is -1 then the current - start day is reused. If row is -1 then the selection is in the top canvas. + * start day is reused. If row is -1 then the selection is in the top canvas. */ void e_day_view_start_selection (EDayView *day_view, - gint day, - gint row) + gint day, + gint row) { if (day == -1) { day = day_view->selection_start_day; @@ -4000,11 +4030,11 @@ e_day_view_start_selection (EDayView *day_view, } /* Updates the selection during a drag. If day is -1 the selection day is - unchanged. */ + * unchanged. */ void e_day_view_update_selection (EDayView *day_view, - gint day, - gint row) + gint day, + gint row) { gboolean need_redraw = FALSE; @@ -4075,7 +4105,7 @@ e_day_view_finish_selection (EDayView *day_view) static void e_day_view_update_long_event_resize (EDayView *day_view, - gint day) + gint day) { gint event_num; gboolean need_reshape = FALSE; @@ -4110,7 +4140,7 @@ e_day_view_update_long_event_resize (EDayView *day_view, static void e_day_view_update_resize (EDayView *day_view, - gint row) + gint row) { /* Same thing again? */ EDayViewEvent *event; @@ -4161,7 +4191,7 @@ e_day_view_update_resize (EDayView *day_view, } /* This converts the resize start or end row back to a time and updates the - event. */ + * event. */ static void e_day_view_finish_long_event_resize (EDayView *day_view) { @@ -4190,8 +4220,8 @@ e_day_view_finish_long_event_resize (EDayView *day_view) client = event->comp_data->client; /* We use a temporary copy of the comp since we don't want to - change the original comp here. Otherwise we would not detect that - the event's time had changed in the "update_event" callback. */ + * change the original comp here. Otherwise we would not detect that + * the event's time had changed in the "update_event" callback. */ comp = e_cal_component_new (); e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp)); @@ -4276,7 +4306,7 @@ e_day_view_finish_long_event_resize (EDayView *day_view) } /* This converts the resize start or end row back to a time and updates the - event. */ + * event. */ static void e_day_view_finish_resize (EDayView *day_view) { @@ -4308,8 +4338,8 @@ e_day_view_finish_resize (EDayView *day_view) client = event->comp_data->client; /* We use a temporary shallow copy of the ico since we don't want to - change the original ico here. Otherwise we would not detect that - the event's time had changed in the "update_event" callback. */ + * change the original ico here. Otherwise we would not detect that + * the event's time had changed in the "update_event" callback. */ comp = e_cal_component_new (); e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp)); @@ -4443,7 +4473,7 @@ e_day_view_free_events (EDayView *day_view) static void e_day_view_free_event_array (EDayView *day_view, - GArray *array) + GArray *array) { EDayViewEvent *event; gint event_num; @@ -4463,9 +4493,9 @@ e_day_view_free_event_array (EDayView *day_view, /* This adds one event to the view, adding it to the appropriate array. */ static gboolean e_day_view_add_event (ECalComponent *comp, - time_t start, - time_t end, - gpointer data) + time_t start, + time_t end, + gpointer data) { EDayViewEvent event; @@ -4513,7 +4543,7 @@ e_day_view_add_event (ECalComponent *comp, event.comp_data->instance_end = end; /* Calculate the start & end minute, relative to the top of the - display. */ + * display. */ offset = add_event_data->day_view->first_hour_shown * 60 + add_event_data->day_view->first_minute_shown; event.start_minute = start_tt.hour * 60 + start_tt.minute - offset; @@ -4539,12 +4569,12 @@ e_day_view_add_event (ECalComponent *comp, && end <= add_event_data->day_view->day_starts[day + 1]) { /* Special case for when the appointment ends at - midnight, i.e. the start of the next day. */ + * midnight, i.e. the start of the next day. */ if (end == add_event_data->day_view->day_starts[day + 1]) { /* If the event last the entire day, then we - skip it here so it gets added to the top - canvas. */ + * skip it here so it gets added to the top + * canvas. */ if (start == add_event_data->day_view->day_starts[day]) break; @@ -4559,7 +4589,7 @@ e_day_view_add_event (ECalComponent *comp, } /* The event wasn't within one day so it must be a long event, - i.e. shown in the top canvas. */ + * i.e. shown in the top canvas. */ g_array_append_val (add_event_data->day_view->long_events, event); add_event_data->day_view->long_events_sorted = FALSE; add_event_data->day_view->long_events_need_layout = TRUE; @@ -4567,7 +4597,7 @@ e_day_view_add_event (ECalComponent *comp, } /* This lays out the short (less than 1 day) events in the columns. - Any long events are simply skipped. */ + * Any long events are simply skipped. */ void e_day_view_check_layout (EDayView *day_view) { @@ -4666,7 +4696,7 @@ e_day_view_reshape_long_events (EDayView *day_view) static void e_day_view_reshape_long_event (EDayView *day_view, - gint event_num) + gint event_num) { EDayViewEvent *event; gint start_day, end_day, item_x, item_y, item_w, item_h; @@ -4705,7 +4735,7 @@ e_day_view_reshape_long_event (EDayView *day_view, item_h -= (E_DAY_VIEW_LONG_EVENT_BORDER_HEIGHT + E_DAY_VIEW_LONG_EVENT_Y_PAD) * 2; /* We don't show the icons while resizing, since we'd have to - draw them on top of the resize rect. Nor when editing. */ + * draw them on top of the resize rect. Nor when editing. */ num_icons = 0; comp = e_cal_component_new (); e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp)); @@ -4770,9 +4800,9 @@ e_day_view_reshape_long_event (EDayView *day_view, } /* Calculate its position. We first calculate the ideal position which - is centered with the icons. We then make sure we haven't gone off - the left edge of the available space. Finally we make sure we don't - go off the right edge. */ + * is centered with the icons. We then make sure we haven't gone off + * the left edge of the available space. Finally we make sure we don't + * go off the right edge. */ icons_width = (E_DAY_VIEW_ICON_WIDTH + E_DAY_VIEW_ICON_X_PAD) * num_icons + E_DAY_VIEW_LONG_EVENT_ICON_R_PAD; time_width = e_day_view_get_time_string_width (day_view); @@ -4782,7 +4812,7 @@ e_day_view_reshape_long_event (EDayView *day_view, text_w = item_w; } else { /* Get the requested size of the label. */ - g_object_get (G_OBJECT (event->canvas_item), "text", &text, NULL); + g_object_get (event->canvas_item, "text", &text, NULL); text_width = 0; if (text) { end_of_line = strchr (text, '\n'); @@ -4828,10 +4858,10 @@ e_day_view_reshape_long_event (EDayView *day_view, } /* This creates or updates the sizes of the canvas items for one day of the - main canvas. */ + * main canvas. */ static void e_day_view_reshape_day_events (EDayView *day_view, - gint day) + gint day) { gint event_num; @@ -4863,8 +4893,8 @@ e_day_view_reshape_day_events (EDayView *day_view, static void e_day_view_reshape_day_event (EDayView *day_view, - gint day, - gint event_num) + gint day, + gint event_num) { EDayViewEvent *event; gint item_x, item_y, item_w, item_h; @@ -4891,7 +4921,7 @@ e_day_view_reshape_day_event (EDayView *day_view, item_h -= (E_DAY_VIEW_EVENT_BORDER_HEIGHT + E_DAY_VIEW_EVENT_Y_PAD) * 2; /* We don't show the icons while resizing, since we'd have to - draw them on top of the resize rect. */ + * draw them on top of the resize rect. */ icons_offset = 0; num_icons = 0; if (is_comp_data_valid (event) && (day_view->resize_drag_pos == E_CALENDAR_VIEW_POS_NONE @@ -4967,7 +4997,7 @@ e_day_view_reshape_day_event (EDayView *day_view, } /* This creates or resizes the horizontal bars used to resize events in the - main canvas. */ + * main canvas. */ static void e_day_view_reshape_main_canvas_resize_bars (EDayView *day_view) { @@ -4979,10 +5009,10 @@ e_day_view_reshape_main_canvas_resize_bars (EDayView *day_view) event_num = day_view->resize_bars_event_num; /* If we're not editing an event, or the event is not shown, - hide the resize bars. */ + * hide the resize bars. */ if (day != -1 && day == day_view->drag_event_day && event_num == day_view->drag_event_num) { - g_object_get (G_OBJECT (day_view->drag_rect_item), + g_object_get (day_view->drag_rect_item, "x1", &x, "y1", &y, "x2", &w, @@ -5034,12 +5064,12 @@ e_day_view_ensure_events_sorted (EDayView *day_view) gint e_day_view_event_sort_func (gconstpointer arg1, - gconstpointer arg2) + gconstpointer arg2) { EDayViewEvent *event1, *event2; - event1 = (EDayViewEvent*) arg1; - event2 = (EDayViewEvent*) arg2; + event1 = (EDayViewEvent *) arg1; + event2 = (EDayViewEvent *) arg2; if (event1->start < event2->start) return -1; @@ -5055,7 +5085,8 @@ e_day_view_event_sort_func (gconstpointer arg1, } static gboolean -e_day_view_add_new_event_in_selected_range (EDayView *day_view, GdkEventKey *key_event) +e_day_view_add_new_event_in_selected_range (EDayView *day_view, + GdkEventKey *key_event) { icalcomponent *icalcomp; ECalClient *client; @@ -5115,7 +5146,7 @@ e_day_view_add_new_event_in_selected_range (EDayView *day_view, GdkEventKey *key comp, e_calendar_view_get_default_category (E_CALENDAR_VIEW (day_view))); /* We add the event locally and start editing it. We don't send it - to the server until the user finishes editing it. */ + * to the server until the user finishes editing it. */ add_event_data.day_view = day_view; add_event_data.comp_data = NULL; e_day_view_add_event (comp, dtstart, dtend, &add_event_data); @@ -5136,7 +5167,8 @@ e_day_view_add_new_event_in_selected_range (EDayView *day_view, GdkEventKey *key } static gboolean -e_day_view_do_key_press (GtkWidget *widget, GdkEventKey *event) +e_day_view_do_key_press (GtkWidget *widget, + GdkEventKey *event) { EDayView *day_view; guint keyval; @@ -5258,7 +5290,7 @@ e_day_view_do_key_press (GtkWidget *widget, GdkEventKey *event) return FALSE; /* We only want to start an edit with a return key or a simple - character. */ + * character. */ if ((keyval != GDK_KEY_Return) && (((keyval >= 0x20) && (keyval <= 0xFF) && (event->state & (GDK_CONTROL_MASK | GDK_MOD1_MASK))) @@ -5271,7 +5303,8 @@ e_day_view_do_key_press (GtkWidget *widget, GdkEventKey *event) } static gboolean -e_day_view_key_press (GtkWidget *widget, GdkEventKey *event) +e_day_view_key_press (GtkWidget *widget, + GdkEventKey *event) { gboolean handled = FALSE; handled = e_day_view_do_key_press (widget, event); @@ -5330,7 +5363,7 @@ e_day_view_goto_end_of_work_day (EDayView *day_view) else day_view->selection_start_row = e_day_view_convert_time_to_row ( - day_view, work_day_end_hour-1, work_day_end_minute+30); + day_view, work_day_end_hour - 1, work_day_end_minute + 30); day_view->selection_end_row = day_view->selection_start_row; e_day_view_ensure_rows_visible (day_view, @@ -5403,7 +5436,7 @@ e_day_view_change_duration_to_end_of_work_day (EDayView *day_view) gint work_end_row,selection_start_row; work_end_row = e_day_view_convert_time_to_row ( - day_view, work_day_end_hour-1, work_day_end_minute+30); + day_view, work_day_end_hour - 1, work_day_end_minute + 30); selection_start_row = day_view->selection_start_row; if (selection_start_row <= work_end_row) day_view->selection_end_row = work_end_row; @@ -5425,7 +5458,8 @@ e_day_view_change_duration_to_end_of_work_day (EDayView *day_view) } static void -e_day_view_cursor_key_up_shifted (EDayView *day_view, GdkEventKey *event) +e_day_view_cursor_key_up_shifted (EDayView *day_view, + GdkEventKey *event) { gint *row; @@ -5454,7 +5488,8 @@ e_day_view_cursor_key_up_shifted (EDayView *day_view, GdkEventKey *event) } static gboolean -e_day_view_focus (GtkWidget *widget, GtkDirectionType direction) +e_day_view_focus (GtkWidget *widget, + GtkDirectionType direction) { EDayView *day_view; gint new_day; @@ -5505,9 +5540,12 @@ e_day_view_focus (GtkWidget *widget, GtkDirectionType direction) * Return value: %TRUE, if a event found. **/ static gboolean -e_day_view_get_extreme_event (EDayView *day_view, gint start_day, - gint end_day, gboolean first, - gint *day_out, gint *event_num_out) +e_day_view_get_extreme_event (EDayView *day_view, + gint start_day, + gint end_day, + gboolean first, + gint *day_out, + gint *event_num_out) { gint loop_day; @@ -5553,8 +5591,10 @@ e_day_view_get_extreme_event (EDayView *day_view, gint start_day, * Return value: %TRUE, if a event found. **/ static gboolean -e_day_view_get_extreme_long_event (EDayView *day_view, gboolean first, - gint *day_out, gint *event_num_out) +e_day_view_get_extreme_long_event (EDayView *day_view, + gboolean first, + gint *day_out, + gint *event_num_out) { g_return_val_if_fail (day_view != NULL, FALSE); g_return_val_if_fail (day_out && event_num_out, FALSE); @@ -5589,8 +5629,10 @@ e_day_view_get_extreme_long_event (EDayView *day_view, gboolean first, * Return value: %TRUE, if a event found. **/ static gboolean -e_day_view_get_next_tab_event (EDayView *day_view, GtkDirectionType direction, - gint *day_out, gint *event_num_out) +e_day_view_get_next_tab_event (EDayView *day_view, + GtkDirectionType direction, + gint *day_out, + gint *event_num_out) { gint new_day; gint new_event_num; @@ -5707,7 +5749,8 @@ e_day_view_get_next_tab_event (EDayView *day_view, GtkDirectionType direction, } static void -e_day_view_cursor_key_down_shifted (EDayView *day_view, GdkEventKey *event) +e_day_view_cursor_key_down_shifted (EDayView *day_view, + GdkEventKey *event) { gint *row; @@ -5736,7 +5779,8 @@ e_day_view_cursor_key_down_shifted (EDayView *day_view, GdkEventKey *event) } static void -e_day_view_cursor_key_left_shifted (EDayView *day_view, GdkEventKey *event) +e_day_view_cursor_key_left_shifted (EDayView *day_view, + GdkEventKey *event) { gint *day; @@ -5760,7 +5804,8 @@ e_day_view_cursor_key_left_shifted (EDayView *day_view, GdkEventKey *event) } static void -e_day_view_cursor_key_right_shifted (EDayView *day_view, GdkEventKey *event) +e_day_view_cursor_key_right_shifted (EDayView *day_view, + GdkEventKey *event) { gint *day; @@ -5784,7 +5829,8 @@ e_day_view_cursor_key_right_shifted (EDayView *day_view, GdkEventKey *event) } static void -e_day_view_cursor_key_up (EDayView *day_view, GdkEventKey *event) +e_day_view_cursor_key_up (EDayView *day_view, + GdkEventKey *event) { if (day_view->selection_start_day == -1) { day_view->selection_start_day = 0; @@ -5816,7 +5862,8 @@ e_day_view_cursor_key_up (EDayView *day_view, GdkEventKey *event) } static void -e_day_view_cursor_key_down (EDayView *day_view, GdkEventKey *event) +e_day_view_cursor_key_down (EDayView *day_view, + GdkEventKey *event) { if (day_view->selection_start_day == -1) { day_view->selection_start_day = 0; @@ -5848,7 +5895,8 @@ e_day_view_cursor_key_down (EDayView *day_view, GdkEventKey *event) } static void -e_day_view_cursor_key_left (EDayView *day_view, GdkEventKey *event) +e_day_view_cursor_key_left (EDayView *day_view, + GdkEventKey *event) { if (day_view->selection_start_day == 0) { gnome_calendar_previous (e_calendar_view_get_calendar (E_CALENDAR_VIEW (day_view))); @@ -5866,7 +5914,8 @@ e_day_view_cursor_key_left (EDayView *day_view, GdkEventKey *event) } static void -e_day_view_cursor_key_right (EDayView *day_view, GdkEventKey *event) +e_day_view_cursor_key_right (EDayView *day_view, + GdkEventKey *event) { if (day_view->selection_end_day == day_view->days_shown - 1) { gnome_calendar_next (e_calendar_view_get_calendar (E_CALENDAR_VIEW (day_view))); @@ -5884,12 +5933,12 @@ e_day_view_cursor_key_right (EDayView *day_view, GdkEventKey *event) } /* Scrolls the main canvas up or down. The pages_to_scroll argument - is multiplied with the adjustment's page size and added to the adjustment's - value, while ensuring we stay within the bounds. A positive value will - scroll the canvas down and a negative value will scroll it up. */ + * is multiplied with the adjustment's page size and added to the adjustment's + * value, while ensuring we stay within the bounds. A positive value will + * scroll the canvas down and a negative value will scroll it up. */ static void -e_day_view_scroll (EDayView *day_view, - gfloat pages_to_scroll) +e_day_view_scroll (EDayView *day_view, + gfloat pages_to_scroll) { GtkAdjustment *adjustment; GtkScrollable *scrollable; @@ -5913,8 +5962,8 @@ e_day_view_scroll (EDayView *day_view, } static void -e_day_view_top_scroll (EDayView *day_view, - gfloat pages_to_scroll) +e_day_view_top_scroll (EDayView *day_view, + gfloat pages_to_scroll) { GtkAdjustment *adjustment; GtkScrollable *scrollable; @@ -5939,8 +5988,8 @@ e_day_view_top_scroll (EDayView *day_view, void e_day_view_ensure_rows_visible (EDayView *day_view, - gint start_row, - gint end_row) + gint start_row, + gint end_row) { GtkAdjustment *adjustment; GtkScrollable *scrollable; @@ -5968,9 +6017,9 @@ e_day_view_ensure_rows_visible (EDayView *day_view, static void e_day_view_start_editing_event (EDayView *day_view, - gint day, - gint event_num, - GdkEventKey *key_event) + gint day, + gint event_num, + GdkEventKey *key_event) { EDayViewEvent *event; ETextEventProcessor *event_processor = NULL; @@ -6010,9 +6059,9 @@ e_day_view_start_editing_event (EDayView *day_view, return; /* We must grab the focus before setting the initial text, since - grabbing the focus will result in a call to - e_day_view_on_editing_started (), which will reset the text to get - rid of the start and end times. */ + * grabbing the focus will result in a call to + * e_day_view_on_editing_started (), which will reset the text to get + * rid of the start and end times. */ e_canvas_item_grab_focus (event->canvas_item, TRUE); if (key_event) { @@ -6032,7 +6081,7 @@ e_day_view_start_editing_event (EDayView *day_view, } /* Try to move the cursor to the end of the text. */ - g_object_get (G_OBJECT (event->canvas_item), + g_object_get (event->canvas_item, "event_processor", &event_processor, NULL); if (event_processor) { @@ -6044,7 +6093,7 @@ e_day_view_start_editing_event (EDayView *day_view, } /* This stops the current edit. If accept is TRUE the event summary is updated, - else the edit is cancelled. */ + * else the edit is cancelled. */ static void e_day_view_stop_editing_event (EDayView *day_view) { @@ -6091,7 +6140,7 @@ cancel_editing (EDayView *day_view) /* Reset the text to what was in the component */ summary = icalcomponent_get_summary (event->comp_data->icalcomp); - g_object_set (G_OBJECT (event->canvas_item), + g_object_set (event->canvas_item, "text", summary ? summary : "", NULL); @@ -6100,7 +6149,9 @@ cancel_editing (EDayView *day_view) } static EDayViewEvent * -tooltip_get_view_event (EDayView *day_view, gint day, gint event_num) +tooltip_get_view_event (EDayView *day_view, + gint day, + gint event_num) { EDayViewEvent *pevent; @@ -6122,7 +6173,8 @@ tooltip_get_view_event (EDayView *day_view, gint day, gint event_num) } static void -tooltip_destroy (EDayView *day_view, GnomeCanvasItem *item) +tooltip_destroy (EDayView *day_view, + GnomeCanvasItem *item) { EDayViewEvent *pevent; gint event_num = GPOINTER_TO_INT(g_object_get_data ((GObject *)item, "event-num")); @@ -6146,8 +6198,8 @@ tooltip_destroy (EDayView *day_view, GnomeCanvasItem *item) static gboolean e_day_view_on_text_item_event (GnomeCanvasItem *item, - GdkEvent *event, - EDayView *day_view) + GdkEvent *event, + EDayView *day_view) { switch (event->type) { case GDK_KEY_PRESS: @@ -6156,11 +6208,11 @@ e_day_view_on_text_item_event (GnomeCanvasItem *item, day_view->resize_event_num = -1; /* We set the keyboard focus to the EDayView, so the - EText item loses it and stops the edit. */ + * EText item loses it and stops the edit. */ gtk_widget_grab_focus (GTK_WIDGET (day_view)); /* Stop the signal last or we will also stop any - other events getting to the EText item. */ + * other events getting to the EText item. */ g_signal_stop_emission_by_name (item, "event"); return TRUE; } else if (event->key.keyval == GDK_KEY_Escape) { @@ -6229,11 +6281,11 @@ e_day_view_on_text_item_event (GnomeCanvasItem *item, break; /* Convert the coords to the main canvas window, or return if the - window is not found. */ + * window is not found. */ layout = GTK_LAYOUT (day_view->main_canvas); window = gtk_layout_get_bin_window (layout); if (!e_day_view_convert_event_coords ( - day_view, (GdkEvent*) event, + day_view, (GdkEvent *) event, window, &event_x, &event_y)) { main_canvas = FALSE; @@ -6241,7 +6293,7 @@ e_day_view_on_text_item_event (GnomeCanvasItem *item, layout = GTK_LAYOUT (day_view->top_canvas); window = gtk_layout_get_bin_window (layout); if (!e_day_view_convert_event_coords ( - day_view, (GdkEvent*) event, + day_view, (GdkEvent *) event, window, &event_x, &event_y)) { return FALSE; } @@ -6265,7 +6317,7 @@ e_day_view_on_text_item_event (GnomeCanvasItem *item, break; /* even when returns position inside, or other, then the day and/or event_num - can be unknown, thus check for this here, otherwise it will crash later */ + * can be unknown, thus check for this here, otherwise it will crash later */ if (day == -1 || event_num == -1) break; @@ -6305,7 +6357,7 @@ e_day_view_on_text_item_event (GnomeCanvasItem *item, pevent->tooltip = (GtkWidget *)g_object_get_data (G_OBJECT (day_view), "tooltip-window"); if (pevent->tooltip) { - e_calendar_view_move_tip (pevent->tooltip, pevent->x+16, pevent->y+16); + e_calendar_view_move_tip (pevent->tooltip, pevent->x + 16, pevent->y + 16); } return TRUE; @@ -6403,7 +6455,9 @@ e_day_view_event_move (ECalendarView *cal_view, } static void -e_day_view_change_event_time (EDayView *day_view, time_t start_dt, time_t end_dt) +e_day_view_change_event_time (EDayView *day_view, + time_t start_dt, + time_t end_dt) { EDayViewEvent *event; gint day, event_num; @@ -6429,8 +6483,8 @@ e_day_view_change_event_time (EDayView *day_view, time_t start_dt, time_t end_dt client = event->comp_data->client; /* We use a temporary shallow copy of the ico since we don't want to - change the original ico here. Otherwise we would not detect that - the event's time had changed in the "update_event" callback. */ + * change the original ico here. Otherwise we would not detect that + * the event's time had changed in the "update_event" callback. */ comp = e_cal_component_new (); e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp)); @@ -6441,7 +6495,7 @@ e_day_view_change_event_time (EDayView *day_view, time_t start_dt, time_t end_dt date.value = &itt; /* FIXME: Should probably keep the timezone of the original start - and end times. */ + * and end times. */ date.tzid = icaltimezone_get_tzid (e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); *date.value = icaltime_from_timet_with_zone (start_dt, FALSE, @@ -6569,7 +6623,7 @@ e_day_view_change_event_end_time_down (EDayView *day_view) static void e_day_view_on_editing_started (EDayView *day_view, - GnomeCanvasItem *item) + GnomeCanvasItem *item) { GtkAllocation allocation; gint day, event_num; @@ -6584,9 +6638,9 @@ e_day_view_on_editing_started (EDayView *day_view, #endif /* FIXME: This is a temporary workaround for a bug which seems to stop - us getting focus_out signals. It is not a complete fix since if we - don't get focus_out signals we don't save the appointment text so - this may be lost. */ + * us getting focus_out signals. It is not a complete fix since if we + * don't get focus_out signals we don't save the appointment text so + * this may be lost. */ if (day_view->editing_event_day == day && day_view->editing_event_num == event_num) return; @@ -6630,7 +6684,7 @@ e_day_view_on_editing_started (EDayView *day_view, static void e_day_view_on_editing_stopped (EDayView *day_view, - GnomeCanvasItem *item) + GnomeCanvasItem *item) { gint day, event_num; EDayViewEvent *event; @@ -6641,8 +6695,8 @@ e_day_view_on_editing_stopped (EDayView *day_view, gboolean on_server; /* Note: the item we are passed here isn't reliable, so we just stop - the edit of whatever item was being edited. We also receive this - event twice for some reason. */ + * the edit of whatever item was being edited. We also receive this + * event twice for some reason. */ day = day_view->editing_event_day; event_num = day_view->editing_event_num; @@ -6681,7 +6735,7 @@ e_day_view_on_editing_stopped (EDayView *day_view, day_view->resize_bars_event_num = -1; g_object_set (event->canvas_item, "handle_popup", FALSE, NULL); - g_object_get (G_OBJECT (event->canvas_item), + g_object_get (event->canvas_item, "text", &text, NULL); g_return_if_fail (text != NULL); @@ -6822,12 +6876,12 @@ e_day_view_on_editing_stopped (EDayView *day_view, } /* FIXME: It is possible that we may produce an invalid time due to daylight - saving times (i.e. when clocks go forward there is a range of time which - is not valid). I don't know the best way to handle daylight saving time. */ + * saving times (i.e. when clocks go forward there is a range of time which + * is not valid). I don't know the best way to handle daylight saving time. */ static time_t e_day_view_convert_grid_position_to_time (EDayView *day_view, - gint col, - gint row) + gint col, + gint row) { ECalendarView *cal_view; gint time_divisions; @@ -6844,7 +6898,7 @@ e_day_view_convert_grid_position_to_time (EDayView *day_view, + row * time_divisions; /* A special case for midnight, where we can use the start of the - next day. */ + * next day. */ if (minutes == 60 * 24) return day_view->day_starts[col + 1]; @@ -6861,9 +6915,9 @@ e_day_view_convert_grid_position_to_time (EDayView *day_view, static gboolean e_day_view_convert_time_to_grid_position (EDayView *day_view, - time_t time, - gint *col, - gint *row) + time_t time, + gint *col, + gint *row) { ECalendarView *cal_view; struct icaltimetype tt; @@ -6887,8 +6941,8 @@ e_day_view_convert_time_to_grid_position (EDayView *day_view, } /* To find the row we need to convert the time to an icaltimetype, - calculate the offset in minutes from the top of the display and - divide it by the mins per row setting. */ + * calculate the offset in minutes from the top of the display and + * divide it by the mins per row setting. */ tt = icaltime_from_timet_with_zone (time, FALSE, e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); minutes = tt.hour * 60 + tt.minute; @@ -6903,11 +6957,11 @@ e_day_view_convert_time_to_grid_position (EDayView *day_view, } /* This starts or stops auto-scrolling when dragging a selection or resizing - an event. */ + * an event. */ void e_day_view_check_auto_scroll (EDayView *day_view, - gint event_x, - gint event_y) + gint event_x, + gint event_y) { GtkAllocation allocation; gint scroll_x, scroll_y; @@ -6933,7 +6987,7 @@ e_day_view_check_auto_scroll (EDayView *day_view, static void e_day_view_start_auto_scroll (EDayView *day_view, - gboolean scroll_up) + gboolean scroll_up) { if (day_view->auto_scroll_timeout_id == 0) { day_view->auto_scroll_timeout_id = g_timeout_add (E_DAY_VIEW_AUTO_SCROLL_TIMEOUT, e_day_view_auto_scroll_handler, day_view); @@ -6993,7 +7047,7 @@ e_day_view_auto_scroll_handler (gpointer data) if (new_scroll_y != scroll_y) { /* NOTE: This reduces flicker, but only works if we don't use - canvas items which have X windows. */ + * canvas items which have X windows. */ gnome_canvas_scroll_to (GNOME_CANVAS (day_view->main_canvas), scroll_x, new_scroll_y); } @@ -7002,8 +7056,8 @@ e_day_view_auto_scroll_handler (gpointer data) canvas_y = day_view->last_mouse_y + new_scroll_y; /* The last_mouse_x position is set to -1 when we are selecting using - the time column. In this case we set canvas_x to 0 and we ignore - the resulting day. */ + * the time column. In this case we set canvas_x to 0 and we ignore + * the resulting day. */ if (day_view->last_mouse_x == -1) canvas_x = 0; @@ -7031,10 +7085,10 @@ e_day_view_auto_scroll_handler (gpointer data) gboolean e_day_view_get_event_rows (EDayView *day_view, - gint day, - gint event_num, - gint *start_row_out, - gint *end_row_out) + gint day, + gint event_num, + gint *start_row_out, + gint *end_row_out) { ECalendarView *cal_view; EDayViewEvent *event; @@ -7065,12 +7119,12 @@ e_day_view_get_event_rows (EDayView *day_view, gboolean e_day_view_get_event_position (EDayView *day_view, - gint day, - gint event_num, - gint *item_x, - gint *item_y, - gint *item_w, - gint *item_h) + gint day, + gint event_num, + gint *item_x, + gint *item_y, + gint *item_w, + gint *item_h) { EDayViewEvent *event; gint start_row, end_row, cols_in_row, start_col, num_columns; @@ -7114,21 +7168,21 @@ e_day_view_get_event_position (EDayView *day_view, *item_h = (end_row - start_row + 1) * day_view->row_height; #else /* This makes the event end on the grid line of the next row, - which maybe looks nicer if you have 2 events on consecutive rows. */ + * which maybe looks nicer if you have 2 events on consecutive rows. */ *item_h = (end_row - start_row + 1) * day_view->row_height + 1; #endif return TRUE; } gboolean -e_day_view_get_long_event_position (EDayView *day_view, - gint event_num, - gint *start_day, - gint *end_day, - gint *item_x, - gint *item_y, - gint *item_w, - gint *item_h) +e_day_view_get_long_event_position (EDayView *day_view, + gint event_num, + gint *start_day, + gint *end_day, + gint *item_x, + gint *item_y, + gint *item_w, + gint *item_h) { EDayViewEvent *event; @@ -7173,14 +7227,14 @@ e_day_view_get_long_event_position (EDayView *day_view, } /* Converts a position within the entire top canvas to a day & event and - a place within the event if appropriate. If event_num_return is NULL, it - simply returns the grid position without trying to find the event. */ + * a place within the event if appropriate. If event_num_return is NULL, it + * simply returns the grid position without trying to find the event. */ static ECalendarViewPosition e_day_view_convert_position_in_top_canvas (EDayView *day_view, - gint x, - gint y, - gint *day_return, - gint *event_num_return) + gint x, + gint y, + gint *day_return, + gint *event_num_return) { EDayViewEvent *event; gint day, row, col; @@ -7248,15 +7302,15 @@ e_day_view_convert_position_in_top_canvas (EDayView *day_view, } /* Converts a position within the entire main canvas to a day, row, event and - a place within the event if appropriate. If event_num_return is NULL, it - simply returns the grid position without trying to find the event. */ + * a place within the event if appropriate. If event_num_return is NULL, it + * simply returns the grid position without trying to find the event. */ static ECalendarViewPosition e_day_view_convert_position_in_main_canvas (EDayView *day_view, - gint x, - gint y, - gint *day_return, - gint *row_return, - gint *event_num_return) + gint x, + gint y, + gint *day_return, + gint *row_return, + gint *event_num_return) { gint day, row, col, event_num; gint item_x, item_y, item_w, item_h; @@ -7271,7 +7325,7 @@ e_day_view_convert_position_in_main_canvas (EDayView *day_view, *event_num_return = -1; /* Check the position is inside the canvas, and determine the day - and row. */ + * and row. */ if (x < 0 || y < 0) return E_CALENDAR_VIEW_POS_OUTSIDE; @@ -7297,7 +7351,7 @@ e_day_view_convert_position_in_main_canvas (EDayView *day_view, return E_CALENDAR_VIEW_POS_NONE; /* Check the selected item first, since the horizontal resizing bars - may be above other events. */ + * may be above other events. */ if (day_view->resize_bars_event_day == day) { if (e_day_view_get_event_position (day_view, day, day_view->resize_bars_event_num, @@ -7348,12 +7402,12 @@ e_day_view_convert_position_in_main_canvas (EDayView *day_view, } static gboolean -e_day_view_on_top_canvas_drag_motion (GtkWidget *widget, - GdkDragContext *context, - gint x, - gint y, - guint time, - EDayView *day_view) +e_day_view_on_top_canvas_drag_motion (GtkWidget *widget, + GdkDragContext *context, + gint x, + gint y, + guint time, + EDayView *day_view) { gint scroll_x, scroll_y; @@ -7374,7 +7428,7 @@ e_day_view_reshape_top_canvas_drag_item (EDayView *day_view) gint x, y, day; /* Calculate the day & start row of the event being dragged, using - the current mouse position. */ + * the current mouse position. */ x = day_view->drag_event_x; y = day_view->drag_event_y; pos = e_day_view_convert_position_in_top_canvas (day_view, x, y, @@ -7392,7 +7446,7 @@ e_day_view_reshape_top_canvas_drag_item (EDayView *day_view) static void e_day_view_update_top_canvas_drag (EDayView *day_view, - gint day) + gint day) { EDayViewEvent *event = NULL; gint row, num_days, start_day, end_day; @@ -7400,7 +7454,7 @@ e_day_view_update_top_canvas_drag (EDayView *day_view, gchar *text; /* Calculate the event's position. If the event is in the same - position we started in, we use the same columns. */ + * position we started in, we use the same columns. */ row = day_view->rows_in_top_display + 1; num_days = 1; @@ -7467,8 +7521,8 @@ e_day_view_update_top_canvas_drag (EDayView *day_view, } /* Set the text, if necessary. We don't want to set the text every - time it moves, so we check if it is currently invisible and only - set the text then. */ + * time it moves, so we check if it is currently invisible and only + * set the text then. */ if (!(day_view->drag_long_event_item->flags & GNOME_CANVAS_ITEM_VISIBLE)) { const gchar *summary; @@ -7490,12 +7544,12 @@ e_day_view_update_top_canvas_drag (EDayView *day_view, } static gboolean -e_day_view_on_main_canvas_drag_motion (GtkWidget *widget, - GdkDragContext *context, - gint x, - gint y, - guint time, - EDayView *day_view) +e_day_view_on_main_canvas_drag_motion (GtkWidget *widget, + GdkDragContext *context, + gint x, + gint y, + guint time, + EDayView *day_view) { gint scroll_x, scroll_y; @@ -7520,7 +7574,7 @@ e_day_view_reshape_main_canvas_drag_item (EDayView *day_view) gint x, y, day, row; /* Calculate the day & start row of the event being dragged, using - the current mouse position. */ + * the current mouse position. */ x = day_view->drag_event_x; y = day_view->drag_event_y; pos = e_day_view_convert_position_in_main_canvas (day_view, x, y, @@ -7539,8 +7593,8 @@ e_day_view_reshape_main_canvas_drag_item (EDayView *day_view) static void e_day_view_update_main_canvas_drag (EDayView *day_view, - gint row, - gint day) + gint row, + gint day) { EDayViewEvent *event = NULL; ECalendarView *cal_view; @@ -7562,7 +7616,7 @@ e_day_view_update_main_canvas_drag (EDayView *day_view, day_view->drag_last_row = row; /* Calculate the event's position. If the event is in the same - position we started in, we use the same columns. */ + * position we started in, we use the same columns. */ cols_in_row = 1; start_row = 0; start_col = 0; @@ -7637,8 +7691,8 @@ e_day_view_update_main_canvas_drag (EDayView *day_view, } /* Set the text, if necessary. We don't want to set the text every - time it moves, so we check if it is currently invisible and only - set the text then. */ + * time it moves, so we check if it is currently invisible and only + * set the text then. */ if (!(day_view->drag_item->flags & GNOME_CANVAS_ITEM_VISIBLE)) { const gchar *summary; @@ -7660,10 +7714,10 @@ e_day_view_update_main_canvas_drag (EDayView *day_view, } static void -e_day_view_on_top_canvas_drag_leave (GtkWidget *widget, - GdkDragContext *context, - guint time, - EDayView *day_view) +e_day_view_on_top_canvas_drag_leave (GtkWidget *widget, + GdkDragContext *context, + guint time, + EDayView *day_view) { day_view->drag_last_day = -1; @@ -7672,10 +7726,10 @@ e_day_view_on_top_canvas_drag_leave (GtkWidget *widget, } static void -e_day_view_on_main_canvas_drag_leave (GtkWidget *widget, - GdkDragContext *context, - guint time, - EDayView *day_view) +e_day_view_on_main_canvas_drag_leave (GtkWidget *widget, + GdkDragContext *context, + guint time, + EDayView *day_view) { day_view->drag_last_day = -1; @@ -7692,9 +7746,9 @@ e_day_view_on_main_canvas_drag_leave (GtkWidget *widget, } static void -e_day_view_on_drag_begin (GtkWidget *widget, - GdkDragContext *context, - EDayView *day_view) +e_day_view_on_drag_begin (GtkWidget *widget, + GdkDragContext *context, + EDayView *day_view) { EDayViewEvent *event; gint day, event_num; @@ -7721,14 +7775,14 @@ e_day_view_on_drag_begin (GtkWidget *widget, } /* Hide the text item, since it will be shown in the special drag - items. */ + * items. */ gnome_canvas_item_hide (event->canvas_item); } static void -e_day_view_on_drag_end (GtkWidget *widget, - GdkDragContext *context, - EDayView *day_view) +e_day_view_on_drag_end (GtkWidget *widget, + GdkDragContext *context, + EDayView *day_view) { EDayViewEvent *event; gint day, event_num; @@ -7737,7 +7791,7 @@ e_day_view_on_drag_end (GtkWidget *widget, event_num = day_view->drag_event_num; /* If the calendar has already been updated in drag_data_received() - we just return. */ + * we just return. */ if (day == -1 || event_num == -1) return; @@ -7765,12 +7819,12 @@ e_day_view_on_drag_end (GtkWidget *widget, } static void -e_day_view_on_drag_data_get (GtkWidget *widget, - GdkDragContext *context, - GtkSelectionData *selection_data, - guint info, - guint time, - EDayView *day_view) +e_day_view_on_drag_data_get (GtkWidget *widget, + GdkDragContext *context, + GtkSelectionData *selection_data, + guint info, + guint time, + EDayView *day_view) { EDayViewEvent *event; icalcomponent *vcal; @@ -7831,16 +7885,16 @@ e_day_view_on_drag_data_get (GtkWidget *widget, } static void -e_day_view_on_top_canvas_drag_data_received (GtkWidget *widget, - GdkDragContext *context, - gint x, - gint y, - GtkSelectionData *selection_data, - guint info, - guint time, - EDayView *day_view) -{ - EDayViewEvent *event=NULL; +e_day_view_on_top_canvas_drag_data_received (GtkWidget *widget, + GdkDragContext *context, + gint x, + gint y, + GtkSelectionData *selection_data, + guint info, + guint time, + EDayView *day_view) +{ + EDayViewEvent *event = NULL; ECalendarViewPosition pos; gint day, start_day, end_day, num_days; gint start_offset, end_offset; @@ -7923,9 +7977,9 @@ e_day_view_on_top_canvas_drag_data_received (GtkWidget *widget, client = event->comp_data->client; /* We clone the event since we don't want to change - the original comp here. - Otherwise we would not detect that the event's time - had changed in the "update_event" callback. */ + * the original comp here. + * Otherwise we would not detect that the event's time + * had changed in the "update_event" callback. */ comp = e_cal_component_new (); e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp)); @@ -7950,7 +8004,7 @@ e_day_view_on_top_canvas_drag_data_received (GtkWidget *widget, date.tzid = NULL; } else { /* FIXME: Should probably keep the timezone of - the original start and end times. */ + * the original start and end times. */ date.tzid = icaltimezone_get_tzid (e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); } cal_comp_set_dtstart_with_oldzone (client, comp, &date); @@ -7966,7 +8020,7 @@ e_day_view_on_top_canvas_drag_data_received (GtkWidget *widget, date.tzid = NULL; } else { /* FIXME: Should probably keep the timezone of - the original start and end times. */ + * the original start and end times. */ date.tzid = icaltimezone_get_tzid (e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); } cal_comp_set_dtend_with_oldzone (client, comp, &date); @@ -7977,7 +8031,7 @@ e_day_view_on_top_canvas_drag_data_received (GtkWidget *widget, day_view->drag_event_day = -1; /* Show the text item again, just in case it hasn't - moved. If we don't do this it may not appear. */ + * moved. If we don't do this it may not appear. */ if (event->canvas_item) gnome_canvas_item_show (event->canvas_item); @@ -8075,14 +8129,14 @@ error: } static void -e_day_view_on_main_canvas_drag_data_received (GtkWidget *widget, - GdkDragContext *context, - gint x, - gint y, - GtkSelectionData *selection_data, - guint info, - guint time, - EDayView *day_view) +e_day_view_on_main_canvas_drag_data_received (GtkWidget *widget, + GdkDragContext *context, + gint x, + gint y, + GtkSelectionData *selection_data, + guint info, + guint time, + EDayView *day_view) { ECalendarView *cal_view; EDayViewEvent *event = NULL; @@ -8174,9 +8228,9 @@ e_day_view_on_main_canvas_drag_data_received (GtkWidget *widget, client = event->comp_data->client; /* We use a temporary shallow copy of comp since we - don't want to change the original comp here. - Otherwise we would not detect that the event's time - had changed in the "update_event" callback. */ + * don't want to change the original comp here. + * Otherwise we would not detect that the event's time + * had changed in the "update_event" callback. */ comp = e_cal_component_new (); e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp)); @@ -8204,7 +8258,7 @@ e_day_view_on_main_canvas_drag_data_received (GtkWidget *widget, day_view->drag_event_day = -1; /* Show the text item again, just in case it hasn't - moved. If we don't do this it may not appear. */ + * moved. If we don't do this it may not appear. */ if (event->canvas_item) gnome_canvas_item_show (event->canvas_item); @@ -8302,20 +8356,20 @@ error: } /* Converts an hour from 0-23 to the preferred time format, and returns the - suffix to add and the width of it in the normal font. */ + * suffix to add and the width of it in the normal font. */ void -e_day_view_convert_time_to_display (EDayView *day_view, - gint hour, - gint *display_hour, - const gchar **suffix, - gint *suffix_width) +e_day_view_convert_time_to_display (EDayView *day_view, + gint hour, + gint *display_hour, + const gchar **suffix, + gint *suffix_width) { ECalModel *model; model = e_calendar_view_get_model (E_CALENDAR_VIEW (day_view)); /* Calculate the actual hour number to display. For 12-hour - format we convert 0-23 to 12-11am/12-11pm. */ + * format we convert 0-23 to 12-11am/12-11pm. */ *display_hour = hour; if (e_cal_model_get_use_24_hour_format (model)) { *suffix = ""; @@ -8337,7 +8391,7 @@ e_day_view_convert_time_to_display (EDayView *day_view, } gint -e_day_view_get_time_string_width (EDayView *day_view) +e_day_view_get_time_string_width (EDayView *day_view) { ECalModel *model; gint time_width; diff --git a/calendar/gui/e-day-view.h b/calendar/gui/e-day-view.h index ae1cf79d56..9f43a1ad78 100644 --- a/calendar/gui/e-day-view.h +++ b/calendar/gui/e-day-view.h @@ -38,31 +38,31 @@ G_BEGIN_DECLS */ /* The maximum number of days shown. We use the week view for anything more - than about 9 days. */ + * than about 9 days. */ #define E_DAY_VIEW_MAX_DAYS 10 /* This is used as a special code to signify a long event instead of the day - of a normal event. */ + * of a normal event. */ #define E_DAY_VIEW_LONG_EVENT E_DAY_VIEW_MAX_DAYS /* The maximum number of columns of appointments within a day in multi-day - view. */ + * view. */ #define E_DAY_VIEW_MULTI_DAY_MAX_COLUMNS 6 /* minimum width of the event in one-day view in pixels */ #define E_DAY_VIEW_MIN_DAY_COL_WIDTH 60 /* The width of the gap between appointments. This should be at least - E_DAY_VIEW_BAR_WIDTH, since in the top canvas we use this space to draw - the triangle to represent continuing events. */ + * E_DAY_VIEW_BAR_WIDTH, since in the top canvas we use this space to draw + * the triangle to represent continuing events. */ #define E_DAY_VIEW_GAP_WIDTH 7 /* The width of the bars down the left of each column and appointment. - This includes the borders on each side of it. */ + * This includes the borders on each side of it. */ #define E_DAY_VIEW_BAR_WIDTH 7 /* The height of the horizontal bar above & beneath the selected event. - This includes the borders on the top and bottom. */ + * This includes the borders on the top and bottom. */ #define E_DAY_VIEW_BAR_HEIGHT 6 /* The size of the reminder & recurrence icons, and padding around them. */ @@ -97,8 +97,8 @@ G_BEGIN_DECLS #define E_DAY_VIEW_TOP_CANVAS_Y_GAP 2 /* These are used to get/set the working days in the week. The bit-flags are - combined together. The bits must be from 0 (Sun) to 6 (Sat) to match the - day values used by localtime etc. */ + * combined together. The bits must be from 0 (Sun) to 6 (Sat) to match the + * day values used by localtime etc. */ typedef enum { E_DAY_VIEW_SUNDAY = 1 << 0, @@ -111,7 +111,7 @@ typedef enum } EDayViewDays; /* These are used to specify the type of an appointment. They match those - used in EMeetingTimeSelector. */ + * used in EMeetingTimeSelector. */ typedef enum { E_DAY_VIEW_BUSY_TENTATIVE = 0, @@ -122,10 +122,10 @@ typedef enum } EDayViewBusyType; /* This is used to specify the format used when displaying the dates. - The full format is like 'Thursday 12 September'. The abbreviated format is - like 'Thu 12 Sep'. The no weekday format is like '12 Sep'. The short format - is like '12'. The actual format used is determined in - e_day_view_recalc_cell_sizes (), once we know the font being used. */ + * The full format is like 'Thursday 12 September'. The abbreviated format is + * like 'Thu 12 Sep'. The no weekday format is like '12 Sep'. The short format + * is like '12'. The actual format used is determined in + * e_day_view_recalc_cell_sizes (), once we know the font being used. */ typedef enum { E_DAY_VIEW_DATE_FULL, @@ -172,14 +172,14 @@ struct _EDayViewEvent { E_CALENDAR_VIEW_EVENT_FIELDS /* For events in the main canvas, this contains the start column. - For long events in the top canvas, this is its row. */ + * For long events in the top canvas, this is its row. */ guint8 start_row_or_col; /* For events in the main canvas, this is the number of columns that - it covers. For long events this is set to 1 if the event is shown. - For both types of events this is set to 0 if the event is not shown, - i.e. it couldn't fit into the display. Currently long events are - always shown as we just increase the height of the top canvas. */ + * it covers. For long events this is set to 1 if the event is shown. + * For both types of events this is set to 0 if the event is not shown, + * i.e. it couldn't fit into the display. Currently long events are + * always shown as we just increase the height of the top canvas. */ guint8 num_columns; }; @@ -243,8 +243,8 @@ struct _EDayView { gboolean work_week_view; /* The number of days we are showing. Usually 1 or 5, but can be up - to E_DAY_VIEW_MAX_DAYS, e.g. when the user selects a range of - days in the date navigator. */ + * to E_DAY_VIEW_MAX_DAYS, e.g. when the user selects a range of + * days in the date navigator. */ gint days_shown; /* The start of each day & an extra element to hold the last time. */ @@ -255,8 +255,8 @@ struct _EDayView { GArray *events[E_DAY_VIEW_MAX_DAYS]; /* These are set to FALSE whenever an event in the corresponding array - is changed. Any function that needs the events sorted calls - e_day_view_ensure_events_sorted (). */ + * is changed. Any function that needs the events sorted calls + * e_day_view_ensure_events_sorted (). */ gboolean long_events_sorted; gboolean events_sorted[E_DAY_VIEW_MAX_DAYS]; @@ -265,7 +265,7 @@ struct _EDayView { gboolean need_layout[E_DAY_VIEW_MAX_DAYS]; /* This is TRUE if we need to reshape the canvas items, but a full - layout is not necessary. */ + * layout is not necessary. */ gboolean long_events_need_reshape; gboolean need_reshape[E_DAY_VIEW_MAX_DAYS]; @@ -273,7 +273,7 @@ struct _EDayView { gint layout_timeout_id; /* The number of rows needed, depending on the times shown and the - minutes per row. */ + * minutes per row. */ gint rows; /* The height of each row. */ @@ -286,7 +286,7 @@ struct _EDayView { gint top_row_height; /* The first and last times shown in the display. The last time isn't - included in the range. Default is 0:00-24:00 */ + * included in the range. Default is 0:00-24:00 */ gint first_hour_shown; gint first_minute_shown; gint last_hour_shown; @@ -304,17 +304,17 @@ struct _EDayView { gboolean show_event_end_times; /* This is set to TRUE when the widget is created, so it scrolls to - the start of the working day when first shown. */ + * the start of the working day when first shown. */ gboolean scroll_to_work_day; /* This is the width & offset of each of the day columns in the - display. */ + * display. */ gint day_widths[E_DAY_VIEW_MAX_DAYS]; gint day_offsets[E_DAY_VIEW_MAX_DAYS + 1]; /* An array holding the number of columns in each row, in each day. - Note that there are a maximum of 12 * 24 rows (when a row is 5 mins) - but we don't always have that many rows. */ + * Note that there are a maximum of 12 * 24 rows (when a row is 5 mins) + * but we don't always have that many rows. */ guint8 cols_per_row[E_DAY_VIEW_MAX_DAYS][12 * 24]; /* The maximum number of columns from all rows in cols_per_row */ gint max_cols; @@ -330,14 +330,14 @@ struct _EDayView { EDayViewDateFormat date_format; /* These are the longest month & weekday names in the current font. - Months are 0 to 11. Weekdays are 0 (Sun) to 6 (Sat). */ + * Months are 0 to 11. Weekdays are 0 (Sun) to 6 (Sat). */ gint longest_month_name; gint longest_abbreviated_month_name; gint longest_weekday_name; gint longest_abbreviated_weekday_name; /* The large font used to display the hours. I don't think we need a - fontset since we only display numbers. */ + * fontset since we only display numbers. */ PangoFontDescription *large_font_desc; PangoFontDescription *small_font_desc; @@ -375,7 +375,7 @@ struct _EDayView { gint editing_event_num; /* This is a GnomeCanvasRect which is placed around an item while it - is being resized, so we can raise it above all other EText items. */ + * is being resized, so we can raise it above all other EText items. */ GnomeCanvasItem *resize_long_event_rect_item; GnomeCanvasItem *resize_rect_item; GnomeCanvasItem *resize_bar_item; @@ -385,26 +385,26 @@ struct _EDayView { gint popup_event_num; /* The currently selected region. If selection_start_day is -1 there is - no current selection. If start_row or end_row is -1 then the - selection is in the top canvas. */ + * no current selection. If start_row or end_row is -1 then the + * selection is in the top canvas. */ gint selection_start_day; gint selection_end_day; gint selection_start_row; gint selection_end_row; /* This is TRUE if the selection is currently being dragged using the - mouse. */ + * mouse. */ gboolean selection_is_being_dragged; /* This specifies which end of the selection is being dragged. */ EDayViewDragPosition selection_drag_pos; /* This is TRUE if the selection is in the top canvas only (i.e. if the - last motion event was in the top canvas). */ + * last motion event was in the top canvas). */ gboolean selection_in_top_canvas; /* The last mouse position, relative to the main canvas window. - Used when auto-scrolling to update the selection. */ + * Used when auto-scrolling to update the selection. */ gint last_mouse_x; gint last_mouse_y; @@ -428,13 +428,13 @@ struct _EDayView { gchar *last_edited_comp_string; /* This is the event the mouse button was pressed on. If the button - is released we start editing it, but if the mouse is dragged we set - this to -1. */ + * is released we start editing it, but if the mouse is dragged we set + * this to -1. */ gint pressed_event_day; gint pressed_event_num; /* These are used when dragging events. If drag_event_day is not -1 we - know that we are dragging one of the EDayView events around. */ + * know that we are dragging one of the EDayView events around. */ gint drag_event_day; gint drag_event_num; @@ -443,16 +443,16 @@ struct _EDayView { gint drag_event_y; /* The offset of the mouse from the top of the event, in rows. - In the top canvas this is the offset from the left, in days. */ + * In the top canvas this is the offset from the left, in days. */ gint drag_event_offset; /* The last day & row dragged to, so we know when we need to update - the dragged event's position. */ + * the dragged event's position. */ gint drag_last_day; gint drag_last_row; /* This is a GnomeCanvasRect which is placed around an item while it - is being resized, so we can raise it above all other EText items. */ + * is being resized, so we can raise it above all other EText items. */ GnomeCanvasItem *drag_long_event_rect_item; GnomeCanvasItem *drag_long_event_item; GnomeCanvasItem *drag_rect_item; @@ -466,7 +466,7 @@ struct _EDayView { gint pm_string_width; /* remember last selected interval when click and restore on double click, - if we double clicked inside that interval. */ + * if we double clicked inside that interval. */ guint32 bc_event_time; time_t before_click_dtstart; time_t before_click_dtend; @@ -483,25 +483,25 @@ GType e_day_view_get_type (void); ECalendarView * e_day_view_new (ECalModel *model); /* Whether we are displaying a work-week, in which case the display always - starts on the first day of the working week. */ + * starts on the first day of the working week. */ gboolean e_day_view_get_work_week_view (EDayView *day_view); void e_day_view_set_work_week_view (EDayView *day_view, gboolean work_week_view); /* The number of days shown in the EDayView, from 1 to 7. This is normally - either 1 or 5 (for the Work-Week view). */ + * either 1 or 5 (for the Work-Week view). */ gint e_day_view_get_days_shown (EDayView *day_view); void e_day_view_set_days_shown (EDayView *day_view, gint days_shown); /* This specifies the working days in the week. The value is a bitwise - combination of day flags. Defaults to Mon-Fri. */ + * combination of day flags. Defaults to Mon-Fri. */ EDayViewDays e_day_view_get_working_days (EDayView *day_view); void e_day_view_set_working_days (EDayView *day_view, EDayViewDays days); /* Whether we display the Marcus Bains Line in the main canvas and time - canvas. */ + * canvas. */ void e_day_view_marcus_bains_update (EDayView *day_view); gboolean e_day_view_marcus_bains_get_show_line (EDayView *day_view); void e_day_view_marcus_bains_set_show_line (EDayView *day_view, diff --git a/calendar/gui/e-meeting-attendee.c b/calendar/gui/e-meeting-attendee.c index 5b101a5d61..e783195ec1 100644 --- a/calendar/gui/e-meeting-attendee.c +++ b/calendar/gui/e-meeting-attendee.c @@ -250,7 +250,8 @@ e_meeting_attendee_get_fburi (EMeetingAttendee *ia) } void -e_meeting_attendee_set_fburi (EMeetingAttendee *ia, gchar *fburi) +e_meeting_attendee_set_fburi (EMeetingAttendee *ia, + gchar *fburi) { EMeetingAttendeePrivate *priv; @@ -275,7 +276,8 @@ e_meeting_attendee_get_address (EMeetingAttendee *ia) } void -e_meeting_attendee_set_address (EMeetingAttendee *ia, gchar *address) +e_meeting_attendee_set_address (EMeetingAttendee *ia, + gchar *address) { EMeetingAttendeePrivate *priv; @@ -310,7 +312,8 @@ e_meeting_attendee_get_member (EMeetingAttendee *ia) } void -e_meeting_attendee_set_member (EMeetingAttendee *ia, gchar *member) +e_meeting_attendee_set_member (EMeetingAttendee *ia, + gchar *member) { EMeetingAttendeePrivate *priv; @@ -345,7 +348,8 @@ e_meeting_attendee_get_cutype (EMeetingAttendee *ia) } void -e_meeting_attendee_set_cutype (EMeetingAttendee *ia, icalparameter_cutype cutype) +e_meeting_attendee_set_cutype (EMeetingAttendee *ia, + icalparameter_cutype cutype) { EMeetingAttendeePrivate *priv; @@ -367,7 +371,8 @@ e_meeting_attendee_get_role (EMeetingAttendee *ia) } void -e_meeting_attendee_set_role (EMeetingAttendee *ia, icalparameter_role role) +e_meeting_attendee_set_role (EMeetingAttendee *ia, + icalparameter_role role) { EMeetingAttendeePrivate *priv; @@ -389,7 +394,8 @@ e_meeting_attendee_get_rsvp (EMeetingAttendee *ia) } void -e_meeting_attendee_set_rsvp (EMeetingAttendee *ia, gboolean rsvp) +e_meeting_attendee_set_rsvp (EMeetingAttendee *ia, + gboolean rsvp) { EMeetingAttendeePrivate *priv; @@ -411,7 +417,8 @@ e_meeting_attendee_get_delto (EMeetingAttendee *ia) } void -e_meeting_attendee_set_delto (EMeetingAttendee *ia, gchar *delto) +e_meeting_attendee_set_delto (EMeetingAttendee *ia, + gchar *delto) { EMeetingAttendeePrivate *priv; @@ -446,7 +453,8 @@ e_meeting_attendee_get_delfrom (EMeetingAttendee *ia) } void -e_meeting_attendee_set_delfrom (EMeetingAttendee *ia, gchar *delfrom) +e_meeting_attendee_set_delfrom (EMeetingAttendee *ia, + gchar *delfrom) { EMeetingAttendeePrivate *priv; @@ -481,7 +489,8 @@ e_meeting_attendee_get_status (EMeetingAttendee *ia) } void -e_meeting_attendee_set_status (EMeetingAttendee *ia, icalparameter_partstat status) +e_meeting_attendee_set_status (EMeetingAttendee *ia, + icalparameter_partstat status) { EMeetingAttendeePrivate *priv; @@ -503,7 +512,8 @@ e_meeting_attendee_get_sentby (EMeetingAttendee *ia) } void -e_meeting_attendee_set_sentby (EMeetingAttendee *ia, gchar *sentby) +e_meeting_attendee_set_sentby (EMeetingAttendee *ia, + gchar *sentby) { EMeetingAttendeePrivate *priv; @@ -538,7 +548,8 @@ e_meeting_attendee_get_cn (EMeetingAttendee *ia) } void -e_meeting_attendee_set_cn (EMeetingAttendee *ia, gchar *cn) +e_meeting_attendee_set_cn (EMeetingAttendee *ia, + gchar *cn) { EMeetingAttendeePrivate *priv; @@ -573,7 +584,8 @@ e_meeting_attendee_get_language (EMeetingAttendee *ia) } void -e_meeting_attendee_set_language (EMeetingAttendee *ia, gchar *language) +e_meeting_attendee_set_language (EMeetingAttendee *ia, + gchar *language) { EMeetingAttendeePrivate *priv; @@ -644,7 +656,7 @@ e_meeting_attendee_set_edit_level (EMeetingAttendee *ia, static gint compare_times (EMeetingTime *time1, - EMeetingTime *time2) + EMeetingTime *time2) { gint day_comparison; @@ -669,7 +681,7 @@ compare_times (EMeetingTime *time1, static gint compare_period_starts (gconstpointer arg1, - gconstpointer arg2) + gconstpointer arg2) { EMeetingFreeBusyPeriod *period1, *period2; @@ -730,7 +742,8 @@ e_meeting_attendee_get_busy_periods (EMeetingAttendee *ia) } gint -e_meeting_attendee_find_first_busy_period (EMeetingAttendee *ia, GDate *date) +e_meeting_attendee_find_first_busy_period (EMeetingAttendee *ia, + GDate *date) { EMeetingAttendeePrivate *priv; EMeetingFreeBusyPeriod *period; @@ -743,7 +756,7 @@ e_meeting_attendee_find_first_busy_period (EMeetingAttendee *ia, GDate *date) ensure_periods_sorted (ia); /* Calculate the first day which could have a busy period which - continues onto our given date. */ + * continues onto our given date. */ tmp_date = *date; g_date_subtract_days (&tmp_date, priv->longest_period_in_days); @@ -771,7 +784,7 @@ e_meeting_attendee_find_first_busy_period (EMeetingAttendee *ia, GDate *date) } /* There may be several busy periods on the same day so we step - backwards to the first one. */ + * backwards to the first one. */ if (cmp == 0) { while (middle > 0) { period = &g_array_index (priv->busy_periods, @@ -782,8 +795,8 @@ e_meeting_attendee_find_first_busy_period (EMeetingAttendee *ia, GDate *date) } } else if (cmp > 0) { /* This means we couldn't find a period on the given day, and - the last one we looked at was before it, so if there are - any more periods after this one we return it. */ + * the last one we looked at was before it, so if there are + * any more periods after this one we return it. */ middle++; if (priv->busy_periods->len <= middle) return -1; @@ -794,17 +807,17 @@ e_meeting_attendee_find_first_busy_period (EMeetingAttendee *ia, GDate *date) gboolean e_meeting_attendee_add_busy_period (EMeetingAttendee *ia, - gint start_year, - gint start_month, - gint start_day, - gint start_hour, - gint start_minute, - gint end_year, - gint end_month, - gint end_day, - gint end_hour, - gint end_minute, - EMeetingFreeBusyType busy_type) + gint start_year, + gint start_month, + gint start_day, + gint start_hour, + gint start_minute, + gint end_year, + gint end_month, + gint end_day, + gint end_hour, + gint end_minute, + EMeetingFreeBusyType busy_type) { EMeetingAttendeePrivate *priv; EMeetingFreeBusyPeriod period; @@ -944,11 +957,11 @@ e_meeting_attendee_get_end_busy_range (EMeetingAttendee *ia) gboolean e_meeting_attendee_set_start_busy_range (EMeetingAttendee *ia, - gint start_year, - gint start_month, - gint start_day, - gint start_hour, - gint start_minute) + gint start_year, + gint start_month, + gint start_day, + gint start_hour, + gint start_minute) { EMeetingAttendeePrivate *priv; @@ -977,11 +990,11 @@ e_meeting_attendee_set_start_busy_range (EMeetingAttendee *ia, gboolean e_meeting_attendee_set_end_busy_range (EMeetingAttendee *ia, - gint end_year, - gint end_month, - gint end_day, - gint end_hour, - gint end_minute) + gint end_year, + gint end_month, + gint end_day, + gint end_hour, + gint end_minute) { EMeetingAttendeePrivate *priv; diff --git a/calendar/gui/e-meeting-attendee.h b/calendar/gui/e-meeting-attendee.h index 145e28c59b..bc2eaa046b 100644 --- a/calendar/gui/e-meeting-attendee.h +++ b/calendar/gui/e-meeting-attendee.h @@ -42,9 +42,9 @@ typedef struct _EMeetingAttendeePrivate EMeetingAttendeePrivate; typedef struct _EMeetingAttendeeClass EMeetingAttendeeClass; /* These specify the type of attendee. Either a person or a resource (e.g. a - meeting room). These are used for the Autopick options, where the user can - ask for a time when, for example, all people and one resource are free. - The default is E_MEETING_ATTENDEE_REQUIRED_PERSON. */ + * meeting room). These are used for the Autopick options, where the user can + * ask for a time when, for example, all people and one resource are free. + * The default is E_MEETING_ATTENDEE_REQUIRED_PERSON. */ typedef enum { E_MEETING_ATTENDEE_REQUIRED_PERSON, diff --git a/calendar/gui/e-meeting-list-view.c b/calendar/gui/e-meeting-list-view.c index 5283b5e385..c27697b40f 100644 --- a/calendar/gui/e-meeting-list-view.c +++ b/calendar/gui/e-meeting-list-view.c @@ -119,7 +119,8 @@ e_meeting_list_view_class_init (EMeetingListViewClass *klass) } static void -add_section (ENameSelector *name_selector, const gchar *name) +add_section (ENameSelector *name_selector, + const gchar *name) { ENameSelectorModel *name_selector_model; @@ -219,7 +220,10 @@ get_status_strings (void) } static void -value_edited (GtkTreeView *view, gint col, const gchar *path, const gchar *text) +value_edited (GtkTreeView *view, + gint col, + const gchar *path, + const gchar *text) { EMeetingStore *model = E_MEETING_STORE (gtk_tree_view_get_model (view)); GtkTreePath *treepath = gtk_tree_path_new_from_string (path); @@ -247,7 +251,8 @@ get_index_from_role (icalparameter_role role) } void -e_meeting_list_view_add_attendee_to_name_selector (EMeetingListView *view, EMeetingAttendee *ma) +e_meeting_list_view_add_attendee_to_name_selector (EMeetingListView *view, + EMeetingAttendee *ma) { EDestinationStore *destination_store; ENameSelectorModel *name_selector_model; @@ -269,7 +274,8 @@ e_meeting_list_view_add_attendee_to_name_selector (EMeetingListView *view, EMeet } void -e_meeting_list_view_remove_attendee_from_name_selector (EMeetingListView *view, EMeetingAttendee *ma) +e_meeting_list_view_remove_attendee_from_name_selector (EMeetingListView *view, + EMeetingAttendee *ma) { GList *destinations, *l; EDestinationStore *destination_store; @@ -359,7 +365,11 @@ e_meeting_list_view_remove_all_attendees_from_name_selector (EMeetingListView *v } static void -attendee_edited_cb (GtkCellRenderer *renderer, const gchar *path, GList *addresses, GList *names, GtkTreeView *view) +attendee_edited_cb (GtkCellRenderer *renderer, + const gchar *path, + GList *addresses, + GList *names, + GtkTreeView *view) { EMeetingStore *model = E_MEETING_STORE (gtk_tree_view_get_model (view)); GtkTreePath *treepath = gtk_tree_path_new_from_string (path); @@ -458,7 +468,8 @@ attendee_edited_cb (GtkCellRenderer *renderer, const gchar *path, GList *address } static void -attendee_editing_canceled_cb (GtkCellRenderer *renderer, GtkTreeView *view) +attendee_editing_canceled_cb (GtkCellRenderer *renderer, + GtkTreeView *view) { EMeetingStore *model = E_MEETING_STORE (gtk_tree_view_get_model (view)); GtkTreePath *path; @@ -481,13 +492,19 @@ attendee_editing_canceled_cb (GtkCellRenderer *renderer, GtkTreeView *view) } static void -type_edited_cb (GtkCellRenderer *renderer, const gchar *path, const gchar *text, GtkTreeView *view) +type_edited_cb (GtkCellRenderer *renderer, + const gchar *path, + const gchar *text, + GtkTreeView *view) { value_edited (view, E_MEETING_STORE_TYPE_COL, path, text); } static void -role_edited_cb (GtkCellRenderer *renderer, const gchar *path, const gchar *text, GtkTreeView *view) +role_edited_cb (GtkCellRenderer *renderer, + const gchar *path, + const gchar *text, + GtkTreeView *view) { /* This is a little more complex than the other callbacks because * we also need to update the "Required Participants" dialog. */ @@ -506,28 +523,36 @@ role_edited_cb (GtkCellRenderer *renderer, const gchar *path, const gchar *text, } static void -rsvp_edited_cb (GtkCellRenderer *renderer, const gchar *path, const gchar *text, GtkTreeView *view) +rsvp_edited_cb (GtkCellRenderer *renderer, + const gchar *path, + const gchar *text, + GtkTreeView *view) { value_edited (view, E_MEETING_STORE_RSVP_COL, path, text); } static void -status_edited_cb (GtkCellRenderer *renderer, const gchar *path, const gchar *text, GtkTreeView *view) +status_edited_cb (GtkCellRenderer *renderer, + const gchar *path, + const gchar *text, + GtkTreeView *view) { value_edited (view, E_MEETING_STORE_STATUS_COL, path, text); } static void -ense_update (GtkWidget *w, gpointer data1, gpointer user_data) +ense_update (GtkWidget *w, + gpointer data1, + gpointer user_data) { gtk_cell_editable_editing_done ((GtkCellEditable *) w); } static void editing_started_cb (GtkCellRenderer *renderer, - GtkCellEditable *editable, - gchar *path, - gpointer user_data) + GtkCellEditable *editable, + gchar *path, + gpointer user_data) { g_signal_connect (editable, "updated", G_CALLBACK(ense_update), NULL); } @@ -548,7 +573,7 @@ build_table (EMeetingListView *lview) gtk_tree_view_set_rules_hint (view, TRUE); renderer = e_select_names_renderer_new (); - g_object_set (G_OBJECT (renderer), "editable", TRUE, NULL); + g_object_set (renderer, "editable", TRUE, NULL); /* The extra space is just a hack to occupy more space for Attendee */ pos = gtk_tree_view_insert_column_with_attributes (view, -1, _("Attendee "), renderer, "text", E_MEETING_STORE_ATTENDEE_COL, @@ -621,82 +646,95 @@ build_table (EMeetingListView *lview) } static void -change_edit_cols_for_user (gpointer key, gpointer value, gpointer user_data) -{ - GtkCellRenderer *renderer = (GtkCellRenderer *) value; - gint key_val = GPOINTER_TO_INT (key); - switch (key_val) - { - case E_MEETING_STORE_ATTENDEE_COL: - g_object_set (G_OBJECT (renderer), "editable", FALSE, NULL); - break; - case E_MEETING_STORE_ROLE_COL: - g_object_set (G_OBJECT (renderer), "editable", FALSE, NULL); - break; - case E_MEETING_STORE_TYPE_COL: - g_object_set (G_OBJECT (renderer), "editable", FALSE, NULL); - break; - case E_MEETING_STORE_RSVP_COL: - g_object_set (G_OBJECT (renderer), "editable", TRUE, NULL); - break; - case E_MEETING_STORE_STATUS_COL: - g_object_set (G_OBJECT (renderer), "editable", TRUE, NULL); - break; - } +change_edit_cols_for_user (gpointer key, + gpointer value, + gpointer user_data) +{ + GtkCellRenderer *renderer = (GtkCellRenderer *) value; + gint key_val = GPOINTER_TO_INT (key); + + switch (key_val) { + case E_MEETING_STORE_ATTENDEE_COL: + g_object_set (renderer, "editable", FALSE, NULL); + break; + case E_MEETING_STORE_ROLE_COL: + g_object_set (renderer, "editable", FALSE, NULL); + break; + case E_MEETING_STORE_TYPE_COL: + g_object_set (renderer, "editable", FALSE, NULL); + break; + case E_MEETING_STORE_RSVP_COL: + g_object_set (renderer, "editable", TRUE, NULL); + break; + case E_MEETING_STORE_STATUS_COL: + g_object_set (renderer, "editable", TRUE, NULL); + break; + } } static void -change_edit_cols_for_organizer (gpointer key, gpointer value, gpointer user_data) +change_edit_cols_for_organizer (gpointer key, + gpointer value, + gpointer user_data) { - GtkCellRenderer *renderer = (GtkCellRenderer *) value; - guint edit_level = GPOINTER_TO_INT (user_data); - g_object_set (G_OBJECT (renderer), "editable", GINT_TO_POINTER (edit_level), NULL); + GtkCellRenderer *renderer = (GtkCellRenderer *) value; + guint edit_level = GPOINTER_TO_INT (user_data); + + g_object_set (renderer, "editable", GINT_TO_POINTER (edit_level), NULL); } static void -row_activated_cb (GtkTreeSelection *selection, EMeetingListView *view) -{ - EMeetingAttendee *existing_attendee; - EMeetingListViewPrivate *priv; - gint row; - EMeetingAttendeeEditLevel el; - gint edit_level; - GtkTreeModel *model; - GtkTreePath *path = NULL; - GList *paths=NULL; - - priv = view->priv; - - if (!(paths = gtk_tree_selection_get_selected_rows (selection, &model))) - return; - if (g_list_length (paths) > 1) - return; - path = g_list_nth_data (paths, 0); - if (!path) - return; - - row = gtk_tree_path_get_indices (path)[0]; - existing_attendee = e_meeting_store_find_attendee_at_row (priv->store, row); - el = e_meeting_attendee_get_edit_level (existing_attendee); - - switch (el) - { - case E_MEETING_ATTENDEE_EDIT_NONE: - edit_level = FALSE; - g_hash_table_foreach (priv->renderers, change_edit_cols_for_organizer, GINT_TO_POINTER (edit_level)); - break; - - case E_MEETING_ATTENDEE_EDIT_FULL: - edit_level = TRUE; - g_hash_table_foreach (priv->renderers, change_edit_cols_for_organizer, GINT_TO_POINTER (edit_level)); - break; - - case E_MEETING_ATTENDEE_EDIT_STATUS: - edit_level = FALSE; - g_hash_table_foreach (priv->renderers, change_edit_cols_for_user, GINT_TO_POINTER (edit_level)); - break; - } +row_activated_cb (GtkTreeSelection *selection, + EMeetingListView *view) +{ + EMeetingAttendee *existing_attendee; + EMeetingListViewPrivate *priv; + gint row; + EMeetingAttendeeEditLevel el; + gint edit_level; + GtkTreeModel *model; + GtkTreePath *path = NULL; + GList *paths = NULL; + priv = view->priv; + + if (!(paths = gtk_tree_selection_get_selected_rows (selection, &model))) + return; + if (g_list_length (paths) > 1) + return; + path = g_list_nth_data (paths, 0); + if (!path) + return; + + row = gtk_tree_path_get_indices (path)[0]; + existing_attendee = e_meeting_store_find_attendee_at_row (priv->store, row); + el = e_meeting_attendee_get_edit_level (existing_attendee); + + switch (el) { + case E_MEETING_ATTENDEE_EDIT_NONE: + edit_level = FALSE; + g_hash_table_foreach ( + priv->renderers, + change_edit_cols_for_organizer, + GINT_TO_POINTER (edit_level)); + break; + + case E_MEETING_ATTENDEE_EDIT_FULL: + edit_level = TRUE; + g_hash_table_foreach ( + priv->renderers, + change_edit_cols_for_organizer, + GINT_TO_POINTER (edit_level)); + break; + + case E_MEETING_ATTENDEE_EDIT_STATUS: + edit_level = FALSE; + g_hash_table_foreach ( + priv->renderers, + change_edit_cols_for_user, + GINT_TO_POINTER (edit_level)); + break; + } } EMeetingListView * @@ -717,7 +755,9 @@ e_meeting_list_view_new (EMeetingStore *store) } void -e_meeting_list_view_column_set_visible (EMeetingListView *view, EMeetingStoreColumns column, gboolean visible) +e_meeting_list_view_column_set_visible (EMeetingListView *view, + EMeetingStoreColumns column, + gboolean visible) { GList *cols, *l; @@ -735,7 +775,8 @@ e_meeting_list_view_column_set_visible (EMeetingListView *view, EMeetingStoreCol } void -e_meeting_list_view_edit (EMeetingListView *emlv, EMeetingAttendee *attendee) +e_meeting_list_view_edit (EMeetingListView *emlv, + EMeetingAttendee *attendee) { EMeetingListViewPrivate *priv; GtkTreePath *path; @@ -758,7 +799,10 @@ e_meeting_list_view_edit (EMeetingListView *emlv, EMeetingAttendee *attendee) } static void -process_section (EMeetingListView *view, GList *destinations, icalparameter_role role, GSList **la) +process_section (EMeetingListView *view, + GList *destinations, + icalparameter_role role, + GSList **la) { EMeetingListViewPrivate *priv; GList *l; @@ -877,7 +921,8 @@ process_section (EMeetingListView *view, GList *destinations, icalparameter_role } static void -add_to_list (gpointer data, gpointer u_data) +add_to_list (gpointer data, + gpointer u_data) { GSList **user_data = u_data; @@ -885,7 +930,9 @@ add_to_list (gpointer data, gpointer u_data) } static void -name_selector_dialog_close_cb (ENameSelectorDialog *dialog, gint response, gpointer data) +name_selector_dialog_close_cb (ENameSelectorDialog *dialog, + gint response, + gpointer data) { EMeetingListView *view = E_MEETING_LIST_VIEW (data); ENameSelectorModel *name_selector_model; @@ -945,7 +992,8 @@ e_meeting_list_view_invite_others_dialog (EMeetingListView *view) } void -e_meeting_list_view_set_editable (EMeetingListView *lview, gboolean set) +e_meeting_list_view_set_editable (EMeetingListView *lview, + gboolean set) { EMeetingListViewPrivate *priv = lview->priv; @@ -968,7 +1016,8 @@ e_meeting_list_view_get_name_selector (EMeetingListView *lview) } void -e_meeting_list_view_set_name_selector (EMeetingListView *lview, ENameSelector *name_selector) +e_meeting_list_view_set_name_selector (EMeetingListView *lview, + ENameSelector *name_selector) { EMeetingListViewPrivate *priv; diff --git a/calendar/gui/e-meeting-store.c b/calendar/gui/e-meeting-store.c index 5a9176a094..51ce798a8b 100644 --- a/calendar/gui/e-meeting-store.c +++ b/calendar/gui/e-meeting-store.c @@ -252,7 +252,8 @@ get_n_columns (GtkTreeModel *model) } static GType -get_column_type (GtkTreeModel *model, gint col) +get_column_type (GtkTreeModel *model, + gint col) { g_return_val_if_fail (E_IS_MEETING_STORE (model), G_TYPE_INVALID); @@ -277,7 +278,9 @@ get_column_type (GtkTreeModel *model, gint col) } static gboolean -get_iter (GtkTreeModel *model, GtkTreeIter *iter, GtkTreePath *path) +get_iter (GtkTreeModel *model, + GtkTreeIter *iter, + GtkTreePath *path) { gint row; @@ -296,7 +299,8 @@ get_iter (GtkTreeModel *model, GtkTreeIter *iter, GtkTreePath *path) } static GtkTreePath * -get_path (GtkTreeModel *model, GtkTreeIter *iter) +get_path (GtkTreeModel *model, + GtkTreeIter *iter) { gint row; GtkTreePath *result; @@ -314,7 +318,10 @@ get_path (GtkTreeModel *model, GtkTreeIter *iter) } static void -get_value (GtkTreeModel *model, GtkTreeIter *iter, gint col, GValue *value) +get_value (GtkTreeModel *model, + GtkTreeIter *iter, + gint col, + GValue *value) { EMeetingStore *store; EMeetingAttendee *attendee; @@ -410,7 +417,8 @@ get_value (GtkTreeModel *model, GtkTreeIter *iter, gint col, GValue *value) } static gboolean -iter_next (GtkTreeModel *model, GtkTreeIter *iter) +iter_next (GtkTreeModel *model, + GtkTreeIter *iter) { gint row; @@ -424,7 +432,9 @@ iter_next (GtkTreeModel *model, GtkTreeIter *iter) } static gboolean -iter_children (GtkTreeModel *model, GtkTreeIter *iter, GtkTreeIter *parent) +iter_children (GtkTreeModel *model, + GtkTreeIter *iter, + GtkTreeIter *parent) { EMeetingStore *store; @@ -442,13 +452,15 @@ iter_children (GtkTreeModel *model, GtkTreeIter *iter, GtkTreeIter *parent) } static gboolean -iter_has_child (GtkTreeModel *model, GtkTreeIter *iter) +iter_has_child (GtkTreeModel *model, + GtkTreeIter *iter) { return FALSE; } static gint -iter_n_children (GtkTreeModel *model, GtkTreeIter *iter) +iter_n_children (GtkTreeModel *model, + GtkTreeIter *iter) { g_return_val_if_fail (E_IS_MEETING_STORE (model), -1); @@ -461,7 +473,10 @@ iter_n_children (GtkTreeModel *model, GtkTreeIter *iter) } static gboolean -iter_nth_child (GtkTreeModel *model, GtkTreeIter *iter, GtkTreeIter *parent, gint n) +iter_nth_child (GtkTreeModel *model, + GtkTreeIter *iter, + GtkTreeIter *parent, + gint n) { EMeetingStore *store; @@ -479,7 +494,9 @@ iter_nth_child (GtkTreeModel *model, GtkTreeIter *iter, GtkTreeIter *parent, gin } static gboolean -iter_parent (GtkTreeModel *model, GtkTreeIter *iter, GtkTreeIter *child) +iter_parent (GtkTreeModel *model, + GtkTreeIter *iter, + GtkTreeIter *child) { return FALSE; } @@ -502,7 +519,10 @@ ems_tree_model_init (GtkTreeModelIface *iface) } void -e_meeting_store_set_value (EMeetingStore *store, gint row, gint col, const gchar *val) +e_meeting_store_set_value (EMeetingStore *store, + gint row, + gint col, + const gchar *val) { icalparameter_cutype type; EMeetingAttendee *attendee = g_ptr_array_index (store->priv->attendees, row); @@ -555,7 +575,9 @@ struct FindAttendeeData }; static void -find_attendee_cb (gpointer key, gpointer value, gpointer user_data) +find_attendee_cb (gpointer key, + gpointer value, + gpointer user_data) { EMeetingStoreQueueData *qdata = value; struct FindAttendeeData *fad = user_data; @@ -568,7 +590,8 @@ find_attendee_cb (gpointer key, gpointer value, gpointer user_data) } static void -refresh_queue_remove (EMeetingStore *store, EMeetingAttendee *attendee) +refresh_queue_remove (EMeetingStore *store, + EMeetingAttendee *attendee) { EMeetingStorePrivate *priv; EMeetingStoreQueueData *qdata; @@ -964,7 +987,8 @@ e_meeting_store_set_week_start_day (EMeetingStore *store, } static void -attendee_changed_cb (EMeetingAttendee *attendee, gpointer data) +attendee_changed_cb (EMeetingAttendee *attendee, + gpointer data) { EMeetingStore *store = E_MEETING_STORE (data); GtkTreePath *path; @@ -989,7 +1013,8 @@ attendee_changed_cb (EMeetingAttendee *attendee, gpointer data) } void -e_meeting_store_add_attendee (EMeetingStore *store, EMeetingAttendee *attendee) +e_meeting_store_add_attendee (EMeetingStore *store, + EMeetingAttendee *attendee) { GtkTreePath *path; GtkTreeIter iter; @@ -1045,7 +1070,8 @@ e_meeting_store_add_attendee_with_defaults (EMeetingStore *store) } void -e_meeting_store_remove_attendee (EMeetingStore *store, EMeetingAttendee *attendee) +e_meeting_store_remove_attendee (EMeetingStore *store, + EMeetingAttendee *attendee) { gint i, row = -1; GtkTreePath *path; @@ -1170,7 +1196,8 @@ e_meeting_store_find_attendee (EMeetingStore *store, } EMeetingAttendee * -e_meeting_store_find_attendee_at_row (EMeetingStore *store, gint row) +e_meeting_store_find_attendee_at_row (EMeetingStore *store, + gint row) { g_return_val_if_fail (E_IS_MEETING_STORE (store), NULL); g_return_val_if_fail (ROW_VALID (store, row), NULL); @@ -1179,7 +1206,8 @@ e_meeting_store_find_attendee_at_row (EMeetingStore *store, gint row) } GtkTreePath * -e_meeting_store_find_attendee_path (EMeetingStore *store, EMeetingAttendee *attendee) +e_meeting_store_find_attendee_path (EMeetingStore *store, + EMeetingAttendee *attendee) { GtkTreePath *path; gint row = -1, i; @@ -1217,7 +1245,8 @@ e_meeting_store_get_attendees (EMeetingStore *store) } static icaltimezone * -find_zone (icalproperty *ip, icalcomponent *tz_top_level) +find_zone (icalproperty *ip, + icalcomponent *tz_top_level) { icalparameter *param; icalcomponent *sub_comp; @@ -1284,9 +1313,9 @@ process_callbacks (EMeetingStoreQueueData *qdata) static void process_free_busy_comp (EMeetingAttendee *attendee, - icalcomponent *fb_comp, - icaltimezone *zone, - icalcomponent *tz_top_level) + icalcomponent *fb_comp, + icaltimezone *zone, + icalcomponent *tz_top_level) { icalproperty *ip; @@ -1385,7 +1414,8 @@ process_free_busy_comp (EMeetingAttendee *attendee, } static void -process_free_busy (EMeetingStoreQueueData *qdata, gchar *text) +process_free_busy (EMeetingStoreQueueData *qdata, + gchar *text) { EMeetingStore *store = qdata->store; EMeetingStorePrivate *priv; @@ -1439,7 +1469,9 @@ process_free_busy (EMeetingStoreQueueData *qdata, gchar *text) * In the returned newly allocated string. */ static gchar * -replace_string (gchar *string, const gchar *from_value, gchar *to_value) +replace_string (gchar *string, + const gchar *from_value, + gchar *to_value) { gchar *replaced; gchar **split_uri; @@ -1673,11 +1705,12 @@ refresh_busy_periods (gpointer data) } static void -refresh_queue_add (EMeetingStore *store, gint row, - EMeetingTime *start, - EMeetingTime *end, - EMeetingStoreRefreshCallback call_back, - gpointer data) +refresh_queue_add (EMeetingStore *store, + gint row, + EMeetingTime *start, + EMeetingTime *end, + EMeetingStoreRefreshCallback call_back, + gpointer data) { EMeetingStorePrivate *priv; EMeetingAttendee *attendee; @@ -1744,7 +1777,9 @@ refresh_queue_add (EMeetingStore *store, gint row, } static void -async_read (GObject *source_object, GAsyncResult *res, gpointer data) +async_read (GObject *source_object, + GAsyncResult *result, + gpointer data) { EMeetingStoreQueueData *qdata = data; GError *error = NULL; @@ -1756,7 +1791,7 @@ async_read (GObject *source_object, GAsyncResult *res, gpointer data) istream = G_INPUT_STREAM (source_object); - read = g_input_stream_read_finish (istream, res, &error); + read = g_input_stream_read_finish (istream, result, &error); if (error || read < 0) { g_warning ("Read finish failed: %s", error ? error->message : "Unknown error"); @@ -1874,7 +1909,8 @@ soup_authenticate (SoupSession *session, } static void -redirect_handler (SoupMessage *msg, gpointer user_data) +redirect_handler (SoupMessage *msg, + gpointer user_data) { if (SOUP_STATUS_IS_REDIRECTION (msg->status_code)) { SoupSession *soup_session = user_data; @@ -1901,7 +1937,9 @@ redirect_handler (SoupMessage *msg, gpointer user_data) } static void -soup_msg_ready_cb (SoupSession *session, SoupMessage *msg, gpointer user_data) +soup_msg_ready_cb (SoupSession *session, + SoupMessage *msg, + gpointer user_data) { EMeetingStoreQueueData *qdata = user_data; @@ -1926,7 +1964,8 @@ soup_msg_ready_cb (SoupSession *session, SoupMessage *msg, gpointer user_data) } static void -download_with_libsoup (const gchar *uri, EMeetingStoreQueueData *qdata) +download_with_libsoup (const gchar *uri, + EMeetingStoreQueueData *qdata) { SoupSession *session; SoupMessage *msg; @@ -1968,7 +2007,8 @@ download_with_libsoup (const gchar *uri, EMeetingStoreQueueData *qdata) } static void -start_async_read (const gchar *uri, gpointer data) +start_async_read (const gchar *uri, + gpointer data) { EMeetingStoreQueueData *qdata = data; GError *error = NULL; @@ -2011,10 +2051,10 @@ start_async_read (const gchar *uri, gpointer data) void e_meeting_store_refresh_all_busy_periods (EMeetingStore *store, - EMeetingTime *start, - EMeetingTime *end, - EMeetingStoreRefreshCallback call_back, - gpointer data) + EMeetingTime *start, + EMeetingTime *end, + EMeetingStoreRefreshCallback call_back, + gpointer data) { gint i; @@ -2026,11 +2066,11 @@ e_meeting_store_refresh_all_busy_periods (EMeetingStore *store, void e_meeting_store_refresh_busy_periods (EMeetingStore *store, - gint row, - EMeetingTime *start, - EMeetingTime *end, - EMeetingStoreRefreshCallback call_back, - gpointer data) + gint row, + EMeetingTime *start, + EMeetingTime *end, + EMeetingStoreRefreshCallback call_back, + gpointer data) { g_return_if_fail (E_IS_MEETING_STORE (store)); diff --git a/calendar/gui/e-meeting-time-sel-item.c b/calendar/gui/e-meeting-time-sel-item.c index 01572ce359..35f3a7d743 100644 --- a/calendar/gui/e-meeting-time-sel-item.c +++ b/calendar/gui/e-meeting-time-sel-item.c @@ -34,9 +34,9 @@ #include "e-meeting-time-sel.h" /* Initially the grid lines were drawn at the bottom of cells, but this didn't - line up well with the GtkEntry widgets, which in the default theme draw a - black shadow line across the top. So I've switched our code to draw the - lines across the top of cells. */ + * line up well with the GtkEntry widgets, which in the default theme draw a + * black shadow line across the top. So I've switched our code to draw the + * lines across the top of cells. */ #define E_MEETING_TIME_SELECTOR_DRAW_GRID_LINES_AT_BOTTOM 0 static void e_meeting_time_selector_item_dispose (GObject *object); @@ -183,7 +183,9 @@ e_meeting_time_selector_item_set_property (GObject *object, } static void -e_meeting_time_selector_item_update (GnomeCanvasItem *item, const cairo_matrix_t *i2c, gint flags) +e_meeting_time_selector_item_update (GnomeCanvasItem *item, + const cairo_matrix_t *i2c, + gint flags) { if (GNOME_CANVAS_ITEM_CLASS (e_meeting_time_selector_item_parent_class)->update) (* GNOME_CANVAS_ITEM_CLASS (e_meeting_time_selector_item_parent_class)->update) (item, i2c, flags); @@ -200,8 +202,12 @@ e_meeting_time_selector_item_update (GnomeCanvasItem *item, const cairo_matrix_t */ static void -draw_strikeout_box (EMeetingTimeSelectorItem *mts_item, cairo_t *cr, - gint x, gint y, gint width, gint height) +draw_strikeout_box (EMeetingTimeSelectorItem *mts_item, + cairo_t *cr, + gint x, + gint y, + gint width, + gint height) { GnomeCanvas *canvas = GNOME_CANVAS_ITEM (mts_item)->canvas; EMeetingTimeSelector *mts = mts_item->mts; @@ -219,7 +225,12 @@ draw_strikeout_box (EMeetingTimeSelectorItem *mts_item, cairo_t *cr, } static void -e_meeting_time_selector_item_draw (GnomeCanvasItem *item, cairo_t *cr, gint x, gint y, gint width, gint height) +e_meeting_time_selector_item_draw (GnomeCanvasItem *item, + cairo_t *cr, + gint x, + gint y, + gint width, + gint height) { EMeetingTimeSelector *mts; EMeetingTimeSelectorItem *mts_item; @@ -278,7 +289,7 @@ e_meeting_time_selector_item_draw (GnomeCanvasItem *item, cairo_t *cr, gint x, g } /* For the main display draw the no-info pattern background for attendee's - that have no calendar information. */ + * that have no calendar information. */ if (!is_display_top) { gdk_cairo_set_source_color (cr, &mts->grid_color); row = y / mts->row_height; @@ -317,8 +328,8 @@ e_meeting_time_selector_item_draw (GnomeCanvasItem *item, cairo_t *cr, gint x, g current_date = date; for (;;) { /* Currently we use the same GnomeCanvasItem class for the - top display and the main display. We may use separate - classes in future if necessary. */ + * top display and the main display. We may use separate + * classes in future if necessary. */ if (is_display_top) e_meeting_time_selector_item_paint_day_top (mts_item, cr, ¤t_date, day_x, y, width, height); else @@ -369,9 +380,12 @@ e_meeting_time_selector_item_draw (GnomeCanvasItem *item, cairo_t *cr, gint x, g static void e_meeting_time_selector_item_paint_day_top (EMeetingTimeSelectorItem *mts_item, - cairo_t *cr, GDate *date, - gint x, gint scroll_y, - gint width, gint height) + cairo_t *cr, + GDate *date, + gint x, + gint scroll_y, + gint width, + gint height) { EMeetingTimeSelector *mts; gint y, grid_x; @@ -424,18 +438,18 @@ e_meeting_time_selector_item_paint_day_top (EMeetingTimeSelectorItem *mts_item, cairo_stroke (cr); /* Draw the date. Set a clipping rectangle so we don't draw over the - next day. */ + * next day. */ if (mts->date_format == E_MEETING_TIME_SELECTOR_DATE_FULL) /* This is a strftime() format string %A = full weekday name, - %B = full month name, %d = month day, %Y = full year. */ + * %B = full month name, %d = month day, %Y = full year. */ format = _("%A, %B %d, %Y"); else if (mts->date_format == E_MEETING_TIME_SELECTOR_DATE_ABBREVIATED_DAY) /* This is a strftime() format string %a = abbreviated weekday - name, %m = month number, %d = month day, %Y = full year. */ + * name, %m = month number, %d = month day, %Y = full year. */ format = _("%a %m/%d/%Y"); else /* This is a strftime() format string %m = month number, - %d = month day, %Y = full year. */ + * %d = month day, %Y = full year. */ format = _("%m/%d/%Y"); g_date_strftime (buffer, sizeof (buffer), format, date); @@ -473,10 +487,16 @@ e_meeting_time_selector_item_paint_day_top (EMeetingTimeSelectorItem *mts_item, } /* This paints the colored bars representing busy periods for the combined - list of attendees. For now we just paint the bars for each attendee of - each other. If we want to speed it up we could optimise it later. */ + * list of attendees. For now we just paint the bars for each attendee of + * each other. If we want to speed it up we could optimise it later. */ static void -e_meeting_time_selector_item_paint_all_attendees_busy_periods (EMeetingTimeSelectorItem *mts_item, cairo_t *cr, GDate *date, gint x, gint scroll_y, gint width, gint height) +e_meeting_time_selector_item_paint_all_attendees_busy_periods (EMeetingTimeSelectorItem *mts_item, + cairo_t *cr, + GDate *date, + gint x, + gint scroll_y, + gint width, + gint height) { EMeetingTimeSelector *mts; EMeetingFreeBusyType busy_type; @@ -509,9 +529,12 @@ e_meeting_time_selector_item_paint_all_attendees_busy_periods (EMeetingTimeSelec static void e_meeting_time_selector_item_paint_day (EMeetingTimeSelectorItem *mts_item, - cairo_t *cr, GDate *date, - gint x, gint scroll_y, - gint width, gint height) + cairo_t *cr, + GDate *date, + gint x, + gint scroll_y, + gint width, + gint height) { EMeetingTimeSelector *mts; gint grid_x, grid_y, attendee_index, unused_y; @@ -522,7 +545,7 @@ e_meeting_time_selector_item_paint_day (EMeetingTimeSelectorItem *mts_item, mts = mts_item->mts; /* Draw the grid lines. The grid lines around unused rows are drawn in - a different color. */ + * a different color. */ /* Draw the horizontal grid lines. */ attendee_index = scroll_y / mts->row_height; @@ -585,9 +608,15 @@ e_meeting_time_selector_item_paint_day (EMeetingTimeSelectorItem *mts_item, } /* This paints the colored bars representing busy periods for the individual - attendees. */ + * attendees. */ static void -e_meeting_time_selector_item_paint_busy_periods (EMeetingTimeSelectorItem *mts_item, cairo_t *cr, GDate *date, gint x, gint scroll_y, gint width, gint height) +e_meeting_time_selector_item_paint_busy_periods (EMeetingTimeSelectorItem *mts_item, + cairo_t *cr, + GDate *date, + gint x, + gint scroll_y, + gint width, + gint height) { EMeetingTimeSelector *mts; EMeetingFreeBusyType busy_type; @@ -608,8 +637,8 @@ e_meeting_time_selector_item_paint_busy_periods (EMeetingTimeSelectorItem *mts_i first_period = e_meeting_time_selector_item_find_first_busy_period (mts_item, date, row); if (first_period != -1) { /* Paint the different types of busy periods, in - reverse order of precedence, so the highest - precedences are displayed. */ + * reverse order of precedence, so the highest + * precedences are displayed. */ for (busy_type = 0; busy_type < E_MEETING_FREE_BUSY_LAST; busy_type++) { @@ -623,11 +652,13 @@ e_meeting_time_selector_item_paint_busy_periods (EMeetingTimeSelectorItem *mts_i } /* This subtracts the attendees longest_period_in_days from the given date, - and does a binary search of the attendee's busy periods array to find the - first one which could possible end on the given day or later. - If none are found it returns -1. */ + * and does a binary search of the attendee's busy periods array to find the + * first one which could possible end on the given day or later. + * If none are found it returns -1. */ static gint -e_meeting_time_selector_item_find_first_busy_period (EMeetingTimeSelectorItem *mts_item, GDate *date, gint row) +e_meeting_time_selector_item_find_first_busy_period (EMeetingTimeSelectorItem *mts_item, + GDate *date, + gint row) { EMeetingTimeSelector *mts; EMeetingAttendee *ia; @@ -644,7 +675,7 @@ e_meeting_time_selector_item_find_first_busy_period (EMeetingTimeSelectorItem *m return -1; /* Check if the period starts after the end of the current canvas - scroll area. */ + * scroll area. */ busy_periods = e_meeting_attendee_get_busy_periods (ia); period = &g_array_index (busy_periods, EMeetingFreeBusyPeriod, period_num); if (g_date_compare (&mts->last_date_shown, &period->start.date) < 0) @@ -654,10 +685,17 @@ e_meeting_time_selector_item_find_first_busy_period (EMeetingTimeSelectorItem *m } /* This paints the visible busy periods for one attendee which are of a certain - busy type, e.g out of office. It is passed the index of the first visible - busy period of the attendee and continues until it runs off the screen. */ + * busy type, e.g out of office. It is passed the index of the first visible + * busy period of the attendee and continues until it runs off the screen. */ static void -e_meeting_time_selector_item_paint_attendee_busy_periods (EMeetingTimeSelectorItem *mts_item, cairo_t *cr, gint x, gint y, gint width, gint row, gint first_period, EMeetingFreeBusyType busy_type) +e_meeting_time_selector_item_paint_attendee_busy_periods (EMeetingTimeSelectorItem *mts_item, + cairo_t *cr, + gint x, + gint y, + gint width, + gint row, + gint first_period, + EMeetingFreeBusyType busy_type) { EMeetingTimeSelector *mts; EMeetingAttendee *ia; @@ -681,7 +719,7 @@ e_meeting_time_selector_item_paint_attendee_busy_periods (EMeetingTimeSelectorIt /* Convert the period start and end times to x coordinates. */ x1 = e_meeting_time_selector_calculate_time_position (mts, &period->start); /* If the period is off the right of the area being drawn, we - are finished. */ + * are finished. */ if (x1 >= x + width) return; @@ -691,10 +729,10 @@ e_meeting_time_selector_item_paint_attendee_busy_periods (EMeetingTimeSelectorIt continue; /* We paint from x1 to x2 - 1, so that for example a time - from 5:00-6:00 is distinct from 6:00-7:00. - We never finish on a grid line separating days, and we only - ever paint on a normal vertical grid line if the period is - only 1 pixel wide. */ + * from 5:00-6:00 is distinct from 6:00-7:00. + * We never finish on a grid line separating days, and we only + * ever paint on a normal vertical grid line if the period is + * only 1 pixel wide. */ x2_within_day = x2 % mts->day_width; if (x2_within_day == 0) { x2 -= 2; @@ -707,8 +745,8 @@ e_meeting_time_selector_item_paint_attendee_busy_periods (EMeetingTimeSelectorIt } /* Paint the rectangle. We leave a gap of 2 pixels at the - top and bottom, remembering that the grid is painted along - the top/bottom line of each row. */ + * top and bottom, remembering that the grid is painted along + * the top/bottom line of each row. */ if (x2 - x1 > 0) { #if E_MEETING_TIME_SELECTOR_DRAW_GRID_LINES_AT_BOTTOM cairo_rectangle (cr, x1 - x, y + 2, @@ -727,14 +765,18 @@ e_meeting_time_selector_item_paint_attendee_busy_periods (EMeetingTimeSelectorIt */ static GnomeCanvasItem * -e_meeting_time_selector_item_point (GnomeCanvasItem *item, double x, double y, - gint cx, gint cy) +e_meeting_time_selector_item_point (GnomeCanvasItem *item, + gdouble x, + gdouble y, + gint cx, + gint cy) { return item; } static gint -e_meeting_time_selector_item_event (GnomeCanvasItem *item, GdkEvent *event) +e_meeting_time_selector_item_event (GnomeCanvasItem *item, + GdkEvent *event) { EMeetingTimeSelectorItem *mts_item; @@ -758,13 +800,13 @@ e_meeting_time_selector_item_event (GnomeCanvasItem *item, GdkEvent *event) } /* This handles all button press events for the item. If the cursor is over - one of the meeting time vertical bars we start a drag. If not we set the - meeting time to the nearest half-hour interval. - Note that GnomeCanvas converts the event coords to world coords, - i.e. relative to the entire canvas scroll area. */ + * one of the meeting time vertical bars we start a drag. If not we set the + * meeting time to the nearest half-hour interval. + * Note that GnomeCanvas converts the event coords to world coords, + * i.e. relative to the entire canvas scroll area. */ static gint e_meeting_time_selector_item_button_press (EMeetingTimeSelectorItem *mts_item, - GdkEvent *event) + GdkEvent *event) { EMeetingTimeSelector *mts; EMeetingTime start_time, end_time; @@ -784,7 +826,7 @@ e_meeting_time_selector_item_button_press (EMeetingTimeSelectorItem *mts_item, GDK_POINTER_MOTION_MASK | GDK_BUTTON_RELEASE_MASK, mts_item->resize_cursor, - event->button.time) == 0 /*Success*/) { + event->button.time) == 0 /*Success */) { mts->dragging_position = position; return TRUE; } @@ -796,7 +838,7 @@ e_meeting_time_selector_item_button_press (EMeetingTimeSelectorItem *mts_item, end_date = &end_time.date; /* Find the nearest half-hour or hour interval, depending on whether - zoomed_out is set. */ + * zoomed_out is set. */ if (!mts->all_day) { gint astart_year, astart_month, astart_day, astart_hour, astart_minute; gint aend_year, aend_month, aend_day, aend_hour, aend_minute; @@ -869,10 +911,10 @@ e_meeting_time_selector_item_button_press (EMeetingTimeSelectorItem *mts_item, } /* This handles all button release events for the item. If we were dragging, - we finish the drag. */ + * we finish the drag. */ static gint e_meeting_time_selector_item_button_release (EMeetingTimeSelectorItem *mts_item, - GdkEvent *event) + GdkEvent *event) { EMeetingTimeSelector *mts; @@ -890,12 +932,12 @@ e_meeting_time_selector_item_button_release (EMeetingTimeSelectorItem *mts_item, } /* This handles all motion notify events for the item. If button1 is pressed - we check if a drag is in progress. If not, we set the cursor if we are over - the meeting time vertical bars. Note that GnomeCanvas doesn't use motion - hints, which may affect performance. */ + * we check if a drag is in progress. If not, we set the cursor if we are over + * the meeting time vertical bars. Note that GnomeCanvas doesn't use motion + * hints, which may affect performance. */ static gint e_meeting_time_selector_item_motion_notify (EMeetingTimeSelectorItem *mts_item, - GdkEvent *event) + GdkEvent *event) { EMeetingTimeSelector *mts; EMeetingTimeSelectorPosition position; @@ -940,7 +982,8 @@ e_meeting_time_selector_item_motion_notify (EMeetingTimeSelectorItem *mts_item, static EMeetingTimeSelectorPosition e_meeting_time_selector_item_get_drag_position (EMeetingTimeSelectorItem *mts_item, - gint x, gint y) + gint x, + gint y) { EMeetingTimeSelector *mts; gboolean is_display_top; @@ -967,11 +1010,11 @@ e_meeting_time_selector_item_get_drag_position (EMeetingTimeSelectorItem *mts_it static gboolean e_meeting_time_selector_item_calculate_busy_range (EMeetingTimeSelector *mts, - gint row, - gint x, - gint width, - gint *start_x, - gint *end_x) + gint row, + gint x, + gint width, + gint *start_x, + gint *end_x) { EMeetingAttendee *ia; EMeetingTime busy_periods_start; diff --git a/calendar/gui/e-meeting-time-sel.c b/calendar/gui/e-meeting-time-sel.c index ebe9bd05c0..9afdfd7a22 100644 --- a/calendar/gui/e-meeting-time-sel.c +++ b/calendar/gui/e-meeting-time-sel.c @@ -74,7 +74,7 @@ const gchar *EMeetingTimeSelectorHours12[24] = { #define E_MEETING_TIME_SELECTOR_FB_DAYS_AFTER 28 /* This is the number of pixels between the mouse has to move before the - scroll speed is incremented. */ + * scroll speed is incremented. */ #define E_MEETING_TIME_SELECTOR_SCROLL_INCREMENT_WIDTH 10 /* This is the maximum scrolling speed. */ @@ -150,22 +150,22 @@ static void e_meeting_time_selector_on_next_button_clicked (GtkWidget *button, EMeetingTimeSelector *mts); static void e_meeting_time_selector_autopick (EMeetingTimeSelector *mts, gboolean forward); -static void e_meeting_time_selector_calculate_time_difference (EMeetingTime*start, - EMeetingTime*end, +static void e_meeting_time_selector_calculate_time_difference (EMeetingTime *start, + EMeetingTime *end, gint *days, gint *hours, gint *minutes); static void e_meeting_time_selector_find_nearest_interval (EMeetingTimeSelector *mts, - EMeetingTime*start_time, - EMeetingTime*end_time, + EMeetingTime *start_time, + EMeetingTime *end_time, gint days, gint hours, gint mins); static void e_meeting_time_selector_find_nearest_interval_backward (EMeetingTimeSelector *mts, EMeetingTime *start_time, EMeetingTime *end_time, gint days, gint hours, gint mins); -static void e_meeting_time_selector_adjust_time (EMeetingTime*mtstime, +static void e_meeting_time_selector_adjust_time (EMeetingTime *mtstime, gint days, gint hours, gint minutes); -static EMeetingFreeBusyPeriod* e_meeting_time_selector_find_time_clash (EMeetingTimeSelector *mts, +static EMeetingFreeBusyPeriod * e_meeting_time_selector_find_time_clash (EMeetingTimeSelector *mts, EMeetingAttendee *attendee, EMeetingTime *start_time, EMeetingTime *end_time); @@ -175,7 +175,7 @@ static void e_meeting_time_selector_recalc_date_format (EMeetingTimeSelector *mt static void e_meeting_time_selector_save_position (EMeetingTimeSelector *mts, EMeetingTime *mtstime); static void e_meeting_time_selector_restore_position (EMeetingTimeSelector *mts, - EMeetingTime*mtstime); + EMeetingTime *mtstime); static void e_meeting_time_selector_on_start_time_changed (GtkWidget *widget, EMeetingTimeSelector *mts); static void e_meeting_time_selector_on_end_time_changed (GtkWidget *widget, @@ -298,7 +298,7 @@ meeting_time_selector_dispose (GObject *object) } static void -e_meeting_time_selector_class_init (EMeetingTimeSelectorClass * class) +e_meeting_time_selector_class_init (EMeetingTimeSelectorClass *class) { GObjectClass *object_class; GtkWidgetClass *widget_class; @@ -359,7 +359,7 @@ e_meeting_time_selector_class_init (EMeetingTimeSelectorClass * class) } static void -e_meeting_time_selector_init (EMeetingTimeSelector * mts) +e_meeting_time_selector_init (EMeetingTimeSelector *mts) { mts->priv = G_TYPE_INSTANCE_GET_PRIVATE ( mts, E_TYPE_MEETING_TIME_SELECTOR, @@ -387,7 +387,8 @@ e_meeting_time_selector_init (EMeetingTimeSelector * mts) } void -e_meeting_time_selector_construct (EMeetingTimeSelector * mts, EMeetingStore *ems) +e_meeting_time_selector_construct (EMeetingTimeSelector *mts, + EMeetingStore *ems) { GtkWidget *hbox, *vbox, *separator, *label, *table, *sw; GtkWidget *alignment, *child_hbox, *arrow, *menuitem; @@ -401,7 +402,7 @@ e_meeting_time_selector_construct (EMeetingTimeSelector * mts, EMeetingStore *em AtkObject *a11y_label, *a11y_date_edit; /* The default meeting time is the nearest half-hour interval in the - future, in working hours. */ + * future, in working hours. */ meeting_start_time = time (NULL); g_date_clear (&mts->meeting_start_time.date, 1); g_date_set_time_t (&mts->meeting_start_time.date, meeting_start_time); @@ -859,11 +860,12 @@ e_meeting_time_selector_construct (EMeetingTimeSelector * mts, EMeetingStore *em } /* This adds a color to the color key beneath the main display. If color is - NULL, it displays the No Info pattern instead. */ + * NULL, it displays the No Info pattern instead. */ static void -e_meeting_time_selector_add_key_color (EMeetingTimeSelector * mts, - GtkWidget *hbox, - gchar *label_text, GdkColor *color) +e_meeting_time_selector_add_key_color (EMeetingTimeSelector *mts, + GtkWidget *hbox, + gchar *label_text, + GdkColor *color) { GtkWidget *child_hbox, *darea, *label; @@ -888,7 +890,9 @@ e_meeting_time_selector_add_key_color (EMeetingTimeSelector * mts, } static gint -e_meeting_time_selector_draw_key_color (GtkWidget *darea, cairo_t *cr, GdkColor *color) +e_meeting_time_selector_draw_key_color (GtkWidget *darea, + cairo_t *cr, + GdkColor *color) { EMeetingTimeSelector * mts; GtkAllocation allocation; @@ -918,8 +922,9 @@ e_meeting_time_selector_draw_key_color (GtkWidget *darea, cairo_t *cr, GdkColor } static void -e_meeting_time_selector_alloc_named_color (EMeetingTimeSelector * mts, - const gchar *name, GdkColor *c) +e_meeting_time_selector_alloc_named_color (EMeetingTimeSelector *mts, + const gchar *name, + GdkColor *c) { g_return_if_fail (name != NULL); g_return_if_fail (c != NULL); @@ -930,7 +935,7 @@ e_meeting_time_selector_alloc_named_color (EMeetingTimeSelector * mts, static void e_meeting_time_selector_options_menu_detacher (GtkWidget *widget, - GtkMenu *menu) + GtkMenu *menu) { EMeetingTimeSelector *mts; @@ -938,14 +943,14 @@ e_meeting_time_selector_options_menu_detacher (GtkWidget *widget, g_return_if_fail (E_IS_MEETING_TIME_SELECTOR (widget)); mts = E_MEETING_TIME_SELECTOR (widget); - g_return_if_fail (mts->options_menu == (GtkWidget*) menu); + g_return_if_fail (mts->options_menu == (GtkWidget *) menu); mts->options_menu = NULL; } static void e_meeting_time_selector_autopick_menu_detacher (GtkWidget *widget, - GtkMenu *menu) + GtkMenu *menu) { EMeetingTimeSelector *mts; @@ -953,7 +958,7 @@ e_meeting_time_selector_autopick_menu_detacher (GtkWidget *widget, g_return_if_fail (E_IS_MEETING_TIME_SELECTOR (widget)); mts = E_MEETING_TIME_SELECTOR (widget); - g_return_if_fail (mts->autopick_menu == (GtkWidget*) menu); + g_return_if_fail (mts->autopick_menu == (GtkWidget *) menu); mts->autopick_menu = NULL; } @@ -1149,12 +1154,12 @@ style_change_idle_func (EMeetingTimeSelector *mts) * FIXME: I can't find a way to get the treeview header heights * other than the below but it isn't nice to realize that widget here * - + * gtk_widget_realize (mts->list_view); gdk_window_get_position (gtk_tree_view_get_bin_window (GTK_TREE_VIEW (mts->list_view)), NULL, &maxheight); gtk_widget_set_size_request (mts->attendees_vbox_spacer, 1, mts->row_height * 3 - maxheight); - + * */ gtk_widget_set_size_request (mts->attendees_vbox_spacer, 1, mts->row_height * 2 - 6); @@ -1177,7 +1182,7 @@ style_change_idle_func (EMeetingTimeSelector *mts) static void e_meeting_time_selector_style_set (GtkWidget *widget, - GtkStyle *previous_style) + GtkStyle *previous_style) { EMeetingTimeSelector *mts = E_MEETING_TIME_SELECTOR (widget); @@ -1191,7 +1196,8 @@ e_meeting_time_selector_style_set (GtkWidget *widget, /* This draws a shadow around the top display and main display. */ static gint -e_meeting_time_selector_draw (GtkWidget *widget, cairo_t *cr) +e_meeting_time_selector_draw (GtkWidget *widget, + cairo_t *cr) { EMeetingTimeSelector *mts; @@ -1206,7 +1212,8 @@ e_meeting_time_selector_draw (GtkWidget *widget, cairo_t *cr) } static void -e_meeting_time_selector_draw_shadow (EMeetingTimeSelector *mts, cairo_t *cr) +e_meeting_time_selector_draw_shadow (EMeetingTimeSelector *mts, + cairo_t *cr) { GtkAllocation allocation; GtkStyle *style; @@ -1233,7 +1240,7 @@ e_meeting_time_selector_draw_shadow (EMeetingTimeSelector *mts, cairo_t *cr) /* When the main canvas scrolls, we scroll the other canvases. */ static void e_meeting_time_selector_hadjustment_changed (GtkAdjustment *adjustment, - EMeetingTimeSelector *mts) + EMeetingTimeSelector *mts) { GtkAdjustment *hadjustment; GtkScrollable *scrollable; @@ -1248,7 +1255,7 @@ e_meeting_time_selector_hadjustment_changed (GtkAdjustment *adjustment, static void e_meeting_time_selector_vadjustment_changed (GtkAdjustment *adjustment, - EMeetingTimeSelector *mts) + EMeetingTimeSelector *mts) { GtkAdjustment *vadjustment; GtkTreeView *tree_view; @@ -1263,16 +1270,16 @@ e_meeting_time_selector_vadjustment_changed (GtkAdjustment *adjustment, void e_meeting_time_selector_get_meeting_time (EMeetingTimeSelector *mts, - gint *start_year, - gint *start_month, - gint *start_day, - gint *start_hour, - gint *start_minute, - gint *end_year, - gint *end_month, - gint *end_day, - gint *end_hour, - gint *end_minute) + gint *start_year, + gint *start_month, + gint *start_day, + gint *start_hour, + gint *start_minute, + gint *end_year, + gint *end_month, + gint *end_day, + gint *end_hour, + gint *end_minute) { *start_year = g_date_get_year (&mts->meeting_start_time.date); *start_month = g_date_get_month (&mts->meeting_start_time.date); @@ -1289,16 +1296,16 @@ e_meeting_time_selector_get_meeting_time (EMeetingTimeSelector *mts, gboolean e_meeting_time_selector_set_meeting_time (EMeetingTimeSelector *mts, - gint start_year, - gint start_month, - gint start_day, - gint start_hour, - gint start_minute, - gint end_year, - gint end_month, - gint end_day, - gint end_hour, - gint end_minute) + gint start_year, + gint start_month, + gint start_day, + gint start_hour, + gint start_minute, + gint end_year, + gint end_month, + gint end_day, + gint end_hour, + gint end_minute) { g_return_val_if_fail (E_IS_MEETING_TIME_SELECTOR (mts), FALSE); @@ -1336,7 +1343,7 @@ e_meeting_time_selector_set_meeting_time (EMeetingTimeSelector *mts, void e_meeting_time_selector_set_all_day (EMeetingTimeSelector *mts, - gboolean all_day) + gboolean all_day) { EMeetingTime saved_time; @@ -1358,7 +1365,7 @@ e_meeting_time_selector_set_all_day (EMeetingTimeSelector *mts, void e_meeting_time_selector_set_working_hours_only (EMeetingTimeSelector *mts, - gboolean working_hours_only) + gboolean working_hours_only) { EMeetingTime saved_time; @@ -1380,10 +1387,10 @@ e_meeting_time_selector_set_working_hours_only (EMeetingTimeSelector *mts, void e_meeting_time_selector_set_working_hours (EMeetingTimeSelector *mts, - gint day_start_hour, - gint day_start_minute, - gint day_end_hour, - gint day_end_minute) + gint day_start_hour, + gint day_start_minute, + gint day_end_hour, + gint day_end_minute) { EMeetingTime saved_time; @@ -1418,7 +1425,7 @@ e_meeting_time_selector_set_working_hours (EMeetingTimeSelector *mts, void e_meeting_time_selector_set_zoomed_out (EMeetingTimeSelector *mts, - gboolean zoomed_out) + gboolean zoomed_out) { EMeetingTime saved_time; @@ -1469,7 +1476,9 @@ e_meeting_time_selector_refresh_cb (gpointer data) } void -e_meeting_time_selector_refresh_free_busy (EMeetingTimeSelector *mts, gint row, gboolean all) +e_meeting_time_selector_refresh_free_busy (EMeetingTimeSelector *mts, + gint row, + gboolean all) { EMeetingTime start, end; @@ -1547,7 +1556,7 @@ e_meeting_time_selector_get_autopick_option (EMeetingTimeSelector *mts) void e_meeting_time_selector_set_autopick_option (EMeetingTimeSelector *mts, - EMeetingTimeSelectorAutopickOption autopick_option) + EMeetingTimeSelectorAutopickOption autopick_option) { g_return_if_fail (E_IS_MEETING_TIME_SELECTOR (mts)); @@ -1566,26 +1575,10 @@ e_meeting_time_selector_set_autopick_option (EMeetingTimeSelector *mts, break; } } -#if 0 -void -e_meeting_time_selector_attendee_set_send_meeting_to (EMeetingTimeSelector *mts, - gint row, - gboolean send_meeting_to) -{ - EMeetingTimeSelectorAttendee *attendee; - - g_return_if_fail (E_IS_MEETING_TIME_SELECTOR (mts)); - g_return_if_fail (row >= 0); - g_return_if_fail (row < mts->attendees->len); - - attendee = &g_array_index (mts->attendees, - EMeetingTimeSelectorAttendee, row); - attendee->send_meeting_to = send_meeting_to; -} -#endif void -e_meeting_time_selector_set_read_only (EMeetingTimeSelector *mts, gboolean read_only) +e_meeting_time_selector_set_read_only (EMeetingTimeSelector *mts, + gboolean read_only) { g_return_if_fail (E_IS_MEETING_TIME_SELECTOR (mts)); @@ -1651,9 +1644,9 @@ e_meeting_time_selector_dump (EMeetingTimeSelector *mts) } /* This formats a EMeetingTimein a string and returns it. - Note that it uses a static buffer. */ + * Note that it uses a static buffer. */ gchar * -e_meeting_time_selector_dump_time (EMeetingTime*mtstime) +e_meeting_time_selector_dump_time (EMeetingTime *mtstime) { static gchar buffer[128]; @@ -1670,7 +1663,7 @@ e_meeting_time_selector_dump_time (EMeetingTime*mtstime) } /* This formats a GDate in a string and returns it. - Note that it uses a static buffer. */ + * Note that it uses a static buffer. */ gchar * e_meeting_time_selector_dump_date (GDate *date) { @@ -1685,14 +1678,14 @@ e_meeting_time_selector_dump_date (GDate *date) static void e_meeting_time_selector_on_invite_others_button_clicked (GtkWidget *button, - EMeetingTimeSelector *mts) + EMeetingTimeSelector *mts) { e_meeting_list_view_invite_others_dialog (mts->list_view); } static void e_meeting_time_selector_on_options_button_clicked (GtkWidget *button, - EMeetingTimeSelector *mts) + EMeetingTimeSelector *mts) { gtk_menu_popup (GTK_MENU (mts->options_menu), NULL, NULL, e_meeting_time_selector_options_menu_position_callback, @@ -1701,10 +1694,10 @@ e_meeting_time_selector_on_options_button_clicked (GtkWidget *button, static void e_meeting_time_selector_options_menu_position_callback (GtkMenu *menu, - gint *x, - gint *y, - gboolean *push_in, - gpointer user_data) + gint *x, + gint *y, + gboolean *push_in, + gpointer user_data) { EMeetingTimeSelector *mts; GtkRequisition menu_requisition; @@ -1733,10 +1726,10 @@ e_meeting_time_selector_options_menu_position_callback (GtkMenu *menu, static void e_meeting_time_selector_on_update_free_busy (GtkWidget *button, - EMeetingTimeSelector *mts) + EMeetingTimeSelector *mts) { /* Make sure the menu pops down, which doesn't happen by default if - keyboard accelerators are used. */ + * keyboard accelerators are used. */ if (gtk_widget_get_visible (mts->options_menu)) gtk_menu_popdown (GTK_MENU (mts->options_menu)); @@ -1745,7 +1738,7 @@ e_meeting_time_selector_on_update_free_busy (GtkWidget *button, static void e_meeting_time_selector_on_autopick_button_clicked (GtkWidget *button, - EMeetingTimeSelector *mts) + EMeetingTimeSelector *mts) { gtk_menu_popup (GTK_MENU (mts->autopick_menu), NULL, NULL, e_meeting_time_selector_autopick_menu_position_callback, @@ -1754,10 +1747,10 @@ e_meeting_time_selector_on_autopick_button_clicked (GtkWidget *button, static void e_meeting_time_selector_autopick_menu_position_callback (GtkMenu *menu, - gint *x, - gint *y, - gboolean *push_in, - gpointer user_data) + gint *x, + gint *y, + gboolean *push_in, + gpointer user_data) { EMeetingTimeSelector *mts; GtkRequisition menu_requisition; @@ -1786,33 +1779,33 @@ e_meeting_time_selector_autopick_menu_position_callback (GtkMenu *menu, static void e_meeting_time_selector_on_autopick_option_toggled (GtkWidget *button, - EMeetingTimeSelector *mts) + EMeetingTimeSelector *mts) { /* Make sure the menu pops down, which doesn't happen by default if - keyboard accelerators are used. */ + * keyboard accelerators are used. */ if (gtk_widget_get_visible (mts->autopick_menu)) gtk_menu_popdown (GTK_MENU (mts->autopick_menu)); } static void e_meeting_time_selector_on_prev_button_clicked (GtkWidget *button, - EMeetingTimeSelector *mts) + EMeetingTimeSelector *mts) { e_meeting_time_selector_autopick (mts, FALSE); } static void e_meeting_time_selector_on_next_button_clicked (GtkWidget *button, - EMeetingTimeSelector *mts) + EMeetingTimeSelector *mts) { e_meeting_time_selector_autopick (mts, TRUE); } /* This tries to find the previous or next meeting time for which all - attendees will be available. */ + * attendees will be available. */ static void e_meeting_time_selector_autopick (EMeetingTimeSelector *mts, - gboolean forward) + gboolean forward) { EMeetingTime start_time, end_time, *resource_free; EMeetingAttendee *attendee; @@ -1833,7 +1826,7 @@ e_meeting_time_selector_autopick (EMeetingTimeSelector *mts, e_meeting_time_selector_find_nearest_interval_backward (mts, &start_time, &end_time, duration_days, duration_hours, duration_minutes); /* Determine if we can skip optional people and if we only need one - resource based on the autopick option. */ + * resource based on the autopick option. */ autopick_option = e_meeting_time_selector_get_autopick_option (mts); if (autopick_option == E_MEETING_TIME_SELECTOR_REQUIRED_PEOPLE || autopick_option == E_MEETING_TIME_SELECTOR_REQUIRED_PEOPLE_AND_ONE_RESOURCE) @@ -1843,14 +1836,14 @@ e_meeting_time_selector_autopick (EMeetingTimeSelector *mts, need_one_resource = TRUE; /* Keep moving forward or backward until we find a possible meeting - time. */ + * time. */ for (;;) { meeting_time_ok = TRUE; found_resource = FALSE; resource_free = NULL; /* Step through each attendee, checking if the meeting time - intersects one of the attendees busy periods. */ + * intersects one of the attendees busy periods. */ for (row = 0; row < e_meeting_store_count_actual_attendees (mts->model); row++) { attendee = e_meeting_store_find_attendee_at_row (mts->model, row); @@ -1863,9 +1856,9 @@ e_meeting_time_selector_autopick (EMeetingTimeSelector *mts, if (need_one_resource && e_meeting_attendee_get_atype (attendee) == E_MEETING_ATTENDEE_RESOURCE) { if (period) { /* We want to remember the closest - prev/next time that one resource is - available, in case we don't find any - free resources. */ + * prev/next time that one resource is + * available, in case we don't find any + * free resources. */ if (forward) { if (!resource_free || e_meeting_time_compare_times (resource_free, &period->end) > 0) resource_free = &period->end; @@ -1891,9 +1884,9 @@ e_meeting_time_selector_autopick (EMeetingTimeSelector *mts, } /* Check that we found one resource if necessary. If not, skip - to the closest time that a resource is free. Note that if - there are no resources, resource_free will never get set, - so we assume the meeting time is OK. */ + * to the closest time that a resource is free. Note that if + * there are no resources, resource_free will never get set, + * so we assume the meeting time is OK. */ if (meeting_time_ok && need_one_resource && !found_resource && resource_free) { if (forward) { @@ -1933,11 +1926,11 @@ e_meeting_time_selector_autopick (EMeetingTimeSelector *mts, } static void -e_meeting_time_selector_calculate_time_difference (EMeetingTime*start, - EMeetingTime*end, - gint *days, - gint *hours, - gint *minutes) +e_meeting_time_selector_calculate_time_difference (EMeetingTime *start, + EMeetingTime *end, + gint *days, + gint *hours, + gint *minutes) { *days = g_date_get_julian (&end->date) - g_date_get_julian (&start->date); *hours = end->hour - start->hour; @@ -1953,12 +1946,14 @@ e_meeting_time_selector_calculate_time_difference (EMeetingTime*start, } /* This moves the given time forward to the next suitable start of a meeting. - If zoomed_out is set, this means every hour. If not every half-hour. */ + * If zoomed_out is set, this means every hour. If not every half-hour. */ static void e_meeting_time_selector_find_nearest_interval (EMeetingTimeSelector *mts, - EMeetingTime*start_time, - EMeetingTime*end_time, - gint days, gint hours, gint mins) + EMeetingTime *start_time, + EMeetingTime *end_time, + gint days, + gint hours, + gint mins) { gint minutes_shown; gboolean set_to_start_of_working_day = FALSE; @@ -1982,7 +1977,7 @@ e_meeting_time_selector_find_nearest_interval (EMeetingTimeSelector *mts, e_meeting_time_selector_adjust_time (end_time, days, hours, mins); /* Check if the interval is less than a day as seen in the display. - If it isn't we don't worry about the working day. */ + * If it isn't we don't worry about the working day. */ if (!mts->working_hours_only || days > 0) return; minutes_shown = (mts->day_end_hour - mts->day_start_hour) * 60; @@ -1991,8 +1986,8 @@ e_meeting_time_selector_find_nearest_interval (EMeetingTimeSelector *mts, return; /* If the meeting time finishes past the end of the working day, move - onto the start of the next working day. If the meeting time starts - before the working day, move it on as well. */ + * onto the start of the next working day. If the meeting time starts + * before the working day, move it on as well. */ if (start_time->hour > mts->day_end_hour || (start_time->hour == mts->day_end_hour && start_time->minute > mts->day_end_minute) @@ -2029,12 +2024,14 @@ e_meeting_time_selector_find_nearest_interval (EMeetingTimeSelector *mts, } /* This moves the given time backward to the next suitable start of a meeting. - If zoomed_out is set, this means every hour. If not every half-hour. */ + * If zoomed_out is set, this means every hour. If not every half-hour. */ static void e_meeting_time_selector_find_nearest_interval_backward (EMeetingTimeSelector *mts, - EMeetingTime*start_time, - EMeetingTime*end_time, - gint days, gint hours, gint mins) + EMeetingTime *start_time, + EMeetingTime *end_time, + gint days, + gint hours, + gint mins) { gint new_hour, minutes_shown; gboolean set_to_end_of_working_day = FALSE; @@ -2069,7 +2066,7 @@ e_meeting_time_selector_find_nearest_interval_backward (EMeetingTimeSelector *mt e_meeting_time_selector_adjust_time (end_time, days, hours, mins); /* Check if the interval is less than a day as seen in the display. - If it isn't we don't worry about the working day. */ + * If it isn't we don't worry about the working day. */ if (!mts->working_hours_only || days > 0) return; minutes_shown = (mts->day_end_hour - mts->day_start_hour) * 60; @@ -2078,9 +2075,9 @@ e_meeting_time_selector_find_nearest_interval_backward (EMeetingTimeSelector *mt return; /* If the meeting time finishes past the end of the working day, move - back to the end of the working day. If the meeting time starts - before the working day, move it back to the end of the previous - working day. */ + * back to the end of the working day. If the meeting time starts + * before the working day, move it back to the end of the previous + * working day. */ if (start_time->hour > mts->day_end_hour || (start_time->hour == mts->day_end_hour && start_time->minute > mts->day_end_minute) @@ -2113,17 +2110,19 @@ e_meeting_time_selector_find_nearest_interval_backward (EMeetingTimeSelector *mt } /* This adds on the given days, hours & minutes to a EMeetingTimeSelectorTime. - It is used to calculate the end of a period given a start & duration. - Days, hours & minutes can be negative, to move backwards, but they should - be within normal ranges, e.g. hours should be between -23 and 23. */ + * It is used to calculate the end of a period given a start & duration. + * Days, hours & minutes can be negative, to move backwards, but they should + * be within normal ranges, e.g. hours should be between -23 and 23. */ static void -e_meeting_time_selector_adjust_time (EMeetingTime*mtstime, - gint days, gint hours, gint minutes) +e_meeting_time_selector_adjust_time (EMeetingTime *mtstime, + gint days, + gint hours, + gint minutes) { gint new_hours, new_minutes; /* We have to handle negative values for hous and minutes here, since - EMeetingTimeuses guint8s to store them. */ + * EMeetingTimeuses guint8s to store them. */ new_minutes = mtstime->minute + minutes; if (new_minutes < 0) { new_minutes += 60; @@ -2144,12 +2143,12 @@ e_meeting_time_selector_adjust_time (EMeetingTime*mtstime, } /* This looks for any busy period of the given attendee which clashes with - the start and end time. It uses a binary search. */ + * the start and end time. It uses a binary search. */ static EMeetingFreeBusyPeriod * e_meeting_time_selector_find_time_clash (EMeetingTimeSelector *mts, - EMeetingAttendee *attendee, - EMeetingTime*start_time, - EMeetingTime*end_time) + EMeetingAttendee *attendee, + EMeetingTime *start_time, + EMeetingTime *end_time) { EMeetingFreeBusyPeriod *period; const GArray *busy_periods; @@ -2162,19 +2161,19 @@ e_meeting_time_selector_find_time_clash (EMeetingTimeSelector *mts, return NULL; /* Step forward through the busy periods until we find a clash or we - go past the end_time. */ + * go past the end_time. */ while (period_num < busy_periods->len) { period = &g_array_index (busy_periods, EMeetingFreeBusyPeriod, period_num); /* If the period starts at or after the end time, there is no - clash and we are finished. The busy periods are sorted by - their start times, so all the rest will be later. */ + * clash and we are finished. The busy periods are sorted by + * their start times, so all the rest will be later. */ if (e_meeting_time_compare_times (&period->start, end_time) >= 0) return NULL; /* If the period ends after the start time, we have found a - clash. From the above test we already know the busy period - isn't completely after the meeting time. */ + * clash. From the above test we already know the busy period + * isn't completely after the meeting time. */ if (e_meeting_time_compare_times (&period->end, start_time) > 0) return period; @@ -2186,12 +2185,12 @@ e_meeting_time_selector_find_time_clash (EMeetingTimeSelector *mts, static void e_meeting_time_selector_on_zoomed_out_toggled (GtkCheckMenuItem *menuitem, - EMeetingTimeSelector *mts) + EMeetingTimeSelector *mts) { gboolean active; /* Make sure the menu pops down, which doesn't happen by default if - keyboard accelerators are used. */ + * keyboard accelerators are used. */ if (gtk_widget_get_visible (mts->options_menu)) gtk_menu_popdown (GTK_MENU (mts->options_menu)); @@ -2202,12 +2201,12 @@ e_meeting_time_selector_on_zoomed_out_toggled (GtkCheckMenuItem *menuitem, static void e_meeting_time_selector_on_working_hours_toggled (GtkCheckMenuItem *menuitem, - EMeetingTimeSelector *mts) + EMeetingTimeSelector *mts) { gboolean active; /* Make sure the menu pops down, which doesn't happen by default if - keyboard accelerators are used. */ + * keyboard accelerators are used. */ if (gtk_widget_get_visible (mts->options_menu)) gtk_menu_popdown (GTK_MENU (mts->options_menu)); @@ -2257,7 +2256,7 @@ e_meeting_time_selector_recalc_grid (EMeetingTimeSelector *mts) /* This saves the first visible time in the given EMeetingTimeSelectorTime. */ static void e_meeting_time_selector_save_position (EMeetingTimeSelector *mts, - EMeetingTime*mtstime) + EMeetingTime *mtstime) { gint scroll_x, scroll_y; @@ -2269,7 +2268,7 @@ e_meeting_time_selector_save_position (EMeetingTimeSelector *mts, /* This restores a saved position. */ static void e_meeting_time_selector_restore_position (EMeetingTimeSelector *mts, - EMeetingTime*mtstime) + EMeetingTime *mtstime) { gint scroll_x, scroll_y, new_scroll_x; @@ -2282,13 +2281,13 @@ e_meeting_time_selector_restore_position (EMeetingTimeSelector *mts, } /* This returns the x pixel coords of the meeting time in the entire scroll - region. It recalculates them if they have been marked as invalid. - If it returns FALSE then no meeting time is set or the meeting time is - not visible in the current scroll area. */ + * region. It recalculates them if they have been marked as invalid. + * If it returns FALSE then no meeting time is set or the meeting time is + * not visible in the current scroll area. */ gboolean e_meeting_time_selector_get_meeting_time_positions (EMeetingTimeSelector *mts, - gint *start_x, - gint *end_x) + gint *start_x, + gint *end_x) { if (mts->meeting_positions_valid) { if (mts->meeting_positions_in_scroll_area) { @@ -2317,12 +2316,12 @@ e_meeting_time_selector_get_meeting_time_positions (EMeetingTimeSelector *mts, } /* This recalculates the date format to used, by computing the width of the - longest date strings in the widget's font and seeing if they fit. */ + * longest date strings in the widget's font and seeing if they fit. */ static void e_meeting_time_selector_recalc_date_format (EMeetingTimeSelector *mts) { /* An array of dates, one for each month in the year 2000. They must - all be Sundays. */ + * all be Sundays. */ static const gint days[12] = { 23, 20, 19, 23, 21, 18, 23, 20, 17, 22, 19, 24 }; GDate date; @@ -2341,7 +2340,7 @@ e_meeting_time_selector_recalc_date_format (EMeetingTimeSelector *mts) max_date_width = mts->day_width - 2; /* Find the biggest full weekday name. We start on a particular - Monday and go through seven days. */ + * Monday and go through seven days. */ g_date_clear (&date, 1); g_date_set_dmy (&date, 3, 1, 2000); /* Monday 3rd Jan 2000. */ longest_weekday_width = 0; @@ -2370,13 +2369,13 @@ e_meeting_time_selector_recalc_date_format (EMeetingTimeSelector *mts) } /* See if we can use the full date. We want to use a date with a - month day > 20 and also the longest weekday. We use a - pre-calculated array of days for each month and add on the - weekday (which is 1 (Mon) to 7 (Sun). */ + * month day > 20 and also the longest weekday. We use a + * pre-calculated array of days for each month and add on the + * weekday (which is 1 (Mon) to 7 (Sun). */ g_date_set_dmy (&date, days[longest_month - 1] + longest_weekday, longest_month, 2000); /* This is a strftime() format string %A = full weekday name, - %B = full month name, %d = month day, %Y = full year. */ + * %B = full month name, %d = month day, %Y = full year. */ g_date_strftime (buffer, sizeof (buffer), _("%A, %B %d, %Y"), &date); #if 0 @@ -2407,7 +2406,7 @@ e_meeting_time_selector_recalc_date_format (EMeetingTimeSelector *mts) g_date_set_dmy (&date, days[longest_month - 1] + longest_weekday, longest_month, 2000); /* This is a strftime() format string %a = abbreviated weekday name, - %m = month number, %d = month day, %Y = full year. */ + * %m = month number, %d = month day, %Y = full year. */ g_date_strftime (buffer, sizeof (buffer), _("%a %m/%d/%Y"), &date); #if 0 @@ -2426,10 +2425,10 @@ e_meeting_time_selector_recalc_date_format (EMeetingTimeSelector *mts) } /* Turn off the background of the canvas windows. This reduces flicker - considerably when scrolling. (Why isn't it in GnomeCanvas?). */ + * considerably when scrolling. (Why isn't it in GnomeCanvas?). */ static void e_meeting_time_selector_on_canvas_realized (GtkWidget *widget, - EMeetingTimeSelector *mts) + EMeetingTimeSelector *mts) { GdkWindow *window; @@ -2438,12 +2437,12 @@ e_meeting_time_selector_on_canvas_realized (GtkWidget *widget, } /* This is called when the meeting start time GnomeDateEdit is changed, - either via the "date_changed". "time_changed" or "activate" signals on one - of the GtkEntry widgets. So don't use the widget parameter since it may be - one of the child GtkEntry widgets. */ + * either via the "date_changed". "time_changed" or "activate" signals on one + * of the GtkEntry widgets. So don't use the widget parameter since it may be + * one of the child GtkEntry widgets. */ static void e_meeting_time_selector_on_start_time_changed (GtkWidget *widget, - EMeetingTimeSelector *mts) + EMeetingTimeSelector *mts) { gint duration_days, duration_hours, duration_minutes; EMeetingTime mtstime; @@ -2484,12 +2483,12 @@ e_meeting_time_selector_on_start_time_changed (GtkWidget *widget, } /* This is called when the meeting end time GnomeDateEdit is changed, - either via the "date_changed", "time_changed" or "activate" signals on one - of the GtkEntry widgets. So don't use the widget parameter since it may be - one of the child GtkEntry widgets. */ + * either via the "date_changed", "time_changed" or "activate" signals on one + * of the GtkEntry widgets. So don't use the widget parameter since it may be + * one of the child GtkEntry widgets. */ static void e_meeting_time_selector_on_end_time_changed (GtkWidget *widget, - EMeetingTimeSelector *mts) + EMeetingTimeSelector *mts) { EMeetingTime mtstime; gint hour = 0, minute = 0; @@ -2517,7 +2516,7 @@ e_meeting_time_selector_on_end_time_changed (GtkWidget *widget, /* If the start time is after the end time, set it to the same time. */ if (e_meeting_time_compare_times (&mtstime, &mts->meeting_start_time) <= 0) { /* We set it first, before updating the widget, so the signal - handler will just return. */ + * handler will just return. */ mts->meeting_start_time = mtstime; if (mts->all_day) g_date_subtract_days (&mts->meeting_start_time.date, 1); @@ -2533,7 +2532,7 @@ e_meeting_time_selector_on_end_time_changed (GtkWidget *widget, } /* This updates the ranges shown in the GnomeDateEdit popup menus, according - to working_hours_only etc. */ + * to working_hours_only etc. */ static void e_meeting_time_selector_update_date_popup_menus (EMeetingTimeSelector *mts) { @@ -2557,8 +2556,8 @@ e_meeting_time_selector_update_date_popup_menus (EMeetingTimeSelector *mts) static void e_meeting_time_selector_on_canvas_size_allocate (GtkWidget *widget, - GtkAllocation *allocation, - EMeetingTimeSelector *mts) + GtkAllocation *allocation, + EMeetingTimeSelector *mts) { e_meeting_time_selector_update_main_canvas_scroll_region (mts); @@ -2566,7 +2565,9 @@ e_meeting_time_selector_on_canvas_size_allocate (GtkWidget *widget, } static gboolean -e_meeting_time_selector_on_canvas_scroll_event (GtkWidget *widget, GdkEventScroll *event, EMeetingTimeSelector *mts) +e_meeting_time_selector_on_canvas_scroll_event (GtkWidget *widget, + GdkEventScroll *event, + EMeetingTimeSelector *mts) { gboolean return_val = FALSE; @@ -2577,8 +2578,8 @@ e_meeting_time_selector_on_canvas_scroll_event (GtkWidget *widget, GdkEventScrol } /* This updates the canvas scroll regions according to the number of attendees. - If the total height needed is less than the height of the canvas, we must - use the height of the canvas, or it causes problems. */ + * If the total height needed is less than the height of the canvas, we must + * use the height of the canvas, or it causes problems. */ static void e_meeting_time_selector_update_main_canvas_scroll_region (EMeetingTimeSelector *mts) { @@ -2596,13 +2597,13 @@ e_meeting_time_selector_update_main_canvas_scroll_region (EMeetingTimeSelector * } /* This changes the meeting time based on the given x coordinate and whether - we are dragging the start or end bar. It returns the new position, which - will be swapped if the start bar is dragged past the end bar or vice versa. - It make sure the meeting time is never dragged outside the visible canvas - area. */ + * we are dragging the start or end bar. It returns the new position, which + * will be swapped if the start bar is dragged past the end bar or vice versa. + * It make sure the meeting time is never dragged outside the visible canvas + * area. */ void e_meeting_time_selector_drag_meeting_time (EMeetingTimeSelector *mts, - gint x) + gint x) { EMeetingTime first_time, last_time, drag_time, *time_to_set; gint scroll_x, scroll_y, canvas_width; @@ -2635,7 +2636,7 @@ e_meeting_time_selector_drag_meeting_time (EMeetingTimeSelector *mts, } /* Calculate the minimum & maximum times we can use, based on the - scroll offsets and whether zoomed_out is set. */ + * scroll offsets and whether zoomed_out is set. */ e_meeting_time_selector_calculate_time (mts, scroll_x, &first_time); e_meeting_time_selector_calculate_time (mts, scroll_x + canvas_width - 1, &last_time); @@ -2665,7 +2666,7 @@ e_meeting_time_selector_drag_meeting_time (EMeetingTimeSelector *mts, e_meeting_time_selector_calculate_time (mts, x, &drag_time); /* Calculate the nearest half-hour or hour, depending on whether - zoomed_out is set. */ + * zoomed_out is set. */ if (!mts->all_day) { if (mts->zoomed_out) { if (drag_time.minute > 30) @@ -2749,8 +2750,8 @@ e_meeting_time_selector_drag_meeting_time (EMeetingTimeSelector *mts, } /* This is the timeout function which handles auto-scrolling when the user is - dragging one of the meeting time vertical bars outside the left or right - edge of the canvas. */ + * dragging one of the meeting time vertical bars outside the left or right + * edge of the canvas. */ static gboolean e_meeting_time_selector_timeout_handler (gpointer data) { @@ -2797,7 +2798,7 @@ e_meeting_time_selector_timeout_handler (gpointer data) scroll_x = CLAMP (scroll_x, 0, max_scroll_x); /* Calculate the minimum or maximum visible time in the canvas, which - we will now set the dragged time to. */ + * we will now set the dragged time to. */ if (scroll_offset > 0) { e_meeting_time_selector_calculate_time (mts, scroll_x + canvas_width - 1, @@ -2890,9 +2891,9 @@ e_meeting_time_selector_timeout_handler (gpointer data) scroll: /* Redraw the canvases. We freeze and thaw the layouts so that they - get redrawn completely. Otherwise the pixels get scrolled left or - right which is not good for us (since our vertical bars have been - moved) and causes flicker. */ + * get redrawn completely. Otherwise the pixels get scrolled left or + * right which is not good for us (since our vertical bars have been + * moved) and causes flicker. */ gnome_canvas_scroll_to (GNOME_CANVAS (mts->display_main), scroll_x, scroll_y); gnome_canvas_scroll_to (GNOME_CANVAS (mts->display_top), @@ -2943,7 +2944,7 @@ e_meeting_time_selector_update_end_date_edit (EMeetingTimeSelector *mts) } /* This ensures that the meeting time is shown on screen, by scrolling the - canvas and possibly by changing the range of dates shown in the canvas. */ + * canvas and possibly by changing the range of dates shown in the canvas. */ static void e_meeting_time_selector_ensure_meeting_time_shown (EMeetingTimeSelector *mts) { @@ -2983,7 +2984,7 @@ e_meeting_time_selector_ensure_meeting_time_shown (EMeetingTimeSelector *mts) } /* This updates the range of dates shown in the canvas, to make sure that the - currently selected meeting time is in the range. */ + * currently selected meeting time is in the range. */ static void e_meeting_time_selector_update_dates_shown (EMeetingTimeSelector *mts) { @@ -2997,10 +2998,10 @@ e_meeting_time_selector_update_dates_shown (EMeetingTimeSelector *mts) } /* This checks if the time's hour is over 24 or its minute is over 60 and if - so it updates the day/hour appropriately. Note that hours and minutes are - stored in guint8's so they can't overflow by much. */ + * so it updates the day/hour appropriately. Note that hours and minutes are + * stored in guint8's so they can't overflow by much. */ void -e_meeting_time_selector_fix_time_overflows (EMeetingTime*mtstime) +e_meeting_time_selector_fix_time_overflows (EMeetingTime *mtstime) { gint hours_to_add, days_to_add; @@ -3023,16 +3024,16 @@ e_meeting_time_selector_fix_time_overflows (EMeetingTime*mtstime) */ /* This takes an x pixel coordinate within the entire canvas scroll region and - returns the date in which it falls. If day_position is not NULL it also - returns the x coordinate within the date, relative to the visible part of - the canvas. It is used when painting the days in the item_draw function. - Note that it must handle negative x coordinates in case we are dragging off - the edge of the canvas. */ + * returns the date in which it falls. If day_position is not NULL it also + * returns the x coordinate within the date, relative to the visible part of + * the canvas. It is used when painting the days in the item_draw function. + * Note that it must handle negative x coordinates in case we are dragging off + * the edge of the canvas. */ void e_meeting_time_selector_calculate_day_and_position (EMeetingTimeSelector *mts, - gint x, - GDate *date, - gint *day_position) + gint x, + GDate *date, + gint *day_position) { gint days_from_first_shown; @@ -3052,9 +3053,12 @@ e_meeting_time_selector_calculate_day_and_position (EMeetingTimeSelector *mts, } /* This takes an x pixel coordinate within a day, and converts it to hours - and minutes, depending on working_hours_only and zoomed_out. */ + * and minutes, depending on working_hours_only and zoomed_out. */ void -e_meeting_time_selector_convert_day_position_to_hours_and_mins (EMeetingTimeSelector *mts, gint day_position, guint8 *hours, guint8 *minutes) +e_meeting_time_selector_convert_day_position_to_hours_and_mins (EMeetingTimeSelector *mts, + gint day_position, + guint8 *hours, + guint8 *minutes) { if (mts->zoomed_out) day_position *= 3; @@ -3068,14 +3072,14 @@ e_meeting_time_selector_convert_day_position_to_hours_and_mins (EMeetingTimeSele } /* This takes an x pixel coordinate within the entire canvas scroll region and - returns the time in which it falls. Note that it won't be extremely - accurate since hours may only be a few pixels wide in the display. - With zoomed_out set each pixel may represent 5 minutes or more, depending - on how small the font is. */ + * returns the time in which it falls. Note that it won't be extremely + * accurate since hours may only be a few pixels wide in the display. + * With zoomed_out set each pixel may represent 5 minutes or more, depending + * on how small the font is. */ void e_meeting_time_selector_calculate_time (EMeetingTimeSelector *mts, - gint x, - EMeetingTime*time) + gint x, + EMeetingTime *time) { gint day_position; @@ -3093,23 +3097,23 @@ e_meeting_time_selector_calculate_time (EMeetingTimeSelector *mts, } /* This takes a EMeetingTime and calculates the x pixel coordinate - within the entire canvas scroll region. It is used to draw the selected - meeting time and all the busy periods. */ + * within the entire canvas scroll region. It is used to draw the selected + * meeting time and all the busy periods. */ gint e_meeting_time_selector_calculate_time_position (EMeetingTimeSelector *mts, - EMeetingTime *mtstime) + EMeetingTime *mtstime) { gint x, date_offset, day_offset; /* Calculate the number of days since the first date shown in the - entire canvas scroll region. */ + * entire canvas scroll region. */ date_offset = g_date_get_julian (&mtstime->date) - g_date_get_julian (&mts->first_date_shown); /* Calculate the x pixel coordinate of the start of the day. */ x = date_offset * mts->day_width; /* Add on the hours and minutes, depending on whether zoomed_out and - working_hours_only are set. */ + * working_hours_only are set. */ day_offset = (mtstime->hour - mts->first_hour_shown) * 60 + mtstime->minute; /* The day width includes an extra vertical grid line so subtract 1. */ @@ -3123,7 +3127,10 @@ e_meeting_time_selector_calculate_time_position (EMeetingTimeSelector *mts, } static void -row_inserted_cb (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data) +row_inserted_cb (GtkTreeModel *model, + GtkTreePath *path, + GtkTreeIter *iter, + gpointer data) { EMeetingTimeSelector *mts = E_MEETING_TIME_SELECTOR (data); gint row = gtk_tree_path_get_indices (path)[0]; @@ -3139,7 +3146,10 @@ row_inserted_cb (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpoi } static void -row_changed_cb (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data) +row_changed_cb (GtkTreeModel *model, + GtkTreePath *path, + GtkTreeIter *iter, + gpointer data) { EMeetingTimeSelector *mts = E_MEETING_TIME_SELECTOR (data); gint row = gtk_tree_path_get_indices (path)[0]; @@ -3149,7 +3159,9 @@ row_changed_cb (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpoin } static void -row_deleted_cb (GtkTreeModel *model, GtkTreePath *path, gpointer data) +row_deleted_cb (GtkTreeModel *model, + GtkTreePath *path, + gpointer data) { EMeetingTimeSelector *mts = E_MEETING_TIME_SELECTOR (data); diff --git a/calendar/gui/e-meeting-time-sel.h b/calendar/gui/e-meeting-time-sel.h index 051901c0ee..7f45242006 100644 --- a/calendar/gui/e-meeting-time-sel.h +++ b/calendar/gui/e-meeting-time-sel.h @@ -68,10 +68,10 @@ G_BEGIN_DECLS /* This is used to specify the format used when displaying the dates. - The full format is like 'Sunday, September 12, 1999'. The abbreviated format - is like 'Sun 12/9/99'. The short format is like '12/9/99'. The actual - format used is determined in e_meeting_time_selector_style_set (), once we - know the font being used. */ + * The full format is like 'Sunday, September 12, 1999'. The abbreviated format + * is like 'Sun 12/9/99'. The short format is like '12/9/99'. The actual + * format used is determined in e_meeting_time_selector_style_set (), once we + * know the font being used. */ typedef enum { E_MEETING_TIME_SELECTOR_DATE_FULL, @@ -80,7 +80,7 @@ typedef enum } EMeetingTimeSelectorDateFormat; /* This is used to specify a position regarding the vertical bars around the - current meeting time, so we know which one is being dragged. */ + * current meeting time, so we know which one is being dragged. */ typedef enum { E_MEETING_TIME_SELECTOR_POS_NONE, @@ -89,7 +89,7 @@ typedef enum } EMeetingTimeSelectorPosition; /* This is used to specify the autopick option, which determines how we choose - the previous/next appropriate meeting time. */ + * the previous/next appropriate meeting time. */ typedef enum { E_MEETING_TIME_SELECTOR_ALL_PEOPLE_AND_RESOURCES, @@ -109,7 +109,7 @@ typedef struct _EMeetingTimeSelectorPrivate EMeetingTimeSelectorPrivate; struct _EMeetingTimeSelector { /* We subclass a GtkTable which makes it easy to add extra widgets - if neccesary. */ + * if neccesary. */ GtkTable table; EMeetingTimeSelectorPrivate *priv; @@ -119,12 +119,12 @@ struct _EMeetingTimeSelector { */ /* This contains our keyboard accelerators, which need to be added to - the toplevel window. */ + * the toplevel window. */ GtkAccelGroup *accel_group; /* The vbox in the top-left corner, containing the 'All Attendees' - title bar packed at the end. Extra widgets can be added here - with PACK_START if necessary. */ + * title bar packed at the end. Extra widgets can be added here + * with PACK_START if necessary. */ GtkWidget *attendees_vbox; GtkWidget *attendees_vbox_spacer; @@ -133,13 +133,13 @@ struct _EMeetingTimeSelector { EMeetingListView *list_view; /* The canvas displaying the dates, times, and the summary - 'All Attendees' free/busy display. */ + * 'All Attendees' free/busy display. */ GtkWidget *display_top; GnomeCanvasItem *item_top; /* The canvas containing the free/busy displays of individual - attendees. This is separate from display_top since it also scrolls - vertically. */ + * attendees. This is separate from display_top since it also scrolls + * vertically. */ GtkWidget *display_main; GnomeCanvasItem *item_main; @@ -197,7 +197,7 @@ struct _EMeetingTimeSelector { gboolean all_day; /* If this is TRUE we only show hours between day_start_hour and - day_end_hour, defaults to TRUE (9am-6pm). */ + * day_end_hour, defaults to TRUE (9am-6pm). */ gboolean working_hours_only; gint day_start_hour; gint day_start_minute; @@ -205,7 +205,7 @@ struct _EMeetingTimeSelector { gint day_end_minute; /* If TRUE, view is compressed, with one cell for every 3 hours rather - than every hour. Defaults to FALSE. */ + * than every hour. Defaults to FALSE. */ gboolean zoomed_out; /* @@ -213,7 +213,7 @@ struct _EMeetingTimeSelector { */ /* These are the first & last dates shown in the current scroll area. - We show E_MEETING_TIME_SELECTOR_DAYS_SHOWN days at a time. */ + * We show E_MEETING_TIME_SELECTOR_DAYS_SHOWN days at a time. */ GDate first_date_shown; GDate last_date_shown; @@ -222,25 +222,25 @@ struct _EMeetingTimeSelector { EMeetingTime meeting_end_time; /* These are the x pixel coordinates in the entire scroll region of - the start and end times. Set to meeting_positions_valid to FALSE to - invalidate. They will then be recomputed when needed. Always access - with e_meeting_time_selector_get_meeting_time_positions (). */ + * the start and end times. Set to meeting_positions_valid to FALSE to + * invalidate. They will then be recomputed when needed. Always access + * with e_meeting_time_selector_get_meeting_time_positions (). */ gint meeting_positions_valid; gint meeting_positions_in_scroll_area; gint meeting_start_x; gint meeting_end_x; /* These are the width and height of the cells, including the grid - lines which are displayed on the right and top or bottom of cells.*/ + * lines which are displayed on the right and top or bottom of cells.*/ gint row_height; gint col_width; /* This is the width of a day in the display, which depends on - col_width, working_hours_only and zoomed_out. */ + * col_width, working_hours_only and zoomed_out. */ gint day_width; /* These are the first and last hour of each day we display, depending - on working_hours_only and zoomed_out. */ + * on working_hours_only and zoomed_out. */ gint first_hour_shown; gint last_hour_shown; @@ -248,12 +248,12 @@ struct _EMeetingTimeSelector { guint auto_scroll_timeout_id; /* This specifies if we are dragging one of the vertical bars around - the meeting time. */ + * the meeting time. */ EMeetingTimeSelectorPosition dragging_position; /* The last x coordinate of the mouse, relative to either the left or - right edge of the canvas. Used in the auto_scroll_timeout function - to determine which way to scroll and how fast. */ + * right edge of the canvas. Used in the auto_scroll_timeout function + * to determine which way to scroll and how fast. */ gint last_drag_x; /* This is used to determine the delay between scrolls. */ @@ -300,9 +300,9 @@ void e_meeting_time_selector_set_week_start_day gint week_start_day); /* This returns the currently selected meeting time. - Note that months are 1-12 and days are 1-31. The start time is guaranteed to - be before or equal to the end time. You may want to check if they are equal - if that if it is a problem. */ + * Note that months are 1-12 and days are 1-31. The start time is guaranteed to + * be before or equal to the end time. You may want to check if they are equal + * if that if it is a problem. */ void e_meeting_time_selector_get_meeting_time (EMeetingTimeSelector *mts, gint *start_year, @@ -389,8 +389,8 @@ gboolean e_meeting_time_selector_attendee_add_busy_period */ /* This returns the x pixel coordinates of the meeting start and end times, - in the entire canvas scroll area. If it returns FALSE, then the meeting - time isn't in the current scroll area (which shouldn't really happen). */ + * in the entire canvas scroll area. If it returns FALSE, then the meeting + * time isn't in the current scroll area (which shouldn't really happen). */ gboolean e_meeting_time_selector_get_meeting_time_positions (EMeetingTimeSelector *mts, gint *start_x, @@ -404,7 +404,7 @@ void e_meeting_time_selector_remove_timeout (EMeetingTimeSelector *mts); void e_meeting_time_selector_fix_time_overflows - (EMeetingTime*mtstime); + (EMeetingTime *mtstime); void e_meeting_time_selector_calculate_day_and_position (EMeetingTimeSelector *mts, @@ -419,7 +419,7 @@ void e_meeting_time_selector_convert_day_position_to_hours_and_mins void e_meeting_time_selector_calculate_time (EMeetingTimeSelector *mts, gint x, - EMeetingTime*time); + EMeetingTime *time); gint e_meeting_time_selector_calculate_time_position (EMeetingTimeSelector *mts, EMeetingTime *mtstime); diff --git a/calendar/gui/e-meeting-types.h b/calendar/gui/e-meeting-types.h index 6e7115cad9..50964f1619 100644 --- a/calendar/gui/e-meeting-types.h +++ b/calendar/gui/e-meeting-types.h @@ -34,10 +34,10 @@ typedef struct _EMeetingTime EMeetingTime; typedef struct _EMeetingFreeBusyPeriod EMeetingFreeBusyPeriod; /* These are used to specify whether an attendee is free or busy at a - particular time. We'll probably replace this with a global calendar type. - These should be ordered in increasing order of preference. Higher precedence - busy periods will be painted over lower precedence ones. These are also - used as for loop counters, so they should start at 0 and be ordered. */ + * particular time. We'll probably replace this with a global calendar type. + * These should be ordered in increasing order of preference. Higher precedence + * busy periods will be painted over lower precedence ones. These are also + * used as for loop counters, so they should start at 0 and be ordered. */ typedef enum { E_MEETING_FREE_BUSY_TENTATIVE = 0, @@ -49,7 +49,7 @@ typedef enum } EMeetingFreeBusyType; /* This is our representation of a time. We use a GDate to store the day, - and guint8s for the hours and minutes. */ + * and guint8s for the hours and minutes. */ struct _EMeetingTime { GDate date; diff --git a/calendar/gui/e-meeting-utils.c b/calendar/gui/e-meeting-utils.c index ac11881bf4..369e819fc3 100644 --- a/calendar/gui/e-meeting-utils.c +++ b/calendar/gui/e-meeting-utils.c @@ -28,8 +28,8 @@ #include "e-meeting-utils.h" gint -e_meeting_time_compare_times (EMeetingTime*time1, - EMeetingTime*time2) +e_meeting_time_compare_times (EMeetingTime *time1, + EMeetingTime *time2) { gint day_comparison; diff --git a/calendar/gui/e-memo-table.c b/calendar/gui/e-memo-table.c index d8388d066b..872408c8da 100644 --- a/calendar/gui/e-memo-table.c +++ b/calendar/gui/e-memo-table.c @@ -121,8 +121,8 @@ memo_table_emit_status_message (EMemoTable *memo_table, } /* Returns the current time, for the ECellDateEdit items. - FIXME: Should probably use the timezone of the item rather than the - current timezone, though that may be difficult to get from here. */ + * FIXME: Should probably use the timezone of the item rather than the + * current timezone, though that may be difficult to get from here. */ static struct tm memo_table_get_current_time (ECellDateEdit *ecde, gpointer user_data) @@ -765,7 +765,8 @@ memo_table_cut_clipboard (ESelectable *selectable) /* Helper for memo_table_copy_clipboard() */ static void -copy_row_cb (gint model_row, gpointer data) +copy_row_cb (gint model_row, + gpointer data) { EMemoTable *memo_table; ECalModelComponent *comp_data; @@ -976,7 +977,8 @@ memo_table_paste_clipboard (ESelectable *selectable) * gint pointed to by the closure data. */ static void -get_selected_row_cb (gint model_row, gpointer data) +get_selected_row_cb (gint model_row, + gpointer data) { gint *row; @@ -1261,7 +1263,8 @@ struct get_selected_uids_closure { /* Used from e_table_selected_row_foreach(), builds a list of the selected UIDs */ static void -add_uid_cb (gint model_row, gpointer data) +add_uid_cb (gint model_row, + gpointer data) { struct get_selected_uids_closure *closure; ECalModelComponent *comp_data; diff --git a/calendar/gui/e-select-names-editable.c b/calendar/gui/e-select-names-editable.c index 6b541e170a..040993595a 100644 --- a/calendar/gui/e-select-names-editable.c +++ b/calendar/gui/e-select-names-editable.c @@ -158,7 +158,7 @@ e_select_names_editable_get_emails (ESelectNamesEditable *esne) if (e_destination_get_contact (destination) && e_contact_get (e_destination_get_contact (destination), E_CONTACT_IS_LIST)) { /* If its a contact_list which is not expanded, it wont have a email id, - so we can use the name as the email id */ + * so we can use the name as the email id */ result = g_list_append (result, g_strdup (e_destination_get_name (destination))); } else @@ -227,7 +227,9 @@ e_select_names_editable_get_names (ESelectNamesEditable *esne) } void -e_select_names_editable_set_address (ESelectNamesEditable *esne, const gchar *name, const gchar *email) +e_select_names_editable_set_address (ESelectNamesEditable *esne, + const gchar *name, + const gchar *email) { EDestinationStore *destination_store; GList *destinations; diff --git a/calendar/gui/e-select-names-renderer.c b/calendar/gui/e-select-names-renderer.c index 3e92636b4b..e5326c108f 100644 --- a/calendar/gui/e-select-names-renderer.c +++ b/calendar/gui/e-select-names-renderer.c @@ -53,7 +53,8 @@ static gint signals[LAST_SIGNAL]; G_DEFINE_TYPE (ESelectNamesRenderer, e_select_names_renderer, GTK_TYPE_CELL_RENDERER_TEXT) static void -e_select_names_renderer_editing_done (GtkCellEditable *editable, ESelectNamesRenderer *cell) +e_select_names_renderer_editing_done (GtkCellEditable *editable, + ESelectNamesRenderer *cell) { GList *addresses = NULL, *names = NULL, *a, *n; gboolean editing_canceled; @@ -101,8 +102,13 @@ e_select_names_renderer_editing_done (GtkCellEditable *editable, ESelectNamesRen } static GtkCellEditable * -e_select_names_renderer_start_editing (GtkCellRenderer *cell, GdkEvent *event, GtkWidget *widget, const gchar *path, - const GdkRectangle *bg_area, const GdkRectangle *cell_area, GtkCellRendererState flags) +e_select_names_renderer_start_editing (GtkCellRenderer *cell, + GdkEvent *event, + GtkWidget *widget, + const gchar *path, + const GdkRectangle *bg_area, + const GdkRectangle *cell_area, + GtkCellRendererState flags) { ESelectNamesRenderer *sn_cell = E_SELECT_NAMES_RENDERER (cell); GtkCellRendererText *text_cell = GTK_CELL_RENDERER_TEXT (cell); @@ -128,7 +134,7 @@ e_select_names_renderer_start_editing (GtkCellRenderer *cell, GdkEvent *event, G g_signal_connect (editable, "editing_done", G_CALLBACK (e_select_names_renderer_editing_done), sn_cell); /* Removed focus-out-event. focus out event already listen by base class. - We don't need to listen for the focus out event any more */ + * We don't need to listen for the focus out event any more */ sn_cell->priv->editable = g_object_ref (editable); sn_cell->priv->path = g_strdup (path); @@ -137,11 +143,14 @@ e_select_names_renderer_start_editing (GtkCellRenderer *cell, GdkEvent *event, G } static void -e_select_names_renderer_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) +e_select_names_renderer_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) { ESelectNamesRenderer *esnr = E_SELECT_NAMES_RENDERER (object); - switch (prop_id) { + switch (property_id) { case PROP_NAME: g_value_set_string (value, esnr->priv->name); break; @@ -154,11 +163,14 @@ e_select_names_renderer_get_property (GObject *object, guint prop_id, GValue *va } static void -e_select_names_renderer_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) +e_select_names_renderer_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) { ESelectNamesRenderer *esnr = E_SELECT_NAMES_RENDERER (object); - switch (prop_id) { + switch (property_id) { case PROP_NAME: g_free (esnr->priv->name); esnr->priv->name = g_strdup (g_value_get_string (value)); diff --git a/calendar/gui/e-task-table.c b/calendar/gui/e-task-table.c index 9125206196..ec49cd1478 100644 --- a/calendar/gui/e-task-table.c +++ b/calendar/gui/e-task-table.c @@ -128,7 +128,9 @@ task_table_emit_status_message (ETaskTable *task_table, } static gint -task_table_percent_compare_cb (gconstpointer a, gconstpointer b, gpointer cmp_cache) +task_table_percent_compare_cb (gconstpointer a, + gconstpointer b, + gpointer cmp_cache) { gint percent1 = GPOINTER_TO_INT (a); gint percent2 = GPOINTER_TO_INT (b); @@ -137,7 +139,9 @@ task_table_percent_compare_cb (gconstpointer a, gconstpointer b, gpointer cmp_ca } static gint -task_table_priority_compare_cb (gconstpointer a, gconstpointer b, gpointer cmp_cache) +task_table_priority_compare_cb (gconstpointer a, + gconstpointer b, + gpointer cmp_cache) { gint priority1, priority2; @@ -155,7 +159,8 @@ task_table_priority_compare_cb (gconstpointer a, gconstpointer b, gpointer cmp_c } static const gchar * -get_cache_str (gpointer cmp_cache, const gchar *str) +get_cache_str (gpointer cmp_cache, + const gchar *str) { const gchar *value; @@ -175,7 +180,9 @@ get_cache_str (gpointer cmp_cache, const gchar *str) } static gboolean -same_cache_string (gpointer cmp_cache, const gchar *str_a, const gchar *str_b) +same_cache_string (gpointer cmp_cache, + const gchar *str_a, + const gchar *str_b) { if (!cmp_cache) return g_utf8_collate (str_a, str_b) == 0; @@ -189,7 +196,9 @@ same_cache_string (gpointer cmp_cache, const gchar *str_a, const gchar *str_b) } static gint -task_table_status_compare_cb (gconstpointer a, gconstpointer b, gpointer cmp_cache) +task_table_status_compare_cb (gconstpointer a, + gconstpointer b, + gpointer cmp_cache) { const gchar *string_a = a; const gchar *string_b = b; @@ -502,7 +511,7 @@ task_table_constructed (GObject *object) /* Priority field. */ cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT); - g_object_set (G_OBJECT (cell), + g_object_set (cell, "strikeout_column", E_CAL_MODEL_TASKS_FIELD_STRIKEOUT, "bold_column", E_CAL_MODEL_TASKS_FIELD_OVERDUE, "bg_color_column", E_CAL_MODEL_FIELD_COLOR, @@ -527,7 +536,7 @@ task_table_constructed (GObject *object) /* Percent field. */ cell = e_cell_percent_new (NULL, GTK_JUSTIFY_LEFT); - g_object_set (G_OBJECT (cell), + g_object_set (cell, "strikeout_column", E_CAL_MODEL_TASKS_FIELD_STRIKEOUT, "bold_column", E_CAL_MODEL_TASKS_FIELD_OVERDUE, "bg_color_column", E_CAL_MODEL_FIELD_COLOR, @@ -540,8 +549,8 @@ task_table_constructed (GObject *object) strings = NULL; for (percent = 0; percent <= 100; percent += 10) { /* Translators: "%d%%" is the percentage of a task done. - %d is the actual value, %% is replaced with a percent sign. - Result values will be 0%, 10%, 20%, ... 100% + * %d is the actual value, %% is replaced with a percent sign. + * Result values will be 0%, 10%, 20%, ... 100% */ strings = g_list_append (strings, g_strdup_printf (_("%d%%"), percent)); } @@ -556,7 +565,7 @@ task_table_constructed (GObject *object) /* Transparency field. */ cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT); - g_object_set (G_OBJECT (cell), + g_object_set (cell, "strikeout_column", E_CAL_MODEL_TASKS_FIELD_STRIKEOUT, "bold_column", E_CAL_MODEL_TASKS_FIELD_OVERDUE, "bg_color_column", E_CAL_MODEL_FIELD_COLOR, @@ -579,7 +588,7 @@ task_table_constructed (GObject *object) /* Status field. */ cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT); - g_object_set (G_OBJECT (cell), + g_object_set (cell, "strikeout_column", E_CAL_MODEL_TASKS_FIELD_STRIKEOUT, "bold_column", E_CAL_MODEL_TASKS_FIELD_OVERDUE, "bg_color_column", E_CAL_MODEL_FIELD_COLOR, @@ -998,7 +1007,8 @@ task_table_cut_clipboard (ESelectable *selectable) /* Helper for task_table_copy_clipboard() */ static void -copy_row_cb (gint model_row, gpointer data) +copy_row_cb (gint model_row, + gpointer data) { ETaskTable *task_table; ECalModelComponent *comp_data; @@ -1209,7 +1219,8 @@ task_table_paste_clipboard (ESelectable *selectable) * gint pointed to by the closure data. */ static void -get_selected_row_cb (gint model_row, gpointer data) +get_selected_row_cb (gint model_row, + gpointer data) { gint *row; @@ -1240,7 +1251,8 @@ get_selected_comp (ETaskTable *task_table) } static void -add_retract_data (ECalComponent *comp, const gchar *retract_comment) +add_retract_data (ECalComponent *comp, + const gchar *retract_comment) { icalcomponent *icalcomp = NULL; icalproperty *icalprop = NULL; @@ -1255,7 +1267,8 @@ add_retract_data (ECalComponent *comp, const gchar *retract_comment) } static gboolean -check_for_retract (ECalComponent *comp, ECalClient *client) +check_for_retract (ECalComponent *comp, + ECalClient *client) { ECalComponentOrganizer org; gchar *email = NULL; @@ -1567,7 +1580,8 @@ struct get_selected_uids_closure { /* Used from e_table_selected_row_foreach(), builds a list of the selected UIDs */ static void -add_uid_cb (gint model_row, gpointer data) +add_uid_cb (gint model_row, + gpointer data) { struct get_selected_uids_closure *closure = data; ECalModelComponent *comp_data; @@ -1748,10 +1762,11 @@ show_completed_rows (ECalModel *model, } /* Returns the current time, for the ECellDateEdit items. - FIXME: Should probably use the timezone of the item rather than the - current timezone, though that may be difficult to get from here. */ + * FIXME: Should probably use the timezone of the item rather than the + * current timezone, though that may be difficult to get from here. */ static struct tm -e_task_table_get_current_time (ECellDateEdit *ecde, gpointer data) +e_task_table_get_current_time (ECellDateEdit *ecde, + gpointer data) { ETaskTable *task_table = data; ECalModel *model; diff --git a/calendar/gui/e-timezone-entry.c b/calendar/gui/e-timezone-entry.c index 3318e666db..a3288b1115 100644 --- a/calendar/gui/e-timezone-entry.c +++ b/calendar/gui/e-timezone-entry.c @@ -38,14 +38,14 @@ struct _ETimezoneEntryPrivate { /* The current timezone, set in e_timezone_entry_set_timezone() - or from the timezone dialog. Note that we don't copy it or - use a ref count - we assume it is never destroyed for the - lifetime of this widget. */ + * or from the timezone dialog. Note that we don't copy it or + * use a ref count - we assume it is never destroyed for the + * lifetime of this widget. */ icaltimezone *timezone; /* This can be set to the default timezone. If the current timezone - setting in the ETimezoneEntry matches this, then the entry field - is hidden. This makes the user interface simpler. */ + * setting in the ETimezoneEntry matches this, then the entry field + * is hidden. This makes the user interface simpler. */ icaltimezone *default_zone; GtkWidget *entry; @@ -85,8 +85,8 @@ timezone_entry_update_entry (ETimezoneEntry *timezone_entry) display_name = icaltimezone_get_display_name (timezone); /* We check if it is one of our builtin timezone - names, in which case we call gettext to translate - it. If it isn't a builtin timezone name, we don't. */ + * names, in which case we call gettext to translate + * it. If it isn't a builtin timezone name, we don't. */ if (icaltimezone_get_builtin_timezone (display_name)) display_name = _(display_name); } else @@ -150,7 +150,7 @@ timezone_entry_add_relation (ETimezoneEntry *timezone_entry) } /* The arrow button beside the date field has been clicked, so we show the - popup with the ECalendar in. */ + * popup with the ECalendar in. */ static void timezone_entry_button_clicked_cb (ETimezoneEntry *timezone_entry) { diff --git a/calendar/gui/e-week-view-event-item.c b/calendar/gui/e-week-view-event-item.c index 917d7de46d..8aa50a99e2 100644 --- a/calendar/gui/e-week-view-event-item.c +++ b/calendar/gui/e-week-view-event-item.c @@ -217,7 +217,7 @@ week_view_event_item_button_press (EWeekViewEventItem *event_item, return FALSE; /* Remember the item clicked and the mouse position, - so we can start a drag if the mouse moves. */ + * so we can start a drag if the mouse moves. */ week_view->drag_event_x = bevent->button.x; week_view->drag_event_y = bevent->button.y; @@ -239,7 +239,7 @@ week_view_event_item_button_press (EWeekViewEventItem *event_item, week_view, event->start, event->end); e_week_view_show_popup_menu ( - week_view, (GdkEventButton*) bevent, + week_view, (GdkEventButton *) bevent, event_item->priv->event_num); g_signal_stop_emission_by_name ( item->canvas, "button_press_event"); @@ -500,7 +500,7 @@ week_view_event_item_draw_icons (EWeekViewEventItem *event_item, } /* This draws a little triangle to indicate that an event extends past - the days visible on screen. */ + * the days visible on screen. */ static void week_view_event_item_draw_triangle (EWeekViewEventItem *event_item, cairo_t *cr, @@ -574,7 +574,7 @@ week_view_event_item_draw_triangle (EWeekViewEventItem *event_item, cr, &week_view->colors[E_WEEK_VIEW_COLOR_EVENT_BORDER]); /* If the height is odd we can use the same central point for both - lines. If it is even we use different end-points. */ + * lines. If it is even we use different end-points. */ c1 = c2 = y + (h / 2); if (h % 2 == 0) c1--; @@ -811,7 +811,7 @@ week_view_event_item_draw (GnomeCanvasItem *canvas_item, cairo_save (cr); draw_curved_rectangle (cr, cx0, cy0, rect_width, rect_height, radius); cairo_set_line_width (cr, 2.0); - cairo_set_source_rgb (cr, red/cc, green/cc, blue/cc); + cairo_set_source_rgb (cr, red / cc, green / cc, blue / cc); cairo_stroke (cr); cairo_restore (cr); } @@ -833,13 +833,13 @@ week_view_event_item_draw (GnomeCanvasItem *canvas_item, pat = cairo_pattern_create_linear ( rect_x + 2, y1 + 1, rect_x + 2, y2 - 7.25); cairo_pattern_add_color_stop_rgba ( - pat, 1, red/cc, green/cc, blue/cc, 0.8); + pat, 1, red / cc, green / cc, blue / cc, 0.8); cairo_pattern_add_color_stop_rgba ( - pat, 0, red/cc, green/cc, blue/cc, 0.4); + pat, 0, red / cc, green / cc, blue / cc, 0.4); cairo_set_source (cr, pat); cairo_fill_preserve (cr); cairo_pattern_destroy (pat); - cairo_set_source_rgba (cr, red/cc, green/cc, blue/cc, 0.2); + cairo_set_source_rgba (cr, red / cc, green / cc, blue / cc, 0.2); cairo_set_line_width (cr, 0.5); cairo_stroke (cr); cairo_restore (cr); @@ -900,9 +900,9 @@ week_view_event_item_draw (GnomeCanvasItem *canvas_item, - E_WEEK_VIEW_EVENT_R_PAD + 1; /* Draw the triangles at the start & end, if needed. - They also use the first few pixels at the edge of the - event so we update rect_x & rect_w so we don't draw over - them. */ + * They also use the first few pixels at the edge of the + * event so we update rect_x & rect_w so we don't draw over + * them. */ if (event->start < week_view->day_starts[span->start_day]) { draw_start_triangle = TRUE; rect_x += 2; @@ -928,7 +928,7 @@ week_view_event_item_draw (GnomeCanvasItem *canvas_item, cairo_save (cr); draw_curved_rectangle (cr, cx0, cy0, rect_width, rect_height, radius); cairo_set_line_width (cr, 2.0); - cairo_set_source_rgb (cr, red/cc, green/cc, blue/cc); + cairo_set_source_rgb (cr, red / cc, green / cc, blue / cc); cairo_stroke (cr); cairo_restore (cr); } @@ -950,13 +950,13 @@ week_view_event_item_draw (GnomeCanvasItem *canvas_item, pat = cairo_pattern_create_linear ( rect_x + 2, y1 + 1, rect_x + 2, y2 - 7.25); cairo_pattern_add_color_stop_rgba ( - pat, 1, red/cc, green/cc, blue/cc, 0.8); + pat, 1, red / cc, green / cc, blue / cc, 0.8); cairo_pattern_add_color_stop_rgba ( - pat, 0, red/cc, green/cc, blue/cc, 0.4); + pat, 0, red / cc, green / cc, blue / cc, 0.4); cairo_set_source (cr, pat); cairo_fill_preserve (cr); cairo_pattern_destroy (pat); - cairo_set_source_rgba (cr, red/cc, green/cc, blue/cc, 0.2); + cairo_set_source_rgba (cr, red / cc, green / cc, blue / cc, 0.2); cairo_set_line_width (cr, 0.5); cairo_stroke (cr); cairo_restore (cr); @@ -1009,12 +1009,12 @@ week_view_event_item_draw (GnomeCanvasItem *canvas_item, editing_span = TRUE; /* Draw the start & end times, if they are not on day - boundaries. The start time would always be shown if it was - needed, though it may be clipped as the window shrinks. - The end time is only displayed if there is enough room. - We calculate the minimum position for the end time, which - depends on whether the start time is displayed. If the end - time doesn't fit, then we don't draw it. */ + * boundaries. The start time would always be shown if it was + * needed, though it may be clipped as the window shrinks. + * The end time is only displayed if there is enough room. + * We calculate the minimum position for the end time, which + * depends on whether the start time is displayed. If the end + * time doesn't fit, then we don't draw it. */ min_end_time_x = x1 + E_WEEK_VIEW_EVENT_L_PAD + E_WEEK_VIEW_EVENT_BORDER_WIDTH + E_WEEK_VIEW_EVENT_EDGE_X_PAD; @@ -1040,7 +1040,7 @@ week_view_event_item_draw (GnomeCanvasItem *canvas_item, cairo_restore (cr); /* We don't want the end time to be drawn over the - start time, so we increase the minimum position. */ + * start time, so we increase the minimum position. */ min_end_time_x += time_width + E_WEEK_VIEW_EVENT_TIME_X_PAD; } @@ -1059,7 +1059,7 @@ week_view_event_item_draw (GnomeCanvasItem *canvas_item, - time_width; /* Draw the end time, if the position is greater than - the minimum calculated above. */ + * the minimum calculated above. */ if (time_x >= min_end_time_x) { week_view_draw_time ( week_view, cr, time_x, diff --git a/calendar/gui/e-week-view-layout.c b/calendar/gui/e-week-view-layout.c index 0b776adcfa..b2fc7ca158 100644 --- a/calendar/gui/e-week-view-layout.c +++ b/calendar/gui/e-week-view-layout.c @@ -47,15 +47,15 @@ static gint e_week_view_find_span_end (gboolean multi_week_view, gint display_start_day, gint day); -GArray* -e_week_view_layout_events (GArray *events, - GArray *old_spans, - gboolean multi_week_view, - gint weeks_shown, - gboolean compress_weekend, - gint start_weekday, - time_t *day_starts, - gint *rows_per_day) +GArray * +e_week_view_layout_events (GArray *events, + GArray *old_spans, + gboolean multi_week_view, + gint weeks_shown, + gboolean compress_weekend, + gint start_weekday, + time_t *day_starts, + gint *rows_per_day) { EWeekViewEvent *event; EWeekViewEventSpan *span; @@ -64,9 +64,9 @@ e_week_view_layout_events (GArray *events, GArray *spans; /* This is a temporary 2-d grid which is used to place events. - Each element is 0 if the position is empty, or 1 if occupied. - We allocate the maximum size possible here, assuming that each - event will need its own row. */ + * Each element is 0 if the position is empty, or 1 if occupied. + * We allocate the maximum size possible here, assuming that each + * event will need its own row. */ grid = g_new0 (guint8, E_WEEK_VIEW_MAX_ROWS_PER_CELL * 7 * E_WEEK_VIEW_MAX_WEEKS); @@ -80,7 +80,7 @@ e_week_view_layout_events (GArray *events, } /* Iterate over the events, finding which weeks they cover, and putting - them in the first free row available. */ + * them in the first free row available. */ for (event_num = 0; event_num < events->len; event_num++) { event = &g_array_index (events, EWeekViewEvent, event_num); e_week_view_layout_event (event, grid, spans, old_spans, @@ -110,16 +110,16 @@ e_week_view_layout_events (GArray *events, } static void -e_week_view_layout_event (EWeekViewEvent *event, - guint8 *grid, - GArray *spans, - GArray *old_spans, - gboolean multi_week_view, - gint weeks_shown, - gboolean compress_weekend, - gint start_weekday, - time_t *day_starts, - gint *rows_per_day) +e_week_view_layout_event (EWeekViewEvent *event, + guint8 *grid, + GArray *spans, + GArray *old_spans, + gboolean multi_week_view, + gint weeks_shown, + gboolean compress_weekend, + gint start_weekday, + time_t *day_starts, + gint *rows_per_day) { gint start_day, end_day, span_start_day, span_end_day, rows_per_cell; gint free_row, row, day, span_num, spans_index, num_spans, days_shown; @@ -139,7 +139,7 @@ e_week_view_layout_event (EWeekViewEvent *event, #endif /* Iterate through each of the spans of the event, where each span - is a sequence of 1 or more days displayed next to each other. */ + * is a sequence of 1 or more days displayed next to each other. */ span_start_day = start_day; rows_per_cell = E_WEEK_VIEW_MAX_ROWS_PER_CELL; span_num = 0; @@ -156,7 +156,7 @@ e_week_view_layout_event (EWeekViewEvent *event, span_end_day); #endif /* Try each row until we find a free one or we fall off the - bottom of the available rows. */ + * bottom of the available rows. */ row = 0; free_row = -1; while (free_row == -1 && row < rows_per_cell) { @@ -184,7 +184,7 @@ e_week_view_layout_event (EWeekViewEvent *event, span_start_day, span_end_day, free_row); #endif /* Add the span to the array, and try to reuse any - canvas items from the old spans. */ + * canvas items from the old spans. */ span.start_day = span_start_day; span.num_days = span_end_day - span_start_day + 1; span.row = free_row; @@ -214,14 +214,14 @@ e_week_view_layout_event (EWeekViewEvent *event, } /* Finds the day containing the given time. - If include_midnight_in_prev_day is TRUE then if the time exactly - matches the start of a day the previous day is returned. This is useful - when calculating the end day of an event. */ + * If include_midnight_in_prev_day is TRUE then if the time exactly + * matches the start of a day the previous day is returned. This is useful + * when calculating the end day of an event. */ static gint -e_week_view_find_day (time_t time_to_find, - gboolean include_midnight_in_prev_day, - gint days_shown, - time_t *day_starts) +e_week_view_find_day (time_t time_to_find, + gboolean include_midnight_in_prev_day, + gint days_shown, + time_t *day_starts) { gint day; @@ -243,16 +243,16 @@ e_week_view_find_day (time_t time_to_find, } /* This returns the last possible day in the same span as the given day. - A span is all the days which are displayed next to each other from left to - right. In the week view all spans are only 1 day, since Tuesday is below - Monday rather than beside it etc. In the month view, if the weekends are not - compressed then each week is a span, otherwise we have to break a span up - on Saturday, use a separate span for Sunday, and start again on Monday. */ + * A span is all the days which are displayed next to each other from left to + * right. In the week view all spans are only 1 day, since Tuesday is below + * Monday rather than beside it etc. In the month view, if the weekends are not + * compressed then each week is a span, otherwise we have to break a span up + * on Saturday, use a separate span for Sunday, and start again on Monday. */ static gint -e_week_view_find_span_end (gboolean multi_week_view, - gboolean compress_weekend, - gint display_start_day, - gint day) +e_week_view_find_span_end (gboolean multi_week_view, + gboolean compress_weekend, + gint display_start_day, + gint day) { gint week, col, sat_col, end_col; @@ -264,7 +264,7 @@ e_week_view_find_span_end (gboolean multi_week_view, end_col = 6; /* If the weekend is compressed we must end any spans on - Saturday and Sunday. */ + * Saturday and Sunday. */ if (compress_weekend) { sat_col = (5 + 7 - display_start_day) % 7; if (col <= sat_col) @@ -280,14 +280,14 @@ e_week_view_find_span_end (gboolean multi_week_view, } void -e_week_view_layout_get_day_position (gint day, - gboolean multi_week_view, - gint weeks_shown, - gint display_start_day, - gboolean compress_weekend, - gint *day_x, - gint *day_y, - gint *rows) +e_week_view_layout_get_day_position (gint day, + gboolean multi_week_view, + gint weeks_shown, + gint display_start_day, + gboolean compress_weekend, + gint *day_x, + gint *day_y, + gint *rows) { gint week, day_of_week, col, weekend_col; @@ -302,8 +302,8 @@ e_week_view_layout_get_day_position (gint day, day_of_week = (display_start_day + day) % 7; if (compress_weekend && day_of_week >= 5) { /* In the compressed view Saturday is above Sunday and - both have just one row as opposed to 2 for all the - other days. */ + * both have just one row as opposed to 2 for all the + * other days. */ if (day_of_week == 5) { *day_y = week * 2; *rows = 1; @@ -316,10 +316,10 @@ e_week_view_layout_get_day_position (gint day, *day_x = col; } else { /* If the weekend is compressed and the day is after - the weekend we have to move back a column. */ + * the weekend we have to move back a column. */ if (compress_weekend) { /* Calculate where the weekend column is. - Note that 5 is Saturday. */ + * Note that 5 is Saturday. */ weekend_col = (5 + 7 - display_start_day) % 7; if (col > weekend_col) col--; @@ -412,20 +412,20 @@ e_week_view_layout_get_day_position (gint day, } /* Returns TRUE if the event span is visible or FALSE if it isn't. - It also returns the number of days of the span that are visible. - Usually this can easily be determined by the start & end days and row of - the span, which are set in e_week_view_layout_event (). Though we need a - special case for the weekends when they are compressed, since the span may - not fit. */ + * It also returns the number of days of the span that are visible. + * Usually this can easily be determined by the start & end days and row of + * the span, which are set in e_week_view_layout_event (). Though we need a + * special case for the weekends when they are compressed, since the span may + * not fit. */ gboolean -e_week_view_layout_get_span_position (EWeekViewEvent *event, - EWeekViewEventSpan *span, - gint rows_per_cell, - gint rows_per_compressed_cell, - gint display_start_day, - gboolean multi_week_view, - gboolean compress_weekend, - gint *span_num_days) +e_week_view_layout_get_span_position (EWeekViewEvent *event, + EWeekViewEventSpan *span, + gint rows_per_cell, + gint rows_per_compressed_cell, + gint display_start_day, + gboolean multi_week_view, + gboolean compress_weekend, + gint *span_num_days) { gint end_day_of_week; @@ -440,9 +440,9 @@ e_week_view_layout_get_span_position (EWeekViewEvent *event, if (multi_week_view) { if (compress_weekend) { /* If it ends on a Saturday and is 1 day glong - we skip it, else we shorten it. If it ends - on a Sunday it must be 1 day long and we - skip it. */ + * we skip it, else we shorten it. If it ends + * on a Sunday it must be 1 day long and we + * skip it. */ if (end_day_of_week == 5) { /* Sat */ if (*span_num_days == 1) { return FALSE; diff --git a/calendar/gui/e-week-view-layout.h b/calendar/gui/e-week-view-layout.h index 98bf1ccb3a..5f1e2870d4 100644 --- a/calendar/gui/e-week-view-layout.h +++ b/calendar/gui/e-week-view-layout.h @@ -29,9 +29,9 @@ G_BEGIN_DECLS /* I've split these functions away from EWeekView so we can use them for - printing. */ + * printing. */ -GArray* e_week_view_layout_events (GArray *events, +GArray * e_week_view_layout_events (GArray *events, GArray *old_spans, gboolean multi_week_view, gint weeks_shown, @@ -41,8 +41,8 @@ GArray* e_week_view_layout_events (GArray *events, gint *rows_per_day); /* Returns which 'cell' in the table the day appears in. Note that most days - have a height of 2 rows, but Sat/Sun are sometimes compressed so they have - a height of only 1 row. */ + * have a height of 2 rows, but Sat/Sun are sometimes compressed so they have + * a height of only 1 row. */ void e_week_view_layout_get_day_position (gint day, gboolean multi_week_view, gint weeks_shown, diff --git a/calendar/gui/e-week-view-main-item.c b/calendar/gui/e-week-view-main-item.c index 03cf3b56d4..bca3343b67 100644 --- a/calendar/gui/e-week-view-main-item.c +++ b/calendar/gui/e-week-view-main-item.c @@ -121,10 +121,10 @@ week_view_main_item_draw_day (EWeekViewMainItem *main_item, working_days = calendar_config_get_working_days (); /* Draw the background of the day. In the month view odd months are - one color and even months another, so you can easily see when each - month starts (defaults are white for odd - January, March, ... and - light gray for even). In the week view the background is always the - same color, the color used for the odd months in the month view. */ + * one color and even months another, so you can easily see when each + * month starts (defaults are white for odd - January, March, ... and + * light gray for even). In the week view the background is always the + * same color, the color used for the odd months in the month view. */ if (today) bg_color = &week_view->colors[E_WEEK_VIEW_COLOR_TODAY_BACKGROUND]; else if ((working_days & day_of_week) == 0) @@ -141,8 +141,8 @@ week_view_main_item_draw_day (EWeekViewMainItem *main_item, cairo_restore (cr); /* Draw the lines on the right and bottom of the cell. The canvas is - sized so that the lines on the right & bottom edges will be off the - edge of the canvas, so we don't have to worry about them. */ + * sized so that the lines on the right & bottom edges will be off the + * edge of the canvas, so we don't have to worry about them. */ right_edge = x + width - 1; bottom_edge = y + height - 1; @@ -188,10 +188,10 @@ week_view_main_item_draw_day (EWeekViewMainItem *main_item, cairo_restore (cr); /* Display the date in the top of the cell. - In the week view, display the long format "10 January" in all cells, - or abbreviate it to "10 Jan" or "10" if that doesn't fit. - In the month view, only use the long format for the first cell and - the 1st of each month, otherwise use "10". */ + * In the week view, display the long format "10 January" in all cells, + * or abbreviate it to "10 Jan" or "10" if that doesn't fit. + * In the month view, only use the long format for the first cell and + * the 1st of each month, otherwise use "10". */ show_day_name = FALSE; show_month_name = FALSE; if (!week_view->multi_week_view) { @@ -209,32 +209,32 @@ week_view_main_item_draw_day (EWeekViewMainItem *main_item, + week_view->space_width * 2 + week_view->month_widths[month - 1] < max_width) /* strftime format %A = full weekday name, %d = day of - month, %B = full month name. You can change the - order but don't change the specifiers or add - anything. */ + * month, %B = full month name. You can change the + * order but don't change the specifiers or add + * anything. */ format_string = _("%A %d %B"); else if (week_view->max_abbr_day_width + week_view->digit_width * 2 + week_view->space_width * 2 + week_view->abbr_month_widths[month - 1] < max_width) /* strftime format %a = abbreviated weekday name, - %d = day of month, %b = abbreviated month name. - You can change the order but don't change the - specifiers or add anything. */ + * %d = day of month, %b = abbreviated month name. + * You can change the order but don't change the + * specifiers or add anything. */ format_string = _("%a %d %b"); } if (!format_string && show_month_name) { if (week_view->digit_width * 2 + week_view->space_width + week_view->month_widths[month - 1] < max_width) /* strftime format %d = day of month, %B = full - month name. You can change the order but don't - change the specifiers or add anything. */ + * month name. You can change the order but don't + * change the specifiers or add anything. */ format_string = _("%d %B"); else if (week_view->digit_width * 2 + week_view->space_width + week_view->abbr_month_widths[month - 1] < max_width) /* strftime format %d = day of month, %b = abbreviated - month name. You can change the order but don't - change the specifiers or add anything. */ + * month name. You can change the order but don't + * change the specifiers or add anything. */ format_string = _("%d %b"); } diff --git a/calendar/gui/e-week-view-titles-item.c b/calendar/gui/e-week-view-titles-item.c index f808e693b1..66f9930534 100644 --- a/calendar/gui/e-week-view-titles-item.c +++ b/calendar/gui/e-week-view-titles-item.c @@ -157,11 +157,11 @@ week_view_titles_item_draw (GnomeCanvasItem *canvas_item, abbreviated = (week_view->max_day_width + 2 >= col_width); /* Shift right one pixel to account for the shadow around the main - canvas. */ + * canvas. */ x--; /* Draw the date. Set a clipping rectangle so we don't draw over the - next day. */ + * next day. */ weekday = week_view->display_start_day; for (col = 0; col < week_view->columns; col++) { if (weekday == 5 && week_view->compress_weekend) diff --git a/calendar/gui/e-week-view.c b/calendar/gui/e-week-view.c index 2385b9f189..a98ff42776 100644 --- a/calendar/gui/e-week-view.c +++ b/calendar/gui/e-week-view.c @@ -75,7 +75,7 @@ #define E_WEEK_VIEW_JUMP_BUTTON_NO_FOCUS -1 /* The timeout before we do a layout, so we don't do a layout for each event - we get from the server. */ + * we get from the server. */ #define E_WEEK_VIEW_LAYOUT_TIMEOUT 100 typedef struct { @@ -236,7 +236,8 @@ week_view_process_component (EWeekView *week_view, } static void -week_view_update_row (EWeekView *week_view, gint row) +week_view_update_row (EWeekView *week_view, + gint row) { ECalModelComponent *comp_data; ECalModel *model; @@ -384,11 +385,11 @@ week_view_time_range_changed_cb (EWeekView *week_view, week_start_offset = (weekday + 7 - week_view->display_start_day) % 7; /* Set the day_offset to the result, so we move back to the - start of the week. */ + * start of the week. */ day_offset = week_start_offset; /* Calculate the base date, i.e. the first day shown when the - scrollbar adjustment value is 0. */ + * scrollbar adjustment value is 0. */ base_date = date; g_date_subtract_days (&base_date, day_offset); @@ -411,8 +412,8 @@ week_view_time_range_changed_cb (EWeekView *week_view, } /* Reset the adjustment value to 0 if the base address has changed. - Note that we do this after updating first_day_shown so that our - signal handler will not try to reload the events. */ + * Note that we do this after updating first_day_shown so that our + * signal handler will not try to reload the events. */ if (update_adjustment_value) { GtkRange *range; GtkAdjustment *adjustment; @@ -460,7 +461,7 @@ timezone_changed_cb (ECalModel *cal_model, return; /* Recalculate the new start of the first week. We just use exactly - the same time, but with the new timezone. */ + * the same time, but with the new timezone. */ tt.year = g_date_get_year (&week_view->first_day_shown); tt.month = g_date_get_month (&week_view->first_day_shown); tt.day = g_date_get_day (&week_view->first_day_shown); @@ -854,8 +855,10 @@ e_week_view_new (ECalModel *model) view = g_object_new (E_TYPE_WEEK_VIEW, "model", model, NULL); - g_signal_connect (G_OBJECT (model), "timezone_changed", - G_CALLBACK (timezone_changed_cb), view); + g_signal_connect ( + model, "timezone_changed", + G_CALLBACK (timezone_changed_cb), view); + return view; } @@ -923,7 +926,8 @@ e_week_view_realize (GtkWidget *widget) } static GdkColor -color_inc (GdkColor c, gint amount) +color_inc (GdkColor c, + gint amount) { #define dec(x) \ if (x + amount >= 0 \ @@ -944,7 +948,8 @@ color_inc (GdkColor c, gint amount) } static void -e_week_view_set_colors (EWeekView *week_view, GtkWidget *widget) +e_week_view_set_colors (EWeekView *week_view, + GtkWidget *widget) { GtkStyle *style; @@ -988,7 +993,8 @@ e_week_view_unrealize (GtkWidget *widget) } static gint -get_string_width (PangoLayout *layout, const gchar *string) +get_string_width (PangoLayout *layout, + const gchar *string) { gint width; @@ -1022,7 +1028,9 @@ get_digit_width (PangoLayout *layout) } static GdkColor -e_week_view_get_text_color (EWeekView *week_view, EWeekViewEvent *event, GtkWidget *widget) +e_week_view_get_text_color (EWeekView *week_view, + EWeekViewEvent *event, + GtkWidget *widget) { GtkStyle *style; GdkColor bg_color; @@ -1042,7 +1050,7 @@ e_week_view_get_text_color (EWeekView *week_view, EWeekViewEvent *event, GtkWidg style = gtk_widget_get_style (widget); - if ((red/cc > 0.7) || (green/cc > 0.7) || (blue/cc > 0.7 )) + if ((red / cc > 0.7) || (green / cc > 0.7) || (blue / cc > 0.7 )) return style->black; else return style->white; @@ -1050,7 +1058,7 @@ e_week_view_get_text_color (EWeekView *week_view, EWeekViewEvent *event, GtkWidg static void e_week_view_style_set (GtkWidget *widget, - GtkStyle *previous_style) + GtkStyle *previous_style) { EWeekView *week_view; GtkStyle *style; @@ -1099,7 +1107,7 @@ e_week_view_style_set (GtkWidget *widget, week_view->row_height = MAX (week_view->row_height, E_WEEK_VIEW_ICON_HEIGHT + E_WEEK_VIEW_ICON_Y_PAD + E_WEEK_VIEW_EVENT_BORDER_HEIGHT * 2); /* Check that the small font is smaller than the default font. - If it isn't, we won't use it. */ + * If it isn't, we won't use it. */ if (week_view->small_font_desc) { if (PANGO_PIXELS (pango_font_metrics_get_ascent (font_metrics)) + PANGO_PIXELS (pango_font_metrics_get_descent (font_metrics)) @@ -1114,7 +1122,7 @@ e_week_view_style_set (GtkWidget *widget, PANGO_PIXELS (pango_font_metrics_get_descent (font_metrics)) + 5); /* Save the sizes of various strings in the font, so we can quickly - decide which date formats to use. */ + * decide which date formats to use. */ max_day_width = 0; max_abbr_day_width = 0; @@ -1169,7 +1177,8 @@ e_week_view_style_set (GtkWidget *widget, /* This recalculates the sizes of each column. */ static void -e_week_view_size_allocate (GtkWidget *widget, GtkAllocation *allocation) +e_week_view_size_allocate (GtkWidget *widget, + GtkAllocation *allocation) { EWeekView *week_view; GtkAllocation canvas_allocation; @@ -1195,7 +1204,7 @@ e_week_view_size_allocate (GtkWidget *widget, GtkAllocation *allocation) 0, 0, new_x2, new_y2); /* Set the scroll region of the main canvas to its allocated width, - but with the height depending on the number of rows needed. */ + * but with the height depending on the number of rows needed. */ gnome_canvas_get_scroll_region ( GNOME_CANVAS (week_view->main_canvas), NULL, NULL, &old_x2, &old_y2); @@ -1239,10 +1248,10 @@ e_week_view_recalc_cell_sizes (EWeekView *week_view) gtk_widget_get_allocation (week_view->main_canvas, &allocation); /* Calculate the column sizes, using floating point so that pixels - get divided evenly. Note that we use one more element than the - number of columns, to make it easy to get the column widths. - We also add one to the width so that the right border of the last - column is off the edge of the displayed area. */ + * get divided evenly. Note that we use one more element than the + * number of columns, to make it easy to get the column widths. + * We also add one to the width so that the right border of the last + * column is off the edge of the displayed area. */ canvas_width = allocation.width + 1; canvas_width /= week_view->columns; offset = 0; @@ -1286,7 +1295,7 @@ e_week_view_recalc_cell_sizes (EWeekView *week_view) pango_context_get_language (pango_context)); /* Calculate the number of rows of events in each cell, for the large - cells and the compressed weekend cells. */ + * cells and the compressed weekend cells. */ if (week_view->multi_week_view) { week_view->events_y_offset = E_WEEK_VIEW_DATE_T_PAD + + PANGO_PIXELS (pango_font_metrics_get_ascent (font_metrics)) @@ -1313,7 +1322,7 @@ e_week_view_recalc_cell_sizes (EWeekView *week_view) E_WEEK_VIEW_MAX_ROWS_PER_CELL); /* Determine which time format to use, based on the width of the cells. - We only allow the time to take up about half of the width. */ + * We only allow the time to take up about half of the width. */ width = week_view->col_widths[0]; time_width = e_week_view_get_time_string_width (week_view); @@ -1337,7 +1346,8 @@ e_week_view_recalc_cell_sizes (EWeekView *week_view) } static gint -e_week_view_focus_in (GtkWidget *widget, GdkEventFocus *event) +e_week_view_focus_in (GtkWidget *widget, + GdkEventFocus *event) { EWeekView *week_view; @@ -1363,7 +1373,7 @@ e_week_view_focus_in (GtkWidget *widget, GdkEventFocus *event) if (e_calendar_view_get_visible_time_range (E_CALENDAR_VIEW (week_view), &my_start, &my_end) && model_start == my_start && model_end == my_end) { /* update only when the same time range is set in a view and in a model; - otherwise time range change invokes also query update */ + * otherwise time range change invokes also query update */ e_week_view_update_query (week_view); } } @@ -1374,7 +1384,8 @@ e_week_view_focus_in (GtkWidget *widget, GdkEventFocus *event) } static gint -e_week_view_focus_out (GtkWidget *widget, GdkEventFocus *event) +e_week_view_focus_out (GtkWidget *widget, + GdkEventFocus *event) { EWeekView *week_view; @@ -1406,11 +1417,11 @@ e_week_view_focus_out (GtkWidget *widget, GdkEventFocus *event) **/ static gboolean e_week_view_get_next_tab_event (EWeekView *week_view, - GtkDirectionType direction, - gint current_event_num, - gint current_span_num, - gint *next_event_num, - gint *next_span_num) + GtkDirectionType direction, + gint current_event_num, + gint current_span_num, + gint *next_event_num, + gint *next_span_num) { gint event_num; @@ -1453,7 +1464,8 @@ e_week_view_get_next_tab_event (EWeekView *week_view, } static gboolean -e_week_view_focus (GtkWidget *widget, GtkDirectionType direction) +e_week_view_focus (GtkWidget *widget, + GtkDirectionType direction) { EWeekView *week_view; gint new_event_num; @@ -1600,12 +1612,12 @@ e_week_view_update_query (EWeekView *week_view) } /* This sets the selected time range. The EWeekView will show the corresponding - month and the days between start_time and end_time will be selected. - To select a single day, use the same value for start_time & end_time. */ + * month and the days between start_time and end_time will be selected. + * To select a single day, use the same value for start_time & end_time. */ static void -e_week_view_set_selected_time_range (ECalendarView *cal_view, - time_t start_time, - time_t end_time) +e_week_view_set_selected_time_range (ECalendarView *cal_view, + time_t start_time, + time_t end_time) { GDate date, end_date; gint num_days; @@ -1644,8 +1656,8 @@ e_week_view_set_selected_time_range (ECalendarView *cal_view, num_days); /* Reset the adjustment value to 0 if the base address has changed. - Note that we do this after updating first_day_shown so that our - signal handler will not try to reload the events. */ + * Note that we do this after updating first_day_shown so that our + * signal handler will not try to reload the events. */ if (update_adjustment_value) { GtkRange *range; GtkAdjustment *adjustment; @@ -1659,9 +1671,9 @@ e_week_view_set_selected_time_range (ECalendarView *cal_view, } void -e_week_view_set_selected_time_range_visible (EWeekView *week_view, - time_t start_time, - time_t end_time) +e_week_view_set_selected_time_range_visible (EWeekView *week_view, + time_t start_time, + time_t end_time) { GDate date, end_date; gint num_days; @@ -1697,9 +1709,9 @@ e_week_view_set_selected_time_range_visible (EWeekView *week_view, /* Returns the selected time range. */ static gboolean -e_week_view_get_selected_time_range (ECalendarView *cal_view, - time_t *start_time, - time_t *end_time) +e_week_view_get_selected_time_range (ECalendarView *cal_view, + time_t *start_time, + time_t *end_time) { gint start_day, end_day; EWeekView *week_view = E_WEEK_VIEW (cal_view); @@ -1723,9 +1735,9 @@ e_week_view_get_selected_time_range (ECalendarView *cal_view, /* Gets the visible time range. Returns FALSE if no time range has been set. */ static gboolean -e_week_view_get_visible_time_range (ECalendarView *cal_view, - time_t *start_time, - time_t *end_time) +e_week_view_get_visible_time_range (ECalendarView *cal_view, + time_t *start_time, + time_t *end_time) { gint num_days; EWeekView *week_view = E_WEEK_VIEW (cal_view); @@ -1743,17 +1755,17 @@ e_week_view_get_visible_time_range (ECalendarView *cal_view, /* Note that the returned date may be invalid if no date has been set yet. */ void -e_week_view_get_first_day_shown (EWeekView *week_view, - GDate *date) +e_week_view_get_first_day_shown (EWeekView *week_view, + GDate *date) { *date = week_view->first_day_shown; } /* This sets the first day shown in the view. It will be rounded down to the - nearest week. */ + * nearest week. */ void -e_week_view_set_first_day_shown (EWeekView *week_view, - GDate *date) +e_week_view_set_first_day_shown (EWeekView *week_view, + GDate *date) { GDate base_date; gint weekday, day_offset, num_days; @@ -1781,7 +1793,7 @@ e_week_view_set_first_day_shown (EWeekView *week_view, day_offset = (weekday + 7 - week_view->display_start_day) % 7; /* Calculate the base date, i.e. the first day shown when the - scrollbar adjustment value is 0. */ + * scrollbar adjustment value is 0. */ base_date = *date; g_date_subtract_days (&base_date, day_offset); @@ -1809,7 +1821,7 @@ e_week_view_set_first_day_shown (EWeekView *week_view, } /* Try to keep the previous selection, but if it is no longer shown - just select the first day. */ + * just select the first day. */ if (week_view->selection_start_day != -1) { week_view->selection_start_day = old_selection_start_julian - g_date_get_julian (&base_date); @@ -1829,8 +1841,8 @@ e_week_view_set_first_day_shown (EWeekView *week_view, } /* Reset the adjustment value to 0 if the base address has changed. - Note that we do this after updating first_day_shown so that our - signal handler will not try to reload the events. */ + * Note that we do this after updating first_day_shown so that our + * signal handler will not try to reload the events. */ if (update_adjustment_value) { GtkRange *range; GtkAdjustment *adjustment; @@ -1847,7 +1859,7 @@ e_week_view_set_first_day_shown (EWeekView *week_view, /* Recalculates the time_t corresponding to the start of each day. */ static void e_week_view_recalc_day_starts (EWeekView *week_view, - time_t lower) + time_t lower) { gint num_days, day; time_t tmp_time; @@ -1864,7 +1876,10 @@ e_week_view_recalc_day_starts (EWeekView *week_view, } static void -month_scrol_by_week_changed_cb (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer user_data) +month_scrol_by_week_changed_cb (GConfClient *client, + guint cnxn_id, + GConfEntry *entry, + gpointer user_data) { EWeekView *week_view = user_data; @@ -1878,7 +1893,7 @@ month_scrol_by_week_changed_cb (GConfClient *client, guint cnxn_id, GConfEntry * } gboolean -e_week_view_get_multi_week_view (EWeekView *week_view) +e_week_view_get_multi_week_view (EWeekView *week_view) { g_return_val_if_fail (E_IS_WEEK_VIEW (week_view), FALSE); @@ -1886,8 +1901,8 @@ e_week_view_get_multi_week_view (EWeekView *week_view) } void -e_week_view_set_multi_week_view (EWeekView *week_view, - gboolean multi_week_view) +e_week_view_set_multi_week_view (EWeekView *week_view, + gboolean multi_week_view) { GtkRange *range; GtkAdjustment *adjustment; @@ -1946,7 +1961,8 @@ e_week_view_get_update_base_date (EWeekView *week_view) } void -e_week_view_set_update_base_date (EWeekView *week_view, gboolean update_base_date) +e_week_view_set_update_base_date (EWeekView *week_view, + gboolean update_base_date) { g_return_if_fail (E_IS_WEEK_VIEW (week_view)); @@ -1954,7 +1970,7 @@ e_week_view_set_update_base_date (EWeekView *week_view, gboolean update_base_dat } gint -e_week_view_get_weeks_shown (EWeekView *week_view) +e_week_view_get_weeks_shown (EWeekView *week_view) { g_return_val_if_fail (E_IS_WEEK_VIEW (week_view), 1); @@ -1962,8 +1978,8 @@ e_week_view_get_weeks_shown (EWeekView *week_view) } void -e_week_view_set_weeks_shown (EWeekView *week_view, - gint weeks_shown) +e_week_view_set_weeks_shown (EWeekView *week_view, + gint weeks_shown) { GtkRange *range; GtkAdjustment *adjustment; @@ -2031,8 +2047,8 @@ e_week_view_set_compress_weekend (EWeekView *week_view, need_reload = e_week_view_recalc_display_start_day (week_view); /* If the display_start_day has changed we need to recalculate the - date range shown and reload all events, otherwise we only need to - do a reshape. */ + * date range shown and reload all events, otherwise we only need to + * do a reshape. */ if (need_reload) { /* Recalculate the days shown and reload if necessary. */ if (g_date_valid (&week_view->first_day_shown)) @@ -2078,7 +2094,7 @@ e_week_view_set_show_event_end_times (EWeekView *week_view, } static gboolean -e_week_view_recalc_display_start_day (EWeekView *week_view) +e_week_view_recalc_display_start_day (EWeekView *week_view) { ECalModel *model; gint week_start_day; @@ -2088,8 +2104,8 @@ e_week_view_recalc_display_start_day (EWeekView *week_view) week_start_day = e_cal_model_get_week_start_day (model); /* The display start day defaults to week_start_day, but we have - to use Saturday if the weekend is compressed and week_start_day - is Sunday. */ + * to use Saturday if the weekend is compressed and week_start_day + * is Sunday. */ display_start_day = week_start_day; if (display_start_day == 6 @@ -2106,7 +2122,8 @@ e_week_view_recalc_display_start_day (EWeekView *week_view) /* Checks if the users participation status is NEEDS-ACTION and shows the summary as bold text */ static void -set_text_as_bold (EWeekViewEvent *event, EWeekViewEventSpan *span) +set_text_as_bold (EWeekViewEvent *event, + EWeekViewEventSpan *span) { ECalComponent *comp; GSList *attendees = NULL, *l; @@ -2131,8 +2148,8 @@ set_text_as_bold (EWeekViewEvent *event, EWeekViewEventSpan *span) } /* The attendee has not yet accepted the meeting, display the summary as bolded. - If the attendee is not present, it might have come through a mailing list. - In that case, we never show the meeting as bold even if it is unaccepted. */ + * If the attendee is not present, it might have come through a mailing list. + * In that case, we never show the meeting as bold even if it is unaccepted. */ if (at && (at->status == ICAL_PARTSTAT_NEEDSACTION)) gnome_canvas_item_set (span->text_item, "bold", TRUE, NULL); @@ -2142,13 +2159,13 @@ set_text_as_bold (EWeekViewEvent *event, EWeekViewEventSpan *span) } /* This calls a given function for each event instance that matches the given - uid. Note that it is safe for the callback to remove the event (since we - step backwards through the arrays). */ + * uid. Note that it is safe for the callback to remove the event (since we + * step backwards through the arrays). */ static void e_week_view_foreach_event_with_uid (EWeekView *week_view, - const gchar *uid, - EWeekViewForeachEventCallback callback, - gpointer data) + const gchar *uid, + EWeekViewForeachEventCallback callback, + gpointer data) { EWeekViewEvent *event; gint event_num; @@ -2174,8 +2191,8 @@ e_week_view_foreach_event_with_uid (EWeekView *week_view, static gboolean e_week_view_remove_event_cb (EWeekView *week_view, - gint event_num, - gpointer data) + gint event_num, + gpointer data) { EWeekViewEvent *event; EWeekViewEventSpan *span; @@ -2189,7 +2206,7 @@ e_week_view_remove_event_cb (EWeekView *week_view, return TRUE; /* If we were editing this event, set editing_event_num to -1 so - on_editing_stopped doesn't try to update the event. */ + * on_editing_stopped doesn't try to update the event. */ if (week_view->editing_event_num == event_num) week_view->editing_event_num = -1; @@ -2202,7 +2219,7 @@ e_week_view_remove_event_cb (EWeekView *week_view, if (week_view->spans) { /* We leave the span elements in the array, but set the canvas item - pointers to NULL. */ + * pointers to NULL. */ for (span_num = 0; span_num < event->num_spans; span_num++) { if (!is_array_index_in_bounds (week_view->spans, event->spans_index + span_num)) break; @@ -2246,12 +2263,12 @@ e_week_view_remove_event_cb (EWeekView *week_view, } void -e_week_view_get_day_position (EWeekView *week_view, - gint day, - gint *day_x, - gint *day_y, - gint *day_w, - gint *day_h) +e_week_view_get_day_position (EWeekView *week_view, + gint day, + gint *day_x, + gint *day_y, + gint *day_w, + gint *day_h) { gint cell_x, cell_y, cell_h; @@ -2276,20 +2293,20 @@ e_week_view_get_day_position (EWeekView *week_view, } /* Returns the bounding box for a span of an event. Usually this can easily - be determined by the start & end days and row of the span, which are set in - e_week_view_layout_event (). Though we need a special case for the weekends - when they are compressed, since the span may not fit. - The bounding box includes the entire width of the days in the view (but - not the vertical line down the right of the last day), though the displayed - event doesn't normally extend to the edges of the day. - It returns FALSE if the span isn't visible. */ + * be determined by the start & end days and row of the span, which are set in + * e_week_view_layout_event (). Though we need a special case for the weekends + * when they are compressed, since the span may not fit. + * The bounding box includes the entire width of the days in the view (but + * not the vertical line down the right of the last day), though the displayed + * event doesn't normally extend to the edges of the day. + * It returns FALSE if the span isn't visible. */ gboolean -e_week_view_get_span_position (EWeekView *week_view, - gint event_num, - gint span_num, - gint *span_x, - gint *span_y, - gint *span_w) +e_week_view_get_span_position (EWeekView *week_view, + gint event_num, + gint span_num, + gint *span_x, + gint *span_y, + gint *span_w) { EWeekViewEvent *event; EWeekViewEventSpan *span; @@ -2340,7 +2357,8 @@ e_week_view_get_span_position (EWeekView *week_view, } static gboolean -ewv_pass_gdkevent_to_etext (EWeekView *week_view, GdkEvent *gevent) +ewv_pass_gdkevent_to_etext (EWeekView *week_view, + GdkEvent *gevent) { g_return_val_if_fail (week_view != NULL, FALSE); g_return_val_if_fail (gevent != NULL, FALSE); @@ -2370,8 +2388,8 @@ ewv_pass_gdkevent_to_etext (EWeekView *week_view, GdkEvent *gevent) static gboolean e_week_view_on_button_press (GtkWidget *widget, - GdkEventButton *event, - EWeekView *week_view) + GdkEventButton *event, + EWeekView *week_view) { gint x, y, day; @@ -2453,8 +2471,8 @@ e_week_view_on_button_press (GtkWidget *widget, static gboolean e_week_view_on_button_release (GtkWidget *widget, - GdkEventButton *event, - EWeekView *week_view) + GdkEventButton *event, + EWeekView *week_view) { #if 0 g_print ("In e_week_view_on_button_release\n"); @@ -2472,8 +2490,8 @@ e_week_view_on_button_release (GtkWidget *widget, static gboolean e_week_view_on_scroll (GtkWidget *widget, - GdkEventScroll *scroll, - EWeekView *week_view) + GdkEventScroll *scroll, + EWeekView *week_view) { GtkRange *range; GtkAdjustment *adjustment; @@ -2525,8 +2543,8 @@ e_week_view_on_scroll (GtkWidget *widget, static gboolean e_week_view_on_motion (GtkWidget *widget, - GdkEventMotion *mevent, - EWeekView *week_view) + GdkEventMotion *mevent, + EWeekView *week_view) { gint x, y, day; @@ -2552,11 +2570,11 @@ e_week_view_on_motion (GtkWidget *widget, } /* Converts a position in the canvas window to a day offset from the first - day displayed. Returns -1 if the position is outside the grid. */ + * day displayed. Returns -1 if the position is outside the grid. */ static gint e_week_view_convert_position_to_day (EWeekView *week_view, - gint x, - gint y) + gint x, + gint y) { gint col, row, grid_x = -1, grid_y = -1, week, day; gint weekend_col; @@ -2612,7 +2630,7 @@ e_week_view_convert_position_to_day (EWeekView *week_view, static void e_week_view_update_selection (EWeekView *week_view, - gint day) + gint day) { gint tmp_day; gboolean need_redraw = FALSE; @@ -2704,10 +2722,10 @@ e_week_view_free_events (EWeekView *week_view) /* This adds one event to the view, adding it to the appropriate array. */ static gboolean e_week_view_add_event (ECalComponent *comp, - time_t start, - time_t end, - gboolean prepend, - gpointer data) + time_t start, + time_t end, + gboolean prepend, + gpointer data) { AddEventData *add_event_data; @@ -2823,12 +2841,12 @@ e_week_view_ensure_events_sorted (EWeekView *week_view) gint e_week_view_event_sort_func (gconstpointer arg1, - gconstpointer arg2) + gconstpointer arg2) { EWeekViewEvent *event1, *event2; - event1 = (EWeekViewEvent*) arg1; - event2 = (EWeekViewEvent*) arg2; + event1 = (EWeekViewEvent *) arg1; + event2 = (EWeekViewEvent *) arg2; if (event1->start < event2->start) return -1; @@ -2919,7 +2937,9 @@ e_week_view_reshape_events (EWeekView *week_view) } static EWeekViewEvent * -tooltip_get_view_event (EWeekView *week_view, gint day, gint event_num) +tooltip_get_view_event (EWeekView *week_view, + gint day, + gint event_num) { EWeekViewEvent *pevent; @@ -2932,7 +2952,8 @@ tooltip_get_view_event (EWeekView *week_view, gint day, gint event_num) } static void -tooltip_destroy (EWeekView *week_view, GnomeCanvasItem *item) +tooltip_destroy (EWeekView *week_view, + GnomeCanvasItem *item) { gint event_num = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (item), "event-num")); EWeekViewEvent *pevent; @@ -2957,8 +2978,8 @@ tooltip_destroy (EWeekView *week_view, GnomeCanvasItem *item) static gboolean tooltip_event_cb (GnomeCanvasItem *item, - GdkEvent *event, - EWeekView *view) + GdkEvent *event, + EWeekView *view) { gint event_num = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (item), "event-num")); EWeekViewEvent *pevent; @@ -2996,7 +3017,7 @@ tooltip_event_cb (GnomeCanvasItem *item, pevent->tooltip = (GtkWidget *)g_object_get_data (G_OBJECT (view), "tooltip-window"); if (pevent->tooltip) { - e_calendar_view_move_tip (pevent->tooltip, pevent->x+16, pevent->y+16); + e_calendar_view_move_tip (pevent->tooltip, pevent->x + 16, pevent->y + 16); } return TRUE; @@ -3010,7 +3031,9 @@ tooltip_event_cb (GnomeCanvasItem *item, } static const gchar * -get_comp_summary (ECalClient *client, icalcomponent *icalcomp, gboolean *free_text) +get_comp_summary (ECalClient *client, + icalcomponent *icalcomp, + gboolean *free_text) { const gchar *my_summary, *location; const gchar *summary; @@ -3037,8 +3060,8 @@ get_comp_summary (ECalClient *client, icalcomponent *icalcomp, gboolean *free_te static void e_week_view_reshape_event_span (EWeekView *week_view, - gint event_num, - gint span_num) + gint event_num, + gint span_num) { EWeekViewEvent *event; EWeekViewEventSpan *span; @@ -3074,7 +3097,7 @@ e_week_view_reshape_event_span (EWeekView *week_view, one_day_event = e_week_view_is_one_day_event (week_view, event_num); /* If the span will not be visible destroy the canvas items and - return. */ + * return. */ if (!e_week_view_get_span_position (week_view, event_num, span_num, &span_x, &span_y, &span_w)) { if (span->background_item) @@ -3096,7 +3119,7 @@ e_week_view_reshape_event_span (EWeekView *week_view, layout = pango_layout_new (pango_context); /* If we are editing a long event we don't show the icons and the EText - item uses the maximum width available. */ + * item uses the maximum width available. */ if (!one_day_event && week_view->editing_event_num == event_num && week_view->editing_span_num == span_num) { show_icons = FALSE; @@ -3178,11 +3201,11 @@ e_week_view_reshape_event_span (EWeekView *week_view, } /* Calculate the position of the text item. - For events < 1 day it starts after the times & icons and ends at the - right edge of the span. - For events >= 1 day we need to determine whether times are shown at - the start and end of the span, then try to center the text item with - the icons in the middle, but making sure we don't go over the times. + * For events < 1 day it starts after the times & icons and ends at the + * right edge of the span. + * For events >= 1 day we need to determine whether times are shown at + * the start and end of the span, then try to center the text item with + * the icons in the middle, but making sure we don't go over the times. */ /* Calculate the space necessary to display a time, e.g. "13:00". */ @@ -3202,16 +3225,16 @@ e_week_view_reshape_event_span (EWeekView *week_view, if (one_day_event) { /* Note that 1-day events don't have a border. Although we - still use the border height to position the events - vertically so they still line up neatly (see above), - we don't use the border width or edge padding at all. */ + * still use the border height to position the events + * vertically so they still line up neatly (see above), + * we don't use the border width or edge padding at all. */ text_x = span_x + E_WEEK_VIEW_EVENT_L_PAD; switch (week_view->time_format) { case E_WEEK_VIEW_TIME_BOTH_SMALL_MIN: case E_WEEK_VIEW_TIME_BOTH: /* These have 2 time strings with a small space between - them and some space before the EText item. */ + * them and some space before the EText item. */ text_x += time_width * 2 + E_WEEK_VIEW_EVENT_TIME_SPACING + E_WEEK_VIEW_EVENT_TIME_X_PAD; @@ -3219,7 +3242,7 @@ e_week_view_reshape_event_span (EWeekView *week_view, case E_WEEK_VIEW_TIME_START_SMALL_MIN: case E_WEEK_VIEW_TIME_START: /* These have just 1 time string with some space - before the EText item. */ + * before the EText item. */ text_x += time_width + E_WEEK_VIEW_EVENT_TIME_X_PAD; break; case E_WEEK_VIEW_TIME_NONE: @@ -3230,13 +3253,13 @@ e_week_view_reshape_event_span (EWeekView *week_view, text_x += icons_width; /* The width of the EText item extends right to the edge of the - event, just inside the border. */ + * event, just inside the border. */ text_w = span_x + span_w - E_WEEK_VIEW_EVENT_R_PAD - text_x; } else { if (use_max_width) { /* When we are editing the event we use all the - available width. */ + * available width. */ text_x = span_x + E_WEEK_VIEW_EVENT_L_PAD + E_WEEK_VIEW_EVENT_BORDER_WIDTH + E_WEEK_VIEW_EVENT_EDGE_X_PAD; @@ -3246,13 +3269,13 @@ e_week_view_reshape_event_span (EWeekView *week_view, } else { text = NULL; /* Get the width of the text of the event. This is a - bit of a hack. It would be better if EText could - tell us this. */ - g_object_get (G_OBJECT (span->text_item), "text", &text, NULL); + * bit of a hack. It would be better if EText could + * tell us this. */ + g_object_get (span->text_item, "text", &text, NULL); text_width = 0; if (text) { /* It should only have one line of text in it. - I'm not sure we need this any more. */ + * I'm not sure we need this any more. */ end_of_line = strchr (text, '\n'); if (end_of_line) line_len = end_of_line - text; @@ -3265,28 +3288,28 @@ e_week_view_reshape_event_span (EWeekView *week_view, } /* Add on the width of the icons and find the default - position, which centers the icons + text. */ + * position, which centers the icons + text. */ width = text_width + icons_width; text_x = span_x + (span_w - width) / 2; /* Now calculate the left-most valid position, and make - sure we don't go to the left of that. */ + * sure we don't go to the left of that. */ min_text_x = span_x + E_WEEK_VIEW_EVENT_L_PAD + E_WEEK_VIEW_EVENT_BORDER_WIDTH + E_WEEK_VIEW_EVENT_EDGE_X_PAD; /* See if we will want to display the start time, and - if so take that into account. */ + * if so take that into account. */ if (event->start > week_view->day_starts[span->start_day]) min_text_x += time_width + E_WEEK_VIEW_EVENT_TIME_X_PAD; /* Now make sure we don't go to the left of the minimum - position. */ + * position. */ text_x = MAX (text_x, min_text_x); /* Now calculate the largest valid width, using the - calculated x position, and make sure we don't - exceed that. */ + * calculated x position, and make sure we don't + * exceed that. */ max_text_w = span_x + span_w - E_WEEK_VIEW_EVENT_R_PAD - E_WEEK_VIEW_EVENT_BORDER_WIDTH - E_WEEK_VIEW_EVENT_EDGE_X_PAD - text_x; @@ -3319,9 +3342,9 @@ e_week_view_reshape_event_span (EWeekView *week_view, gboolean e_week_view_start_editing_event (EWeekView *week_view, - gint event_num, - gint span_num, - gchar *initial_text) + gint event_num, + gint span_num, + gchar *initial_text) { EWeekViewEvent *event; EWeekViewEventSpan *span; @@ -3403,7 +3426,7 @@ e_week_view_start_editing_event (EWeekView *week_view, span = &g_array_index (week_view->spans, EWeekViewEventSpan, event->spans_index + span_num); /* Try to move the cursor to the end of the text. */ - g_object_get (G_OBJECT (span->text_item), "event_processor", &event_processor, NULL); + g_object_get (span->text_item, "event_processor", &event_processor, NULL); if (event_processor) { command.action = E_TEP_MOVE; command.position = E_TEP_END_OF_BUFFER; @@ -3459,7 +3482,7 @@ cancel_editing (EWeekView *week_view) /* Reset the text to what was in the component */ summary = icalcomponent_get_summary (event->comp_data->icalcomp); - g_object_set (G_OBJECT (span->text_item), "text", summary ? summary : "", NULL); + g_object_set (span->text_item, "text", summary ? summary : "", NULL); /* Stop editing */ e_week_view_stop_editing_event (week_view); @@ -3467,8 +3490,8 @@ cancel_editing (EWeekView *week_view) static gboolean e_week_view_on_text_item_event (GnomeCanvasItem *item, - GdkEvent *gdkevent, - EWeekView *week_view) + GdkEvent *gdkevent, + EWeekView *week_view) { EWeekViewEvent *event; gint event_num, span_num; @@ -3486,11 +3509,11 @@ e_week_view_on_text_item_event (GnomeCanvasItem *item, tooltip_destroy (week_view, item); if (!E_TEXT (item)->preedit_len && gdkevent && gdkevent->key.keyval == GDK_KEY_Return) { /* We set the keyboard focus to the EDayView, so the - EText item loses it and stops the edit. */ + * EText item loses it and stops the edit. */ gtk_widget_grab_focus (GTK_WIDGET (week_view)); /* Stop the signal last or we will also stop any - other events getting to the EText item. */ + * other events getting to the EText item. */ g_signal_stop_emission_by_name (G_OBJECT (item), "event"); return TRUE; } else if (gdkevent->key.keyval == GDK_KEY_Escape) { @@ -3516,7 +3539,7 @@ e_week_view_on_text_item_event (GnomeCanvasItem *item, return FALSE; /* if we started to editing new item on the canvas, then do not open editing dialog until it's saved, - because the save of the event recalculates event numbers and you can edit different one */ + * because the save of the event recalculates event numbers and you can edit different one */ if (!is_icalcomp_on_the_server (event->comp_data->icalcomp, event->comp_data->client)) return TRUE; @@ -3552,7 +3575,7 @@ e_week_view_on_text_item_event (GnomeCanvasItem *item, e_week_view_set_selected_time_range_visible (week_view, e->start, e->end); e_week_view_show_popup_menu (week_view, - (GdkEventButton*) gdkevent, + (GdkEventButton *) gdkevent, event_num); g_signal_stop_emission_by_name (G_OBJECT (item->canvas), @@ -3576,7 +3599,7 @@ e_week_view_on_text_item_event (GnomeCanvasItem *item, g_warning ("No GdkEvent"); /* FIXME: Remember the day offset from the start of - the event, for DnD. */ + * the event, for DnD. */ return TRUE; } @@ -3601,7 +3624,7 @@ e_week_view_on_text_item_event (GnomeCanvasItem *item, } /* Stop the signal last or we will also stop any - other events getting to the EText item. */ + * other events getting to the EText item. */ g_signal_stop_emission_by_name (G_OBJECT (item), "event"); return TRUE; } @@ -3648,7 +3671,7 @@ e_week_view_on_text_item_event (GnomeCanvasItem *item, pevent->tooltip = (GtkWidget *)g_object_get_data (G_OBJECT (week_view), "tooltip-window"); if (pevent->tooltip) { - e_calendar_view_move_tip (pevent->tooltip, pevent->x+16, pevent->y+16); + e_calendar_view_move_tip (pevent->tooltip, pevent->x + 16, pevent->y + 16); } return TRUE; case GDK_FOCUS_CHANGE: @@ -3746,7 +3769,8 @@ static gboolean e_week_view_event_move (ECalendarView *cal_view, ECalViewMoveDir } static gint -e_week_view_get_day_offset_of_event (EWeekView *week_view, time_t event_time) +e_week_view_get_day_offset_of_event (EWeekView *week_view, + time_t event_time) { time_t first_day = week_view->day_starts[0]; @@ -3757,7 +3781,8 @@ e_week_view_get_day_offset_of_event (EWeekView *week_view, time_t event_time) } void -e_week_view_scroll_a_step (EWeekView *week_view, ECalViewMoveDirection direction) +e_week_view_scroll_a_step (EWeekView *week_view, + ECalViewMoveDirection direction) { GtkAdjustment *adjustment; GtkRange *range; @@ -3799,7 +3824,10 @@ e_week_view_scroll_a_step (EWeekView *week_view, ECalViewMoveDirection direction } static void -e_week_view_change_event_time (EWeekView *week_view, time_t start_dt, time_t end_dt, gboolean is_all_day) +e_week_view_change_event_time (EWeekView *week_view, + time_t start_dt, + time_t end_dt, + gboolean is_all_day) { EWeekViewEvent *event; gint event_num; @@ -3827,13 +3855,13 @@ e_week_view_change_event_time (EWeekView *week_view, time_t start_dt, time_t end client = event->comp_data->client; /* We use a temporary shallow copy of the ico since we don't want to - change the original ico here. Otherwise we would not detect that - the event's time had changed in the "update_event" callback. */ + * change the original ico here. Otherwise we would not detect that + * the event's time had changed in the "update_event" callback. */ comp = e_cal_component_new (); e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp)); date.value = &itt; /* FIXME: Should probably keep the timezone of the original start - and end times. */ + * and end times. */ date.tzid = icaltimezone_get_tzid (e_calendar_view_get_timezone (E_CALENDAR_VIEW (week_view))); *date.value = icaltime_from_timet_with_zone (start_dt, is_all_day, @@ -3881,7 +3909,7 @@ out: static void e_week_view_on_editing_started (EWeekView *week_view, - GnomeCanvasItem *item) + GnomeCanvasItem *item) { gint event_num, span_num; @@ -3897,7 +3925,7 @@ e_week_view_on_editing_started (EWeekView *week_view, week_view->editing_span_num = span_num; /* We need to reshape long events so the whole width is used while - editing. */ + * editing. */ if (!e_week_view_is_one_day_event (week_view, event_num)) { e_week_view_reshape_event_span (week_view, event_num, span_num); @@ -3908,7 +3936,7 @@ e_week_view_on_editing_started (EWeekView *week_view, static void e_week_view_on_editing_stopped (EWeekView *week_view, - GnomeCanvasItem *item) + GnomeCanvasItem *item) { gint event_num, span_num; EWeekViewEvent *event; @@ -3921,8 +3949,8 @@ e_week_view_on_editing_stopped (EWeekView *week_view, gboolean on_server; /* Note: the item we are passed here isn't reliable, so we just stop - the edit of whatever item was being edited. We also receive this - event twice for some reason. */ + * the edit of whatever item was being edited. We also receive this + * event twice for some reason. */ event_num = week_view->editing_event_num; span_num = week_view->editing_span_num; @@ -3954,7 +3982,7 @@ e_week_view_on_editing_stopped (EWeekView *week_view, text = NULL; g_object_set (span->text_item, "handle_popup", FALSE, NULL); - g_object_get (G_OBJECT (span->text_item), "text", &text, NULL); + g_object_get (span->text_item, "text", &text, NULL); comp = e_cal_component_new (); e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp)); @@ -3980,7 +4008,7 @@ e_week_view_on_editing_stopped (EWeekView *week_view, const gchar *summary; summary = get_comp_summary (event->comp_data->client, event->comp_data->icalcomp, &free_text); - g_object_set (G_OBJECT (span->text_item), "text", summary ? summary : "", NULL); + g_object_set (span->text_item, "text", summary ? summary : "", NULL); if (free_text) g_free ((gchar *) summary); @@ -4097,10 +4125,10 @@ e_week_view_on_editing_stopped (EWeekView *week_view, } gboolean -e_week_view_find_event_from_item (EWeekView *week_view, - GnomeCanvasItem *item, - gint *event_num_return, - gint *span_num_return) +e_week_view_find_event_from_item (EWeekView *week_view, + GnomeCanvasItem *item, + gint *event_num_return, + gint *span_num_return) { EWeekViewEvent *event; EWeekViewEventSpan *span; @@ -4129,17 +4157,17 @@ e_week_view_find_event_from_item (EWeekView *week_view, } /* Finds the index of the event with the given uid. - Returns TRUE if an event with the uid was found. - Note that for recurring events there may be several EWeekViewEvents, one - for each instance, all with the same iCalObject and uid. So only use this - function if you know the event doesn't recur or you are just checking to - see if any events with the uid exist. */ + * Returns TRUE if an event with the uid was found. + * Note that for recurring events there may be several EWeekViewEvents, one + * for each instance, all with the same iCalObject and uid. So only use this + * function if you know the event doesn't recur or you are just checking to + * see if any events with the uid exist. */ static gboolean -e_week_view_find_event_from_uid (EWeekView *week_view, - ECalClient *client, - const gchar *uid, - const gchar *rid, - gint *event_num_return) +e_week_view_find_event_from_uid (EWeekView *week_view, + ECalClient *client, + const gchar *uid, + const gchar *rid, + gint *event_num_return) { EWeekViewEvent *event; gint event_num, num_events; @@ -4184,8 +4212,8 @@ e_week_view_find_event_from_uid (EWeekView *week_view, } gboolean -e_week_view_is_one_day_event (EWeekView *week_view, - gint event_num) +e_week_view_is_one_day_event (EWeekView *week_view, + gint event_num) { EWeekViewEvent *event; EWeekViewEventSpan *span; @@ -4260,7 +4288,8 @@ e_week_view_cursor_key_right (EWeekView *week_view) } static gboolean -e_week_view_add_new_event_in_selected_range (EWeekView *week_view, const gchar *initial_text) +e_week_view_add_new_event_in_selected_range (EWeekView *week_view, + const gchar *initial_text) { ECalClient *client; ECalModel *model; @@ -4314,7 +4343,7 @@ e_week_view_add_new_event_in_selected_range (EWeekView *week_view, const gchar * comp, e_calendar_view_get_default_category (E_CALENDAR_VIEW (week_view))); /* We add the event locally and start editing it. We don't send it - to the server until the user finishes editing it. */ + * to the server until the user finishes editing it. */ add_event_data.week_view = week_view; add_event_data.comp_data = NULL; e_week_view_add_event (comp, dtstart, dtend, TRUE, &add_event_data); @@ -4356,7 +4385,8 @@ e_week_view_add_new_event_in_selected_range (EWeekView *week_view, const gchar * } static gboolean -e_week_view_do_key_press (GtkWidget *widget, GdkEventKey *event) +e_week_view_do_key_press (GtkWidget *widget, + GdkEventKey *event) { EWeekView *week_view; gchar *initial_text; @@ -4437,7 +4467,7 @@ e_week_view_do_key_press (GtkWidget *widget, GdkEventKey *event) return FALSE; /* We only want to start an edit with a return key or a simple - character. */ + * character. */ if (event->keyval == GDK_KEY_Return) { initial_text = NULL; } else if (((event->keyval >= 0x20) && (event->keyval <= 0xFF) @@ -4457,7 +4487,8 @@ e_week_view_do_key_press (GtkWidget *widget, GdkEventKey *event) } static gint -e_week_view_get_adjust_days_for_move_up (EWeekView *week_view,gint current_day) +e_week_view_get_adjust_days_for_move_up (EWeekView *week_view, + gint current_day) { if (week_view->multi_week_view) return -7; @@ -4466,7 +4497,8 @@ e_week_view_get_adjust_days_for_move_up (EWeekView *week_view,gint current_day) } static gint -e_week_view_get_adjust_days_for_move_down (EWeekView *week_view,gint current_day) +e_week_view_get_adjust_days_for_move_down (EWeekView *week_view, + gint current_day) { if (week_view->multi_week_view) return 7; @@ -4475,19 +4507,22 @@ e_week_view_get_adjust_days_for_move_down (EWeekView *week_view,gint current_day } static gint -e_week_view_get_adjust_days_for_move_left (EWeekView *week_view,gint current_day) +e_week_view_get_adjust_days_for_move_left (EWeekView *week_view, + gint current_day) { return -1; } static gint -e_week_view_get_adjust_days_for_move_right (EWeekView *week_view,gint current_day) +e_week_view_get_adjust_days_for_move_right (EWeekView *week_view, + gint current_day) { return 1; } static gboolean -e_week_view_key_press (GtkWidget *widget, GdkEventKey *event) +e_week_view_key_press (GtkWidget *widget, + GdkEventKey *event) { gboolean handled = FALSE; handled = e_week_view_do_key_press (widget, event); @@ -4499,9 +4534,9 @@ e_week_view_key_press (GtkWidget *widget, GdkEventKey *event) } void -e_week_view_show_popup_menu (EWeekView *week_view, - GdkEventButton *bevent, - gint event_num) +e_week_view_show_popup_menu (EWeekView *week_view, + GdkEventButton *bevent, + gint event_num) { week_view->popup_event_num = event_num; @@ -4518,7 +4553,8 @@ e_week_view_popup_menu (GtkWidget *widget) } void -e_week_view_jump_to_button_item (EWeekView *week_view, GnomeCanvasItem *item) +e_week_view_jump_to_button_item (EWeekView *week_view, + GnomeCanvasItem *item) { gint day; GnomeCalendar *calendar; @@ -4539,8 +4575,8 @@ e_week_view_jump_to_button_item (EWeekView *week_view, GnomeCanvasItem *item) static gboolean e_week_view_on_jump_button_event (GnomeCanvasItem *item, - GdkEvent *event, - EWeekView *week_view) + GdkEvent *event, + EWeekView *week_view) { gint day; @@ -4594,20 +4630,20 @@ e_week_view_on_jump_button_event (GnomeCanvasItem *item, } /* Converts an hour from 0-23 to the preferred time format, and returns the - suffix to add and the width of it in the normal font. */ + * suffix to add and the width of it in the normal font. */ void -e_week_view_convert_time_to_display (EWeekView *week_view, - gint hour, - gint *display_hour, - const gchar **suffix, - gint *suffix_width) +e_week_view_convert_time_to_display (EWeekView *week_view, + gint hour, + gint *display_hour, + const gchar **suffix, + gint *suffix_width) { ECalModel *model; model = e_calendar_view_get_model (E_CALENDAR_VIEW (week_view)); /* Calculate the actual hour number to display. For 12-hour - format we convert 0-23 to 12-11am/12-11pm. */ + * format we convert 0-23 to 12-11am/12-11pm. */ *display_hour = hour; if (e_cal_model_get_use_24_hour_format (model)) { *suffix = ""; @@ -4629,7 +4665,7 @@ e_week_view_convert_time_to_display (EWeekView *week_view, } gint -e_week_view_get_time_string_width (EWeekView *week_view) +e_week_view_get_time_string_width (EWeekView *week_view) { ECalModel *model; gint time_width; @@ -4691,7 +4727,8 @@ e_week_view_get_num_events_selected (EWeekView *week_view) } gboolean -e_week_view_is_jump_button_visible (EWeekView *week_view, gint day) +e_week_view_is_jump_button_visible (EWeekView *week_view, + gint day) { g_return_val_if_fail (E_IS_WEEK_VIEW (week_view), FALSE); diff --git a/calendar/gui/e-week-view.h b/calendar/gui/e-week-view.h index 9525b87c02..5a1f2e6d22 100644 --- a/calendar/gui/e-week-view.h +++ b/calendar/gui/e-week-view.h @@ -53,12 +53,12 @@ ((obj), E_TYPE_WEEK_VIEW, EWeekViewClass)) /* The maximum number of weeks we show. 5 is usually enough for 1 month, - but we allow 6 for longer selections. */ + * but we allow 6 for longer selections. */ #define E_WEEK_VIEW_MAX_WEEKS 6 /* The size of the reminder & recurrence icons, and padding around them. - X_PAD is the padding between icons. R_PAD is the padding on the right of - the last icon, before the event text. */ + * X_PAD is the padding between icons. R_PAD is the padding on the right of + * the last icon, before the event text. */ #define E_WEEK_VIEW_ICON_WIDTH 16 #define E_WEEK_VIEW_ICON_HEIGHT 16 #define E_WEEK_VIEW_ICON_X_PAD 1 @@ -66,7 +66,7 @@ #define E_WEEK_VIEW_ICON_R_PAD 8 /* The space on the left & right outside of the event. (The triangle to - indicate the event continues is displayed in this space). */ + * indicate the event continues is displayed in this space). */ #define E_WEEK_VIEW_EVENT_L_PAD 2 #define E_WEEK_VIEW_EVENT_R_PAD 2 @@ -90,12 +90,12 @@ #define E_WEEK_VIEW_EVENT_EDGE_X_PAD 2 /* The padding above and on the right of the date string at the top of each - cell. */ + * cell. */ #define E_WEEK_VIEW_DATE_T_PAD 2 #define E_WEEK_VIEW_DATE_R_PAD 4 /* The padding above and below the line under the date string, in the Week - view, and also the space on the left of it. */ + * view, and also the space on the left of it. */ #define E_WEEK_VIEW_DATE_LINE_T_PAD 1 #define E_WEEK_VIEW_DATE_LINE_B_PAD 1 #define E_WEEK_VIEW_DATE_LINE_L_PAD 10 @@ -104,8 +104,8 @@ #define E_WEEK_VIEW_DATE_B_PAD 1 /* We use a 7-bit field to store row numbers in EWeekViewEventSpan, so the - maximum number or rows we can allow is 127. It is very unlikely to be - reached anyway. */ + * maximum number or rows we can allow is 127. It is very unlikely to be + * reached anyway. */ #define E_WEEK_VIEW_MAX_ROWS_PER_CELL 127 G_BEGIN_DECLS @@ -139,7 +139,7 @@ typedef enum } EWeekViewDragPosition; /* These specify which times are shown for the 1-day events. We use the small - font for the minutes if it can be loaded and the option is on. */ + * font for the minutes if it can be loaded and the option is on. */ typedef enum { E_WEEK_VIEW_TIME_NONE, @@ -195,8 +195,8 @@ struct _EWeekView { gint layout_timeout_id; /* An array of EWeekViewEventSpan elements. Each event has its own - space within this array, and uses the spans_index and num_spans - fields of the EWeekViewEvent struct to access it. */ + * space within this array, and uses the spans_index and num_spans + * fields of the EWeekViewEvent struct to access it. */ GArray *spans; /* The start of each day displayed. */ @@ -209,7 +209,7 @@ struct _EWeekView { GDate first_day_shown; /* If we are displaying multiple weeks in rows. If this is FALSE only - one week is shown, with a different layout. */ + * one week is shown, with a different layout. */ gboolean multi_week_view; /* TRUE when requires scrolling by a week in a multi_week_view */ @@ -219,11 +219,11 @@ struct _EWeekView { gboolean update_base_date; /* How many weeks we are showing. This is only relevant if - display_month is TRUE. */ + * display_month is TRUE. */ gint weeks_shown; /* If Sat & Sun are compressed. Only applicable in month view, since - they are always compressed into 1 cell in the week view. */ + * they are always compressed into 1 cell in the week view. */ gboolean compress_weekend; /* Whether we use show event end times. */ @@ -233,8 +233,8 @@ struct _EWeekView { gint week_start_day; /* The first day of the week we display, 0 (Monday) to 6 (Sunday). - This will usually be week_start_day, but if the weekend is - compressed, and week_start_day is Sunday we have to use Saturday. */ + * This will usually be week_start_day, but if the weekend is + * compressed, and week_start_day is Sunday we have to use Saturday. */ gint display_start_day; /* The vertical offset of the events from the top of the cells. */ @@ -257,7 +257,7 @@ struct _EWeekView { PangoFontDescription *small_font_desc; /* The widths of various pieces of text, used to determine which of - several date formats to display, set in e_week_view_style_set (). */ + * several date formats to display, set in e_week_view_style_set (). */ gint space_width; /* One space character ' '. */ gint colon_width; /* Size of ':' in the font. */ gint slash_width; /* Size of '/' in the font. */ @@ -273,10 +273,10 @@ struct _EWeekView { gint max_abbr_month_width; /* The size of the main grid of days and of the cells. A row - corresponds to a compressed day, so normal days usually take - up 2 rows. Note that the offsets arrays have one more element - than the widths/heights arrays since they also contain the - right/bottom edge. */ + * corresponds to a compressed day, so normal days usually take + * up 2 rows. Note that the offsets arrays have one more element + * than the widths/heights arrays since they also contain the + * right/bottom edge. */ gint rows; gint columns; gint col_widths[7]; @@ -285,7 +285,7 @@ struct _EWeekView { gint row_offsets[E_WEEK_VIEW_MAX_WEEKS * 2 + 1]; /* This specifies which times we are showing for the events, depending - on how much room is available. */ + * on how much room is available. */ EWeekViewTimeFormat time_format; /* The icons. */ @@ -307,22 +307,22 @@ struct _EWeekView { GdkCursor *last_cursor_set; /* The currently selected region, in days from the first day shown. - If selection_start_day is -1 there is no current selection. */ + * If selection_start_day is -1 there is no current selection. */ gint selection_start_day; gint selection_end_day; /* This specifies which end of the selection is being dragged, or is - E_WEEK_VIEW_DRAG_NONE if the selection isn't being dragged. */ + * E_WEEK_VIEW_DRAG_NONE if the selection isn't being dragged. */ EWeekViewDragPosition selection_drag_pos; /* This is the event the mouse button was pressed on. If the button - is released we start editing it, but if the mouse is dragged we set - this to -1. */ + * is released we start editing it, but if the mouse is dragged we set + * this to -1. */ gint pressed_event_num; gint pressed_span_num; /* The event span currently being edited. The num is -1 if no event is - being edited. */ + * being edited. */ gint editing_event_num; gint editing_span_num; @@ -344,7 +344,7 @@ struct _EWeekView { gboolean event_destroyed; /* remember last selected interval when click and restore on double click, - if we double clicked inside that interval. */ + * if we double clicked inside that interval. */ guint32 bc_event_time; time_t before_click_dtstart; time_t before_click_dtend; @@ -365,16 +365,16 @@ GType e_week_view_get_type (void); ECalendarView * e_week_view_new (ECalModel *model); /* The first day shown. Note that it will be rounded down to the start of a - week when set. The returned value will be invalid if no date has been set - yet. */ + * week when set. The returned value will be invalid if no date has been set + * yet. */ void e_week_view_get_first_day_shown (EWeekView *week_view, GDate *date); void e_week_view_set_first_day_shown (EWeekView *week_view, GDate *date); /* The selected time range. The EWeekView will show the corresponding - month and the days between start_time and end_time will be selected. - To select a single day, use the same value for start_time & end_time. */ + * month and the days between start_time and end_time will be selected. + * To select a single day, use the same value for start_time & end_time. */ void e_week_view_set_selected_time_range_visible (EWeekView *week_view, time_t start_time, @@ -396,7 +396,7 @@ void e_week_view_set_weeks_shown (EWeekView *week_view, gint weeks_shown); /* Whether the weekend (Sat/Sun) should be compressed into 1 cell in the Month - view. In the Week view they are always compressed. */ + * view. In the Week view they are always compressed. */ gboolean e_week_view_get_compress_weekend (EWeekView *week_view); void e_week_view_set_compress_weekend (EWeekView *week_view, gboolean compress_weekend); diff --git a/calendar/gui/ea-cal-view-event.c b/calendar/gui/ea-cal-view-event.c index f3716d7623..5111d6d27f 100644 --- a/calendar/gui/ea-cal-view-event.c +++ b/calendar/gui/ea-cal-view-event.c @@ -176,7 +176,7 @@ static void ea_cal_view_finalize (GObject *object) } #endif -AtkObject* +AtkObject * ea_cal_view_event_new (GObject *obj) { AtkObject *atk_obj = NULL; @@ -386,7 +386,7 @@ ea_cal_view_event_get_index_in_parent (AtkObject *accessible) --event_num) { day_view_event = &g_array_index (day_view->long_events, EDayViewEvent, event_num); - if (cal_view_event == (ECalendarViewEvent*) day_view_event) + if (cal_view_event == (ECalendarViewEvent *) day_view_event) return event_num; } @@ -397,7 +397,7 @@ ea_cal_view_event_get_index_in_parent (AtkObject *accessible) --event_num) { day_view_event = &g_array_index (day_view->events[day], EDayViewEvent, event_num); - if (cal_view_event == (ECalendarViewEvent*) day_view_event) + if (cal_view_event == (ECalendarViewEvent *) day_view_event) return num_before + event_num; } num_before += day_view->events[day]->len; @@ -447,12 +447,12 @@ atk_component_interface_init (AtkComponentIface *iface) } static void -ea_cal_view_get_extents (AtkComponent *component, - gint *x, - gint *y, - gint *width, - gint *height, - AtkCoordType coord_type) +ea_cal_view_get_extents (AtkComponent *component, + gint *x, + gint *y, + gint *width, + gint *height, + AtkCoordType coord_type) { GObject *g_obj; GnomeCanvasItem *canvas_item; @@ -568,7 +568,8 @@ atk_action_interface_init (AtkActionIface *iface) } static gboolean -ea_cal_view_event_do_action (AtkAction *action, gint i) +ea_cal_view_event_do_action (AtkAction *action, + gint i) { AtkGObjectAccessible *atk_gobj; AtkComponent *atk_comp; @@ -591,7 +592,8 @@ ea_cal_view_event_get_n_actions (AtkAction *action) } static const gchar * -ea_cal_view_event_action_get_name (AtkAction *action, gint i) +ea_cal_view_event_action_get_name (AtkAction *action, + gint i) { if (i >= 0 && i < CAL_VIEW_EVENT_ACTION_NUM) return action_name[i]; diff --git a/calendar/gui/ea-cal-view.c b/calendar/gui/ea-cal-view.c index 5b93469450..e6c3d65b9b 100644 --- a/calendar/gui/ea-cal-view.c +++ b/calendar/gui/ea-cal-view.c @@ -33,7 +33,7 @@ static void ea_cal_view_class_init (EaCalViewClass *klass); -static AtkObject* ea_cal_view_get_parent (AtkObject *accessible); +static AtkObject * ea_cal_view_get_parent (AtkObject *accessible); static void ea_cal_view_real_initialize (AtkObject *accessible, gpointer data); static void ea_cal_view_event_changed_cb (ECalendarView *cal_view, @@ -50,11 +50,17 @@ static void atk_action_interface_init (AtkActionIface *iface); static gboolean action_interface_do_action (AtkAction *action, gint i); static gint action_interface_get_n_actions (AtkAction *action); static const gchar * -action_interface_get_description (AtkAction *action, gint i); + action_interface_get_description + (AtkAction *action, + gint i); static const gchar * -action_interface_get_keybinding (AtkAction *action, gint i); + action_interface_get_keybinding + (AtkAction *action, + gint i); static const gchar * -action_interface_action_get_name (AtkAction *action, gint i); + action_interface_action_get_name + (AtkAction *action, + gint i); static gpointer parent_class = NULL; @@ -119,7 +125,7 @@ ea_cal_view_class_init (EaCalViewClass *klass) class->initialize = ea_cal_view_real_initialize; } -AtkObject* +AtkObject * ea_cal_view_new (GtkWidget *widget) { GObject *object; @@ -136,7 +142,8 @@ ea_cal_view_new (GtkWidget *widget) } static void -ea_cal_view_real_initialize (AtkObject *accessible, gpointer data) +ea_cal_view_real_initialize (AtkObject *accessible, + gpointer data) { ECalendarView *cal_view; GnomeCalendar *gcal; @@ -156,10 +163,12 @@ ea_cal_view_real_initialize (AtkObject *accessible, gpointer data) * of the event is removed, the cal_view_event will go to the state * of "defunct" (changed by weak ref callback of atkgobjectaccessible */ - g_signal_connect (G_OBJECT(cal_view), "event_changed", - G_CALLBACK (ea_cal_view_event_changed_cb), NULL); - g_signal_connect (G_OBJECT(cal_view), "event_added", - G_CALLBACK (ea_cal_view_event_added_cb), NULL); + g_signal_connect ( + cal_view, "event_changed", + G_CALLBACK (ea_cal_view_event_changed_cb), NULL); + g_signal_connect ( + cal_view, "event_added", + G_CALLBACK (ea_cal_view_event_added_cb), NULL); /* listen for date changes of calendar */ gcal = e_calendar_view_get_calendar (cal_view); @@ -170,7 +179,7 @@ ea_cal_view_real_initialize (AtkObject *accessible, gpointer data) accessible); } -static AtkObject* +static AtkObject * ea_cal_view_get_parent (AtkObject *accessible) { ECalendarView *cal_view; @@ -188,7 +197,8 @@ ea_cal_view_get_parent (AtkObject *accessible) } static void -ea_cal_view_event_changed_cb (ECalendarView *cal_view, ECalendarViewEvent *event, +ea_cal_view_event_changed_cb (ECalendarView *cal_view, + ECalendarViewEvent *event, gpointer data) { AtkObject *atk_obj; @@ -225,7 +235,8 @@ ea_cal_view_event_changed_cb (ECalendarView *cal_view, ECalendarViewEvent *event } static void -ea_cal_view_event_added_cb (ECalendarView *cal_view, ECalendarViewEvent *event, +ea_cal_view_event_added_cb (ECalendarView *cal_view, + ECalendarViewEvent *event, gpointer data) { AtkObject *atk_obj; @@ -290,7 +301,8 @@ idle_dates_changed (gpointer data) } static void -ea_cal_view_dates_change_cb (GnomeCalendar *gcal, gpointer data) +ea_cal_view_dates_change_cb (GnomeCalendar *gcal, + gpointer data) { g_idle_add (idle_dates_changed, data); } @@ -320,7 +332,8 @@ atk_action_interface_init (AtkActionIface *iface) } static gboolean -action_interface_do_action (AtkAction *action, gint index) +action_interface_do_action (AtkAction *action, + gint index) { GtkWidget *widget; gboolean return_value = TRUE; @@ -381,13 +394,15 @@ action_interface_get_n_actions (AtkAction *action) } static const gchar * -action_interface_get_description (AtkAction *action, gint index) +action_interface_get_description (AtkAction *action, + gint index) { return action_interface_action_get_name (action, index); } static const gchar * -action_interface_get_keybinding (AtkAction *action, gint index) +action_interface_get_keybinding (AtkAction *action, + gint index) { GtkWidget *widget; @@ -424,7 +439,8 @@ action_interface_get_keybinding (AtkAction *action, gint index) } static const gchar * -action_interface_action_get_name (AtkAction *action, gint i) +action_interface_action_get_name (AtkAction *action, + gint i) { if (i >= 0 && i < CAL_VIEW_ACTION_NUM) return action_name[i]; diff --git a/calendar/gui/ea-cal-view.h b/calendar/gui/ea-cal-view.h index 959f7816b5..d0363025e0 100644 --- a/calendar/gui/ea-cal-view.h +++ b/calendar/gui/ea-cal-view.h @@ -51,7 +51,7 @@ struct _EaCalViewClass GtkAccessibleClass parent_class; }; -AtkObject* ea_cal_view_new (GtkWidget *widget); +AtkObject * ea_cal_view_new (GtkWidget *widget); G_END_DECLS diff --git a/calendar/gui/ea-calendar.c b/calendar/gui/ea-calendar.c index 423e2dfbd7..cbea6ded02 100644 --- a/calendar/gui/ea-calendar.c +++ b/calendar/gui/ea-calendar.c @@ -50,9 +50,9 @@ EA_FACTORY_GOBJECT ( EA_FACTORY (EA_TYPE_GNOME_CALENDAR, ea_gnome_calendar, ea_gnome_calendar_new) static gboolean ea_calendar_focus_watcher (GSignalInvocationHint *ihint, - guint n_param_values, - const GValue *param_values, - gpointer data); + guint n_param_values, + const GValue *param_values, + gpointer data); static gpointer e_text_type, pixbuf_type, e_day_view_type, e_week_view_type; static gpointer e_day_view_main_item_type, e_week_view_main_item_type; diff --git a/calendar/gui/ea-day-view-cell.c b/calendar/gui/ea-day-view-cell.c index a94a9d193f..4fe1c5bedb 100644 --- a/calendar/gui/ea-day-view-cell.c +++ b/calendar/gui/ea-day-view-cell.c @@ -69,7 +69,9 @@ e_day_view_cell_class_init (EDayViewCellClass *class) } EDayViewCell * -e_day_view_cell_new (EDayView *day_view, gint row, gint column) +e_day_view_cell_new (EDayView *day_view, + gint row, + gint column) { GObject *object; EDayViewCell *cell; @@ -95,7 +97,7 @@ static void ea_day_view_cell_class_init (EaDayViewCellClass *klass); static const gchar * ea_day_view_cell_get_name (AtkObject *accessible); static const gchar * ea_day_view_cell_get_description (AtkObject *accessible); -static AtkStateSet* ea_day_view_cell_ref_state_set (AtkObject *obj); +static AtkStateSet * ea_day_view_cell_ref_state_set (AtkObject *obj); static AtkObject * ea_day_view_cell_get_parent (AtkObject *accessible); static gint ea_day_view_cell_get_index_in_parent (AtkObject *accessible); @@ -168,7 +170,7 @@ ea_day_view_cell_class_init (EaDayViewCellClass *klass) class->get_index_in_parent = ea_day_view_cell_get_index_in_parent; } -AtkObject* +AtkObject * ea_day_view_cell_new (GObject *obj) { gpointer object; @@ -240,7 +242,7 @@ ea_day_view_cell_get_description (AtkObject *accessible) return ea_day_view_cell_get_name (accessible); } -static AtkStateSet* +static AtkStateSet * ea_day_view_cell_ref_state_set (AtkObject *obj) { AtkStateSet *state_set; @@ -326,8 +328,11 @@ atk_component_interface_init (AtkComponentIface *iface) static void component_interface_get_extents (AtkComponent *component, - gint *x, gint *y, gint *width, gint *height, - AtkCoordType coord_type) + gint *x, + gint *y, + gint *width, + gint *height, + AtkCoordType coord_type) { GObject *g_obj; AtkObject *atk_obj; diff --git a/calendar/gui/ea-day-view-cell.h b/calendar/gui/ea-day-view-cell.h index 669fb1abae..2b2f6dddc5 100644 --- a/calendar/gui/ea-day-view-cell.h +++ b/calendar/gui/ea-day-view-cell.h @@ -78,7 +78,7 @@ struct _EaDayViewCellClass AtkGObjectAccessibleClass parent_class; }; -AtkObject* ea_day_view_cell_new (GObject *gobj); +AtkObject * ea_day_view_cell_new (GObject *gobj); G_END_DECLS diff --git a/calendar/gui/ea-day-view-main-item.c b/calendar/gui/ea-day-view-main-item.c index 1274cb7b72..1ced61b7ad 100644 --- a/calendar/gui/ea-day-view-main-item.c +++ b/calendar/gui/ea-day-view-main-item.c @@ -43,7 +43,7 @@ static const gchar * (AtkObject *accessible); static gint ea_day_view_main_item_get_n_children (AtkObject *obj); -static AtkObject* ea_day_view_main_item_ref_child (AtkObject *obj, +static AtkObject * ea_day_view_main_item_ref_child (AtkObject *obj, gint i); static AtkObject * ea_day_view_main_item_get_parent (AtkObject *accessible); static gint ea_day_view_main_item_get_index_in_parent (AtkObject *accessible); @@ -67,7 +67,7 @@ static gint table_interface_get_column_at_index (AtkTable *table, gint index); static gint table_interface_get_row_at_index (AtkTable *table, gint index); -static AtkObject* table_interface_ref_at (AtkTable *table, +static AtkObject * table_interface_ref_at (AtkTable *table, gint row, gint column); static gint table_interface_get_n_rows (AtkTable *table); @@ -97,25 +97,29 @@ static gboolean table_interface_add_column_selection (AtkTable *table, gint column); static gboolean table_interface_remove_column_selection (AtkTable *table, gint column); -static AtkObject* table_interface_get_row_header (AtkTable *table, gint row); -static AtkObject* table_interface_get_column_header (AtkTable *table, +static AtkObject * table_interface_get_row_header (AtkTable *table, gint row); +static AtkObject * table_interface_get_column_header (AtkTable *table, gint in_col); -static AtkObject* table_interface_get_caption (AtkTable *table); +static AtkObject * table_interface_get_caption (AtkTable *table); static const gchar * -table_interface_get_column_description (AtkTable *table, gint in_col); + table_interface_get_column_description + (AtkTable *table, + gint in_col); static const gchar * -table_interface_get_row_description (AtkTable *table, gint row); + table_interface_get_row_description + (AtkTable *table, + gint row); -static AtkObject* table_interface_get_summary (AtkTable *table); +static AtkObject * table_interface_get_summary (AtkTable *table); /* atk selection interface */ static void atk_selection_interface_init (AtkSelectionIface *iface); static gboolean selection_interface_add_selection (AtkSelection *selection, gint i); static gboolean selection_interface_clear_selection (AtkSelection *selection); -static AtkObject* selection_interface_ref_selection (AtkSelection *selection, +static AtkObject * selection_interface_ref_selection (AtkSelection *selection, gint i); static gint selection_interface_get_selection_count (AtkSelection *selection); static gboolean selection_interface_is_child_selected (AtkSelection *selection, @@ -130,17 +134,19 @@ ea_day_view_main_item_destory_cell_data (EaDayViewMainItem *ea_main_item); static gint ea_day_view_main_item_get_child_index_at (EaDayViewMainItem *ea_main_item, - gint row, gint column); + gint row, + gint column); static gint ea_day_view_main_item_get_row_at_index (EaDayViewMainItem *ea_main_item, - gint index); + gint index); static gint ea_day_view_main_item_get_column_at_index (EaDayViewMainItem *ea_main_item, - gint index); + gint index); static gint ea_day_view_main_item_get_row_label (EaDayViewMainItem *ea_main_item, - gint row, gchar *buffer, - gint buffer_size); + gint row, + gchar *buffer, + gint buffer_size); #ifdef ACC_DEBUG static gint n_ea_day_view_main_item_created = 0; @@ -233,7 +239,7 @@ ea_day_view_main_item_class_init (EaDayViewMainItemClass *klass) class->get_index_in_parent = ea_day_view_main_item_get_index_in_parent; } -AtkObject* +AtkObject * ea_day_view_main_item_new (GObject *obj) { AtkObject *accessible; @@ -334,7 +340,8 @@ ea_day_view_main_item_get_n_children (AtkObject *accessible) } static AtkObject * -ea_day_view_main_item_ref_child (AtkObject *accessible, gint index) +ea_day_view_main_item_ref_child (AtkObject *accessible, + gint index) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; @@ -418,7 +425,8 @@ ea_day_view_main_item_get_index_in_parent (AtkObject *accessible) /* callbacks */ static void -ea_day_view_main_item_dates_change_cb (GnomeCalendar *gcal, gpointer data) +ea_day_view_main_item_dates_change_cb (GnomeCalendar *gcal, + gpointer data) { EaDayViewMainItem *ea_main_item; @@ -436,7 +444,8 @@ ea_day_view_main_item_dates_change_cb (GnomeCalendar *gcal, gpointer data) } static void -ea_day_view_main_item_time_change_cb (EDayView *day_view, gpointer data) +ea_day_view_main_item_time_change_cb (EDayView *day_view, + gpointer data) { EaDayViewMainItem *ea_main_item; AtkObject *item_cell = NULL; @@ -474,7 +483,8 @@ ea_day_view_main_item_time_change_cb (EDayView *day_view, gpointer data) static gint ea_day_view_main_item_get_child_index_at (EaDayViewMainItem *ea_main_item, - gint row, gint column) + gint row, + gint column) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; @@ -499,7 +509,7 @@ ea_day_view_main_item_get_child_index_at (EaDayViewMainItem *ea_main_item, static gint ea_day_view_main_item_get_row_at_index (EaDayViewMainItem *ea_main_item, - gint index) + gint index) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; @@ -525,7 +535,7 @@ ea_day_view_main_item_get_row_at_index (EaDayViewMainItem *ea_main_item, static gint ea_day_view_main_item_get_column_at_index (EaDayViewMainItem *ea_main_item, - gint index) + gint index) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; @@ -551,7 +561,9 @@ ea_day_view_main_item_get_column_at_index (EaDayViewMainItem *ea_main_item, static gint ea_day_view_main_item_get_row_label (EaDayViewMainItem *ea_main_item, - gint row, gchar *buffer, gint buffer_size) + gint row, + gchar *buffer, + gint buffer_size) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; @@ -645,8 +657,11 @@ atk_component_interface_init (AtkComponentIface *iface) static void component_interface_get_extents (AtkComponent *component, - gint *x, gint *y, gint *width, gint *height, - AtkCoordType coord_type) + gint *x, + gint *y, + gint *width, + gint *height, + AtkCoordType coord_type) { GObject *g_obj; AtkObject *ea_canvas; @@ -704,14 +719,14 @@ atk_table_interface_init (AtkTableIface *iface) iface->get_column_description = table_interface_get_column_description; } -static AtkObject* +static AtkObject * table_interface_ref_at (AtkTable *table, - gint row, - gint column) + gint row, + gint column) { gint index; - EaDayViewMainItem* ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table); + EaDayViewMainItem * ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table); index = ea_day_view_main_item_get_child_index_at (ea_main_item, row, column); return ea_day_view_main_item_ref_child (ATK_OBJECT (ea_main_item), index); @@ -724,7 +739,7 @@ table_interface_get_n_rows (AtkTable *table) GObject *g_obj; EDayViewMainItem *main_item; EDayView *day_view; - EaDayViewMainItem* ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table); + EaDayViewMainItem * ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table); atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item); g_obj = atk_gobject_accessible_get_object (atk_gobj); @@ -744,7 +759,7 @@ table_interface_get_n_columns (AtkTable *table) GObject *g_obj; EDayViewMainItem *main_item; EDayView *day_view; - EaDayViewMainItem* ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table); + EaDayViewMainItem * ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table); atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item); g_obj = atk_gobject_accessible_get_object (atk_gobj); @@ -759,39 +774,39 @@ table_interface_get_n_columns (AtkTable *table) static gint table_interface_get_index_at (AtkTable *table, - gint row, - gint column) + gint row, + gint column) { - EaDayViewMainItem* ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table); + EaDayViewMainItem * ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table); return ea_day_view_main_item_get_child_index_at (ea_main_item, row, column); } static gint table_interface_get_column_at_index (AtkTable *table, - gint index) + gint index) { - EaDayViewMainItem* ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table); + EaDayViewMainItem * ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table); return ea_day_view_main_item_get_column_at_index (ea_main_item, index); } static gint table_interface_get_row_at_index (AtkTable *table, - gint index) + gint index) { - EaDayViewMainItem* ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table); + EaDayViewMainItem * ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table); return ea_day_view_main_item_get_row_at_index (ea_main_item, index); } static gint -table_interface_get_column_extent_at (AtkTable *table, - gint row, - gint column) +table_interface_get_column_extent_at (AtkTable *table, + gint row, + gint column) { gint index; gint width = 0, height = 0; AtkObject *child; - EaDayViewMainItem* ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table); + EaDayViewMainItem * ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table); index = ea_day_view_main_item_get_child_index_at (ea_main_item, row, column); @@ -805,14 +820,14 @@ table_interface_get_column_extent_at (AtkTable *table, } static gint -table_interface_get_row_extent_at (AtkTable *table, - gint row, - gint column) +table_interface_get_row_extent_at (AtkTable *table, + gint row, + gint column) { gint index; gint width = 0, height = 0; AtkObject *child; - EaDayViewMainItem* ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table); + EaDayViewMainItem * ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table); index = ea_day_view_main_item_get_child_index_at (ea_main_item, row, column); @@ -827,13 +842,13 @@ table_interface_get_row_extent_at (AtkTable *table, static gboolean table_interface_is_row_selected (AtkTable *table, - gint row) + gint row) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; EDayViewMainItem *main_item; EDayView *day_view; - EaDayViewMainItem* ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table); + EaDayViewMainItem * ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table); atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item); g_obj = atk_gobject_accessible_get_object (atk_gobj); @@ -857,8 +872,8 @@ table_interface_is_row_selected (AtkTable *table, static gboolean table_interface_is_selected (AtkTable *table, - gint row, - gint column) + gint row, + gint column) { return table_interface_is_row_selected (table, row) && table_interface_is_column_selected (table, column); @@ -866,13 +881,13 @@ table_interface_is_selected (AtkTable *table, static gboolean table_interface_is_column_selected (AtkTable *table, - gint column) + gint column) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; EDayViewMainItem *main_item; EDayView *day_view; - EaDayViewMainItem* ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table); + EaDayViewMainItem * ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table); atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item); g_obj = atk_gobject_accessible_get_object (atk_gobj); @@ -890,13 +905,13 @@ table_interface_is_column_selected (AtkTable *table, static gint table_interface_get_selected_rows (AtkTable *table, - gint **rows_selected) + gint **rows_selected) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; EDayViewMainItem *main_item; EDayView *day_view; - EaDayViewMainItem* ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table); + EaDayViewMainItem * ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table); gint start_row = -1, n_rows = 0; atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item); @@ -931,13 +946,13 @@ table_interface_get_selected_rows (AtkTable *table, static gint table_interface_get_selected_columns (AtkTable *table, - gint **columns_selected) + gint **columns_selected) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; EDayViewMainItem *main_item; EDayView *day_view; - EaDayViewMainItem* ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table); + EaDayViewMainItem * ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table); gint start_column = -1, n_columns = 0; atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item); @@ -965,13 +980,13 @@ table_interface_get_selected_columns (AtkTable *table, static gboolean table_interface_add_row_selection (AtkTable *table, - gint row) + gint row) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; EDayViewMainItem *main_item; EDayView *day_view; - EaDayViewMainItem* ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table); + EaDayViewMainItem * ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table); atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item); g_obj = atk_gobject_accessible_get_object (atk_gobj); @@ -998,20 +1013,20 @@ table_interface_add_row_selection (AtkTable *table, static gboolean table_interface_remove_row_selection (AtkTable *table, - gint row) + gint row) { return FALSE; } static gboolean table_interface_add_column_selection (AtkTable *table, - gint column) + gint column) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; EDayViewMainItem *main_item; EDayView *day_view; - EaDayViewMainItem* ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table); + EaDayViewMainItem * ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table); atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item); g_obj = atk_gobject_accessible_get_object (atk_gobj); @@ -1035,44 +1050,44 @@ table_interface_add_column_selection (AtkTable *table, static gboolean table_interface_remove_column_selection (AtkTable *table, - gint column) + gint column) { /* FIXME: NOT IMPLEMENTED */ return FALSE; } -static AtkObject* +static AtkObject * table_interface_get_row_header (AtkTable *table, - gint row) + gint row) { /* FIXME: NOT IMPLEMENTED */ return NULL; } -static AtkObject* +static AtkObject * table_interface_get_column_header (AtkTable *table, - gint in_col) + gint in_col) { /* FIXME: NOT IMPLEMENTED */ return NULL; } -static AtkObject* -table_interface_get_caption (AtkTable *table) +static AtkObject * +table_interface_get_caption (AtkTable *table) { /* FIXME: NOT IMPLEMENTED */ return NULL; } static const gchar * -table_interface_get_column_description (AtkTable *table, - gint in_col) +table_interface_get_column_description (AtkTable *table, + gint in_col) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; EDayViewMainItem *main_item; EDayView *day_view; - EaDayViewMainItem* ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table); + EaDayViewMainItem * ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table); const gchar *description; EaCellTable *cell_data; @@ -1101,12 +1116,12 @@ table_interface_get_column_description (AtkTable *table, } static const gchar * -table_interface_get_row_description (AtkTable *table, - gint row) +table_interface_get_row_description (AtkTable *table, + gint row) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; - EaDayViewMainItem* ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table); + EaDayViewMainItem * ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table); const gchar *description; EaCellTable *cell_data; @@ -1133,8 +1148,8 @@ table_interface_get_row_description (AtkTable *table, return description; } -static AtkObject* -table_interface_get_summary (AtkTable *table) +static AtkObject * +table_interface_get_summary (AtkTable *table) { /* FIXME: NOT IMPLEMENTED */ return NULL; @@ -1155,13 +1170,14 @@ atk_selection_interface_init (AtkSelectionIface *iface) } static gboolean -selection_interface_add_selection (AtkSelection *selection, gint i) +selection_interface_add_selection (AtkSelection *selection, + gint i) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; EDayViewMainItem *main_item; EDayView *day_view; - EaDayViewMainItem* ea_main_item = EA_DAY_VIEW_MAIN_ITEM (selection); + EaDayViewMainItem * ea_main_item = EA_DAY_VIEW_MAIN_ITEM (selection); gint column, row; atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item); @@ -1199,7 +1215,7 @@ selection_interface_clear_selection (AtkSelection *selection) GObject *g_obj; EDayViewMainItem *main_item; EDayView *day_view; - EaDayViewMainItem* ea_main_item = EA_DAY_VIEW_MAIN_ITEM (selection); + EaDayViewMainItem * ea_main_item = EA_DAY_VIEW_MAIN_ITEM (selection); atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item); g_obj = atk_gobject_accessible_get_object (atk_gobj); @@ -1220,14 +1236,15 @@ selection_interface_clear_selection (AtkSelection *selection) return TRUE; } -static AtkObject* -selection_interface_ref_selection (AtkSelection *selection, gint i) +static AtkObject * +selection_interface_ref_selection (AtkSelection *selection, + gint i) { gint count; GObject *g_obj; EDayViewMainItem *main_item; EDayView *day_view; - EaDayViewMainItem* ea_main_item = EA_DAY_VIEW_MAIN_ITEM (selection); + EaDayViewMainItem * ea_main_item = EA_DAY_VIEW_MAIN_ITEM (selection); gint start_index; count = selection_interface_get_selection_count (selection); @@ -1253,7 +1270,7 @@ selection_interface_get_selection_count (AtkSelection *selection) GObject *g_obj; EDayViewMainItem *main_item; EDayView *day_view; - EaDayViewMainItem* ea_main_item = EA_DAY_VIEW_MAIN_ITEM (selection); + EaDayViewMainItem * ea_main_item = EA_DAY_VIEW_MAIN_ITEM (selection); gint start_index, end_index; atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item); @@ -1278,13 +1295,14 @@ selection_interface_get_selection_count (AtkSelection *selection) } static gboolean -selection_interface_is_child_selected (AtkSelection *selection, gint i) +selection_interface_is_child_selected (AtkSelection *selection, + gint i) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; EDayViewMainItem *main_item; EDayView *day_view; - EaDayViewMainItem* ea_main_item = EA_DAY_VIEW_MAIN_ITEM (selection); + EaDayViewMainItem * ea_main_item = EA_DAY_VIEW_MAIN_ITEM (selection); gint column, row; atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item); diff --git a/calendar/gui/ea-day-view-main-item.h b/calendar/gui/ea-day-view-main-item.h index c782e6acc8..b3ef6a0160 100644 --- a/calendar/gui/ea-day-view-main-item.h +++ b/calendar/gui/ea-day-view-main-item.h @@ -51,7 +51,7 @@ struct _EaDayViewMainItemClass AtkGObjectAccessibleClass parent_class; }; -AtkObject* ea_day_view_main_item_new (GObject *obj); +AtkObject * ea_day_view_main_item_new (GObject *obj); G_END_DECLS diff --git a/calendar/gui/ea-day-view.c b/calendar/gui/ea-day-view.c index 72f3e5ba61..89e9c4b8a0 100644 --- a/calendar/gui/ea-day-view.c +++ b/calendar/gui/ea-day-view.c @@ -36,7 +36,7 @@ static void ea_day_view_class_init (EaDayViewClass *klass); static const gchar * ea_day_view_get_name (AtkObject *accessible); static const gchar * ea_day_view_get_description (AtkObject *accessible); static gint ea_day_view_get_n_children (AtkObject *obj); -static AtkObject* ea_day_view_ref_child (AtkObject *obj, +static AtkObject * ea_day_view_ref_child (AtkObject *obj, gint i); static gpointer parent_class = NULL; @@ -99,7 +99,7 @@ ea_day_view_class_init (EaDayViewClass *klass) class->ref_child = ea_day_view_ref_child; } -AtkObject* +AtkObject * ea_day_view_new (GtkWidget *widget) { GObject *object; @@ -233,7 +233,8 @@ ea_day_view_get_n_children (AtkObject *accessible) } static AtkObject * -ea_day_view_ref_child (AtkObject *accessible, gint index) +ea_day_view_ref_child (AtkObject *accessible, + gint index) { EDayView *day_view; gint child_num; diff --git a/calendar/gui/ea-day-view.h b/calendar/gui/ea-day-view.h index 33399f6600..3e6d6154ef 100644 --- a/calendar/gui/ea-day-view.h +++ b/calendar/gui/ea-day-view.h @@ -50,7 +50,7 @@ struct _EaDayViewClass EaCalViewClass parent_class; }; -AtkObject* ea_day_view_new (GtkWidget *widget); +AtkObject * ea_day_view_new (GtkWidget *widget); G_END_DECLS diff --git a/calendar/gui/ea-gnome-calendar.c b/calendar/gui/ea-gnome-calendar.c index 0983de84b9..e1826355b5 100644 --- a/calendar/gui/ea-gnome-calendar.c +++ b/calendar/gui/ea-gnome-calendar.c @@ -35,7 +35,7 @@ static void ea_gnome_calendar_class_init (EaGnomeCalendarClass *klass); -static gint ea_gnome_calendar_get_n_children (AtkObject* obj); +static gint ea_gnome_calendar_get_n_children (AtkObject * obj); static AtkObject * ea_gnome_calendar_ref_child (AtkObject *obj, gint i); static void ea_gcal_dates_change_cb (GnomeCalendar *gcal, gpointer data); @@ -114,7 +114,7 @@ ea_gnome_calendar_class_init (EaGnomeCalendarClass *klass) class->ref_child = ea_gnome_calendar_ref_child; } -AtkObject* +AtkObject * ea_gnome_calendar_new (GtkWidget *widget) { GObject *object; @@ -253,7 +253,7 @@ ea_gnome_calendar_get_label_description (GnomeCalendar *gcal) } static gint -ea_gnome_calendar_get_n_children (AtkObject* obj) +ea_gnome_calendar_get_n_children (AtkObject *obj) { g_return_val_if_fail (EA_IS_GNOME_CALENDAR (obj), 0); @@ -264,7 +264,8 @@ ea_gnome_calendar_get_n_children (AtkObject* obj) } static AtkObject * -ea_gnome_calendar_ref_child (AtkObject *obj, gint i) +ea_gnome_calendar_ref_child (AtkObject *obj, + gint i) { AtkObject * child = NULL; GnomeCalendar * calendarWidget; @@ -309,7 +310,8 @@ ea_gnome_calendar_ref_child (AtkObject *obj, gint i) } static void -ea_gcal_dates_change_cb (GnomeCalendar *gcal, gpointer data) +ea_gcal_dates_change_cb (GnomeCalendar *gcal, + gpointer data) { const gchar *new_name; diff --git a/calendar/gui/ea-gnome-calendar.h b/calendar/gui/ea-gnome-calendar.h index db9acdb47e..953db4a2d5 100644 --- a/calendar/gui/ea-gnome-calendar.h +++ b/calendar/gui/ea-gnome-calendar.h @@ -50,7 +50,7 @@ struct _EaGnomeCalendarClass GtkAccessibleClass parent_class; }; -AtkObject* ea_gnome_calendar_new (GtkWidget *widget); +AtkObject * ea_gnome_calendar_new (GtkWidget *widget); const gchar * ea_gnome_calendar_get_label_description (GnomeCalendar *gcal); diff --git a/calendar/gui/ea-jump-button.c b/calendar/gui/ea-jump-button.c index e19b1037a0..34a7b32ad0 100644 --- a/calendar/gui/ea-jump-button.c +++ b/calendar/gui/ea-jump-button.c @@ -112,7 +112,7 @@ ea_jump_button_class_init (EaJumpButtonClass *klass) class->get_description = ea_jump_button_get_description; } -AtkObject* +AtkObject * ea_jump_button_new (GObject *obj) { AtkObject *atk_obj = NULL; @@ -171,7 +171,7 @@ atk_action_interface_init (AtkActionIface *iface) static gboolean jump_button_do_action (AtkAction *action, - gint i) + gint i) { gboolean return_value = TRUE; AtkGObjectAccessible *atk_gobj; @@ -209,7 +209,7 @@ jump_button_get_n_actions (AtkAction *action) static const gchar * jump_button_get_keybinding (AtkAction *action, - gint i) + gint i) { const gchar *return_value = NULL; diff --git a/calendar/gui/ea-week-view-cell.c b/calendar/gui/ea-week-view-cell.c index 506a5f5724..fce7a9def1 100644 --- a/calendar/gui/ea-week-view-cell.c +++ b/calendar/gui/ea-week-view-cell.c @@ -69,7 +69,9 @@ e_week_view_cell_class_init (EWeekViewCellClass *class) } EWeekViewCell * -e_week_view_cell_new (EWeekView *week_view, gint row, gint column) +e_week_view_cell_new (EWeekView *week_view, + gint row, + gint column) { GObject *object; EWeekViewCell *cell; @@ -95,7 +97,7 @@ static void ea_week_view_cell_class_init (EaWeekViewCellClass *klass); static const gchar * ea_week_view_cell_get_name (AtkObject *accessible); static const gchar * ea_week_view_cell_get_description (AtkObject *accessible); -static AtkStateSet* ea_week_view_cell_ref_state_set (AtkObject *obj); +static AtkStateSet * ea_week_view_cell_ref_state_set (AtkObject *obj); static AtkObject * ea_week_view_cell_get_parent (AtkObject *accessible); static gint ea_week_view_cell_get_index_in_parent (AtkObject *accessible); @@ -169,7 +171,7 @@ ea_week_view_cell_class_init (EaWeekViewCellClass *klass) } -AtkObject* +AtkObject * ea_week_view_cell_new (GObject *obj) { gpointer object; @@ -252,7 +254,7 @@ ea_week_view_cell_get_description (AtkObject *accessible) return ea_week_view_cell_get_name (accessible); } -static AtkStateSet* +static AtkStateSet * ea_week_view_cell_ref_state_set (AtkObject *obj) { AtkStateSet *state_set; @@ -336,8 +338,11 @@ atk_component_interface_init (AtkComponentIface *iface) static void component_interface_get_extents (AtkComponent *component, - gint *x, gint *y, gint *width, gint *height, - AtkCoordType coord_type) + gint *x, + gint *y, + gint *width, + gint *height, + AtkCoordType coord_type) { GObject *g_obj; AtkObject *atk_obj; diff --git a/calendar/gui/ea-week-view-cell.h b/calendar/gui/ea-week-view-cell.h index 1524e9d3a8..afef4d1302 100644 --- a/calendar/gui/ea-week-view-cell.h +++ b/calendar/gui/ea-week-view-cell.h @@ -78,7 +78,7 @@ struct _EaWeekViewCellClass AtkGObjectAccessibleClass parent_class; }; -AtkObject* ea_week_view_cell_new (GObject *gobj); +AtkObject * ea_week_view_cell_new (GObject *gobj); G_END_DECLS diff --git a/calendar/gui/ea-week-view-main-item.c b/calendar/gui/ea-week-view-main-item.c index cdeefa0138..f7a5a2a7fe 100644 --- a/calendar/gui/ea-week-view-main-item.c +++ b/calendar/gui/ea-week-view-main-item.c @@ -147,7 +147,7 @@ static void atk_selection_interface_init (AtkSelectionIface *iface); static gboolean selection_interface_add_selection (AtkSelection *selection, gint i); static gboolean selection_interface_clear_selection (AtkSelection *selection); -static AtkObject* selection_interface_ref_selection (AtkSelection *selection, +static AtkObject * selection_interface_ref_selection (AtkSelection *selection, gint i); static gint selection_interface_get_selection_count (AtkSelection *selection); static gboolean selection_interface_is_child_selected (AtkSelection *selection, @@ -268,7 +268,7 @@ ea_week_view_main_item_class_init (EaWeekViewMainItemClass *klass) class->get_index_in_parent = ea_week_view_main_item_get_index_in_parent; } -AtkObject* +AtkObject * ea_week_view_main_item_new (GObject *obj) { AtkObject *accessible; @@ -369,7 +369,8 @@ ea_week_view_main_item_get_n_children (AtkObject *accessible) } static AtkObject * -ea_week_view_main_item_ref_child (AtkObject *accessible, gint index) +ea_week_view_main_item_ref_child (AtkObject *accessible, + gint index) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; @@ -453,7 +454,8 @@ ea_week_view_main_item_get_index_in_parent (AtkObject *accessible) /* callbacks */ static void -ea_week_view_main_item_dates_change_cb (GnomeCalendar *gcal, gpointer data) +ea_week_view_main_item_dates_change_cb (GnomeCalendar *gcal, + gpointer data) { EaWeekViewMainItem *ea_main_item; @@ -471,7 +473,8 @@ ea_week_view_main_item_dates_change_cb (GnomeCalendar *gcal, gpointer data) } static void -ea_week_view_main_item_time_change_cb (EWeekView *week_view, gpointer data) +ea_week_view_main_item_time_change_cb (EWeekView *week_view, + gpointer data) { EaWeekViewMainItem *ea_main_item; AtkObject *item_cell = NULL; @@ -507,7 +510,8 @@ ea_week_view_main_item_time_change_cb (EWeekView *week_view, gpointer data) static gint ea_week_view_main_item_get_child_index_at (EaWeekViewMainItem *ea_main_item, - gint row, gint column) + gint row, + gint column) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; @@ -533,7 +537,7 @@ ea_week_view_main_item_get_child_index_at (EaWeekViewMainItem *ea_main_item, static gint ea_week_view_main_item_get_row_at_index (EaWeekViewMainItem *ea_main_item, - gint index) + gint index) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; @@ -554,7 +558,7 @@ ea_week_view_main_item_get_row_at_index (EaWeekViewMainItem *ea_main_item, static gint ea_week_view_main_item_get_column_at_index (EaWeekViewMainItem *ea_main_item, - gint index) + gint index) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; @@ -575,7 +579,9 @@ ea_week_view_main_item_get_column_at_index (EaWeekViewMainItem *ea_main_item, static gint ea_week_view_main_item_get_row_label (EaWeekViewMainItem *ea_main_item, - gint row, gchar *buffer, gint buffer_size) + gint row, + gchar *buffer, + gint buffer_size) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; @@ -649,8 +655,11 @@ atk_component_interface_init (AtkComponentIface *iface) static void component_interface_get_extents (AtkComponent *component, - gint *x, gint *y, gint *width, gint *height, - AtkCoordType coord_type) + gint *x, + gint *y, + gint *width, + gint *height, + AtkCoordType coord_type) { GObject *g_obj; AtkObject *ea_canvas; @@ -708,14 +717,14 @@ atk_table_interface_init (AtkTableIface *iface) iface->get_column_description = table_interface_get_column_description; } -static AtkObject* +static AtkObject * table_interface_ref_at (AtkTable *table, - gint row, - gint column) + gint row, + gint column) { gint index; - EaWeekViewMainItem* ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (table); + EaWeekViewMainItem * ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (table); index = ea_week_view_main_item_get_child_index_at (ea_main_item, row, column); return ea_week_view_main_item_ref_child (ATK_OBJECT (ea_main_item), index); @@ -728,7 +737,7 @@ table_interface_get_n_rows (AtkTable *table) GObject *g_obj; EWeekViewMainItem *main_item; EWeekView *week_view; - EaWeekViewMainItem* ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (table); + EaWeekViewMainItem * ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (table); atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item); g_obj = atk_gobject_accessible_get_object (atk_gobj); @@ -746,7 +755,7 @@ table_interface_get_n_columns (AtkTable *table) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; - EaWeekViewMainItem* ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (table); + EaWeekViewMainItem * ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (table); atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item); g_obj = atk_gobject_accessible_get_object (atk_gobj); @@ -758,39 +767,39 @@ table_interface_get_n_columns (AtkTable *table) static gint table_interface_get_index_at (AtkTable *table, - gint row, - gint column) + gint row, + gint column) { - EaWeekViewMainItem* ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (table); + EaWeekViewMainItem * ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (table); return ea_week_view_main_item_get_child_index_at (ea_main_item, row, column); } static gint table_interface_get_column_at_index (AtkTable *table, - gint index) + gint index) { - EaWeekViewMainItem* ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (table); + EaWeekViewMainItem * ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (table); return ea_week_view_main_item_get_column_at_index (ea_main_item, index); } static gint table_interface_get_row_at_index (AtkTable *table, - gint index) + gint index) { - EaWeekViewMainItem* ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (table); + EaWeekViewMainItem * ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (table); return ea_week_view_main_item_get_row_at_index (ea_main_item, index); } static gint -table_interface_get_column_extent_at (AtkTable *table, - gint row, - gint column) +table_interface_get_column_extent_at (AtkTable *table, + gint row, + gint column) { gint index; gint width = 0, height = 0; AtkObject *child; - EaWeekViewMainItem* ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (table); + EaWeekViewMainItem * ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (table); index = ea_week_view_main_item_get_child_index_at (ea_main_item, row, column); @@ -804,14 +813,14 @@ table_interface_get_column_extent_at (AtkTable *table, } static gint -table_interface_get_row_extent_at (AtkTable *table, - gint row, - gint column) +table_interface_get_row_extent_at (AtkTable *table, + gint row, + gint column) { gint index; gint width = 0, height = 0; AtkObject *child; - EaWeekViewMainItem* ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (table); + EaWeekViewMainItem * ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (table); index = ea_week_view_main_item_get_child_index_at (ea_main_item, row, column); @@ -826,13 +835,13 @@ table_interface_get_row_extent_at (AtkTable *table, static gboolean table_interface_is_row_selected (AtkTable *table, - gint row) + gint row) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; EWeekViewMainItem *main_item; EWeekView *week_view; - EaWeekViewMainItem* ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (table); + EaWeekViewMainItem * ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (table); atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item); g_obj = atk_gobject_accessible_get_object (atk_gobj); @@ -845,7 +854,7 @@ table_interface_is_row_selected (AtkTable *table, if (week_view->selection_start_day == -1) /* no selection */ return FALSE; - if ((row < 0)&&(row + 1 > week_view->weeks_shown )) + if ((row < 0) && (row + 1 > week_view->weeks_shown )) return FALSE; if (((week_view->selection_start_day < row * 7) && (week_view->selection_end_day < row * 7)) || @@ -858,8 +867,8 @@ table_interface_is_row_selected (AtkTable *table, static gboolean table_interface_is_selected (AtkTable *table, - gint row, - gint column) + gint row, + gint column) { return table_interface_is_row_selected (table, row) && table_interface_is_column_selected (table, column); @@ -867,13 +876,13 @@ table_interface_is_selected (AtkTable *table, static gboolean table_interface_is_column_selected (AtkTable *table, - gint column) + gint column) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; EWeekViewMainItem *main_item; EWeekView *week_view; - EaWeekViewMainItem* ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (table); + EaWeekViewMainItem * ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (table); atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item); g_obj = atk_gobject_accessible_get_object (atk_gobj); @@ -883,13 +892,13 @@ table_interface_is_column_selected (AtkTable *table, main_item = E_WEEK_VIEW_MAIN_ITEM (g_obj); week_view = e_week_view_main_item_get_week_view (main_item); - if ((column <0)||(column >6)) + if ((column <0) || (column >6)) return FALSE; else { gint i; - for (i=0;iweeks_shown;i++) - if ((column + i*7>= week_view->selection_start_day ) && - (column + i*7<= week_view->selection_end_day)) + for (i = 0; i < week_view->weeks_shown; i++) + if ((column + i *7>= week_view->selection_start_day ) && + (column + i *7<= week_view->selection_end_day)) return TRUE; return FALSE; } @@ -897,13 +906,13 @@ table_interface_is_column_selected (AtkTable *table, static gint table_interface_get_selected_rows (AtkTable *table, - gint **rows_selected) + gint **rows_selected) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; EWeekViewMainItem *main_item; EWeekView *week_view; - EaWeekViewMainItem* ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (table); + EaWeekViewMainItem * ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (table); gint start_row = -1, n_rows = 0; atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item); @@ -932,13 +941,13 @@ table_interface_get_selected_rows (AtkTable *table, static gint table_interface_get_selected_columns (AtkTable *table, - gint **columns_selected) + gint **columns_selected) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; EWeekViewMainItem *main_item; EWeekView *week_view; - EaWeekViewMainItem* ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (table); + EaWeekViewMainItem * ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (table); gint start_column = -1, n_columns = 0; atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item); @@ -970,13 +979,13 @@ table_interface_get_selected_columns (AtkTable *table, static gboolean table_interface_add_row_selection (AtkTable *table, - gint row) + gint row) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; EWeekViewMainItem *main_item; EWeekView *week_view; - EaWeekViewMainItem* ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (table); + EaWeekViewMainItem * ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (table); atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item); g_obj = atk_gobject_accessible_get_object (atk_gobj); @@ -997,20 +1006,20 @@ table_interface_add_row_selection (AtkTable *table, static gboolean table_interface_remove_row_selection (AtkTable *table, - gint row) + gint row) { return FALSE; } static gboolean table_interface_add_column_selection (AtkTable *table, - gint column) + gint column) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; EWeekViewMainItem *main_item; EWeekView *week_view; - EaWeekViewMainItem* ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (table); + EaWeekViewMainItem * ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (table); atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item); g_obj = atk_gobject_accessible_get_object (atk_gobj); @@ -1023,7 +1032,7 @@ table_interface_add_column_selection (AtkTable *table, /* FIXME: we need multi-selection */ week_view->selection_start_day = column; - week_view->selection_end_day = (week_view->weeks_shown - 1)*7+column; + week_view->selection_end_day = (week_view->weeks_shown - 1) * 7 + column; gtk_widget_queue_draw (week_view->main_canvas); return TRUE; @@ -1031,42 +1040,42 @@ table_interface_add_column_selection (AtkTable *table, static gboolean table_interface_remove_column_selection (AtkTable *table, - gint column) + gint column) { /* FIXME: NOT IMPLEMENTED */ return FALSE; } -static AtkObject* +static AtkObject * table_interface_get_row_header (AtkTable *table, - gint row) + gint row) { /* FIXME: NOT IMPLEMENTED */ return NULL; } -static AtkObject* +static AtkObject * table_interface_get_column_header (AtkTable *table, - gint in_col) + gint in_col) { /* FIXME: NOT IMPLEMENTED */ return NULL; } -static AtkObject* -table_interface_get_caption (AtkTable *table) +static AtkObject * +table_interface_get_caption (AtkTable *table) { /* FIXME: NOT IMPLEMENTED */ return NULL; } static const gchar * -table_interface_get_column_description (AtkTable *table, - gint in_col) +table_interface_get_column_description (AtkTable *table, + gint in_col) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; - EaWeekViewMainItem* ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (table); + EaWeekViewMainItem * ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (table); const gchar *description; EaCellTable *cell_data; @@ -1118,14 +1127,14 @@ table_interface_get_column_description (AtkTable *table, } static const gchar * -table_interface_get_row_description (AtkTable *table, - gint row) +table_interface_get_row_description (AtkTable *table, + gint row) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; EWeekViewMainItem *main_item; EWeekView *week_view; - EaWeekViewMainItem* ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (table); + EaWeekViewMainItem * ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (table); const gchar *description; EaCellTable *cell_data; @@ -1155,8 +1164,8 @@ table_interface_get_row_description (AtkTable *table, return description; } -static AtkObject* -table_interface_get_summary (AtkTable *table) +static AtkObject * +table_interface_get_summary (AtkTable *table) { /* FIXME: NOT IMPLEMENTED */ return NULL; @@ -1177,13 +1186,14 @@ atk_selection_interface_init (AtkSelectionIface *iface) } static gboolean -selection_interface_add_selection (AtkSelection *selection, gint i) +selection_interface_add_selection (AtkSelection *selection, + gint i) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; EWeekViewMainItem *main_item; EWeekView *week_view; - EaWeekViewMainItem* ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (selection); + EaWeekViewMainItem * ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (selection); atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item); g_obj = atk_gobject_accessible_get_object (atk_gobj); @@ -1211,7 +1221,7 @@ selection_interface_clear_selection (AtkSelection *selection) GObject *g_obj; EWeekViewMainItem *main_item; EWeekView *week_view; - EaWeekViewMainItem* ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (selection); + EaWeekViewMainItem * ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (selection); atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item); g_obj = atk_gobject_accessible_get_object (atk_gobj); @@ -1229,14 +1239,15 @@ selection_interface_clear_selection (AtkSelection *selection) return TRUE; } -static AtkObject* -selection_interface_ref_selection (AtkSelection *selection, gint i) +static AtkObject * +selection_interface_ref_selection (AtkSelection *selection, + gint i) { gint count; GObject *g_obj; EWeekViewMainItem *main_item; EWeekView *week_view; - EaWeekViewMainItem* ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (selection); + EaWeekViewMainItem * ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (selection); gint start_index; count = selection_interface_get_selection_count (selection); @@ -1262,7 +1273,7 @@ selection_interface_get_selection_count (AtkSelection *selection) GObject *g_obj; EWeekViewMainItem *main_item; EWeekView *week_view; - EaWeekViewMainItem* ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (selection); + EaWeekViewMainItem * ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (selection); atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item); g_obj = atk_gobject_accessible_get_object (atk_gobj); @@ -1280,13 +1291,14 @@ selection_interface_get_selection_count (AtkSelection *selection) } static gboolean -selection_interface_is_child_selected (AtkSelection *selection, gint i) +selection_interface_is_child_selected (AtkSelection *selection, + gint i) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; EWeekViewMainItem *main_item; EWeekView *week_view; - EaWeekViewMainItem* ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (selection); + EaWeekViewMainItem * ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (selection); atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item); g_obj = atk_gobject_accessible_get_object (atk_gobj); @@ -1296,7 +1308,7 @@ selection_interface_is_child_selected (AtkSelection *selection, gint i) main_item = E_WEEK_VIEW_MAIN_ITEM (g_obj); week_view = e_week_view_main_item_get_week_view (main_item); - if ((week_view->selection_start_day <= i)&&(week_view->selection_end_day >= i)) + if ((week_view->selection_start_day <= i) && (week_view->selection_end_day >= i)) return TRUE; else return FALSE; diff --git a/calendar/gui/ea-week-view-main-item.h b/calendar/gui/ea-week-view-main-item.h index d9110160c4..f8598c9a1f 100644 --- a/calendar/gui/ea-week-view-main-item.h +++ b/calendar/gui/ea-week-view-main-item.h @@ -52,7 +52,7 @@ struct _EaWeekViewMainItemClass AtkGObjectAccessibleClass parent_class; }; -AtkObject* ea_week_view_main_item_new (GObject *obj); +AtkObject * ea_week_view_main_item_new (GObject *obj); G_END_DECLS diff --git a/calendar/gui/ea-week-view.c b/calendar/gui/ea-week-view.c index c431f2ce14..15fe1cb09f 100644 --- a/calendar/gui/ea-week-view.c +++ b/calendar/gui/ea-week-view.c @@ -36,7 +36,7 @@ static void ea_week_view_class_init (EaWeekViewClass *klass); static const gchar * ea_week_view_get_name (AtkObject *accessible); static const gchar * ea_week_view_get_description (AtkObject *accessible); static gint ea_week_view_get_n_children (AtkObject *obj); -static AtkObject* ea_week_view_ref_child (AtkObject *obj, +static AtkObject * ea_week_view_ref_child (AtkObject *obj, gint i); static gpointer parent_class = NULL; @@ -101,7 +101,7 @@ ea_week_view_class_init (EaWeekViewClass *klass) class->ref_child = ea_week_view_ref_child; } -AtkObject* +AtkObject * ea_week_view_new (GtkWidget *widget) { GObject *object; @@ -256,7 +256,8 @@ ea_week_view_get_n_children (AtkObject *accessible) } static AtkObject * -ea_week_view_ref_child (AtkObject *accessible, gint index) +ea_week_view_ref_child (AtkObject *accessible, + gint index) { EWeekView *week_view; gint child_num, max_count; diff --git a/calendar/gui/ea-week-view.h b/calendar/gui/ea-week-view.h index 09409ec4cf..d6184f08c4 100644 --- a/calendar/gui/ea-week-view.h +++ b/calendar/gui/ea-week-view.h @@ -51,7 +51,7 @@ struct _EaWeekViewClass EaCalViewClass parent_class; }; -AtkObject* ea_week_view_new (GtkWidget *widget); +AtkObject * ea_week_view_new (GtkWidget *widget); G_END_DECLS diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index aca2d05068..cf1a12deab 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -99,8 +99,8 @@ struct _GnomeCalendarPrivate { guint update_marcus_bains_line_timeout; /* This is the view currently shown. We use it to keep track of the - positions of the panes. range_selected is TRUE if a range of dates - was selected in the date navigator to show the view. */ + * positions of the panes. range_selected is TRUE if a range of dates + * was selected in the date navigator to show the view. */ ECalendarView *views[GNOME_CAL_LAST_VIEW]; GnomeCalendarViewType current_view_type; GList *notifications; @@ -108,8 +108,8 @@ struct _GnomeCalendarPrivate { gboolean range_selected; /* These are the saved positions of the panes. They are multiples of - calendar month widths & heights in the date navigator, so that they - will work OK after theme changes. */ + * calendar month widths & heights in the date navigator, so that they + * will work OK after theme changes. */ gint hpane_pos; gint hpane_pos_month_view; @@ -117,8 +117,8 @@ struct _GnomeCalendarPrivate { guint day_selected_id; /* The dates currently shown. If they are -1 then we have no dates - shown. We only use these to check if we need to emit a - 'dates-shown-changed' signal.*/ + * shown. We only use these to check if we need to emit a + * 'dates-shown-changed' signal.*/ time_t visible_start; time_t visible_end; gboolean updating; @@ -204,7 +204,9 @@ message_push (Message *msg) G_DEFINE_TYPE (GnomeCalendar, gnome_calendar, G_TYPE_OBJECT) static void -gcal_update_status_message (GnomeCalendar *gcal, const gchar *message, gdouble percent) +gcal_update_status_message (GnomeCalendar *gcal, + const gchar *message, + gdouble percent) { ECalModel *model; @@ -301,9 +303,9 @@ view_progress_cb (ECalModel *model, static void view_complete_cb (ECalModel *model, - const GError *error, - ECalClientSourceType type, - GnomeCalendar *gcal) + const GError *error, + ECalClientSourceType type, + GnomeCalendar *gcal) { gcal_update_status_message (gcal, NULL, -1); } @@ -878,7 +880,7 @@ get_times_for_views (GnomeCalendar *gcal, time_to_gdate_with_zone (&date, *start_time, timezone); /* The start of the work-week is the first working day after the - week start day. */ + * week start day. */ /* Get the weekday corresponding to start_time, 0 (Sun) to 6 (Sat). */ weekday = g_date_get_weekday (&date) % 7; @@ -902,7 +904,7 @@ get_times_for_views (GnomeCalendar *gcal, last_day = (last_day + 6) % 7; } /* Now calculate the days we need to show to include all the - working days in the week. Add 1 to make it inclusive. */ + * working days in the week. Add 1 to make it inclusive. */ days_shown = (last_day + 7 - first_day) % 7 + 1; } else { /* If no working days are set, just use 7. */ @@ -974,7 +976,9 @@ get_times_for_views (GnomeCalendar *gcal, /* Computes the range of time that the date navigator is showing */ static void -get_date_navigator_range (GnomeCalendar *gcal, time_t *start_time, time_t *end_time) +get_date_navigator_range (GnomeCalendar *gcal, + time_t *start_time, + time_t *end_time) { ECalModel *model; gint start_year, start_month, start_day; @@ -1014,7 +1018,8 @@ get_date_navigator_range (GnomeCalendar *gcal, time_t *start_time, time_t *end_t /* Adjusts a given query sexp with the time range of the date navigator */ static gchar * -adjust_client_view_sexp (GnomeCalendar *gcal, const gchar *sexp) +adjust_client_view_sexp (GnomeCalendar *gcal, + const gchar *sexp) { time_t start_time, end_time; gchar *start, *end; @@ -1550,7 +1555,7 @@ notify_selected_time_changed (GnomeCalendar *gcal) static void gnome_calendar_goto_date (GnomeCalendar *gcal, - GnomeCalendarGotoDateType goto_date) + GnomeCalendarGotoDateType goto_date) { ECalModel *model; time_t new_time = 0; @@ -1566,7 +1571,7 @@ gnome_calendar_goto_date (GnomeCalendar *gcal, switch (goto_date) { /* GNOME_CAL_GOTO_TODAY and GNOME_CAL_GOTO_DATE are - currently not used + * currently not used */ case GNOME_CAL_GOTO_TODAY: break; @@ -1625,7 +1630,8 @@ gnome_calendar_goto_date (GnomeCalendar *gcal, } void -gnome_calendar_goto (GnomeCalendar *gcal, time_t new_time) +gnome_calendar_goto (GnomeCalendar *gcal, + time_t new_time) { GnomeCalendarPrivate *priv; gint i; @@ -1676,7 +1682,8 @@ gnome_calendar_update_view_times (GnomeCalendar *gcal, } static void -gnome_calendar_direction (GnomeCalendar *gcal, gint direction) +gnome_calendar_direction (GnomeCalendar *gcal, + gint direction) { ECalModel *model; icaltimezone *timezone; @@ -1724,7 +1731,8 @@ gnome_calendar_previous (GnomeCalendar *gcal) } void -gnome_calendar_dayjump (GnomeCalendar *gcal, time_t time) +gnome_calendar_dayjump (GnomeCalendar *gcal, + time_t time) { ECalModel *model; icaltimezone *timezone; @@ -1866,16 +1874,18 @@ gnome_calendar_display_view (GnomeCalendar *gcal, gnome_calendar_set_range_selected (gcal, range_selected); /* For the week & month views we want the selection in the date - navigator to be rounded to the nearest week when the arrow buttons - are pressed to move to the previous/next month. */ + * navigator to be rounded to the nearest week when the arrow buttons + * are pressed to move to the previous/next month. */ g_object_set ( gcal->priv->date_navigator->calitem, "preserve_day_when_moving", preserve_day, NULL); /* keep week days selected as before for a work week view */ - g_object_set (G_OBJECT (gcal->priv->date_navigator->calitem), - "keep_wdays_on_weeknum_click", view_type == GNOME_CAL_WORK_WEEK_VIEW, - NULL); + g_object_set ( + gcal->priv->date_navigator->calitem, + "keep_wdays_on_weeknum_click", + view_type == GNOME_CAL_WORK_WEEK_VIEW, + NULL); if (!gcal->priv->base_view_time) start_time = time (NULL); @@ -1931,7 +1941,8 @@ gnome_calendar_get_memo_table (GnomeCalendar *gcal) } void -gnome_calendar_set_memo_table (GnomeCalendar *gcal, GtkWidget *memo_table) +gnome_calendar_set_memo_table (GnomeCalendar *gcal, + GtkWidget *memo_table) { g_return_if_fail (GNOME_IS_CALENDAR (gcal)); @@ -1957,7 +1968,8 @@ gnome_calendar_get_task_table (GnomeCalendar *gcal) } void -gnome_calendar_set_task_table (GnomeCalendar *gcal, GtkWidget *task_table) +gnome_calendar_set_task_table (GnomeCalendar *gcal, + GtkWidget *task_table) { g_return_if_fail (GNOME_IS_CALENDAR (gcal)); @@ -2009,7 +2021,7 @@ gnome_calendar_set_range_selected (GnomeCalendar *gcal, void gnome_calendar_set_selected_time_range (GnomeCalendar *gcal, - time_t start_time) + time_t start_time) { gnome_calendar_update_view_times (gcal, start_time); gnome_calendar_update_date_navigator (gcal); @@ -2026,7 +2038,9 @@ gnome_calendar_set_selected_time_range (GnomeCalendar *gcal, **/ #if 0 /* KILL-BONOBO */ void -gnome_calendar_new_task (GnomeCalendar *gcal, time_t *dtstart, time_t *dtend) +gnome_calendar_new_task (GnomeCalendar *gcal, + time_t *dtstart, + time_t *dtend) { GnomeCalendarPrivate *priv; ECal *ecal; @@ -2080,12 +2094,12 @@ gnome_calendar_new_task (GnomeCalendar *gcal, time_t *dtstart, time_t *dtend) #endif /* Returns the selected time range for the current view. Note that this may be - different from the fields in the GnomeCalendar, since the view may clip - this or choose a more appropriate time. */ + * different from the fields in the GnomeCalendar, since the view may clip + * this or choose a more appropriate time. */ void gnome_calendar_get_current_time_range (GnomeCalendar *gcal, - time_t *start_time, - time_t *end_time) + time_t *start_time, + time_t *end_time) { GnomeCalendarViewType view_type; ECalendarView *view; @@ -2097,7 +2111,7 @@ gnome_calendar_get_current_time_range (GnomeCalendar *gcal, } /* This updates the month shown and the days selected in the calendar, if - necessary. */ + * necessary. */ static void gnome_calendar_update_date_navigator (GnomeCalendar *gcal) { @@ -2165,8 +2179,8 @@ gnome_calendar_notify_dates_shown_changed (GnomeCalendar *gcal) return; /* We check if the visible date range has changed, and only emit the - signal if it has. (This makes sure we only change the folder title - bar label in the shell when we need to.) */ + * signal if it has. (This makes sure we only change the folder title + * bar label in the shell when we need to.) */ if (priv->visible_start != start_time || priv->visible_end != end_time) { priv->visible_start = start_time; @@ -2206,9 +2220,9 @@ struct purge_data { static gboolean check_instance_cb (ECalComponent *comp, - time_t instance_start, - time_t instance_end, - gpointer data) + time_t instance_start, + time_t instance_end, + gpointer data) { struct purge_data *pd = data; @@ -2219,7 +2233,8 @@ check_instance_cb (ECalComponent *comp, } void -gnome_calendar_purge (GnomeCalendar *gcal, time_t older_than) +gnome_calendar_purge (GnomeCalendar *gcal, + time_t older_than) { gchar *sexp, *start, *end; GList *clients, *l; diff --git a/calendar/gui/gnome-cal.h b/calendar/gui/gnome-cal.h index 58130399f4..bc65fe2316 100644 --- a/calendar/gui/gnome-cal.h +++ b/calendar/gui/gnome-cal.h @@ -166,8 +166,8 @@ void gnome_calendar_new_task (GnomeCalendar *gcal, time_t *dtend); /* Returns the selected time range for the current view. Note that this may be - different from the fields in the GnomeCalendar, since the view may clip - this or choose a more appropriate time. */ + * different from the fields in the GnomeCalendar, since the view may clip + * this or choose a more appropriate time. */ void gnome_calendar_get_current_time_range (GnomeCalendar *gcal, time_t *start_time, diff --git a/calendar/gui/itip-utils.c b/calendar/gui/itip-utils.c index 19f01614c6..c2fa19ba68 100644 --- a/calendar/gui/itip-utils.c +++ b/calendar/gui/itip-utils.c @@ -397,7 +397,8 @@ typedef struct { } ItipUtilTZData; static void -foreach_tzid_callback (icalparameter *param, gpointer data) +foreach_tzid_callback (icalparameter *param, + gpointer data) { ItipUtilTZData *tz_data = data; const gchar *tzid; @@ -1057,7 +1058,8 @@ comp_limit_attendees (ECalComponent *comp) } static void -comp_sentby (ECalComponent *comp, ECalClient *cal_client) +comp_sentby (ECalComponent *comp, + ECalClient *cal_client) { ECalComponentOrganizer organizer; GSList * attendees, *l; @@ -1109,7 +1111,8 @@ comp_sentby (ECalComponent *comp, ECalClient *cal_client) } } static ECalComponent * -comp_minimal (ECalComponent *comp, gboolean attendee) +comp_minimal (ECalComponent *comp, + gboolean attendee) { ECalComponent *clone; icalcomponent *icomp, *icomp_clone; @@ -1827,15 +1830,16 @@ itip_publish_begin (ECalComponent *pub_comp, } static void -fb_sort (struct icalperiodtype *ipt, gint fb_count) +fb_sort (struct icalperiodtype *ipt, + gint fb_count) { gint i,j; if (ipt == NULL || fb_count == 0) return; - for (i = 0; i < fb_count-1; i++) { - for (j = i+1; j < fb_count; j++) { + for (i = 0; i < fb_count - 1; i++) { + for (j = i + 1; j < fb_count; j++) { struct icalperiodtype temp; if (icaltime_compare (ipt[i].start, ipt[j].start) < 0) @@ -1880,7 +1884,7 @@ comp_fb_normalize (icalcomponent *icomp) fb_count = icalcomponent_count_properties (icomp, ICAL_FREEBUSY_PROPERTY); - ipt = g_new0 (struct icalperiodtype, fb_count+1); + ipt = g_new0 (struct icalperiodtype, fb_count + 1); for (prop = icalcomponent_get_first_property (icomp, ICAL_FREEBUSY_PROPERTY); @@ -1894,7 +1898,7 @@ comp_fb_normalize (icalcomponent *icomp) fb_sort (ipt, fb_count); - for (j = 0; j <= fb_count-1; j++) { + for (j = 0; j <= fb_count - 1; j++) { icalparameter *param; prop = icalproperty_new_freebusy (ipt[j]); diff --git a/calendar/gui/misc.c b/calendar/gui/misc.c index 29de491df8..f3bacef89b 100644 --- a/calendar/gui/misc.c +++ b/calendar/gui/misc.c @@ -86,7 +86,8 @@ get_uri_without_password (const gchar *full_uri) } gint -get_position_in_array (GPtrArray *objects, gpointer item) +get_position_in_array (GPtrArray *objects, + gpointer item) { gint i; @@ -99,7 +100,8 @@ get_position_in_array (GPtrArray *objects, gpointer item) } gchar * -calculate_time (time_t start, time_t end) +calculate_time (time_t start, + time_t end) { time_t difference = end - start; gchar *str; diff --git a/calendar/gui/print.c b/calendar/gui/print.c index 2c17b05c86..6d37168fc1 100644 --- a/calendar/gui/print.c +++ b/calendar/gui/print.c @@ -68,10 +68,10 @@ struct PrintCalItem { time_t start; }; -static double +static gdouble evo_calendar_print_renderer_get_width (GtkPrintContext *context, - PangoFontDescription *font, - const gchar *text) + PangoFontDescription *font, + const gchar *text) { PangoLayout *layout; gint layout_width, layout_height; @@ -90,8 +90,8 @@ evo_calendar_print_renderer_get_width (GtkPrintContext *context, static gdouble evo_calendar_print_renderer_get_height (GtkPrintContext *context, - PangoFontDescription *font, - const gchar *text) + PangoFontDescription *font, + const gchar *text) { PangoLayout *layout; gint layout_width, layout_height; @@ -108,7 +108,7 @@ evo_calendar_print_renderer_get_height (GtkPrintContext *context, return pango_units_to_double (layout_height); } -static double +static gdouble get_font_size (PangoFontDescription *font) { g_return_val_if_fail (font, 0.0); @@ -139,17 +139,17 @@ get_font_size (PangoFontDescription *font) #define MONTH_NORMAL_FONT_SIZE 8 /* The height of the header bar across the top of the Day, Week & Month views, - which contains the dates shown and the 2 small calendar months. */ + * which contains the dates shown and the 2 small calendar months. */ #define HEADER_HEIGHT 80 /* The width of the small calendar months, the space from the right edge of - the header rectangle, and the space between the months. */ + * the header rectangle, and the space between the months. */ #define MIN_SMALL_MONTH_WIDTH 100 #define SMALL_MONTH_PAD 5 #define SMALL_MONTH_SPACING 20 /* The minimum number of rows we leave space for for the long events in the - day view. */ + * day view. */ #define DAY_VIEW_MIN_ROWS_IN_TOP_DISPLAY 2 /* The row height for long events in the day view. */ @@ -170,7 +170,7 @@ get_font_size (PangoFontDescription *font) #define EPSILON 0.01 /* The weird month of September 1752, where 3 Sep through 13 Sep were - eliminated due to the Gregorian reformation. */ + * eliminated due to the Gregorian reformation. */ static const gint sept_1752[42] = { 0, 0, 1, 2, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, @@ -222,7 +222,7 @@ struct psinfo }; /* Convenience function to help the transition to timezone functions. - It converts a time_t to a struct tm. */ + * It converts a time_t to a struct tm. */ static void convert_timet_to_struct_tm (time_t time, icaltimezone *zone, @@ -282,7 +282,7 @@ build_month (ECalModel *model, d_week = time_day_of_week (1, month, year); /* Get the configuration setting specifying which weekday we put on - the left column, 0=Sun to 6=Sat. */ + * the left column, 0=Sun to 6=Sat. */ week_start_day = e_cal_model_get_week_start_day (model); /* Figure out which square we want to put the 1 in. */ @@ -299,7 +299,8 @@ build_month (ECalModel *model, } static PangoFontDescription * -get_font_for_size (double height, PangoWeight weight) +get_font_for_size (gdouble height, + PangoWeight weight) { PangoFontDescription *desc; gint size; @@ -316,19 +317,23 @@ get_font_for_size (double height, PangoWeight weight) } /* Prints a rectangle, with or without a border, filled or outline, and - possibly with triangular arrows at one or both horizontal edges. - width = width of border, -ve means no border. - red,green,blue = bgcolor to fill, -ve means no fill. - left_triangle_width, right_triangle_width = width from edge of rectangle to - point of triangle, or -ve for no triangle. */ + * possibly with triangular arrows at one or both horizontal edges. + * width = width of border, -ve means no border. + * red,green,blue = bgcolor to fill, -ve means no fill. + * left_triangle_width, right_triangle_width = width from edge of rectangle to + * point of triangle, or -ve for no triangle. */ static void print_border_with_triangles (GtkPrintContext *pc, - gdouble x1, gdouble x2, - gdouble y1, gdouble y2, - gdouble line_width, - gdouble red, gdouble green, gdouble blue, - gdouble left_triangle_width, - gdouble right_triangle_width) + gdouble x1, + gdouble x2, + gdouble y1, + gdouble y2, + gdouble line_width, + gdouble red, + gdouble green, + gdouble blue, + gdouble left_triangle_width, + gdouble right_triangle_width) { cairo_t *cr = gtk_print_context_get_cairo_context (pc); @@ -385,14 +390,18 @@ print_border_with_triangles (GtkPrintContext *pc, } /* Prints a rectangle, with or without a border, and filled or outline. - width = width of border, -ve means no border. - fillcolor = shade of fill, -ve means no fill. */ + * width = width of border, -ve means no border. + * fillcolor = shade of fill, -ve means no fill. */ static void print_border_rgb (GtkPrintContext *pc, - gdouble x1, gdouble x2, - gdouble y1, gdouble y2, - gdouble line_width, - gdouble red, gdouble green, gdouble blue) + gdouble x1, + gdouble x2, + gdouble y1, + gdouble y2, + gdouble line_width, + gdouble red, + gdouble green, + gdouble blue) { print_border_with_triangles ( pc, x1, x2, y1, y2, line_width, @@ -401,10 +410,12 @@ print_border_rgb (GtkPrintContext *pc, static void print_border (GtkPrintContext *pc, - gdouble x1, gdouble x2, - gdouble y1, gdouble y2, - gdouble line_width, - gdouble fillcolor) + gdouble x1, + gdouble x2, + gdouble y1, + gdouble y2, + gdouble line_width, + gdouble fillcolor) { print_border_rgb ( pc, x1, x2, y1, y2, line_width, @@ -413,9 +424,13 @@ print_border (GtkPrintContext *pc, static void print_rectangle (GtkPrintContext *context, - gdouble x, gdouble y, - gdouble width, gdouble height, - gdouble red, gdouble green, gdouble blue) + gdouble x, + gdouble y, + gdouble width, + gdouble height, + gdouble red, + gdouble green, + gdouble blue) { cairo_t *cr = gtk_print_context_get_cairo_context (context); @@ -429,12 +444,17 @@ print_rectangle (GtkPrintContext *context, } /* Prints 1 line of aligned text in a box. It is centered vertically, and - the horizontal alignment can be either PANGO_ALIGN_LEFT, PANGO_ALIGN_RIGHT, - or PANGO_ALIGN_CENTER. */ -static double -print_text (GtkPrintContext *context, PangoFontDescription *desc, - const gchar *text, PangoAlignment alignment, - gdouble x1, gdouble x2, gdouble y1, gdouble y2) + * the horizontal alignment can be either PANGO_ALIGN_LEFT, PANGO_ALIGN_RIGHT, + * or PANGO_ALIGN_CENTER. */ +static gdouble +print_text (GtkPrintContext *context, + PangoFontDescription *desc, + const gchar *text, + PangoAlignment alignment, + gdouble x1, + gdouble x2, + gdouble y1, + gdouble y2) { PangoLayout *layout; gint layout_width, layout_height; @@ -475,10 +495,14 @@ print_text (GtkPrintContext *context, PangoFontDescription *desc, } /* gets/frees the font for you, as a normal font */ -static double -print_text_size (GtkPrintContext *context, const gchar *text, - PangoAlignment alignment, gdouble x1, gdouble x2, - gdouble y1, gdouble y2) +static gdouble +print_text_size (GtkPrintContext *context, + const gchar *text, + PangoAlignment alignment, + gdouble x1, + gdouble x2, + gdouble y1, + gdouble y2) { PangoFontDescription *font; gdouble w; @@ -491,10 +515,14 @@ print_text_size (GtkPrintContext *context, const gchar *text, } /* gets/frees the font for you, as a bold font */ -static double -print_text_size_bold (GtkPrintContext *context, const gchar *text, - PangoAlignment alignment, gdouble x1, gdouble x2, - gdouble y1, gdouble y2) +static gdouble +print_text_size_bold (GtkPrintContext *context, + const gchar *text, + PangoAlignment alignment, + gdouble x1, + gdouble x2, + gdouble y1, + gdouble y2) { PangoFontDescription *font; gdouble w; @@ -507,10 +535,15 @@ print_text_size_bold (GtkPrintContext *context, const gchar *text, } static void -titled_box (GtkPrintContext *context, const gchar *text, - PangoFontDescription *font, PangoAlignment alignment, - gdouble *x1, gdouble *y1, gdouble *x2, gdouble *y2, - gdouble linewidth) +titled_box (GtkPrintContext *context, + const gchar *text, + PangoFontDescription *font, + PangoAlignment alignment, + gdouble *x1, + gdouble *y1, + gdouble *x2, + gdouble *y2, + gdouble linewidth) { gdouble size; @@ -572,17 +605,17 @@ format_date (struct tm *tm, if (flags & DATE_DAY) { if (flags & DATE_DAYNAME) strcat(fmt, " "); - strcat (fmt, gettext (days[tm->tm_mday-1])); + strcat (fmt, gettext (days[tm->tm_mday - 1])); } if (flags & DATE_MONTH) { - if (flags & (DATE_DAY|DATE_DAYNAME)) + if (flags & (DATE_DAY | DATE_DAYNAME)) strcat(fmt, " "); strcat(fmt, "%B"); - if ((flags & (DATE_DAY|DATE_YEAR)) == (DATE_DAY|DATE_YEAR)) + if ((flags & (DATE_DAY | DATE_YEAR)) == (DATE_DAY | DATE_YEAR)) strcat(fmt, ","); } if (flags & DATE_YEAR) { - if (flags & (DATE_DAY|DATE_DAYNAME|DATE_MONTH)) + if (flags & (DATE_DAY | DATE_DAYNAME | DATE_MONTH)) strcat(fmt, " "); strcat(fmt, "%Y"); } @@ -612,7 +645,8 @@ const gchar *daynames[] = N_("Th"), N_("Fr"), N_("Sa") }; static gdouble -calc_small_month_width (GtkPrintContext *context, gdouble for_height) +calc_small_month_width (GtkPrintContext *context, + gdouble for_height) { PangoFontDescription *font_bold; @@ -643,10 +677,17 @@ calc_small_month_width (GtkPrintContext *context, gdouble for_height) print out the month small, embolden any days with events. */ static void -print_month_small (GtkPrintContext *context, GnomeCalendar *gcal, time_t month, - gdouble x1, gdouble y1, gdouble x2, gdouble y2, - gint titleflags, time_t greystart, time_t greyend, - gint bordertitle) +print_month_small (GtkPrintContext *context, + GnomeCalendar *gcal, + time_t month, + gdouble x1, + gdouble y1, + gdouble x2, + gdouble y2, + gint titleflags, + time_t greystart, + time_t greyend, + gint bordertitle) { icaltimezone *zone; PangoFontDescription *font, *font_bold, *font_normal; @@ -685,11 +726,11 @@ print_month_small (GtkPrintContext *context, GnomeCalendar *gcal, time_t month, col_width = (x2 - x1) / (7 + (week_numbers ? 1 : 0)); /* The top row with the day abbreviations gets an extra bit of - vertical space around it. */ + * vertical space around it. */ row_height = ABS (y2 - y1) / 7.4; /* First we need to calculate a reasonable font size. We start with a - rough guess of just under the height of each row. */ + * rough guess of just under the height of each row. */ font_size = row_height; /* get month days */ @@ -700,8 +741,8 @@ print_month_small (GtkPrintContext *context, GnomeCalendar *gcal, time_t month, font_bold = get_font_for_size (font_size, PANGO_WEIGHT_BOLD); /* Get a reasonable estimate of the largest number we will need, - and use it to calculate the offset from the right edge of the - cell that we should put the numbers. */ + * and use it to calculate the offset from the right edge of the + * cell that we should put the numbers. */ w = evo_calendar_print_renderer_get_width (context, font_bold, "23"); text_xpad = (col_width - w) / 2; @@ -732,9 +773,9 @@ print_month_small (GtkPrintContext *context, GnomeCalendar *gcal, time_t month, if (week_numbers) { cell_left = x1; /* We add a 0.05 to make sure the cells meet up with - each other. Otherwise you sometimes get lines - between them which looks bad. Maybe I'm not using - coords in the way gnome-print expects. */ + * each other. Otherwise you sometimes get lines + * between them which looks bad. Maybe I'm not using + * coords in the way gnome-print expects. */ cell_right = cell_left + col_width + 0.05; text_right = cell_right - text_xpad; @@ -774,9 +815,9 @@ print_month_small (GtkPrintContext *context, GnomeCalendar *gcal, time_t month, cell_left = x1 + (x + (week_numbers ? 1 : 0)) * col_width; /* We add a 0.05 to make sure the cells meet up with - each other. Otherwise you sometimes get lines - between them which looks bad. Maybe I'm not using - coords in the way gnome-print expects. */ + * each other. Otherwise you sometimes get lines + * between them which looks bad. Maybe I'm not using + * coords in the way gnome-print expects. */ cell_right = cell_left + col_width + 0.05; text_right = cell_right - text_xpad; @@ -813,13 +854,18 @@ print_month_small (GtkPrintContext *context, GnomeCalendar *gcal, time_t month, } /* wraps text into the print context, not taking up more than its allowed space */ -static double +static gdouble bound_text (GtkPrintContext *context, PangoFontDescription *font, - const gchar *text, gint len, - gdouble x1, gdouble y1, - gdouble x2, gdouble y2, - gboolean can_wrap, gdouble *last_page_start, gint *pages) + const gchar *text, + gint len, + gdouble x1, + gdouble y1, + gdouble x2, + gdouble y2, + gboolean can_wrap, + gdouble *last_page_start, + gint *pages) { PangoLayout *layout; gint layout_width, layout_height; @@ -871,9 +917,14 @@ bound_text (GtkPrintContext *context, /* Draw the borders, lines, and times down the left of the day view. */ static void -print_day_background (GtkPrintContext *context, GnomeCalendar *gcal, - time_t whence, struct pdinfo *pdi, - double left, double right, double top, double bottom) +print_day_background (GtkPrintContext *context, + GnomeCalendar *gcal, + time_t whence, + struct pdinfo *pdi, + gdouble left, + gdouble right, + gdouble top, + gdouble bottom) { ECalModel *model; PangoFontDescription *font_hour, *font_minute; @@ -969,7 +1020,7 @@ print_day_background (GtkPrintContext *context, GnomeCalendar *gcal, cairo_stroke (cr); /* Draw the horizontal line for the 1/2-hours, across the - entire width except for part of the time column. */ + * entire width except for part of the time column. */ cairo_move_to (cr, left + width * 0.6, y - yinc / 2); cairo_line_to (cr, right, y - yinc / 2); cairo_set_line_width (cr, 1); @@ -984,13 +1035,13 @@ print_day_background (GtkPrintContext *context, GnomeCalendar *gcal, /* This adds one event to the view, adding it to the appropriate array. */ static gint print_day_add_event (ECalModelComponent *comp_data, - time_t start, - time_t end, - icaltimezone *zone, - gint days_shown, - time_t *day_starts, - GArray *long_events, - GArray **events) + time_t start, + time_t end, + icaltimezone *zone, + gint days_shown, + time_t *day_starts, + GArray *long_events, + GArray **events) { EDayViewEvent event; @@ -1018,7 +1069,7 @@ print_day_add_event (ECalModelComponent *comp_data, event.canvas_item = NULL; /* Calculate the start & end minute, relative to the top of the - display. */ + * display. */ /*offset = day_view->first_hour_shown * 60 + day_view->first_minute_shown;*/ offset = 0; @@ -1033,12 +1084,12 @@ print_day_add_event (ECalModelComponent *comp_data, if (start >= day_starts[day] && end <= day_starts[day + 1]) { /* Special case for when the appointment ends at - midnight, i.e. the start of the next day. */ + * midnight, i.e. the start of the next day. */ if (end == day_starts[day + 1]) { /* If the event last the entire day, then we - skip it here so it gets added to the top - canvas. */ + * skip it here so it gets added to the top + * canvas. */ if (start == day_starts[day]) break; @@ -1050,14 +1101,16 @@ print_day_add_event (ECalModelComponent *comp_data, } /* The event wasn't within one day so it must be a long event, - i.e. shown in the top canvas. */ + * i.e. shown in the top canvas. */ g_array_append_val (long_events, event); return E_DAY_VIEW_LONG_EVENT; } static gboolean -print_day_details_cb (ECalComponent *comp, time_t istart, time_t iend, - gpointer data) +print_day_details_cb (ECalComponent *comp, + time_t istart, + time_t iend, + gpointer data) { ECalModelGenerateInstancesData *mdata = (ECalModelGenerateInstancesData *) data; struct pdinfo *pdi = (struct pdinfo *) mdata->cb_data; @@ -1118,10 +1171,17 @@ get_role_as_string (icalparameter_role role) return res; } -static double -print_attendees (GtkPrintContext *context, PangoFontDescription *font, cairo_t *cr, - double left, double right, double top, double bottom, - ECalComponent *comp, gint page_nr, gint *pages) +static gdouble +print_attendees (GtkPrintContext *context, + PangoFontDescription *font, + cairo_t *cr, + gdouble left, + gdouble right, + gdouble top, + gdouble bottom, + ECalComponent *comp, + gint page_nr, + gint *pages) { GSList *attendees = NULL, *l; @@ -1222,13 +1282,13 @@ print_day_long_event (GtkPrintContext *context, return; /* If the event starts before the first day being printed, draw a - triangle. (Note that I am assuming we are just showing 1 day at - the moment.) */ + * triangle. (Note that I am assuming we are just showing 1 day at + * the moment.) */ if (event->start < pdi->day_starts[0]) left_triangle_width = 4; /* If the event ends after the last day being printed, draw a - triangle. */ + * triangle. */ if (event->end > pdi->day_starts[1]) right_triangle_width = 4; @@ -1244,7 +1304,7 @@ print_day_long_event (GtkPrintContext *context, right_triangle_width); /* If the event starts after the first day being printed, we need to - print the start time. */ + * print the start time. */ if (event->start > pdi->day_starts[0]) { date_tm.tm_year = 2001; date_tm.tm_mon = 0; @@ -1262,7 +1322,7 @@ print_day_long_event (GtkPrintContext *context, } /* If the event ends before the end of the last day being printed, - we need to print the end time. */ + * we need to print the end time. */ if (event->end < pdi->day_starts[1]) { date_tm.tm_year = 2001; date_tm.tm_mon = 0; @@ -1290,9 +1350,15 @@ print_day_long_event (GtkPrintContext *context, } static void -print_day_event (GtkPrintContext *context, PangoFontDescription *font, - double left, double right, double top, double bottom, - EDayViewEvent *event, struct pdinfo *pdi, ECalModel *model) +print_day_event (GtkPrintContext *context, + PangoFontDescription *font, + gdouble left, + gdouble right, + gdouble top, + gdouble bottom, + EDayViewEvent *event, + struct pdinfo *pdi, + ECalModel *model) { gdouble x1, x2, y1, y2, col_width, row_height; gint start_offset, end_offset, start_row, end_row; @@ -1373,8 +1439,13 @@ print_day_event (GtkPrintContext *context, PangoFontDescription *font, } static void -print_day_details (GtkPrintContext *context, GnomeCalendar *gcal, time_t whence, - double left, double right, double top, double bottom) +print_day_details (GtkPrintContext *context, + GnomeCalendar *gcal, + time_t whence, + gdouble left, + gdouble right, + gdouble top, + gdouble bottom) { ECalModel *model; icaltimezone *zone; @@ -1448,12 +1519,12 @@ print_day_details (GtkPrintContext *context, GnomeCalendar *gcal, time_t whence, font = get_font_for_size (12, PANGO_WEIGHT_NORMAL); /* We always leave space for DAY_VIEW_MIN_ROWS_IN_TOP_DISPLAY in the - top display, but we may have more rows than that, in which case - the main display area will be compressed. */ + * top display, but we may have more rows than that, in which case + * the main display area will be compressed. */ /* Limit long day event to half the height of the panel */ rows_in_top_display = MIN (MAX (rows_in_top_display, DAY_VIEW_MIN_ROWS_IN_TOP_DISPLAY), - (bottom-top)*0.5/DAY_VIEW_ROW_HEIGHT); + (bottom - top) * 0.5 / DAY_VIEW_ROW_HEIGHT); if (rows_in_top_display > pdi.long_events->len) rows_in_top_display = pdi.long_events->len; @@ -1475,7 +1546,7 @@ print_day_details (GtkPrintContext *context, GnomeCalendar *gcal, time_t whence, const gchar **xpm = (const gchar **) jump_xpm; /* this ugly thing is here only to get rid of compiler warning - about unused 'jump_xpm_focused' */ + * about unused 'jump_xpm_focused' */ if (pixbuf) xpm = (const gchar **) jump_xpm_focused; @@ -1485,7 +1556,7 @@ print_day_details (GtkPrintContext *context, GnomeCalendar *gcal, time_t whence, /* Right align - 10 comes from print_day_long_event too */ x = right - gdk_pixbuf_get_width (pixbuf) * 0.5 - 10; /* Placing '...' over the last all day event entry printed. '-1 -1' comes - from print_long_day_event (top/bottom spacing in each cell) */ + from print_long_day_event (top / bottom spacing in each cell) */ y = top + LONG_DAY_EVENTS_TOP_SPACING + DAY_VIEW_ROW_HEIGHT * (i - 1) + (DAY_VIEW_ROW_HEIGHT - 1 - 1) * 0.5; @@ -1552,8 +1623,8 @@ print_day_details (GtkPrintContext *context, GnomeCalendar *gcal, time_t whence, /* Returns TRUE if the event is a one-day event (i.e. not a long event). */ static gboolean print_is_one_day_week_event (EWeekViewEvent *event, - EWeekViewEventSpan *span, - time_t *day_starts) + EWeekViewEventSpan *span, + time_t *day_starts) { if (event->start == day_starts[span->start_day] && event->end == day_starts[span->start_day + 1]) @@ -1568,23 +1639,31 @@ print_is_one_day_week_event (EWeekViewEvent *event, } static void -print_week_long_event (GtkPrintContext *context, PangoFontDescription *font, - struct psinfo *psi, - double x1, double x2, double y1, double row_height, - EWeekViewEvent *event, EWeekViewEventSpan *span, - gchar *text, double red, double green, double blue) +print_week_long_event (GtkPrintContext *context, + PangoFontDescription *font, + struct psinfo *psi, + gdouble x1, + gdouble x2, + gdouble y1, + gdouble row_height, + EWeekViewEvent *event, + EWeekViewEventSpan *span, + gchar *text, + gdouble red, + gdouble green, + gdouble blue) { gdouble left_triangle_width = -1.0, right_triangle_width = -1.0; struct tm date_tm; gchar buffer[32]; /* If the event starts before the first day of the span, draw a - triangle to indicate it continues. */ + * triangle to indicate it continues. */ if (event->start < psi->day_starts[span->start_day]) left_triangle_width = 4; /* If the event ends after the last day of the span, draw a - triangle. */ + * triangle. */ if (event->end > psi->day_starts[span->start_day + span->num_days]) right_triangle_width = 4; @@ -1593,7 +1672,7 @@ print_week_long_event (GtkPrintContext *context, PangoFontDescription *font, left_triangle_width, right_triangle_width); /* If the event starts after the first day being printed, we need to - print the start time. */ + * print the start time. */ if (event->start > psi->day_starts[span->start_day]) { date_tm.tm_year = 2001; date_tm.tm_mon = 0; @@ -1613,7 +1692,7 @@ print_week_long_event (GtkPrintContext *context, PangoFontDescription *font, } /* If the event ends before the end of the last day being printed, - we need to print the end time. */ + * we need to print the end time. */ if (event->end < psi->day_starts[span->start_day + span->num_days]) { date_tm.tm_year = 2001; date_tm.tm_mon = 0; @@ -1638,11 +1717,19 @@ print_week_long_event (GtkPrintContext *context, PangoFontDescription *font, } static void -print_week_day_event (GtkPrintContext *context, PangoFontDescription *font, - struct psinfo *psi, - double x1, double x2, double y1, double row_height, - EWeekViewEvent *event, EWeekViewEventSpan *span, - gchar *text, double red, double green, double blue) +print_week_day_event (GtkPrintContext *context, + PangoFontDescription *font, + struct psinfo *psi, + gdouble x1, + gdouble x2, + gdouble y1, + gdouble row_height, + EWeekViewEvent *event, + EWeekViewEventSpan *span, + gchar *text, + gdouble red, + gdouble green, + gdouble blue) { struct tm date_tm; gchar buffer[32]; @@ -1681,12 +1768,16 @@ print_week_day_event (GtkPrintContext *context, PangoFontDescription *font, } static void -print_week_event (GtkPrintContext *context, PangoFontDescription *font, - struct psinfo *psi, - double left, double top, - double cell_width, double cell_height, - ECalModel *model, - EWeekViewEvent *event, GArray *spans) +print_week_event (GtkPrintContext *context, + PangoFontDescription *font, + struct psinfo *psi, + gdouble left, + gdouble top, + gdouble cell_width, + gdouble cell_height, + ECalModel *model, + EWeekViewEvent *event, + GArray *spans) { EWeekViewEventSpan *span; gint span_num; @@ -1790,7 +1881,7 @@ print_week_event (GtkPrintContext *context, PangoFontDescription *font, const gchar **xpm = (const gchar **) jump_xpm; /* this ugly thing is here only to get rid of compiler warning - about unused 'jump_xpm_focused' */ + * about unused 'jump_xpm_focused' */ if (pixbuf) xpm = (const gchar **) jump_xpm_focused; @@ -1817,9 +1908,11 @@ print_week_event (GtkPrintContext *context, PangoFontDescription *font, static void print_week_view_background (GtkPrintContext *context, PangoFontDescription *font, - struct psinfo *psi, - double left, double top, - double cell_width, double cell_height) + struct psinfo *psi, + gdouble left, + gdouble top, + gdouble cell_width, + gdouble cell_height) { struct tm tm; gint day, day_x, day_y, day_h; @@ -1844,7 +1937,7 @@ print_week_view_background (GtkPrintContext *context, convert_timet_to_struct_tm (psi->day_starts[day], psi->zone, &tm); /* In the month view we draw a grey background for the end - of the previous month and the start of the following. */ + * of the previous month and the start of the following. */ fillcolor = -1.0; if (psi->multi_week_view && (tm.tm_mon != psi->month)) fillcolor = 0.9; @@ -1869,9 +1962,9 @@ print_week_view_background (GtkPrintContext *context, cairo_stroke (cr); /* strftime format %A = full weekday name, %d = day of - month, %B = full month name. You can change the - order but don't change the specifiers or add - anything. */ + * month, %B = full month name. You can change the + * order but don't change the specifiers or add + * anything. */ format_string = _("%A %d %B"); } @@ -1886,9 +1979,9 @@ print_week_view_background (GtkPrintContext *context, /* This adds one event to the view, adding it to the appropriate array. */ static gboolean print_week_summary_cb (ECalComponent *comp, - time_t start, - time_t end, - gpointer data) + time_t start, + time_t end, + gpointer data) { EWeekViewEvent event; @@ -1929,10 +2022,17 @@ print_week_summary_cb (ECalComponent *comp, } static void -print_week_summary (GtkPrintContext *context, GnomeCalendar *gcal, - time_t whence, gboolean multi_week_view, gint weeks_shown, - gint month, double font_size, - double left, double right, double top, double bottom) +print_week_summary (GtkPrintContext *context, + GnomeCalendar *gcal, + time_t whence, + gboolean multi_week_view, + gint weeks_shown, + gint month, + gdouble font_size, + gdouble left, + gdouble right, + gdouble top, + gdouble bottom) { icaltimezone *zone; EWeekViewEvent *event; @@ -2000,7 +2100,7 @@ print_week_summary (GtkPrintContext *context, GnomeCalendar *gcal, } /* Calculate the row height, using the normal font and with room for - space or a rectangle around it. */ + * space or a rectangle around it. */ psi.row_height = font_size * 1.2; psi.header_row_height = font_size * 1.5; @@ -2081,7 +2181,7 @@ print_month_summary (GtkPrintContext *context, month = tt.month - 1; /* Find the start of the month, and then the start of the week on - or before that day. */ + * or before that day. */ if (!date) date = time_month_begin_with_zone (whence, zone); date = time_week_begin_with_zone (date, weekday, zone); @@ -2093,9 +2193,9 @@ print_month_summary (GtkPrintContext *context, /* do day names ... */ /* We are only interested in outputting the weekday here, but we want - to be able to step through the week without worrying about - overflows making strftime choke, so we move near to the start of - the month. */ + * to be able to step through the week without worrying about + * overflows making strftime choke, so we move near to the start of + * the month. */ convert_timet_to_struct_tm (date, zone, &tm); tm.tm_mday = (tm.tm_mday % 7) + 7; @@ -2137,9 +2237,14 @@ print_month_summary (GtkPrintContext *context, } static void -print_todo_details (GtkPrintContext *context, GnomeCalendar *gcal, - time_t start, time_t end, - double left, double right, double top, double bottom) +print_todo_details (GtkPrintContext *context, + GnomeCalendar *gcal, + time_t start, + time_t end, + gdouble left, + gdouble right, + gdouble top, + gdouble bottom) { PangoFontDescription *font_summary; gdouble y, yend, x, xend; @@ -2151,7 +2256,7 @@ print_todo_details (GtkPrintContext *context, GnomeCalendar *gcal, cairo_t *cr; /* We get the tasks directly from the TaskPad ETable. This means we - get them filtered & sorted for free. */ + * get them filtered & sorted for free. */ task_table = gnome_calendar_get_task_table (gcal); table = E_TABLE (task_table); g_return_if_fail (table != NULL); @@ -2220,7 +2325,7 @@ print_todo_details (GtkPrintContext *context, GnomeCalendar *gcal, y = bound_text (context, font_summary, summary.value, -1, x + 14, y + 4, xend, yend, FALSE, NULL, NULL); - y += get_font_size (font_summary)-5; + y += get_font_size (font_summary) - 5; cr = gtk_print_context_get_cairo_context (context); cairo_move_to (cr, x, y); cairo_line_to (cr, xend, y); @@ -2234,7 +2339,9 @@ print_todo_details (GtkPrintContext *context, GnomeCalendar *gcal, } static void -print_day_view (GtkPrintContext *context, GnomeCalendar *gcal, time_t date) +print_day_view (GtkPrintContext *context, + GnomeCalendar *gcal, + time_t date) { ECalModel *model; GtkPageSetup *setup; @@ -2309,9 +2416,14 @@ print_day_view (GtkPrintContext *context, GnomeCalendar *gcal, time_t date) } static void -print_work_week_background (GtkPrintContext *context, GnomeCalendar *gcal, - time_t whence, struct pdinfo *pdi, double left, - double right, double top, double bottom) +print_work_week_background (GtkPrintContext *context, + GnomeCalendar *gcal, + time_t whence, + struct pdinfo *pdi, + gdouble left, + gdouble right, + gdouble top, + gdouble bottom) { ECalModel *model; PangoFontDescription *font_hour, *font_minute; @@ -2424,7 +2536,7 @@ print_work_week_background (GtkPrintContext *context, GnomeCalendar *gcal, cairo_stroke (cr); /* Draw the horizontal line for the 1/2-hours, across the - entire width except for part of the time column. */ + * entire width except for part of the time column. */ cairo_move_to (cr, left + width * 0.6, y - yinc / 2); cairo_line_to (cr, right, y - yinc / 2); cairo_set_line_width (cr, 1); @@ -2433,7 +2545,7 @@ print_work_week_background (GtkPrintContext *context, GnomeCalendar *gcal, } /* Draw the vertical lines for the days */ - day_width = (right - left - 2*width) / pdi->days_shown; + day_width = (right - left - 2 *width) / pdi->days_shown; for (i = 0; i < pdi->days_shown - 1; ++i) { cr = gtk_print_context_get_cairo_context (context); cairo_move_to (cr, left + width + day_width * (i + 1), top); @@ -2456,9 +2568,14 @@ print_work_week_background (GtkPrintContext *context, GnomeCalendar *gcal, } static void -print_work_week_day_details (GtkPrintContext *context, GnomeCalendar *gcal, - time_t whence, double left, double right, - double top, double bottom, struct pdinfo *_pdi) +print_work_week_day_details (GtkPrintContext *context, + GnomeCalendar *gcal, + time_t whence, + gdouble left, + gdouble right, + gdouble top, + gdouble bottom, + struct pdinfo *_pdi) { ECalModel *model; icaltimezone *zone; @@ -2536,12 +2653,12 @@ print_work_week_day_details (GtkPrintContext *context, GnomeCalendar *gcal, font = get_font_for_size (12, PANGO_WEIGHT_NORMAL); /* We always leave space for DAY_VIEW_MIN_ROWS_IN_TOP_DISPLAY in the - top display, but we may have more rows than that, in which case - the main display area will be compressed. */ + * top display, but we may have more rows than that, in which case + * the main display area will be compressed. */ /* Limit long day event to half the height of the panel */ rows_in_top_display = MIN (MAX (rows_in_top_display, DAY_VIEW_MIN_ROWS_IN_TOP_DISPLAY), - (bottom-top)*0.5/DAY_VIEW_ROW_HEIGHT); + (bottom - top) * 0.5 / DAY_VIEW_ROW_HEIGHT); if (rows_in_top_display > pdi.long_events->len) rows_in_top_display = pdi.long_events->len; @@ -2563,7 +2680,7 @@ print_work_week_day_details (GtkPrintContext *context, GnomeCalendar *gcal, const gchar **xpm = (const gchar **) jump_xpm; /* this ugly thing is here only to get rid of compiler warning - about unused 'jump_xpm_focused' */ + * about unused 'jump_xpm_focused' */ if (pixbuf) xpm = (const gchar **) jump_xpm_focused; @@ -2573,7 +2690,7 @@ print_work_week_day_details (GtkPrintContext *context, GnomeCalendar *gcal, /* Right align - 10 comes from print_day_long_event too */ x = right - gdk_pixbuf_get_width (pixbuf) * 0.5 - 10; /* Placing '...' over the last all day event entry printed. '-1 -1' comes - from print_long_day_event (top/bottom spacing in each cell) */ + from print_long_day_event (top / bottom spacing in each cell) */ y = top + LONG_DAY_EVENTS_TOP_SPACING + DAY_VIEW_ROW_HEIGHT * (i - 1) + (DAY_VIEW_ROW_HEIGHT - 1 - 1) * 0.5; @@ -2653,7 +2770,9 @@ print_work_week_view_cb (ECalComponent *comp, } static void -print_work_week_view (GtkPrintContext *context, GnomeCalendar *gcal, time_t date) +print_work_week_view (GtkPrintContext *context, + GnomeCalendar *gcal, + time_t date) { GtkPageSetup *setup; icaltimezone *zone; @@ -2728,7 +2847,7 @@ print_work_week_view (GtkPrintContext *context, GnomeCalendar *gcal, time_t date 24 + 3, 24 + 3 + 24); /* Now print each days' events */ - day_width = (width - 2*DAY_VIEW_TIME_COLUMN_WIDTH) / days; + day_width = (width - 2 *DAY_VIEW_TIME_COLUMN_WIDTH) / days; when = start; for (i = 0; i < days; ++i) { day_x = DAY_VIEW_TIME_COLUMN_WIDTH + day_width * i; @@ -2749,7 +2868,9 @@ print_work_week_view (GtkPrintContext *context, GnomeCalendar *gcal, time_t date } static void -print_week_view (GtkPrintContext *context, GnomeCalendar *gcal, time_t date) +print_week_view (GtkPrintContext *context, + GnomeCalendar *gcal, + time_t date) { GtkPageSetup *setup; ECalModel *model; @@ -2776,7 +2897,7 @@ print_week_view (GtkPrintContext *context, GnomeCalendar *gcal, time_t date) when = time_week_begin_with_zone (date, week_start_day, zone); /* If the week starts on a Sunday, we have to show the Saturday first, - since the weekend is compressed. */ + * since the weekend is compressed. */ if (week_start_day == 0) { if (tm.tm_wday == 6) when = time_add_day_with_zone (when, 6, zone); @@ -2830,7 +2951,9 @@ print_week_view (GtkPrintContext *context, GnomeCalendar *gcal, time_t date) } static void -print_month_view (GtkPrintContext *context, GnomeCalendar *gcal, time_t date) +print_month_view (GtkPrintContext *context, + GnomeCalendar *gcal, + time_t date) { ECalModel *model; GtkPageSetup *setup; @@ -2879,7 +3002,9 @@ print_month_view (GtkPrintContext *context, GnomeCalendar *gcal, time_t date) } static gboolean -same_date (struct tm tm1, time_t t2, icaltimezone *zone) +same_date (struct tm tm1, + time_t t2, + icaltimezone *zone) { struct tm tm2; @@ -2922,13 +3047,14 @@ write_label_piece (time_t t, strcat (buffer, etext); } -static icaltimezone* -get_zone_from_tzid (ECalClient *client, const gchar *tzid) +static icaltimezone * +get_zone_from_tzid (ECalClient *client, + const gchar *tzid) { icaltimezone *zone; /* Note that the timezones may not be on the server, so we try to get - the builtin timezone with the TZID first. */ + * the builtin timezone with the TZID first. */ zone = icaltimezone_get_builtin_timezone_from_tzid (tzid); if (!zone && tzid) { GError *error = NULL; @@ -3404,8 +3530,8 @@ print_comp_draw_page (GtkPrintOperation *operation, static void print_comp_begin_print (GtkPrintOperation *operation, - GtkPrintContext *context, - PrintCompItem *pci) + GtkPrintContext *context, + PrintCompItem *pci) { gint pages; @@ -3448,7 +3574,9 @@ print_comp (ECalComponent *comp, } static void -print_title (GtkPrintContext *context, const gchar *text, gdouble page_width) +print_title (GtkPrintContext *context, + const gchar *text, + gdouble page_width) { PangoFontDescription *desc; PangoLayout *layout; @@ -3509,8 +3637,10 @@ print_table_draw_page (GtkPrintOperation *operation, } void -print_table (ETable *table, const gchar *dialog_title, - const gchar *print_header, GtkPrintOperationAction action) +print_table (ETable *table, + const gchar *dialog_title, + const gchar *print_header, + GtkPrintOperationAction action) { GtkPrintOperation *operation; EPrintable *printable; diff --git a/calendar/gui/tag-calendar.c b/calendar/gui/tag-calendar.c index 82eae30c83..6a0fdcce1f 100644 --- a/calendar/gui/tag-calendar.c +++ b/calendar/gui/tag-calendar.c @@ -94,9 +94,9 @@ prepare_tag (ECalendar *ecal, * called from e_cal_generate_instances() */ static gboolean tag_calendar_cb (ECalComponent *comp, - time_t istart, - time_t iend, - gpointer data) + time_t istart, + time_t iend, + gpointer data) { struct calendar_tag_closure *c = data; struct icaltimetype start_tt, end_tt; @@ -104,7 +104,7 @@ tag_calendar_cb (ECalComponent *comp, guint8 style = 0; /* If we are skipping TRANSPARENT events, return if the event is - transparent. */ + * transparent. */ e_cal_component_get_transparency (comp, &transparency); if (transparency == E_CAL_COMPONENT_TRANSP_TRANSPARENT) { if (c->skip_transparent_events) @@ -153,7 +153,7 @@ get_recur_events_italic (void) void tag_calendar_by_client (ECalendar *ecal, ECalClient *client, - GCancellable *cancellable) + GCancellable *cancellable) { struct calendar_tag_closure *c; @@ -182,9 +182,9 @@ tag_calendar_by_client (ECalendar *ecal, } /* Resolves TZIDs for the recurrence generator, for when the comp is not on - the server. We need to try to use builtin timezones first, as they may not - be added to the server yet. */ -static icaltimezone* + * the server. We need to try to use builtin timezones first, as they may not + * be added to the server yet. */ +static icaltimezone * resolve_tzid_cb (const gchar *tzid, gpointer data) { diff --git a/calendar/gui/weekday-picker.c b/calendar/gui/weekday-picker.c index a9cd687169..d1a9a2835a 100644 --- a/calendar/gui/weekday-picker.c +++ b/calendar/gui/weekday-picker.c @@ -380,7 +380,8 @@ weekday_picker_class_init (WeekdayPickerClass *class) } static void -day_clicked (WeekdayPicker *wp, gint index) +day_clicked (WeekdayPicker *wp, + gint index) { WeekdayPickerPrivate *priv = wp->priv; guint8 day_mask; @@ -397,7 +398,8 @@ day_clicked (WeekdayPicker *wp, gint index) } static gint -handle_key_press_event (WeekdayPicker *wp, GdkEvent *event) +handle_key_press_event (WeekdayPicker *wp, + GdkEvent *event) { WeekdayPickerPrivate *priv = wp->priv; guint keyval = event->key.keyval; @@ -434,7 +436,9 @@ handle_key_press_event (WeekdayPicker *wp, GdkEvent *event) /* Event handler for the day items */ static gint -day_event_cb (GnomeCanvasItem *item, GdkEvent *event, gpointer data) +day_event_cb (GnomeCanvasItem *item, + GdkEvent *event, + gpointer data) { WeekdayPicker *wp; WeekdayPickerPrivate *priv; @@ -530,7 +534,8 @@ weekday_picker_new (void) * Sunday is bit 0, Monday is bit 1, etc. **/ void -weekday_picker_set_days (WeekdayPicker *wp, guint8 day_mask) +weekday_picker_set_days (WeekdayPicker *wp, + guint8 day_mask) { WeekdayPickerPrivate *priv; @@ -576,7 +581,8 @@ weekday_picker_get_days (WeekdayPicker *wp) * weekday_picker_set_days(). **/ void -weekday_picker_set_blocked_days (WeekdayPicker *wp, guint8 blocked_day_mask) +weekday_picker_set_blocked_days (WeekdayPicker *wp, + guint8 blocked_day_mask) { WeekdayPickerPrivate *priv; @@ -618,7 +624,8 @@ weekday_picker_get_blocked_days (WeekdayPicker *wp) * Sets the day that defines the start of the week for a weekday picker. **/ void -weekday_picker_set_week_start_day (WeekdayPicker *wp, gint week_start_day) +weekday_picker_set_week_start_day (WeekdayPicker *wp, + gint week_start_day) { WeekdayPickerPrivate *priv; diff --git a/calendar/importers/icalendar-importer.c b/calendar/importers/icalendar-importer.c index 585d423921..739a23cf1d 100644 --- a/calendar/importers/icalendar-importer.c +++ b/calendar/importers/icalendar-importer.c @@ -115,7 +115,8 @@ ivcal_import_done (ICalImporter *ici) /* This removes all components except VEVENTs and VTIMEZONEs from the toplevel */ static void -prepare_events (icalcomponent *icalcomp, GList **vtodos) +prepare_events (icalcomponent *icalcomp, + GList **vtodos) { icalcomponent *subcomp; icalcompiter iter; @@ -143,10 +144,11 @@ prepare_events (icalcomponent *icalcomp, GList **vtodos) } /* This removes all components except VTODOs and VTIMEZONEs from the toplevel - icalcomponent, and adds the given list of VTODO components. The list is - freed afterwards. */ + * icalcomponent, and adds the given list of VTODO components. The list is + * freed afterwards. */ static void -prepare_tasks (icalcomponent *icalcomp, GList *vtodos) +prepare_tasks (icalcomponent *icalcomp, + GList *vtodos) { icalcomponent *subcomp; GList *elem; @@ -203,7 +205,11 @@ receive_objects_ready_cb (GObject *source_object, } static void -update_objects (ECalClient *cal_client, icalcomponent *icalcomp, GCancellable *cancellable, void (*done_cb)(gpointer user_data), gpointer user_data) +update_objects (ECalClient *cal_client, + icalcomponent *icalcomp, + GCancellable *cancellable, + void (*done_cb) (gpointer user_data), + gpointer user_data) { icalcomponent_kind kind; icalcomponent *vcal; @@ -246,7 +252,8 @@ struct _selector_data { }; static void -button_toggled_cb (GtkWidget *widget, struct _selector_data *sd) +button_toggled_cb (GtkWidget *widget, + struct _selector_data *sd) { g_datalist_set_data_full(&sd->target->data, "primary-source", g_object_ref (e_source_selector_get_primary_selection ((ESourceSelector *) sd->selector)), @@ -256,7 +263,8 @@ button_toggled_cb (GtkWidget *widget, struct _selector_data *sd) } static void -primary_selection_changed_cb (ESourceSelector *selector, EImportTarget *target) +primary_selection_changed_cb (ESourceSelector *selector, + EImportTarget *target) { g_datalist_set_data_full(&target->data, "primary-source", g_object_ref (e_source_selector_get_primary_selection (selector)), @@ -264,7 +272,9 @@ primary_selection_changed_cb (ESourceSelector *selector, EImportTarget *target) } static GtkWidget * -ivcal_getwidget (EImport *ei, EImportTarget *target, EImportImporter *im) +ivcal_getwidget (EImport *ei, + EImportTarget *target, + EImportImporter *im) { GtkWidget *vbox, *hbox, *first = NULL; GSList *group = NULL; @@ -318,7 +328,9 @@ ivcal_getwidget (EImport *ei, EImportTarget *target, EImportImporter *im) sd->notebook = nb; sd->page = i; g_object_set_data_full((GObject *)rb, "selector-data", sd, g_free); - g_signal_connect(G_OBJECT (rb), "toggled", G_CALLBACK (button_toggled_cb), sd); + g_signal_connect ( + rb, "toggled", + G_CALLBACK (button_toggled_cb), sd); if (!group) group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (rb)); @@ -403,7 +415,9 @@ ivcal_opened (GObject *source_object, } static void -ivcal_import (EImport *ei, EImportTarget *target, icalcomponent *icalcomp) +ivcal_import (EImport *ei, + EImportTarget *target, + icalcomponent *icalcomp) { EClientSourceType type; ICalImporter *ici = g_malloc0 (sizeof (*ici)); @@ -426,7 +440,9 @@ ivcal_import (EImport *ei, EImportTarget *target, icalcomponent *icalcomp) } static void -ivcal_cancel (EImport *ei, EImportTarget *target, EImportImporter *im) +ivcal_cancel (EImport *ei, + EImportTarget *target, + EImportImporter *im) { ICalImporter *ici = g_datalist_get_data(&target->data, "ivcal-data"); @@ -440,7 +456,9 @@ ivcal_cancel (EImport *ei, EImportTarget *target, EImportImporter *im) */ static gboolean -ical_supported (EImport *ei, EImportTarget *target, EImportImporter *im) +ical_supported (EImport *ei, + EImportTarget *target, + EImportImporter *im) { gchar *filename; gchar *contents; @@ -482,7 +500,9 @@ ical_supported (EImport *ei, EImportTarget *target, EImportImporter *im) } static void -ical_import (EImport *ei, EImportTarget *target, EImportImporter *im) +ical_import (EImport *ei, + EImportTarget *target, + EImportImporter *im) { gchar *filename; gchar *contents; @@ -512,7 +532,9 @@ ical_import (EImport *ei, EImportTarget *target, EImportImporter *im) } static GtkWidget * -ivcal_get_preview (EImport *ei, EImportTarget *target, EImportImporter *im) +ivcal_get_preview (EImport *ei, + EImportTarget *target, + EImportImporter *im) { GtkWidget *preview; EImportTargetURI *s = (EImportTargetURI *) target; @@ -570,7 +592,9 @@ ical_importer_peek (void) */ static gboolean -vcal_supported (EImport *ei, EImportTarget *target, EImportImporter *im) +vcal_supported (EImport *ei, + EImportTarget *target, + EImportImporter *im) { gchar *filename; gchar *contents; @@ -601,8 +625,8 @@ vcal_supported (EImport *ei, EImportTarget *target, EImportImporter *im) if (icalcomp && is_icalcomp_usable (icalcomp)) { /* If we can create proper iCalendar from the file, then - rather use ics importer, because it knows to read more - information than older version, the vCalendar. */ + * rather use ics importer, because it knows to read more + * information than older version, the vCalendar. */ ret = FALSE; g_free (contents); } else { @@ -631,8 +655,8 @@ vcal_supported (EImport *ei, EImportTarget *target, EImportImporter *im) } /* This tries to load in a vCalendar file and convert it to an icalcomponent. - It returns NULL on failure. */ -static icalcomponent* + * It returns NULL on failure. */ +static icalcomponent * load_vcalendar_file (const gchar *filename) { icalvcal_defaults defaults = { NULL }; @@ -667,7 +691,9 @@ load_vcalendar_file (const gchar *filename) } static void -vcal_import (EImport *ei, EImportTarget *target, EImportImporter *im) +vcal_import (EImport *ei, + EImportTarget *target, + EImportImporter *im) { gchar *filename; icalcomponent *icalcomp; @@ -688,7 +714,9 @@ vcal_import (EImport *ei, EImportTarget *target, EImportImporter *im) } static GtkWidget * -vcal_get_preview (EImport *ei, EImportTarget *target, EImportImporter *im) +vcal_get_preview (EImport *ei, + EImportTarget *target, + EImportImporter *im) { GtkWidget *preview; EImportTargetURI *s = (EImportTargetURI *) target; @@ -736,7 +764,9 @@ vcal_importer_peek (void) /* ********************************************************************** */ static gboolean -gnome_calendar_supported (EImport *ei, EImportTarget *target, EImportImporter *im) +gnome_calendar_supported (EImport *ei, + EImportTarget *target, + EImportImporter *im) { gchar *filename; gboolean res; @@ -800,7 +830,11 @@ default_source_opened_cb (GObject *source_object, } static void -open_default_source (ICalIntelligentImporter *ici, ECalClientSourceType source_type, void (* opened_cb) (ECalClient *cal_client, const GError *error, ICalIntelligentImporter *ici)) +open_default_source (ICalIntelligentImporter *ici, + ECalClientSourceType source_type, + void (* opened_cb) (ECalClient *cal_client, + const GError *error, + ICalIntelligentImporter *ici)) { ESource *source; ECalClient *cal_client; @@ -912,7 +946,9 @@ gc_import_events (ECalClient *cal_client, } static void -gnome_calendar_import (EImport *ei, EImportTarget *target, EImportImporter *im) +gnome_calendar_import (EImport *ei, + EImportTarget *target, + EImportImporter *im) { icalcomponent *icalcomp = NULL; gchar *filename; @@ -920,7 +956,7 @@ gnome_calendar_import (EImport *ei, EImportTarget *target, EImportImporter *im) ICalIntelligentImporter *ici; /* This is pretty shitty, everything runs in the gui thread and can block - for quite some time */ + * for quite some time */ do_calendar = GPOINTER_TO_INT(g_datalist_get_data(&target->data, "gnomecal-do-cal")); do_tasks = GPOINTER_TO_INT(g_datalist_get_data(&target->data, "gnomecal-do-tasks")); @@ -967,19 +1003,23 @@ gnome_calendar_import (EImport *ei, EImportTarget *target, EImportImporter *im) } static void -calendar_toggle_cb (GtkToggleButton *tb, EImportTarget *target) +calendar_toggle_cb (GtkToggleButton *tb, + EImportTarget *target) { g_datalist_set_data(&target->data, "gnomecal-do-cal", GINT_TO_POINTER(gtk_toggle_button_get_active(tb))); } static void -tasks_toggle_cb (GtkToggleButton *tb, EImportTarget *target) +tasks_toggle_cb (GtkToggleButton *tb, + EImportTarget *target) { g_datalist_set_data(&target->data, "gnomecal-do-tasks", GINT_TO_POINTER(gtk_toggle_button_get_active(tb))); } static GtkWidget * -gnome_calendar_getwidget (EImport *ei, EImportTarget *target, EImportImporter *im) +gnome_calendar_getwidget (EImport *ei, + EImportTarget *target, + EImportImporter *im) { GtkWidget *hbox, *w; GConfClient *gconf; @@ -1011,7 +1051,9 @@ gnome_calendar_getwidget (EImport *ei, EImportTarget *target, EImportImporter *i } static void -gnome_calendar_cancel (EImport *ei, EImportTarget *target, EImportImporter *im) +gnome_calendar_cancel (EImport *ei, + EImportTarget *target, + EImportImporter *im) { ICalIntelligentImporter *ici = g_datalist_get_data(&target->data, "gnomecal-data"); @@ -1041,7 +1083,9 @@ gnome_calendar_importer_peek (void) /* ********************************************************************** */ static gchar * -format_dt (const ECalComponentDateTime *dt, GHashTable *timezones, icaltimezone *users_zone) +format_dt (const ECalComponentDateTime *dt, + GHashTable *timezones, + icaltimezone *users_zone) { struct tm tm; @@ -1076,7 +1120,8 @@ strip_mailto (const gchar *str) } static void -preview_comp (EWebViewPreview *preview, ECalComponent *comp) +preview_comp (EWebViewPreview *preview, + ECalComponent *comp) { ECalComponentText text = { 0 }; ECalComponentDateTime dt; @@ -1293,7 +1338,8 @@ preview_comp (EWebViewPreview *preview, ECalComponent *comp) } static void -preview_selection_changed_cb (GtkTreeSelection *selection, EWebViewPreview *preview) +preview_selection_changed_cb (GtkTreeSelection *selection, + EWebViewPreview *preview) { GtkTreeIter iter; GtkTreeModel *model = NULL; diff --git a/capplet/anjal-settings-main.c b/capplet/anjal-settings-main.c index 5a03ec685c..2bc3268b58 100644 --- a/capplet/anjal-settings-main.c +++ b/capplet/anjal-settings-main.c @@ -101,7 +101,8 @@ create_default_shell (void) } gint -main (gint argc, gchar *argv[]) +main (gint argc, + gchar *argv[]) { GError *error = NULL; @@ -122,7 +123,7 @@ main (gint argc, gchar *argv[]) p_SetProcessDEPPolicy = GetProcAddress (GetModuleHandle ("kernel32.dll"), "SetProcessDEPPolicy"); if (p_SetProcessDEPPolicy) - (*p_SetProcessDEPPolicy) (PROCESS_DEP_ENABLE|PROCESS_DEP_DISABLE_ATL_THUNK_EMULATION); + (*p_SetProcessDEPPolicy) (PROCESS_DEP_ENABLE | PROCESS_DEP_DISABLE_ATL_THUNK_EMULATION); } #endif diff --git a/capplet/settings/anjal-mail-view.c b/capplet/settings/anjal-mail-view.c index eb8a06e56d..c0926536cb 100644 --- a/capplet/settings/anjal-mail-view.c +++ b/capplet/settings/anjal-mail-view.c @@ -39,7 +39,7 @@ struct _AnjalMailViewPrivate { G_DEFINE_TYPE (AnjalMailView, anjal_mail_view, GTK_TYPE_NOTEBOOK) static void -anjal_mail_view_init (AnjalMailView *shell) +anjal_mail_view_init (AnjalMailView *shell) { shell->priv = g_new0 (AnjalMailViewPrivate, 1); shell->priv->started = TRUE; @@ -57,25 +57,32 @@ anjal_mail_view_finalize (GObject *object) } static void -view_set_folder_uri (AnjalMailView *mail_view, const gchar *uri) +view_set_folder_uri (AnjalMailView *mail_view, + const gchar *uri) { } + static void -view_set_folder_tree_widget (AnjalMailView *mail_view, GtkWidget *tree) +view_set_folder_tree_widget (AnjalMailView *mail_view, + GtkWidget *tree) { } + static void -view_set_folder_tree (AnjalMailView *mail_view, EMFolderTree *tree) +view_set_folder_tree (AnjalMailView *mail_view, + EMFolderTree *tree) { } static void -view_set_search (AnjalMailView *mail_view, const gchar *search) +view_set_search (AnjalMailView *mail_view, + const gchar *search) { } static void -view_init_search (AnjalMailView *mail_view, GtkWidget *search) +view_init_search (AnjalMailView *mail_view, + GtkWidget *search) { } diff --git a/capplet/settings/mail-account-view.c b/capplet/settings/mail-account-view.c index e579e6a070..3e35276361 100644 --- a/capplet/settings/mail-account-view.c +++ b/capplet/settings/mail-account-view.c @@ -82,7 +82,7 @@ struct _dialog_errors { static guint signals[LAST_SIGNAL] = { 0 }; static void -mail_account_view_init (MailAccountView *shell) +mail_account_view_init (MailAccountView *shell) { shell->priv = g_new0 (MailAccountViewPrivate, 1); @@ -144,7 +144,7 @@ check_servers (gchar *server) { gint len = G_N_ELEMENTS (std_server), i; - for (i=0; inext) { - ESource *existing = (ESource*) sources->data; + ESource *existing = (ESource *) sources->data; if (!g_strcmp0 (e_source_peek_relative_uri (existing), mav->priv->username)) { @@ -482,25 +482,25 @@ create_review (MailAccountView *view) g_free (buff); gtk_widget_show (label); PACK_BOXF (label) - gtk_table_attach ((GtkTable *) table, box, 0, 1, 0, 1, GTK_EXPAND|GTK_FILL, GTK_SHRINK, INDENTATION, 0); + gtk_table_attach ((GtkTable *) table, box, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_SHRINK, INDENTATION, 0); label = gtk_label_new (_("Name:")); gtk_widget_show (label); PACK_BOX (label); - gtk_table_attach ((GtkTable *) table, box, 0, 1, 1, 2, GTK_EXPAND|GTK_FILL, GTK_SHRINK, INDENTATION, 0); + gtk_table_attach ((GtkTable *) table, box, 0, 1, 1, 2, GTK_EXPAND | GTK_FILL, GTK_SHRINK, INDENTATION, 0); entry = gtk_label_new (e_account_get_string (em_account_editor_get_modified_account (view->edit), E_ACCOUNT_ID_NAME)); gtk_widget_show (entry); PACK_BOX (entry) - gtk_table_attach ((GtkTable *) table, box, 1, 2, 1, 2, GTK_EXPAND|GTK_FILL, GTK_SHRINK, INDENTATION, 0); + gtk_table_attach ((GtkTable *) table, box, 1, 2, 1, 2, GTK_EXPAND | GTK_FILL, GTK_SHRINK, INDENTATION, 0); label = gtk_label_new (_("Email address:")); gtk_widget_show (label); PACK_BOX (label) - gtk_table_attach ((GtkTable *) table, box, 0, 1, 2, 3, GTK_EXPAND|GTK_FILL, GTK_SHRINK, INDENTATION, 0); + gtk_table_attach ((GtkTable *) table, box, 0, 1, 2, 3, GTK_EXPAND | GTK_FILL, GTK_SHRINK, INDENTATION, 0); entry = gtk_label_new (e_account_get_string (em_account_editor_get_modified_account (view->edit), E_ACCOUNT_ID_ADDRESS)); gtk_widget_show (entry); PACK_BOX (entry) - gtk_table_attach ((GtkTable *) table, box, 1, 2, 2, 3, GTK_EXPAND|GTK_FILL, GTK_SHRINK, INDENTATION, 0); + gtk_table_attach ((GtkTable *) table, box, 1, 2, 2, 3, GTK_EXPAND | GTK_FILL, GTK_SHRINK, INDENTATION, 0); label = gtk_label_new (NULL); buff = g_markup_printf_escaped ("%s", _("Details:")); @@ -508,7 +508,7 @@ create_review (MailAccountView *view) g_free (buff); gtk_widget_show (label); PACK_BOXF (label); - gtk_table_attach ((GtkTable *) table, box, 0, 1, 3, 4, GTK_EXPAND|GTK_FILL, GTK_SHRINK, INDENTATION, 0); + gtk_table_attach ((GtkTable *) table, box, 0, 1, 3, 4, GTK_EXPAND | GTK_FILL, GTK_SHRINK, INDENTATION, 0); label = gtk_label_new (NULL); buff = g_markup_printf_escaped ("%s", _("Receiving")); @@ -516,44 +516,44 @@ create_review (MailAccountView *view) g_free (buff); gtk_widget_show (label); PACK_BOXF (label); - gtk_table_attach ((GtkTable *) table, box, 1, 2, 3, 4, GTK_EXPAND|GTK_FILL, GTK_SHRINK, INDENTATION, 0); + gtk_table_attach ((GtkTable *) table, box, 1, 2, 3, 4, GTK_EXPAND | GTK_FILL, GTK_SHRINK, INDENTATION, 0); label = gtk_label_new (_("Server type:")); gtk_widget_show (label); PACK_BOX (label); - gtk_table_attach ((GtkTable *) table, box, 0, 1, 4, 5, GTK_EXPAND|GTK_FILL, GTK_SHRINK, INDENTATION, 0); + gtk_table_attach ((GtkTable *) table, box, 0, 1, 4, 5, GTK_EXPAND | GTK_FILL, GTK_SHRINK, INDENTATION, 0); entry = gtk_label_new (url->protocol); gtk_widget_show (entry); PACK_BOX (entry) - gtk_table_attach ((GtkTable *) table, box, 1, 2, 4, 5, GTK_EXPAND|GTK_FILL, GTK_SHRINK, INDENTATION, 0); + gtk_table_attach ((GtkTable *) table, box, 1, 2, 4, 5, GTK_EXPAND | GTK_FILL, GTK_SHRINK, INDENTATION, 0); label = gtk_label_new (_("Server address:")); gtk_widget_show (label); PACK_BOX (label); - gtk_table_attach ((GtkTable *) table, box, 0, 1, 5, 6, GTK_EXPAND|GTK_FILL, GTK_SHRINK, INDENTATION, 0); + gtk_table_attach ((GtkTable *) table, box, 0, 1, 5, 6, GTK_EXPAND | GTK_FILL, GTK_SHRINK, INDENTATION, 0); entry = gtk_label_new (url->host); gtk_widget_show (entry); PACK_BOX (entry); - gtk_table_attach ((GtkTable *) table, box, 1, 2, 5, 6, GTK_EXPAND|GTK_FILL, GTK_SHRINK, INDENTATION, 0); + gtk_table_attach ((GtkTable *) table, box, 1, 2, 5, 6, GTK_EXPAND | GTK_FILL, GTK_SHRINK, INDENTATION, 0); label = gtk_label_new (_("Username:")); gtk_widget_show (label); PACK_BOX (label); - gtk_table_attach ((GtkTable *) table, box, 0, 1, 6, 7, GTK_EXPAND|GTK_FILL, GTK_SHRINK, INDENTATION, 0); + gtk_table_attach ((GtkTable *) table, box, 0, 1, 6, 7, GTK_EXPAND | GTK_FILL, GTK_SHRINK, INDENTATION, 0); entry = gtk_label_new (url->user); gtk_widget_show (entry); PACK_BOX (entry); - gtk_table_attach ((GtkTable *) table, box, 1, 2, 6, 7, GTK_EXPAND|GTK_FILL, GTK_SHRINK, INDENTATION, 0); + gtk_table_attach ((GtkTable *) table, box, 1, 2, 6, 7, GTK_EXPAND | GTK_FILL, GTK_SHRINK, INDENTATION, 0); label = gtk_label_new (_("Use encryption:")); gtk_widget_show (label); PACK_BOX (label); - gtk_table_attach ((GtkTable *) table, box, 0, 1, 7, 8, GTK_EXPAND|GTK_FILL, GTK_SHRINK, INDENTATION, 0); + gtk_table_attach ((GtkTable *) table, box, 0, 1, 7, 8, GTK_EXPAND | GTK_FILL, GTK_SHRINK, INDENTATION, 0); enc = (gchar *)camel_url_get_param(url, "security-method"); entry = gtk_label_new (enc ? enc : _("never")); gtk_widget_show (entry); PACK_BOX (entry); - gtk_table_attach ((GtkTable *) table, box, 1, 2, 7, 8, GTK_EXPAND|GTK_FILL, GTK_SHRINK, INDENTATION, 0); + gtk_table_attach ((GtkTable *) table, box, 1, 2, 7, 8, GTK_EXPAND | GTK_FILL, GTK_SHRINK, INDENTATION, 0); view->priv->username = g_strdup (url->user); camel_url_free (url); @@ -567,28 +567,28 @@ create_review (MailAccountView *view) g_free (buff); gtk_widget_show (label); PACK_BOXF (label); - gtk_table_attach ((GtkTable *) table, box, 2, 3, 3, 4, GTK_EXPAND|GTK_FILL, GTK_SHRINK, INDENTATION, 0); + gtk_table_attach ((GtkTable *) table, box, 2, 3, 3, 4, GTK_EXPAND | GTK_FILL, GTK_SHRINK, INDENTATION, 0); entry = gtk_label_new (url->protocol); gtk_widget_show (entry); PACK_BOX (entry) - gtk_table_attach ((GtkTable *) table, box, 2, 3, 4, 5, GTK_EXPAND|GTK_FILL, GTK_SHRINK, INDENTATION, 0); + gtk_table_attach ((GtkTable *) table, box, 2, 3, 4, 5, GTK_EXPAND | GTK_FILL, GTK_SHRINK, INDENTATION, 0); entry = gtk_label_new (url->host); gtk_widget_show (entry); PACK_BOX (entry); - gtk_table_attach ((GtkTable *) table, box, 2, 3, 5, 6, GTK_EXPAND|GTK_FILL, GTK_SHRINK, INDENTATION, 0); + gtk_table_attach ((GtkTable *) table, box, 2, 3, 5, 6, GTK_EXPAND | GTK_FILL, GTK_SHRINK, INDENTATION, 0); entry = gtk_label_new (url->user); gtk_widget_show (entry); PACK_BOX (entry); - gtk_table_attach ((GtkTable *) table, box, 2, 3, 6, 7, GTK_EXPAND|GTK_FILL, GTK_SHRINK, INDENTATION, 0); + gtk_table_attach ((GtkTable *) table, box, 2, 3, 6, 7, GTK_EXPAND | GTK_FILL, GTK_SHRINK, INDENTATION, 0); enc = (gchar *)camel_url_get_param(url, "security-method"); entry = gtk_label_new (enc ? enc : _("never")); gtk_widget_show (entry); PACK_BOX (entry); - gtk_table_attach ((GtkTable *) table, box, 2, 3, 7, 8, GTK_EXPAND|GTK_FILL, GTK_SHRINK, INDENTATION, 0); + gtk_table_attach ((GtkTable *) table, box, 2, 3, 7, 8, GTK_EXPAND | GTK_FILL, GTK_SHRINK, INDENTATION, 0); /* label = gtk_label_new (_("Organization:")); @@ -596,7 +596,7 @@ create_review (MailAccountView *view) entry = gtk_entry_new (); gtk_widget_show (entry); gtk_table_attach (table, label, 0, 1, 3, 4, GTK_SHRINK, GTK_SHRINK, INDENTATION, 0); - gtk_table_attach (table, entry, 1, 2, 3, 4, GTK_EXPAND|GTK_FILL, GTK_SHRINK, INDENTATION, 0); + gtk_table_attach (table, entry, 1, 2, 3, 4, GTK_EXPAND | GTK_FILL, GTK_SHRINK, INDENTATION, 0); */ gtk_widget_show (table); @@ -638,13 +638,14 @@ struct _page_text { }; static void -mav_next_pressed (GtkButton *button, MailAccountView *mav) +mav_next_pressed (GtkButton *button, + MailAccountView *mav) { if (mail_account_pages[mav->current_page].validate_page) { gint ret = (*mail_account_pages[mav->current_page].validate_page) (mav); MAVPage *page = mav->pages[mav->current_page]; if (ret) { - gtk_label_set_text ((GtkLabel *) page->error_label, _(dialog_errors[ret-1].detail)); + gtk_label_set_text ((GtkLabel *) page->error_label, _(dialog_errors[ret - 1].detail)); gtk_widget_show (page->error); return; } @@ -847,7 +848,8 @@ mav_next_pressed (GtkButton *button, MailAccountView *mav) } static void -mav_prev_pressed (GtkButton *button, MailAccountView *mav) +mav_prev_pressed (GtkButton *button, + MailAccountView *mav) { if (mav->current_page == 0) return; @@ -863,7 +865,8 @@ mav_prev_pressed (GtkButton *button, MailAccountView *mav) } static GtkWidget * -mav_construct_page (MailAccountView *view, MAVPageType type) +mav_construct_page (MailAccountView *view, + MAVPageType type) { MAVPage *page = g_new0 (MAVPage, 1); GtkWidget *box, *tmp, *error_box; @@ -927,7 +930,7 @@ mav_construct_page (MailAccountView *view, MAVPageType type) page->prev = gtk_button_new (); gtk_container_add ((GtkContainer *) page->prev, box); gtk_widget_show_all (page->prev); - g_signal_connect(page->prev, "clicked", G_CALLBACK(mav_prev_pressed), view); + g_signal_connect (page->prev, "clicked", G_CALLBACK(mav_prev_pressed), view); } if ((view->original && mail_account_pages[type].next_edit) || mail_account_pages[type].next) { @@ -944,7 +947,7 @@ mav_construct_page (MailAccountView *view, MAVPageType type) G_CALLBACK (gtk_widget_grab_default), NULL); gtk_container_add ((GtkContainer *) page->next, box); gtk_widget_show_all (page->next); - g_signal_connect(page->next, "clicked", G_CALLBACK(mav_next_pressed), view); + g_signal_connect (page->next, "clicked", G_CALLBACK(mav_next_pressed), view); } box = gtk_hbox_new (FALSE, 0); @@ -1043,7 +1046,8 @@ emae_check_servers (const gchar *email) } static void -next_page (GtkWidget *entry, MailAccountView *mav) +next_page (GtkWidget *entry, + MailAccountView *mav) { mav_next_pressed (NULL, mav); } @@ -1062,7 +1066,7 @@ mail_account_view_construct (MailAccountView *view, gtk_scrolled_window_add_with_viewport ((GtkScrolledWindow *) view->scroll, view->page_widget); gtk_widget_show_all (view->scroll); gtk_widget_set_size_request ((GtkWidget *) view, -1, 300); - for (i=0; ipages[i] = (MAVPage *) mav_construct_page (view, i); view->pages[i]->done = FALSE; view->wpages[i] = view->pages[i]->box; @@ -1099,7 +1103,7 @@ mail_account_view_construct (MailAccountView *view, gtk_widget_show (label); gtk_widget_show (pwd); gtk_table_attach ((GtkTable *) table, label, 0, 1, 2, 3, GTK_FILL, 0, 0, 0); - gtk_table_attach ((GtkTable *) table, pwd, 1, 2, 2, 3, GTK_FILL|GTK_EXPAND, 0, 0, 0); + gtk_table_attach ((GtkTable *) table, pwd, 1, 2, 2, 3, GTK_FILL | GTK_EXPAND, 0, 0, 0); view->password = pwd; } @@ -1123,7 +1127,8 @@ mail_account_view_new (EAccount *account, } static void -mav_close (GtkButton *w, MailAccountView *mfv) +mav_close (GtkButton *w, + MailAccountView *mfv) { g_signal_emit (mfv, signals[VIEW_CLOSE], 0); } @@ -1150,7 +1155,7 @@ mail_account_view_get_tab_widget (MailAccountView *mcv) gtk_container_add ((GtkContainer *) tool, box); gtk_widget_show_all (tool); gtk_icon_size_lookup_for_settings (gtk_widget_get_settings (tool) , GTK_ICON_SIZE_MENU, &w, &h); - gtk_widget_set_size_request (tool, w+2, h+2); + gtk_widget_set_size_request (tool, w + 2, h + 2); box = gtk_label_new (_("Account Wizard")); tab_label = gtk_hbox_new (FALSE, 0); @@ -1163,11 +1168,15 @@ mail_account_view_get_tab_widget (MailAccountView *mcv) } void -mail_account_view_activate (MailAccountView *mcv, GtkWidget *tree, GtkWidget *folder_tree, GtkWidget *check_mail, GtkWidget *sort_by, gboolean act) +mail_account_view_activate (MailAccountView *mcv, + GtkWidget *tree, + GtkWidget *folder_tree, + GtkWidget *check_mail, + GtkWidget *sort_by, + gboolean act) { if (!check_mail || !sort_by) return; - //gtk_widget_hide (folder_tree); gtk_widget_set_sensitive (check_mail, TRUE); gtk_widget_set_sensitive (sort_by, FALSE); } diff --git a/capplet/settings/mail-account-view.h b/capplet/settings/mail-account-view.h index 1b04533403..0a582c4a13 100644 --- a/capplet/settings/mail-account-view.h +++ b/capplet/settings/mail-account-view.h @@ -39,7 +39,7 @@ typedef struct _MailAccountViewPrivate MailAccountViewPrivate; typedef struct _MailAccountService MailAccountService; typedef enum { - MAV_IDENTITY_PAGE=0, + MAV_IDENTITY_PAGE = 0, MAV_RECV_PAGE, MAV_RECV_OPT_PAGE, MAV_SEND_PAGE, diff --git a/capplet/settings/mail-capplet-shell.c b/capplet/settings/mail-capplet-shell.c index 75e2e11fff..47956cd782 100644 --- a/capplet/settings/mail-capplet-shell.c +++ b/capplet/settings/mail-capplet-shell.c @@ -91,7 +91,7 @@ G_DEFINE_TYPE (MailCappletShell, mail_capplet_shell, GTK_TYPE_WINDOW) static void setup_abooks (void); static void -mail_capplet_shell_init (MailCappletShell *shell) +mail_capplet_shell_init (MailCappletShell *shell) { shell->priv = g_new0 (MailCappletShellPrivate, 1); shell->priv->settings_view = NULL; @@ -184,15 +184,15 @@ mail_capplet_shell_quit (MailCappletShell *shell) static void ms_delete_event (MailCappletShell *shell, - GdkEvent *event G_GNUC_UNUSED, - gpointer data G_GNUC_UNUSED) + GdkEvent *event G_GNUC_UNUSED, + gpointer data G_GNUC_UNUSED) { mail_capplet_shell_quit (shell); } static void ms_show_post_druid (MailViewChild *mfv G_GNUC_UNUSED, - MailCappletShell *shell) + MailCappletShell *shell) { gtk_widget_destroy (GTK_WIDGET (shell)); } @@ -200,7 +200,10 @@ ms_show_post_druid (MailViewChild *mfv G_GNUC_UNUSED, #define PACK_IN_TOOL(wid,icon) { GtkWidget *tbox; tbox = gtk_hbox_new (FALSE, 0); gtk_box_pack_start ((GtkBox *)tbox, gtk_image_new_from_icon_name(icon, GTK_ICON_SIZE_BUTTON), FALSE, FALSE, 0); wid = (GtkWidget *)gtk_tool_button_new (tbox, NULL); } static void -mail_capplet_shell_construct (MailCappletShell *shell, gint socket_id, gboolean just_druid, gboolean main_loop) +mail_capplet_shell_construct (MailCappletShell *shell, + gint socket_id, + gboolean just_druid, + gboolean main_loop) { MailCappletShellPrivate *priv = shell->priv; GtkStyle *style = gtk_widget_get_default_style (); @@ -292,7 +295,9 @@ mail_capplet_shell_construct (MailCappletShell *shell, gint socket_id, gboolean } GtkWidget * -mail_capplet_shell_new (gint socket_id, gboolean just_druid, gboolean main_loop) +mail_capplet_shell_new (gint socket_id, + gboolean just_druid, + gboolean main_loop) { MailCappletShell *shell = g_object_new (MAIL_CAPPLET_SHELL_TYPE, NULL); mail_capplet_shell_construct (shell, socket_id, just_druid, main_loop); @@ -351,7 +356,7 @@ setup_abooks (void) if (on_this_computer) { /* make sure "Personal" shows up as a source under - this group */ + * this group */ GSList *sources = e_source_group_peek_sources (on_this_computer); GSList *s; for (s = sources; s; s = s->next) { diff --git a/capplet/settings/mail-guess-servers.c b/capplet/settings/mail-guess-servers.c index 307aeeec1c..0b144940e9 100644 --- a/capplet/settings/mail-guess-servers.c +++ b/capplet/settings/mail-guess-servers.c @@ -50,7 +50,8 @@ #include "mail-guess-servers.h" static gchar * -xml_to_gchar (xmlChar *xml, EmailProvider *provider) +xml_to_gchar (xmlChar *xml, + EmailProvider *provider) { gchar *gxml = NULL; gchar *tmp; @@ -89,7 +90,8 @@ xml_to_gchar (xmlChar *xml, EmailProvider *provider) } static SoupMessage * -get_url (SoupSession *session, const gchar *url) +get_url (SoupSession *session, + const gchar *url) { SoupMessage *msg; const gchar *header; @@ -175,7 +177,9 @@ handle_outgoing (xmlNodePtr head, } static gboolean -parse_message (const gchar *msg, gint length, EmailProvider *provider) +parse_message (const gchar *msg, + gint length, + EmailProvider *provider) { xmlDocPtr doc; xmlNodePtr node; @@ -227,7 +231,8 @@ parse_message (const gchar *msg, gint length, EmailProvider *provider) } static gboolean -parse_soup_message (SoupMessage *msg, EmailProvider *provider) +parse_soup_message (SoupMessage *msg, + EmailProvider *provider) { return parse_message ( msg->response_body->data, @@ -334,7 +339,8 @@ mail_guess_servers (EmailProvider *provider) #ifdef TEST gint -main (gint argc, gchar **argv) +main (gint argc, + gchar **argv) { EmailProvider *provider; g_thread_init (NULL); diff --git a/capplet/settings/mail-settings-view.c b/capplet/settings/mail-settings-view.c index 3ae2c6d30c..a699dca9ea 100644 --- a/capplet/settings/mail-settings-view.c +++ b/capplet/settings/mail-settings-view.c @@ -52,7 +52,7 @@ static guint signals[LAST_SIGNAL] = { 0 }; static void msv_regen_view (MailSettingsView *acview); static void -mail_settings_view_init (MailSettingsView *shell) +mail_settings_view_init (MailSettingsView *shell) { shell->priv = g_new0 (MailSettingsViewPrivate, 1); @@ -94,7 +94,8 @@ mail_settings_view_class_init (MailSettingsViewClass *klass) } static void -msv_edit_account (GtkButton *button, MailSettingsView *msv) +msv_edit_account (GtkButton *button, + MailSettingsView *msv) { EAccount *acc = g_object_get_data((GObject *)button, "account"); @@ -102,7 +103,8 @@ msv_edit_account (GtkButton *button, MailSettingsView *msv) } static void -msv_delete_account (GtkButton *button, MailSettingsView *msv) +msv_delete_account (GtkButton *button, + MailSettingsView *msv) { EAccount *account = g_object_get_data((GObject *)button, "account"); EAccountList *account_list = e_get_account_list (); @@ -116,7 +118,9 @@ msv_delete_account (GtkButton *button, MailSettingsView *msv) } static void -msv_account_added (EAccountList *al, EAccount *account, MailSettingsView *msv) +msv_account_added (EAccountList *al, + EAccount *account, + MailSettingsView *msv) { msv_regen_view (msv); } @@ -124,7 +128,8 @@ msv_account_added (EAccountList *al, EAccount *account, MailSettingsView *msv) #define PACK_BOX(w,s) box = gtk_hbox_new(FALSE, 0); gtk_box_pack_start((GtkBox *)box, w, FALSE, FALSE, s); gtk_widget_show(box); gtk_widget_show(w); gtk_box_pack_start((GtkBox *)acview->priv->box, box, FALSE, FALSE, 3); static void -build_account_button (MailSettingsView *acview, EAccount *account) +build_account_button (MailSettingsView *acview, + EAccount *account) { GtkWidget *box, *box1, *label, *tbox, *tlabel; gchar *tmp; @@ -153,7 +158,7 @@ build_account_button (MailSettingsView *acview, EAccount *account) gtk_widget_show (tbox); gtk_container_add ((GtkContainer *) label, tbox); g_object_set_data ((GObject *)label, "account", account); - g_signal_connect(label, "clicked", G_CALLBACK(msv_edit_account), acview); + g_signal_connect (label, "clicked", G_CALLBACK(msv_edit_account), acview); gtk_box_pack_start ((GtkBox *) box1, label, FALSE, FALSE, 0); gtk_widget_show (label); @@ -171,7 +176,7 @@ build_account_button (MailSettingsView *acview, EAccount *account) static void msv_regen_view (MailSettingsView *acview) { - struct _EAccount *account; + EAccount *account; EAccountList *accounts = acview->priv->accounts; EIterator *node; GtkWidget *box, *label; @@ -226,7 +231,8 @@ mail_settings_view_new () } static void -msv_close (GtkButton *w, MailSettingsView *mfv) +msv_close (GtkButton *w, + MailSettingsView *mfv) { g_signal_emit (mfv, signals[VIEW_CLOSE], 0); } @@ -253,7 +259,7 @@ mail_settings_view_get_tab_widget (MailSettingsView *mcv) gtk_container_add ((GtkContainer *) tool, box); gtk_widget_show_all (tool); gtk_icon_size_lookup_for_settings (gtk_widget_get_settings (tool) , GTK_ICON_SIZE_MENU, &w, &h); - gtk_widget_set_size_request (tool, w+2, h+2); + gtk_widget_set_size_request (tool, w + 2, h + 2); box = gtk_label_new (_("Settings")); tab_label = gtk_hbox_new (FALSE, 0); @@ -268,12 +274,16 @@ mail_settings_view_get_tab_widget (MailSettingsView *mcv) } void -mail_settings_view_activate (MailSettingsView *mcv, GtkWidget *tree, GtkWidget *folder_tree, GtkWidget *check_mail, GtkWidget *sort_by, GtkWidget *slider, gboolean act) +mail_settings_view_activate (MailSettingsView *mcv, + GtkWidget *tree, + GtkWidget *folder_tree, + GtkWidget *check_mail, + GtkWidget *sort_by, + GtkWidget *slider, + gboolean act) { if (!check_mail || !sort_by) return; - //if (!GTK_WIDGET_VISIBLE (folder_tree)) - // gtk_widget_show (slider); gtk_widget_set_sensitive (check_mail, TRUE); gtk_widget_set_sensitive (sort_by, FALSE); } diff --git a/capplet/settings/mail-view.c b/capplet/settings/mail-view.c index 279b83c2d5..53daf3fd08 100644 --- a/capplet/settings/mail-view.c +++ b/capplet/settings/mail-view.c @@ -72,7 +72,7 @@ static MailConvView * mv_switch_message_view (MailView *mv, const gchar *uri); void anjal_shell_view_restore_state (EShellView *view, const gchar *uri); static void -mail_view_init (MailView *shell) +mail_view_init (MailView *shell) { shell->priv = g_new0 (MailViewPrivate, 1); shell->priv->children = NULL; @@ -95,7 +95,8 @@ mail_view_finalize (GObject *object) } static void -mv_set_folder_uri (AnjalMailView *mv, const gchar *uri) +mv_set_folder_uri (AnjalMailView *mv, + const gchar *uri) { #ifndef ANJAL_SETTINGS mail_view_set_folder_uri ((MailView *) mv, uri); @@ -108,7 +109,8 @@ static void set_folder_tree (AnjalMailView *mv, EMFolderTree *tree) } static void -set_search (AnjalMailView *mv, const gchar *search) +set_search (AnjalMailView *mv, + const gchar *search) { #ifndef ANJAL_SETTINGS mail_view_set_search ((MailView *) mv, search); @@ -138,7 +140,10 @@ mail_view_class_init (MailViewClass *klass) }; static void -mv_switch (GtkNotebook *notebook, GtkWidget *page, guint page_num, gpointer user_data) +mv_switch (GtkNotebook *notebook, + GtkWidget *page, + guint page_num, + gpointer user_data) { MailView *shell = (MailView *) notebook; MailViewPrivate *priv = shell->priv; @@ -192,21 +197,23 @@ mail_view_new () } static gint -mv_get_page_number (GtkNotebook *note, GtkWidget *widget) +mv_get_page_number (GtkNotebook *note, + GtkWidget *widget) { gint i, total; total = gtk_notebook_get_n_pages (note); - for (i=0; ishell_view, ((MailViewChild *) mfv)->uri); } static void -mv_folder_loaded (MailFolderView *mfv, MailView *mv) +mv_folder_loaded (MailFolderView *mfv, + MailView *mv) { g_signal_handlers_block_by_func (mfv, mv_folder_loaded, mv); g_signal_emit (mv, signals[VIEW_NEW], 0); } static MailViewChild * -mail_view_add_folder (MailView *mv, gpointer data, gboolean block) +mail_view_add_folder (MailView *mv, + gpointer data, + gboolean block) { MailFolderView *mfv = mail_folder_view_new (); gint position = 0; @@ -330,7 +344,9 @@ mail_view_add_folder (MailView *mv, gpointer data, gboolean block) } static MailViewChild * -mail_view_add_composer (MailView *mv, gpointer data, gboolean block) +mail_view_add_composer (MailView *mv, + gpointer data, + gboolean block) { MailComposerView *mcv; gint position = 0; @@ -338,7 +354,7 @@ mail_view_add_composer (MailView *mv, gpointer data, gboolean block) if (!data) mcv = mail_composer_view_new (); - else if (data == (gpointer)-1) { + else if (data == (gpointer) - 1) { special = TRUE; data = NULL; } else @@ -351,7 +367,7 @@ mail_view_add_composer (MailView *mv, gpointer data, gboolean block) position = gtk_notebook_append_page ((GtkNotebook *) mv, (GtkWidget *) mcv, mcv->tab_label); else { gint position = gtk_notebook_get_current_page ((GtkNotebook *) mv); - gtk_notebook_insert_page ((GtkNotebook *) mv, (GtkWidget *) mcv, mcv->tab_label, position+1); + gtk_notebook_insert_page ((GtkNotebook *) mv, (GtkWidget *) mcv, mcv->tab_label, position + 1); } gtk_notebook_set_tab_reorderable (GTK_NOTEBOOK (mv), (GtkWidget *) mcv, TRUE); @@ -368,7 +384,9 @@ mail_view_add_composer (MailView *mv, gpointer data, gboolean block) } static MailViewChild * -mail_view_add_message (MailView *mv, gpointer data, gboolean block) +mail_view_add_message (MailView *mv, + gpointer data, + gboolean block) { MailConvView *mcv = mail_conv_view_new (); gint position = 0; @@ -380,11 +398,11 @@ mail_view_add_message (MailView *mv, gpointer data, gboolean block) mv->priv->children = block ? g_list_append (mv->priv->children, mcv) : g_list_prepend (mv->priv->children, mcv); position = gtk_notebook_get_current_page ((GtkNotebook *) mv); - gtk_notebook_insert_page ((GtkNotebook *) mv, (GtkWidget *) mcv, mail_conv_view_get_tab_widget (mcv), position+1); + gtk_notebook_insert_page ((GtkNotebook *) mv, (GtkWidget *) mcv, mail_conv_view_get_tab_widget (mcv), position + 1); gtk_notebook_set_tab_reorderable (GTK_NOTEBOOK (mv), (GtkWidget *) mcv, TRUE); gtk_notebook_set_tab_detachable (GTK_NOTEBOOK (mv), (GtkWidget *) mcv, FALSE); if (!block) - gtk_notebook_set_current_page ((GtkNotebook *) mv, position+1); + gtk_notebook_set_current_page ((GtkNotebook *) mv, position + 1); if (!block) mail_conv_view_activate (mcv, mv->tree, mv->folder_tree, mv->check_mail, mv->sort_by, FALSE); @@ -397,13 +415,17 @@ mail_view_add_message (MailView *mv, gpointer data, gboolean block) #endif static void -mv_show_acc_mcv (MailViewChild *mfv, EAccount *account, MailView *mv) +mv_show_acc_mcv (MailViewChild *mfv, + EAccount *account, + MailView *mv) { mail_view_add_page (mv, MAIL_VIEW_ACCOUNT, account); } static MailViewChild * -mail_view_add_settings (MailView *mv, gpointer data, gboolean block) +mail_view_add_settings (MailView *mv, + gpointer data, + gboolean block) { MailSettingsView *msv = mail_settings_view_new (); gint position = 0; @@ -452,7 +474,9 @@ mail_view_add_account (MailView *mv, } MailViewChild * -mail_view_add_page (MailView *mv, guint16 type, gpointer data) +mail_view_add_page (MailView *mv, + guint16 type, + gpointer data) { MailViewChild *child = NULL, *current_child; gboolean block = FALSE; @@ -493,11 +517,12 @@ mail_view_add_page (MailView *mv, guint16 type, gpointer data) #ifndef ANJAL_SETTINGS static void -mv_switch_folder_view (MailView *mv, const gchar *uri) +mv_switch_folder_view (MailView *mv, + const gchar *uri) { - gint i=0, len = g_list_length (mv->priv->children); + gint i = 0, len = g_list_length (mv->priv->children); GList *tmp = mv->priv->children; - while (itype == MAIL_VIEW_FOLDER && !strcmp (uri, child->uri)) { @@ -515,9 +540,10 @@ mv_switch_folder_view (MailView *mv, const gchar *uri) } static MailConvView * -mv_switch_message_view (MailView *mv, const gchar *uri) +mv_switch_message_view (MailView *mv, + const gchar *uri) { - gint i=0; + gint i = 0; GList *tmp = mv->priv->children; while (tmp) { MailViewChild *child = tmp->data; @@ -535,7 +561,8 @@ mv_switch_message_view (MailView *mv, const gchar *uri) } void -mail_view_set_folder_uri (MailView *mv, const gchar *uri) +mail_view_set_folder_uri (MailView *mv, + const gchar *uri) { mv_switch_folder_view (mv, uri); @@ -551,21 +578,24 @@ mail_view_close_view (MailView *mv) } void -mail_view_set_folder_tree (MailView *mv, GtkWidget *tree) +mail_view_set_folder_tree (MailView *mv, + GtkWidget *tree) { mv->tree = tree; } #ifndef ANJAL_SETTINGS static void -mv_spinner_done (CamelFolder *f, gpointer data) +mv_spinner_done (CamelFolder *f, + gpointer data) { MailView *mv = (MailView *) data; mv_spinner_show (mv, FALSE); } void -mail_view_set_search (MailView *mv, const gchar *search) +mail_view_set_search (MailView *mv, + const gchar *search) { MailViewChild *child = (MailViewChild *) mv->priv->current_view; @@ -578,7 +608,8 @@ mail_view_set_search (MailView *mv, const gchar *search) #endif void -mail_view_set_shell_view (MailView *mv, EShellView *shell) +mail_view_set_shell_view (MailView *mv, + EShellView *shell) { mv->shell_view = shell; } diff --git a/capplet/settings/mail-view.h b/capplet/settings/mail-view.h index 6f814fd81e..3295cdb61c 100644 --- a/capplet/settings/mail-view.h +++ b/capplet/settings/mail-view.h @@ -36,7 +36,7 @@ #define MAIL_VIEW_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), MAIL_VIEW_TYPE, MailViewClass)) enum { - MAIL_VIEW_FOLDER=1, + MAIL_VIEW_FOLDER = 1, MAIL_VIEW_COMPOSER, MAIL_VIEW_MESSAGE, MAIL_VIEW_ACCOUNT, @@ -60,12 +60,12 @@ typedef struct _MailView { typedef struct _MailViewClass { AnjalMailViewClass parent_class; - void (* view_new) (MailView*); + void (* view_new) (MailView *); } MailViewClass; typedef enum { - MAIL_VIEW_HOLD_FOCUS=1, + MAIL_VIEW_HOLD_FOCUS = 1, } MailViewFlags; typedef struct _MailViewChild { diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c index 6f608ab302..157f9b6387 100644 --- a/composer/e-msg-composer.c +++ b/composer/e-msg-composer.c @@ -225,18 +225,19 @@ emcu_remove_xevolution_headers (CamelMimeMessage *message) { struct _camel_header_raw *scan, *list = NULL; - for (scan = ((CamelMimePart *) message)->headers;scan;scan=scan->next) + for (scan = ((CamelMimePart *) message)->headers; scan; scan = scan->next) if (!strncmp(scan->name, "X-Evolution", 11)) camel_header_raw_append (&list, scan->name, scan->value, scan->offset); - for (scan=list;scan;scan=scan->next) + for (scan = list; scan; scan = scan->next) camel_medium_remove_header ((CamelMedium *) message, scan->name); return list; } -static EDestination** -destination_list_to_vector_sized (GList *list, gint n) +static EDestination ** +destination_list_to_vector_sized (GList *list, + gint n) { EDestination **destv; gint i = 0; @@ -259,7 +260,7 @@ destination_list_to_vector_sized (GList *list, gint n) return destv; } -static EDestination** +static EDestination ** destination_list_to_vector (GList *list) { return destination_list_to_vector_sized (list, -1); @@ -268,7 +269,8 @@ destination_list_to_vector (GList *list) #define LINE_LEN 72 static gboolean -text_requires_quoted_printable (const gchar *text, gsize len) +text_requires_quoted_printable (const gchar *text, + gsize len) { const gchar *p; gsize pos; @@ -291,7 +293,8 @@ text_requires_quoted_printable (const gchar *text, gsize len) } static CamelTransferEncoding -best_encoding (GByteArray *buf, const gchar *charset) +best_encoding (GByteArray *buf, + const gchar *charset) { gchar *in, *out, outbuf[256], *ch; gsize inlen, outlen; @@ -385,7 +388,8 @@ e_msg_composer_clear_inlined_table (EMsgComposer *composer) } static void -add_inlined_images (EMsgComposer *composer, CamelMultipart *multipart) +add_inlined_images (EMsgComposer *composer, + CamelMultipart *multipart) { EMsgComposerPrivate *p = composer->priv; @@ -2720,7 +2724,7 @@ add_attachments_handle_mime_part (EMsgComposer *composer, static void add_attachments_from_multipart (EMsgComposer *composer, CamelMultipart *multipart, - gboolean just_inlines, + gboolean just_inlines, gint depth) { /* find appropriate message attachments to add to the composer */ @@ -2999,7 +3003,7 @@ handle_multipart_alternative (EMsgComposer *composer, break; } else if (camel_content_type_is (content_type, "text", "*")) { /* anyt text part not text/html is second rate so the first - text part we find isn't necessarily the one we'll use. */ + * text part we find isn't necessarily the one we'll use. */ if (!text_part) text_part = mime_part; } else { @@ -3334,7 +3338,7 @@ e_msg_composer_new_with_message (EShell *shell, format++; flags = g_strsplit (format, ", ", 0); - for (i=0;flags[i];i++) { + for (i = 0; flags[i]; i++) { if (g_ascii_strcasecmp (flags[i], "text/html") == 0) gtkhtml_editor_set_html_mode ( GTKHTML_EDITOR (composer), TRUE); @@ -3911,7 +3915,8 @@ e_msg_composer_print (EMsgComposer *composer, } static GList * -add_recipients (GList *list, const gchar *recips) +add_recipients (GList *list, + const gchar *recips) { CamelInternetAddress *cia; const gchar *name, *addr; @@ -4505,7 +4510,7 @@ e_msg_composer_add_inline_image_from_file (EMsgComposer *composer, * be wrapped in a multipart/related. **/ void -e_msg_composer_add_inline_image_from_mime_part (EMsgComposer *composer, +e_msg_composer_add_inline_image_from_mime_part (EMsgComposer *composer, CamelMimePart *part) { gchar *url; diff --git a/e-util/e-alert.c b/e-util/e-alert.c index 5ef7c577e8..88dbb7189d 100644 --- a/e-util/e-alert.c +++ b/e-util/e-alert.c @@ -149,17 +149,17 @@ map_type (const gchar *nick) } /* - XML format: - - - Primary error text.? - Secondary error text.? -
"); @@ -307,7 +299,9 @@ e_web_view_preview_end_update (EWebViewPreview *preview) } static gchar * -replace_string (const gchar *text, const gchar *find, const gchar *replace) +replace_string (const gchar *text, + const gchar *find, + const gchar *replace) { const gchar *p, *next; GString *str; @@ -337,7 +331,8 @@ replace_string (const gchar *text, const gchar *find, const gchar *replace) } static gchar * -web_view_preview_escape_text (EWebViewPreview *preview, const gchar *text) +web_view_preview_escape_text (EWebViewPreview *preview, + const gchar *text) { gchar *utf8_valid, *res, *end; @@ -375,13 +370,13 @@ web_view_preview_escape_text (EWebViewPreview *preview, const gchar *text) } void -e_web_view_preview_add_header (EWebViewPreview *preview, gint index, const gchar *header) +e_web_view_preview_add_header (EWebViewPreview *preview, + gint index, + const gchar *header) { gchar *escaped; - g_return_if_fail (preview != NULL); g_return_if_fail (E_IS_WEB_VIEW_PREVIEW (preview)); - g_return_if_fail (preview->priv != NULL); g_return_if_fail (preview->priv->updating_content != NULL); g_return_if_fail (header != NULL); @@ -400,13 +395,12 @@ e_web_view_preview_add_header (EWebViewPreview *preview, gint index, const gchar } void -e_web_view_preview_add_text (EWebViewPreview *preview, const gchar *text) +e_web_view_preview_add_text (EWebViewPreview *preview, + const gchar *text) { gchar *escaped; - g_return_if_fail (preview != NULL); g_return_if_fail (E_IS_WEB_VIEW_PREVIEW (preview)); - g_return_if_fail (preview->priv != NULL); g_return_if_fail (preview->priv->updating_content != NULL); g_return_if_fail (text != NULL); @@ -420,11 +414,10 @@ e_web_view_preview_add_text (EWebViewPreview *preview, const gchar *text) } void -e_web_view_preview_add_raw_html (EWebViewPreview *preview, const gchar *raw_html) +e_web_view_preview_add_raw_html (EWebViewPreview *preview, + const gchar *raw_html) { - g_return_if_fail (preview != NULL); g_return_if_fail (E_IS_WEB_VIEW_PREVIEW (preview)); - g_return_if_fail (preview->priv != NULL); g_return_if_fail (preview->priv->updating_content != NULL); g_return_if_fail (raw_html != NULL); @@ -434,9 +427,7 @@ e_web_view_preview_add_raw_html (EWebViewPreview *preview, const gchar *raw_html void e_web_view_preview_add_separator (EWebViewPreview *preview) { - g_return_if_fail (preview != NULL); g_return_if_fail (E_IS_WEB_VIEW_PREVIEW (preview)); - g_return_if_fail (preview->priv != NULL); g_return_if_fail (preview->priv->updating_content != NULL); g_string_append (preview->priv->updating_content, "
"); @@ -445,9 +436,7 @@ e_web_view_preview_add_separator (EWebViewPreview *preview) void e_web_view_preview_add_empty_line (EWebViewPreview *preview) { - g_return_if_fail (preview != NULL); g_return_if_fail (E_IS_WEB_VIEW_PREVIEW (preview)); - g_return_if_fail (preview->priv != NULL); g_return_if_fail (preview->priv->updating_content != NULL); g_string_append (preview->priv->updating_content, " "); @@ -455,13 +444,13 @@ e_web_view_preview_add_empty_line (EWebViewPreview *preview) /* section can be NULL, but value cannot */ void -e_web_view_preview_add_section (EWebViewPreview *preview, const gchar *section, const gchar *value) +e_web_view_preview_add_section (EWebViewPreview *preview, + const gchar *section, + const gchar *value) { gchar *escaped_section = NULL, *escaped_value; - g_return_if_fail (preview != NULL); g_return_if_fail (E_IS_WEB_VIEW_PREVIEW (preview)); - g_return_if_fail (preview->priv != NULL); g_return_if_fail (preview->priv->updating_content != NULL); g_return_if_fail (value != NULL); diff --git a/widgets/misc/e-web-view.c b/widgets/misc/e-web-view.c index 18529b603e..8e037ac66c 100644 --- a/widgets/misc/e-web-view.c +++ b/widgets/misc/e-web-view.c @@ -2049,7 +2049,8 @@ e_web_view_get_cursor_image_src (EWebView *web_view) } void -e_web_view_set_cursor_image_src (EWebView *web_view, const gchar *src_uri) +e_web_view_set_cursor_image_src (EWebView *web_view, + const gchar *src_uri) { g_return_if_fail (E_IS_WEB_VIEW (web_view)); diff --git a/widgets/misc/ea-calendar-cell.c b/widgets/misc/ea-calendar-cell.c index b8e53fd359..c71f4f4d47 100644 --- a/widgets/misc/ea-calendar-cell.c +++ b/widgets/misc/ea-calendar-cell.c @@ -70,7 +70,9 @@ e_calendar_cell_class_init (ECalendarCellClass *class) } ECalendarCell * -e_calendar_cell_new (ECalendarItem *calitem, gint row, gint column) +e_calendar_cell_new (ECalendarItem *calitem, + gint row, + gint column) { GObject *object; ECalendarCell *cell; @@ -182,7 +184,7 @@ ea_calendar_cell_init (EaCalendarCell *a11y) atk_state_set_add_state (a11y->state_set, ATK_STATE_FOCUSABLE); } -AtkObject* +AtkObject * ea_calendar_cell_new (GObject *obj) { gpointer object; @@ -316,8 +318,11 @@ atk_component_interface_init (AtkComponentIface *iface) static void component_interface_get_extents (AtkComponent *component, - gint *x, gint *y, gint *width, gint *height, - AtkCoordType coord_type) + gint *x, + gint *y, + gint *width, + gint *height, + AtkCoordType coord_type) { GObject *g_obj; AtkObject *atk_obj, *atk_canvas; diff --git a/widgets/misc/ea-calendar-cell.h b/widgets/misc/ea-calendar-cell.h index fa68fdca55..2fd2051538 100644 --- a/widgets/misc/ea-calendar-cell.h +++ b/widgets/misc/ea-calendar-cell.h @@ -79,7 +79,7 @@ struct _EaCalendarCellClass AtkGObjectAccessibleClass parent_class; }; -AtkObject* ea_calendar_cell_new (GObject *gobj); +AtkObject * ea_calendar_cell_new (GObject *gobj); G_END_DECLS diff --git a/widgets/misc/ea-calendar-item.c b/widgets/misc/ea-calendar-item.c index 5d482feb40..98a715eacf 100644 --- a/widgets/misc/ea-calendar-item.c +++ b/widgets/misc/ea-calendar-item.c @@ -45,7 +45,7 @@ static const gchar * ea_calendar_item_get_name (AtkObject *accessible); static const gchar * ea_calendar_item_get_description (AtkObject *accessible); static gint ea_calendar_item_get_n_children (AtkObject *accessible); static AtkObject *ea_calendar_item_ref_child (AtkObject *accessible, gint index); -static AtkStateSet* ea_calendar_item_ref_state_set (AtkObject *accessible); +static AtkStateSet * ea_calendar_item_ref_state_set (AtkObject *accessible); /* atk table interface */ static void atk_table_interface_init (AtkTableIface *iface); @@ -56,7 +56,7 @@ static gint table_interface_get_column_at_index (AtkTable *table, gint index); static gint table_interface_get_row_at_index (AtkTable *table, gint index); -static AtkObject* table_interface_ref_at (AtkTable *table, +static AtkObject * table_interface_ref_at (AtkTable *table, gint row, gint column); static gint table_interface_get_n_rows (AtkTable *table); @@ -86,29 +86,31 @@ static gboolean table_interface_add_column_selection (AtkTable *table, gint column); static gboolean table_interface_remove_column_selection (AtkTable *table, gint column); -static AtkObject* table_interface_get_row_header (AtkTable *table, gint row); -static AtkObject* table_interface_get_column_header (AtkTable *table, +static AtkObject * table_interface_get_row_header (AtkTable *table, gint row); +static AtkObject * table_interface_get_column_header (AtkTable *table, gint in_col); -static AtkObject* table_interface_get_caption (AtkTable *table); +static AtkObject * table_interface_get_caption (AtkTable *table); static const gchar * -table_interface_get_column_description (AtkTable *table, gint in_col); +table_interface_get_column_description (AtkTable *table, + gint in_col); static const gchar * -table_interface_get_row_description (AtkTable *table, gint row); +table_interface_get_row_description (AtkTable *table, + gint row); -static AtkObject* table_interface_get_summary (AtkTable *table); +static AtkObject *table_interface_get_summary (AtkTable *table); /* atk selection interface */ static void atk_selection_interface_init (AtkSelectionIface *iface); static gboolean selection_interface_add_selection (AtkSelection *selection, - gint i); + gint i); static gboolean selection_interface_clear_selection (AtkSelection *selection); -static AtkObject* selection_interface_ref_selection (AtkSelection *selection, - gint i); +static AtkObject *selection_interface_ref_selection (AtkSelection *selection, + gint i); static gint selection_interface_get_selection_count (AtkSelection *selection); static gboolean selection_interface_is_child_selected (AtkSelection *selection, - gint i); + gint i); /* callbacks */ static void selection_preview_change_cb (ECalendarItem *calitem); @@ -118,18 +120,20 @@ static void date_range_changed_cb (ECalendarItem *calitem); static EaCellTable *ea_calendar_item_get_cell_data (EaCalendarItem *ea_calitem); static void ea_calendar_item_destory_cell_data (EaCalendarItem *ea_calitem); static gboolean ea_calendar_item_get_column_label (EaCalendarItem *ea_calitem, - gint column, - gchar *buffer, - gint buffer_size); + gint column, + gchar *buffer, + gint buffer_size); static gboolean ea_calendar_item_get_row_label (EaCalendarItem *ea_calitem, - gint row, - gchar *buffer, - gint buffer_size); + gint row, + gchar *buffer, + gint buffer_size); static gboolean e_calendar_item_get_offset_for_date (ECalendarItem *calitem, - gint year, gint month, gint day, - gint *offset); + gint year, + gint month, + gint day, + gint *offset); static void ea_calendar_set_focus_object (EaCalendarItem *ea_calitem, - AtkObject *item_cell); + AtkObject *item_cell); #ifdef ACC_DEBUG static gint n_ea_calendar_item_created = 0; @@ -212,7 +216,7 @@ ea_calendar_item_class_init (EaCalendarItemClass *klass) class->ref_child = ea_calendar_item_ref_child; } -AtkObject* +AtkObject * ea_calendar_item_new (GObject *obj) { gpointer object; @@ -350,7 +354,7 @@ ea_calendar_item_get_description (AtkObject *accessible) return _("evolution calendar item"); } -static AtkStateSet* +static AtkStateSet * ea_calendar_item_ref_state_set (AtkObject *accessible) { AtkStateSet *state_set; @@ -403,7 +407,8 @@ ea_calendar_item_get_n_children (AtkObject *accessible) } static AtkObject * -ea_calendar_item_ref_child (AtkObject *accessible, gint index) +ea_calendar_item_ref_child (AtkObject *accessible, + gint index) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; @@ -482,14 +487,14 @@ atk_table_interface_init (AtkTableIface *iface) iface->get_column_description = table_interface_get_column_description; } -static AtkObject* +static AtkObject * table_interface_ref_at (AtkTable *table, - gint row, - gint column) + gint row, + gint column) { gint index; - EaCalendarItem* ea_calitem = EA_CALENDAR_ITEM (table); + EaCalendarItem * ea_calitem = EA_CALENDAR_ITEM (table); index = EA_CALENDAR_COLUMN_NUM * row + column; return ea_calendar_item_ref_child (ATK_OBJECT (ea_calitem), index); } @@ -499,7 +504,7 @@ table_interface_get_n_rows (AtkTable *table) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; - EaCalendarItem* ea_calitem = EA_CALENDAR_ITEM (table); + EaCalendarItem * ea_calitem = EA_CALENDAR_ITEM (table); gint n_children; atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_calitem); @@ -516,7 +521,7 @@ table_interface_get_n_columns (AtkTable *table) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; - EaCalendarItem* ea_calitem = EA_CALENDAR_ITEM (table); + EaCalendarItem * ea_calitem = EA_CALENDAR_ITEM (table); atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_calitem); g_obj = atk_gobject_accessible_get_object (atk_gobj); @@ -528,12 +533,12 @@ table_interface_get_n_columns (AtkTable *table) static gint table_interface_get_index_at (AtkTable *table, - gint row, - gint column) + gint row, + gint column) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; - EaCalendarItem* ea_calitem = EA_CALENDAR_ITEM (table); + EaCalendarItem * ea_calitem = EA_CALENDAR_ITEM (table); atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_calitem); g_obj = atk_gobject_accessible_get_object (atk_gobj); @@ -545,11 +550,11 @@ table_interface_get_index_at (AtkTable *table, static gint table_interface_get_column_at_index (AtkTable *table, - gint index) + gint index) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; - EaCalendarItem* ea_calitem = EA_CALENDAR_ITEM (table); + EaCalendarItem * ea_calitem = EA_CALENDAR_ITEM (table); gint n_children; atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_calitem); @@ -565,11 +570,11 @@ table_interface_get_column_at_index (AtkTable *table, static gint table_interface_get_row_at_index (AtkTable *table, - gint index) + gint index) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; - EaCalendarItem* ea_calitem = EA_CALENDAR_ITEM (table); + EaCalendarItem * ea_calitem = EA_CALENDAR_ITEM (table); gint n_children; atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_calitem); @@ -584,14 +589,14 @@ table_interface_get_row_at_index (AtkTable *table, } static gint -table_interface_get_column_extent_at (AtkTable *table, - gint row, - gint column) +table_interface_get_column_extent_at (AtkTable *table, + gint row, + gint column) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; ECalendarItem *calitem; - EaCalendarItem* ea_calitem = EA_CALENDAR_ITEM (table); + EaCalendarItem * ea_calitem = EA_CALENDAR_ITEM (table); atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_calitem); g_obj = atk_gobject_accessible_get_object (atk_gobj); @@ -604,12 +609,13 @@ table_interface_get_column_extent_at (AtkTable *table, static gint table_interface_get_row_extent_at (AtkTable *table, - gint row, gint column) + gint row, + gint column) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; ECalendarItem *calitem; - EaCalendarItem* ea_calitem = EA_CALENDAR_ITEM (table); + EaCalendarItem * ea_calitem = EA_CALENDAR_ITEM (table); atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_calitem); g_obj = atk_gobject_accessible_get_object (atk_gobj); @@ -623,7 +629,7 @@ table_interface_get_row_extent_at (AtkTable *table, /* any day in the row is selected, the row is selected */ static gboolean table_interface_is_row_selected (AtkTable *table, - gint row) + gint row) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; @@ -673,8 +679,8 @@ table_interface_is_row_selected (AtkTable *table, static gboolean table_interface_is_selected (AtkTable *table, - gint row, - gint column) + gint row, + gint column) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; @@ -722,14 +728,14 @@ table_interface_is_selected (AtkTable *table, static gboolean table_interface_is_column_selected (AtkTable *table, - gint column) + gint column) { return FALSE; } static gint table_interface_get_selected_rows (AtkTable *table, - gint **rows_selected) + gint **rows_selected) { *rows_selected = NULL; return -1; @@ -737,7 +743,7 @@ table_interface_get_selected_rows (AtkTable *table, static gint table_interface_get_selected_columns (AtkTable *table, - gint **columns_selected) + gint **columns_selected) { *columns_selected = NULL; return -1; @@ -745,62 +751,63 @@ table_interface_get_selected_columns (AtkTable *table, static gboolean table_interface_add_row_selection (AtkTable *table, - gint row) + gint row) { return FALSE; } static gboolean table_interface_remove_row_selection (AtkTable *table, - gint row) + gint row) { return FALSE; } static gboolean table_interface_add_column_selection (AtkTable *table, - gint column) + gint column) { return FALSE; } static gboolean table_interface_remove_column_selection (AtkTable *table, - gint column) + gint column) { /* FIXME: NOT IMPLEMENTED */ return FALSE; } -static AtkObject* +static AtkObject * table_interface_get_row_header (AtkTable *table, - gint row) + gint row) { /* FIXME: NOT IMPLEMENTED */ return NULL; } -static AtkObject* +static AtkObject * table_interface_get_column_header (AtkTable *table, - gint in_col) + gint in_col) { /* FIXME: NOT IMPLEMENTED */ return NULL; } -static AtkObject* -table_interface_get_caption (AtkTable *table) +static AtkObject * +table_interface_get_caption (AtkTable *table) { /* FIXME: NOT IMPLEMENTED */ return NULL; } static const gchar * -table_interface_get_column_description (AtkTable *table, gint in_col) +table_interface_get_column_description (AtkTable *table, + gint in_col) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; - EaCalendarItem* ea_calitem = EA_CALENDAR_ITEM (table); + EaCalendarItem * ea_calitem = EA_CALENDAR_ITEM (table); const gchar *description = NULL; EaCellTable *cell_data; gint n_columns; @@ -830,11 +837,12 @@ table_interface_get_column_description (AtkTable *table, gint in_col) } static const gchar * -table_interface_get_row_description (AtkTable *table, gint row) +table_interface_get_row_description (AtkTable *table, + gint row) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; - EaCalendarItem* ea_calitem = EA_CALENDAR_ITEM (table); + EaCalendarItem * ea_calitem = EA_CALENDAR_ITEM (table); const gchar *description = NULL; EaCellTable *cell_data; gint n_rows; @@ -863,8 +871,8 @@ table_interface_get_row_description (AtkTable *table, gint row) return description; } -static AtkObject* -table_interface_get_summary (AtkTable *table) +static AtkObject * +table_interface_get_summary (AtkTable *table) { /* FIXME: NOT IMPLEMENTED */ return NULL; @@ -885,12 +893,13 @@ atk_selection_interface_init (AtkSelectionIface *iface) } static gboolean -selection_interface_add_selection (AtkSelection *selection, gint index) +selection_interface_add_selection (AtkSelection *selection, + gint index) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; ECalendarItem *calitem; - EaCalendarItem* ea_calitem = EA_CALENDAR_ITEM (selection); + EaCalendarItem * ea_calitem = EA_CALENDAR_ITEM (selection); gint year, month, day; GDate start_date, end_date; @@ -917,7 +926,7 @@ selection_interface_clear_selection (AtkSelection *selection) AtkGObjectAccessible *atk_gobj; GObject *g_obj; ECalendarItem *calitem; - EaCalendarItem* ea_calitem = EA_CALENDAR_ITEM (selection); + EaCalendarItem * ea_calitem = EA_CALENDAR_ITEM (selection); atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_calitem); g_obj = atk_gobject_accessible_get_object (atk_gobj); @@ -930,12 +939,13 @@ selection_interface_clear_selection (AtkSelection *selection) return TRUE; } -static AtkObject* -selection_interface_ref_selection (AtkSelection *selection, gint i) +static AtkObject * +selection_interface_ref_selection (AtkSelection *selection, + gint i) { GObject *g_obj; ECalendarItem *calitem; - EaCalendarItem* ea_calitem = EA_CALENDAR_ITEM (selection); + EaCalendarItem * ea_calitem = EA_CALENDAR_ITEM (selection); gint count, sel_offset; GDate start_date, end_date; @@ -964,7 +974,7 @@ selection_interface_get_selection_count (AtkSelection *selection) AtkGObjectAccessible *atk_gobj; GObject *g_obj; ECalendarItem *calitem; - EaCalendarItem* ea_calitem = EA_CALENDAR_ITEM (selection); + EaCalendarItem * ea_calitem = EA_CALENDAR_ITEM (selection); GDate start_date, end_date; atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_calitem); @@ -980,11 +990,12 @@ selection_interface_get_selection_count (AtkSelection *selection) } static gboolean -selection_interface_is_child_selected (AtkSelection *selection, gint index) +selection_interface_is_child_selected (AtkSelection *selection, + gint index) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; - EaCalendarItem* ea_calitem = EA_CALENDAR_ITEM (selection); + EaCalendarItem * ea_calitem = EA_CALENDAR_ITEM (selection); gint row, column, n_children; atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_calitem); @@ -1066,7 +1077,7 @@ ea_calendar_item_get_cell_data (EaCalendarItem *ea_calitem) if (!cell_data) { gint n_cells = ea_calendar_item_get_n_children (ATK_OBJECT (ea_calitem)); - cell_data = ea_cell_table_create (n_cells/EA_CALENDAR_COLUMN_NUM, + cell_data = ea_cell_table_create (n_cells / EA_CALENDAR_COLUMN_NUM, EA_CALENDAR_COLUMN_NUM, FALSE); g_object_set_data (G_OBJECT (ea_calitem), @@ -1092,8 +1103,10 @@ ea_calendar_item_destory_cell_data (EaCalendarItem *ea_calitem) } static gboolean -ea_calendar_item_get_row_label (EaCalendarItem *ea_calitem, gint row, - gchar *buffer, gint buffer_size) +ea_calendar_item_get_row_label (EaCalendarItem *ea_calitem, + gint row, + gchar *buffer, + gint buffer_size) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; @@ -1123,8 +1136,10 @@ ea_calendar_item_get_row_label (EaCalendarItem *ea_calitem, gint row, } static gboolean -ea_calendar_item_get_column_label (EaCalendarItem *ea_calitem, gint column, - gchar *buffer, gint buffer_size) +ea_calendar_item_get_column_label (EaCalendarItem *ea_calitem, + gint column, + gchar *buffer, + gint buffer_size) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; @@ -1147,9 +1162,13 @@ ea_calendar_item_get_column_label (EaCalendarItem *ea_calitem, gint column, /* the coordinate the e-calendar canvas coord */ gboolean e_calendar_item_get_day_extents (ECalendarItem *calitem, - gint year, gint month, gint date, - gint *x, gint *y, - gint *width, gint *height) + gint year, + gint month, + gint date, + gint *x, + gint *y, + gint *width, + gint *height) { GnomeCanvasItem *item; GtkWidget *widget; @@ -1229,8 +1248,11 @@ e_calendar_item_get_day_extents (ECalendarItem *calitem, /* month is from 0 to 11 */ gboolean -e_calendar_item_get_date_for_offset (ECalendarItem *calitem, gint day_offset, - gint *year, gint *month, gint *day) +e_calendar_item_get_date_for_offset (ECalendarItem *calitem, + gint day_offset, + gint *year, + gint *month, + gint *day) { gint start_year, start_month, start_day; gint end_year, end_month, end_day; @@ -1258,8 +1280,10 @@ e_calendar_item_get_date_for_offset (ECalendarItem *calitem, gint day_offset, /* the arg month is from 0 to 11 */ static gboolean e_calendar_item_get_offset_for_date (ECalendarItem *calitem, - gint year, gint month, gint day, - gint *offset) + gint year, + gint month, + gint day, + gint *offset) { gint start_year, start_month, start_day; gint end_year, end_month, end_day; @@ -1286,7 +1310,8 @@ e_calendar_item_get_offset_for_date (ECalendarItem *calitem, gint e_calendar_item_get_n_days_from_week_start (ECalendarItem *calitem, - gint year, gint month) + gint year, + gint month) { struct tm tmp_tm; gint start_weekday, days_from_week_start; @@ -1304,7 +1329,8 @@ e_calendar_item_get_n_days_from_week_start (ECalendarItem *calitem, } static void -ea_calendar_set_focus_object (EaCalendarItem *ea_calitem, AtkObject *item_cell) +ea_calendar_set_focus_object (EaCalendarItem *ea_calitem, + AtkObject *item_cell) { AtkStateSet *state_set, *old_state_set; AtkObject *old_cell; diff --git a/widgets/misc/ea-cell-table.c b/widgets/misc/ea-cell-table.c index c0c2bc0cde..bbdef0aea1 100644 --- a/widgets/misc/ea-cell-table.c +++ b/widgets/misc/ea-cell-table.c @@ -27,9 +27,11 @@ #include "ea-cell-table.h" EaCellTable * -ea_cell_table_create (gint rows, gint columns, gboolean column_first) +ea_cell_table_create (gint rows, + gint columns, + gboolean column_first) { - EaCellTable * cell_data; + EaCellTable *cell_data; gint index; g_return_val_if_fail (((columns > 0) && (rows > 0)), NULL); @@ -55,7 +57,7 @@ ea_cell_table_create (gint rows, gint columns, gboolean column_first) } void -ea_cell_table_destroy (EaCellTable * cell_data) +ea_cell_table_destroy (EaCellTable *cell_data) { gint index; g_return_if_fail (cell_data); @@ -80,8 +82,9 @@ ea_cell_table_destroy (EaCellTable * cell_data) } gpointer -ea_cell_table_get_cell (EaCellTable * cell_data, - gint row, gint column) +ea_cell_table_get_cell (EaCellTable *cell_data, + gint row, + gint column) { gint index; @@ -95,8 +98,10 @@ ea_cell_table_get_cell (EaCellTable * cell_data, } gboolean -ea_cell_table_set_cell (EaCellTable * cell_data, - gint row, gint column, gpointer cell) +ea_cell_table_set_cell (EaCellTable *cell_data, + gint row, + gint column, + gpointer cell) { gint index; @@ -117,8 +122,8 @@ ea_cell_table_set_cell (EaCellTable * cell_data, } gpointer -ea_cell_table_get_cell_at_index (EaCellTable * cell_data, - gint index) +ea_cell_table_get_cell_at_index (EaCellTable *cell_data, + gint index) { g_return_val_if_fail (cell_data, NULL); @@ -128,8 +133,9 @@ ea_cell_table_get_cell_at_index (EaCellTable * cell_data, } gboolean -ea_cell_table_set_cell_at_index (EaCellTable * cell_data, - gint index, gpointer cell) +ea_cell_table_set_cell_at_index (EaCellTable *cell_data, + gint index, + gpointer cell) { g_return_val_if_fail (cell_data, FALSE); @@ -147,8 +153,8 @@ ea_cell_table_set_cell_at_index (EaCellTable * cell_data, } const gchar * -ea_cell_table_get_column_label (EaCellTable * cell_data, - gint column) +ea_cell_table_get_column_label (EaCellTable *cell_data, + gint column) { g_return_val_if_fail (cell_data, NULL); g_return_val_if_fail ((column >= 0 && column < cell_data->columns), NULL); @@ -157,8 +163,9 @@ ea_cell_table_get_column_label (EaCellTable * cell_data, } void -ea_cell_table_set_column_label (EaCellTable * cell_data, - gint column, const gchar *label) +ea_cell_table_set_column_label (EaCellTable *cell_data, + gint column, + const gchar *label) { g_return_if_fail (cell_data); g_return_if_fail ((column >= 0 && column < cell_data->columns)); @@ -169,8 +176,8 @@ ea_cell_table_set_column_label (EaCellTable * cell_data, } const gchar * -ea_cell_table_get_row_label (EaCellTable * cell_data, - gint row) +ea_cell_table_get_row_label (EaCellTable *cell_data, + gint row) { g_return_val_if_fail (cell_data, NULL); g_return_val_if_fail ((row >= 0 && row < cell_data->rows), NULL); @@ -179,8 +186,9 @@ ea_cell_table_get_row_label (EaCellTable * cell_data, } void -ea_cell_table_set_row_label (EaCellTable * cell_data, - gint row, const gchar *label) +ea_cell_table_set_row_label (EaCellTable *cell_data, + gint row, + const gchar *label) { g_return_if_fail (cell_data); g_return_if_fail ((row >= 0 && row < cell_data->rows)); @@ -192,7 +200,8 @@ ea_cell_table_set_row_label (EaCellTable * cell_data, gint ea_cell_table_get_index (EaCellTable *cell_data, - gint row, gint column) + gint row, + gint column) { g_return_val_if_fail (cell_data, -1); if (row < 0 || row >= cell_data->rows || diff --git a/widgets/misc/test-calendar.c b/widgets/misc/test-calendar.c index 83b8f11cd7..7a4d2f8954 100644 --- a/widgets/misc/test-calendar.c +++ b/widgets/misc/test-calendar.c @@ -46,14 +46,15 @@ static void on_selection_changed (ECalendarItem *calitem); static void delete_event_cb (GtkWidget *widget, - GdkEventAny *event, - gpointer data) + GdkEventAny *event, + gpointer data) { gtk_main_quit (); } gint -main (gint argc, gchar **argv) +main (gint argc, + gchar **argv) { GtkWidget *window; GtkWidget *cal; diff --git a/widgets/misc/test-dateedit.c b/widgets/misc/test-dateedit.c index 79ca726c3e..2629fad4e0 100644 --- a/widgets/misc/test-dateedit.c +++ b/widgets/misc/test-dateedit.c @@ -48,7 +48,8 @@ static void on_time_changed (EDateEdit *dedit, #endif gint -main (gint argc, gchar **argv) +main (gint argc, + gchar **argv) { GtkWidget *window; EDateEdit *dedit; @@ -94,14 +95,14 @@ main (gint argc, gchar **argv) gtk_table_attach (GTK_TABLE (table), button, 1, 2, 0, 1, 0, 0, 0, 0); gtk_widget_show (button); - g_signal_connect((button), "clicked", + g_signal_connect ((button), "clicked", G_CALLBACK (on_get_date_clicked), dedit); /* EDateEdit 2. */ dedit = E_DATE_EDIT (e_date_edit_new ()); - gtk_table_attach (GTK_TABLE (table), (GtkWidget*) dedit, + gtk_table_attach (GTK_TABLE (table), (GtkWidget *) dedit, 0, 1, 1, 2, GTK_FILL, GTK_EXPAND, 0, 0); - gtk_widget_show ((GtkWidget*) (dedit)); + gtk_widget_show ((GtkWidget *) (dedit)); e_date_edit_set_week_start_day (dedit, 1); e_date_edit_set_show_week_numbers (dedit, TRUE); e_date_edit_set_use_24_hour_format (dedit, FALSE); @@ -127,9 +128,9 @@ main (gint argc, gchar **argv) /* EDateEdit 3. */ dedit = E_DATE_EDIT (e_date_edit_new ()); - gtk_table_attach (GTK_TABLE (table), (GtkWidget*) dedit, + gtk_table_attach (GTK_TABLE (table), (GtkWidget *) dedit, 0, 1, 2, 3, GTK_FILL, GTK_EXPAND, 0, 0); - gtk_widget_show ((GtkWidget*) (dedit)); + gtk_widget_show ((GtkWidget *) (dedit)); e_date_edit_set_week_start_day (dedit, 1); e_date_edit_set_show_week_numbers (dedit, TRUE); e_date_edit_set_use_24_hour_format (dedit, FALSE); @@ -168,9 +169,9 @@ main (gint argc, gchar **argv) } static void -delete_event_cb (GtkWidget *widget, - GdkEventAny *event, - GtkWidget *window) +delete_event_cb (GtkWidget *widget, + GdkEventAny *event, + GtkWidget *window) { gtk_widget_destroy (window); @@ -178,8 +179,8 @@ delete_event_cb (GtkWidget *widget, } static void -on_get_date_clicked (GtkWidget *button, - EDateEdit *dedit) +on_get_date_clicked (GtkWidget *button, + EDateEdit *dedit) { time_t t; @@ -197,8 +198,8 @@ on_get_date_clicked (GtkWidget *button, } static void -on_toggle_24_hour_clicked (GtkWidget *button, - EDateEdit *dedit) +on_toggle_24_hour_clicked (GtkWidget *button, + EDateEdit *dedit) { gboolean use_24_hour_format; @@ -208,8 +209,8 @@ on_toggle_24_hour_clicked (GtkWidget *button, #if 0 static void -on_date_changed (EDateEdit *dedit, - gchar *name) +on_date_changed (EDateEdit *dedit, + gchar *name) { gint year, month, day; @@ -226,8 +227,8 @@ on_date_changed (EDateEdit *dedit, } static void -on_time_changed (EDateEdit *dedit, - gchar *name) +on_time_changed (EDateEdit *dedit, + gchar *name) { gint hour, minute; @@ -245,8 +246,8 @@ on_time_changed (EDateEdit *dedit, #endif static void -on_changed (EDateEdit *dedit, - gchar *name) +on_changed (EDateEdit *dedit, + gchar *name) { gint year, month, day, hour, minute; diff --git a/widgets/misc/test-preferences-window.c b/widgets/misc/test-preferences-window.c index e7c4499d6a..738d7ff403 100644 --- a/widgets/misc/test-preferences-window.c +++ b/widgets/misc/test-preferences-window.c @@ -71,8 +71,8 @@ add_pages (EPreferencesWindow *preferences_window) static gint delete_event_callback (GtkWidget *widget, - GdkEventAny *event, - gpointer data) + GdkEventAny *event, + gpointer data) { gtk_main_quit (); @@ -80,7 +80,8 @@ delete_event_callback (GtkWidget *widget, } gint -main (gint argc, gchar **argv) +main (gint argc, + gchar **argv) { GtkWidget *window; diff --git a/widgets/table/e-cell-checkbox.c b/widgets/table/e-cell-checkbox.c index 7969e2b4f0..9e775761c7 100644 --- a/widgets/table/e-cell-checkbox.c +++ b/widgets/table/e-cell-checkbox.c @@ -42,9 +42,13 @@ G_DEFINE_TYPE (ECellCheckbox, e_cell_checkbox, E_TYPE_CELL_TOGGLE) static GdkPixbuf *checks[2]; static void -ecc_print (ECellView *ecell_view, GtkPrintContext *context, - gint model_col, gint view_col, gint row, - gdouble width, gdouble height) +ecc_print (ECellView *ecell_view, + GtkPrintContext *context, + gint model_col, + gint view_col, + gint row, + gdouble width, + gdouble height) { cairo_t *cr = gtk_print_context_get_cairo_context (context); const gint value = GPOINTER_TO_INT ( diff --git a/widgets/table/e-cell-combo.c b/widgets/table/e-cell-combo.c index f759185a56..2617cfafdf 100644 --- a/widgets/table/e-cell-combo.c +++ b/widgets/table/e-cell-combo.c @@ -109,7 +109,7 @@ static void e_cell_combo_restart_edit (ECellCombo *ecc); G_DEFINE_TYPE (ECellCombo, e_cell_combo, E_TYPE_CELL_POPUP) static void -e_cell_combo_class_init (ECellComboClass *class) +e_cell_combo_class_init (ECellComboClass *class) { ECellPopupClass *ecpc = E_CELL_POPUP_CLASS (class); GObjectClass *object_class = G_OBJECT_CLASS (class); @@ -120,7 +120,7 @@ e_cell_combo_class_init (ECellComboClass *class) } static void -e_cell_combo_init (ECellCombo *ecc) +e_cell_combo_init (ECellCombo *ecc) { GtkWidget *frame; AtkObject *a11y; @@ -129,7 +129,7 @@ e_cell_combo_init (ECellCombo *ecc) GtkScrolledWindow *scrolled_window; /* We create one popup window for the ECell, since there will only - ever be one popup in use at a time. */ + * ever be one popup in use at a time. */ ecc->popup_window = gtk_window_new (GTK_WINDOW_POPUP); gtk_window_set_type_hint ( @@ -292,10 +292,10 @@ e_cell_combo_do_popup (ECellPopup *ecp, } static void -e_cell_combo_select_matching_item (ECellCombo *ecc) +e_cell_combo_select_matching_item (ECellCombo *ecc) { ECellPopup *ecp = E_CELL_POPUP (ecc); - ECellView *ecv = (ECellView*) ecp->popup_cell_view; + ECellView *ecv = (ECellView *) ecp->popup_cell_view; ECellText *ecell_text = E_CELL_TEXT (ecp->child); ETableItem *eti = E_TABLE_ITEM (ecp->popup_cell_view->cell_view.e_table_item_view); ETableCol *ecol; @@ -342,7 +342,9 @@ e_cell_combo_select_matching_item (ECellCombo *ecc) } static void -e_cell_combo_show_popup (ECellCombo *ecc, gint row, gint view_col) +e_cell_combo_show_popup (ECellCombo *ecc, + gint row, + gint view_col) { GdkWindow *window; GtkAllocation allocation; @@ -379,13 +381,13 @@ e_cell_combo_show_popup (ECellCombo *ecc, gint row, gint view_col) /* Calculates the size and position of the popup window (like GtkCombo). */ static void -e_cell_combo_get_popup_pos (ECellCombo *ecc, - gint row, - gint view_col, - gint *x, - gint *y, - gint *height, - gint *width) +e_cell_combo_get_popup_pos (ECellCombo *ecc, + gint row, + gint view_col, + gint *x, + gint *y, + gint *height, + gint *width) { ECellPopup *ecp = E_CELL_POPUP (ecc); ETableItem *eti = E_TABLE_ITEM (ecp->popup_cell_view->cell_view.e_table_item_view); @@ -448,7 +450,7 @@ e_cell_combo_get_popup_pos (ECellCombo *ecc, avail_height = gdk_screen_height () - *y; /* We'll use the entire screen width if needed, but we save space for - the vertical scrollbar in case we need to show that. */ + * the vertical scrollbar in case we need to show that. */ screen_width = gdk_screen_width (); avail_width = screen_width - scrollbar_width; @@ -481,7 +483,7 @@ e_cell_combo_get_popup_pos (ECellCombo *ecc, *width = column_width; /* If it is larger than the available width, use that instead and show - the horizontal scrollbar. */ + * the horizontal scrollbar. */ if (*width > avail_width) { *width = avail_width; show_hscroll = TRUE; @@ -506,11 +508,11 @@ e_cell_combo_get_popup_pos (ECellCombo *ecc, /* Check if it fits in the available height. */ if (work_height + list_requisition.height > avail_height) { /* It doesn't fit, so we see if we have the minimum space - needed. */ + * needed. */ if (work_height + min_height > avail_height && *y - row_height > avail_height) { /* We don't, so we show the popup above the cell - instead of below it. */ + * instead of below it. */ avail_height = *y - row_height; *y -= (work_height + list_requisition.height + row_height); @@ -526,7 +528,7 @@ e_cell_combo_get_popup_pos (ECellCombo *ecc, } /* We try to line it up with the right edge of the column, but we don't - want it to go off the edges of the screen. */ + * want it to go off the edges of the screen. */ if (*x > screen_width) *x = screen_width; *x -= *width; @@ -540,7 +542,8 @@ e_cell_combo_get_popup_pos (ECellCombo *ecc, } static void -e_cell_combo_selection_changed (GtkTreeSelection *selection, ECellCombo *ecc) +e_cell_combo_selection_changed (GtkTreeSelection *selection, + ECellCombo *ecc) { GtkTreeIter iter; GtkTreeModel *model; @@ -554,25 +557,25 @@ e_cell_combo_selection_changed (GtkTreeSelection *selection, ECellCombo *ecc) } /* This handles button press events in the popup window. - Note that since we have a pointer grab on this window, we also get button - press events for windows outside the application here, so we hide the popup - window if that happens. We also get propagated events from child widgets - which we ignore. */ + * Note that since we have a pointer grab on this window, we also get button + * press events for windows outside the application here, so we hide the popup + * window if that happens. We also get propagated events from child widgets + * which we ignore. */ static gint -e_cell_combo_button_press (GtkWidget *popup_window, - GdkEvent *event, - ECellCombo *ecc) +e_cell_combo_button_press (GtkWidget *popup_window, + GdkEvent *event, + ECellCombo *ecc) { GtkWidget *event_widget; event_widget = gtk_get_event_widget (event); /* If the button press was for a widget inside the popup list, but - not the popup window itself, then we ignore the event and return - FALSE. Otherwise we will hide the popup. - Note that since we have a pointer grab on the popup list, button - presses outside the application will be reported to this window, - which is why we hide the popup in this case. */ + * not the popup window itself, then we ignore the event and return + * FALSE. Otherwise we will hide the popup. + * Note that since we have a pointer grab on the popup list, button + * presses outside the application will be reported to this window, + * which is why we hide the popup in this case. */ while (event_widget) { event_widget = gtk_widget_get_parent (event_widget); if (event_widget == ecc->popup_tree_view) @@ -588,10 +591,10 @@ e_cell_combo_button_press (GtkWidget *popup_window, d(g_print("%s: popup_shown = FALSE\n", __FUNCTION__)); /* We don't want to update the cell here. Since the list is in browse - mode there will always be one item selected, so when we popup the - list one item is selected even if it doesn't match the current text - in the cell. So if you click outside the popup (which is what has - happened here) it is better to not update the cell. */ + * mode there will always be one item selected, so when we popup the + * list one item is selected even if it doesn't match the current text + * in the cell. So if you click outside the popup (which is what has + * happened here) it is better to not update the cell. */ /*e_cell_combo_update_cell (ecc);*/ e_cell_combo_restart_edit (ecc); @@ -599,16 +602,16 @@ e_cell_combo_button_press (GtkWidget *popup_window, } /* This handles button release events in the popup window. If the button is - released inside the list, we want to hide the popup window and update the - cell with the new selection. */ + * released inside the list, we want to hide the popup window and update the + * cell with the new selection. */ static gint -e_cell_combo_button_release (GtkWidget *popup_window, - GdkEventButton *event, - ECellCombo *ecc) +e_cell_combo_button_release (GtkWidget *popup_window, + GdkEventButton *event, + ECellCombo *ecc) { GtkWidget *event_widget; - event_widget = gtk_get_event_widget ((GdkEvent*) event); + event_widget = gtk_get_event_widget ((GdkEvent *) event); /* See if the button was released in the list (or its children). */ while (event_widget && event_widget != ecc->popup_tree_view) @@ -619,7 +622,7 @@ e_cell_combo_button_release (GtkWidget *popup_window, return FALSE; /* The button was released inside the list, so we hide the popup and - update the cell to reflect the new selection. */ + * update the cell to reflect the new selection. */ gtk_grab_remove (ecc->popup_window); gdk_pointer_ungrab (event->time); gdk_keyboard_ungrab (event->time); @@ -635,11 +638,11 @@ e_cell_combo_button_release (GtkWidget *popup_window, } /* This handles key press events in the popup window. If the Escape key is - pressed we hide the popup, and do not change the cell contents. */ + * pressed we hide the popup, and do not change the cell contents. */ static gint -e_cell_combo_key_press (GtkWidget *popup_window, - GdkEventKey *event, - ECellCombo *ecc) +e_cell_combo_key_press (GtkWidget *popup_window, + GdkEventKey *event, + ECellCombo *ecc) { /* If the Escape key is pressed we hide the popup. */ if (event->keyval != GDK_KEY_Escape @@ -670,10 +673,10 @@ e_cell_combo_key_press (GtkWidget *popup_window, } static void -e_cell_combo_update_cell (ECellCombo *ecc) +e_cell_combo_update_cell (ECellCombo *ecc) { ECellPopup *ecp = E_CELL_POPUP (ecc); - ECellView *ecv = (ECellView*) ecp->popup_cell_view; + ECellView *ecv = (ECellView *) ecp->popup_cell_view; ECellText *ecell_text = E_CELL_TEXT (ecp->child); ETableItem *eti = E_TABLE_ITEM (ecv->e_table_item_view); ETableCol *ecol; @@ -708,11 +711,11 @@ e_cell_combo_update_cell (ECellCombo *ecc) } static void -e_cell_combo_restart_edit (ECellCombo *ecc) +e_cell_combo_restart_edit (ECellCombo *ecc) { /* This doesn't work. ETable stops the edit straight-away again. */ #if 0 - ECellView *ecv = (ECellView*) ecc->popup_cell_view; + ECellView *ecv = (ECellView *) ecc->popup_cell_view; ETableItem *eti = E_TABLE_ITEM (ecv->e_table_item_view); e_table_item_enter_edit (eti, ecc->popup_view_col, ecc->popup_row); diff --git a/widgets/table/e-cell-date-edit.c b/widgets/table/e-cell-date-edit.c index 7517ad0e9c..3035652116 100644 --- a/widgets/table/e-cell-date-edit.c +++ b/widgets/table/e-cell-date-edit.c @@ -219,7 +219,7 @@ e_cell_date_edit_init (ECellDateEdit *ecde) ecde->time_callback_destroy = NULL; /* We create one popup window for the ECell, since there will only - ever be one popup in use at a time. */ + * ever be one popup in use at a time. */ ecde->popup_window = gtk_window_new (GTK_WINDOW_POPUP); gtk_window_set_type_hint (GTK_WINDOW (ecde->popup_window), @@ -299,7 +299,7 @@ e_cell_date_edit_init (ECellDateEdit *ecde) now_button = gtk_button_new_with_label (_("Now")); gtk_container_add (GTK_CONTAINER (bbox), now_button); gtk_widget_show (now_button); - g_signal_connect((now_button), "clicked", + g_signal_connect ((now_button), "clicked", G_CALLBACK (e_cell_date_edit_on_now_clicked), ecde); ecde->now_button = now_button; @@ -307,7 +307,7 @@ e_cell_date_edit_init (ECellDateEdit *ecde) today_button = gtk_button_new_with_label (_("Today")); gtk_container_add (GTK_CONTAINER (bbox), today_button); gtk_widget_show (today_button); - g_signal_connect((today_button), "clicked", + g_signal_connect ((today_button), "clicked", G_CALLBACK (e_cell_date_edit_on_today_clicked), ecde); ecde->today_button = today_button; @@ -316,7 +316,7 @@ e_cell_date_edit_init (ECellDateEdit *ecde) none_button = gtk_button_new_with_label (C_("table-date", "None")); gtk_container_add (GTK_CONTAINER (bbox), none_button); gtk_widget_show (none_button); - g_signal_connect((none_button), "clicked", + g_signal_connect ((none_button), "clicked", G_CALLBACK (e_cell_date_edit_on_none_clicked), ecde); ecde->none_button = none_button; @@ -324,7 +324,7 @@ e_cell_date_edit_init (ECellDateEdit *ecde) ok_button = gtk_button_new_with_label (_("OK")); gtk_container_add (GTK_CONTAINER (bbox), ok_button); gtk_widget_show (ok_button); - g_signal_connect((ok_button), "clicked", + g_signal_connect ((ok_button), "clicked", G_CALLBACK (e_cell_date_edit_on_ok_clicked), ecde); @@ -346,16 +346,16 @@ e_cell_date_edit_init (ECellDateEdit *ecde) * Returns: an ECellDateEdit object. */ ECell * -e_cell_date_edit_new (void) +e_cell_date_edit_new (void) { return g_object_new (e_cell_date_edit_get_type (), NULL); } static void -e_cell_date_edit_get_property (GObject *object, - guint property_id, - GValue *value, - GParamSpec *pspec) +e_cell_date_edit_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) { ECellDateEdit *ecde; @@ -389,10 +389,10 @@ e_cell_date_edit_get_property (GObject *object, } static void -e_cell_date_edit_set_property (GObject *object, - guint property_id, - const GValue *value, - GParamSpec *pspec) +e_cell_date_edit_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) { ECellDateEdit *ecde; gint ivalue; @@ -477,10 +477,10 @@ e_cell_date_edit_dispose (GObject *object) } static gint -e_cell_date_edit_do_popup (ECellPopup *ecp, - GdkEvent *event, - gint row, - gint view_col) +e_cell_date_edit_do_popup (ECellPopup *ecp, + GdkEvent *event, + gint row, + gint view_col) { ECellDateEdit *ecde = E_CELL_DATE_EDIT (ecp); GdkWindow *window; @@ -499,11 +499,11 @@ e_cell_date_edit_do_popup (ECellPopup *ecp, } static void -e_cell_date_edit_set_popup_values (ECellDateEdit *ecde) +e_cell_date_edit_set_popup_values (ECellDateEdit *ecde) { ECellPopup *ecp = E_CELL_POPUP (ecde); ECellText *ecell_text = E_CELL_TEXT (ecp->child); - ECellView *ecv = (ECellView*) ecp->popup_cell_view; + ECellView *ecv = (ECellView *) ecp->popup_cell_view; ETableItem *eti = E_TABLE_ITEM (ecp->popup_cell_view->cell_view.e_table_item_view); ETableCol *ecol; gchar *cell_text; @@ -519,7 +519,7 @@ e_cell_date_edit_set_popup_values (ECellDateEdit *ecde) ecol->col_idx, ecp->popup_row); /* Try to parse just a date first. If the value is only a date, we - use a DATE value. */ + * use a DATE value. */ status = e_time_parse_date (cell_text, &date_tm); if (status == E_TIME_PARSE_INVALID) { is_date = FALSE; @@ -527,7 +527,7 @@ e_cell_date_edit_set_popup_values (ECellDateEdit *ecde) } /* If there is no date and time set, or the date is invalid, we clear - the selections, else we select the appropriate date & time. */ + * the selections, else we select the appropriate date & time. */ calitem = E_CALENDAR_ITEM (E_CALENDAR (ecde->calendar)->calitem); if (status == E_TIME_PARSE_NONE || status == E_TIME_PARSE_INVALID) { gtk_entry_set_text (GTK_ENTRY (ecde->time_entry), ""); @@ -562,8 +562,8 @@ e_cell_date_edit_set_popup_values (ECellDateEdit *ecde) } static void -e_cell_date_edit_select_matching_time (ECellDateEdit *ecde, - gchar *time) +e_cell_date_edit_select_matching_time (ECellDateEdit *ecde, + gchar *time) { gboolean found = FALSE; gboolean valid; @@ -605,9 +605,9 @@ e_cell_date_edit_select_matching_time (ECellDateEdit *ecde, } static void -e_cell_date_edit_show_popup (ECellDateEdit *ecde, - gint row, - gint view_col) +e_cell_date_edit_show_popup (ECellDateEdit *ecde, + gint row, + gint view_col) { GdkWindow *window; gint x, y, width, height; @@ -631,13 +631,13 @@ e_cell_date_edit_show_popup (ECellDateEdit *ecde, /* Calculates the size and position of the popup window (like GtkCombo). */ static void -e_cell_date_edit_get_popup_pos (ECellDateEdit *ecde, - gint row, - gint view_col, - gint *x, - gint *y, - gint *height, - gint *width) +e_cell_date_edit_get_popup_pos (ECellDateEdit *ecde, + gint row, + gint view_col, + gint *x, + gint *y, + gint *height, + gint *width) { ECellPopup *ecp = E_CELL_POPUP (ecde); ETableItem *eti = E_TABLE_ITEM (ecp->popup_cell_view->cell_view.e_table_item_view); @@ -672,7 +672,7 @@ e_cell_date_edit_get_popup_pos (ECellDateEdit *ecde, *x += x1; /* The ETable positions don't include the grid lines, I think, so we - add 1. */ + * add 1. */ scrollable = GTK_SCROLLABLE (&GNOME_CANVAS (canvas)->layout); adjustment = gtk_scrollable_get_vadjustment (scrollable); value = (gint) gtk_adjustment_get_value (adjustment); @@ -681,7 +681,7 @@ e_cell_date_edit_get_popup_pos (ECellDateEdit *ecde, avail_height = gdk_screen_height () - *y; /* We'll use the entire screen width if needed, but we save space for - the vertical scrollbar in case we need to show that. */ + * the vertical scrollbar in case we need to show that. */ screen_width = gdk_screen_width (); gtk_widget_get_preferred_size (ecde->popup_window, &popup_requisition, NULL); @@ -696,10 +696,10 @@ e_cell_date_edit_get_popup_pos (ECellDateEdit *ecde, /* Check if it fits in the available height. */ if (popup_requisition.height > avail_height) { /* It doesn't fit, so we see if we have the minimum space - needed. */ + * needed. */ if (*y - row_height > avail_height) { /* We don't, so we show the popup above the cell - instead of below it. */ + * instead of below it. */ *y -= (popup_requisition.height + row_height); if (*y < 0) *y = 0; @@ -707,7 +707,7 @@ e_cell_date_edit_get_popup_pos (ECellDateEdit *ecde, } /* We try to line it up with the right edge of the column, but we don't - want it to go off the edges of the screen. */ + * want it to go off the edges of the screen. */ if (*x > screen_width) *x = screen_width; *x -= *width; @@ -718,11 +718,11 @@ e_cell_date_edit_get_popup_pos (ECellDateEdit *ecde, } /* This handles key press events in the popup window. If the Escape key is - pressed we hide the popup, and do not change the cell contents. */ + * pressed we hide the popup, and do not change the cell contents. */ static gint -e_cell_date_edit_key_press (GtkWidget *popup_window, - GdkEventKey *event, - ECellDateEdit *ecde) +e_cell_date_edit_key_press (GtkWidget *popup_window, + GdkEventKey *event, + ECellDateEdit *ecde) { /* If the Escape key is pressed we hide the popup. */ if (event->keyval != GDK_KEY_Escape) @@ -734,16 +734,16 @@ e_cell_date_edit_key_press (GtkWidget *popup_window, } /* This handles button press events in the popup window. If the button is - pressed outside the popup, we hide it and do not change the cell contents. + * pressed outside the popup, we hide it and do not change the cell contents. */ static gint -e_cell_date_edit_button_press (GtkWidget *popup_window, - GdkEventButton *event, - ECellDateEdit *ecde) +e_cell_date_edit_button_press (GtkWidget *popup_window, + GdkEventButton *event, + ECellDateEdit *ecde) { GtkWidget *event_widget; - event_widget = gtk_get_event_widget ((GdkEvent*) event); + event_widget = gtk_get_event_widget ((GdkEvent *) event); if (gtk_widget_get_toplevel (event_widget) != popup_window) { e_cell_date_edit_hide_popup (ecde); } @@ -752,9 +752,9 @@ e_cell_date_edit_button_press (GtkWidget *popup_window, } /* Clears the time list and rebuilds it using the lower_hour, upper_hour - and use_24_hour_format settings. */ + * and use_24_hour_format settings. */ static void -e_cell_date_edit_rebuild_time_list (ECellDateEdit *ecde) +e_cell_date_edit_rebuild_time_list (ECellDateEdit *ecde) { GtkListStore *store; gchar buffer[40]; @@ -774,7 +774,7 @@ e_cell_date_edit_rebuild_time_list (ECellDateEdit *ecde) for (hour = ecde->lower_hour; hour <= ecde->upper_hour; hour++) { /* We don't want to display midnight at the end, since that is - really in the next day. */ + * really in the next day. */ if (hour == 24) break; @@ -798,8 +798,8 @@ e_cell_date_edit_rebuild_time_list (ECellDateEdit *ecde) } static void -e_cell_date_edit_on_ok_clicked (GtkWidget *button, - ECellDateEdit *ecde) +e_cell_date_edit_on_ok_clicked (GtkWidget *button, + ECellDateEdit *ecde) { ECalendarItem *calitem; GDate start_date, end_date; @@ -860,7 +860,7 @@ e_cell_date_edit_show_time_invalid_warning (ECellDateEdit *ecde) buffer, sizeof (buffer)); /* FIXME: Fix transient settings - I'm not sure it works with popup - windows. Maybe we need to use a normal window without decorations.*/ + * windows. Maybe we need to use a normal window without decorations.*/ dialog = gtk_message_dialog_new ( GTK_WINDOW (ecde->popup_window), GTK_DIALOG_DESTROY_WITH_PARENT, @@ -937,7 +937,7 @@ e_cell_date_edit_update_cell (ECellDateEdit *ecde, { ECellPopup *ecp = E_CELL_POPUP (ecde); ECellText *ecell_text = E_CELL_TEXT (ecp->child); - ECellView *ecv = (ECellView*) ecp->popup_cell_view; + ECellView *ecv = (ECellView *) ecp->popup_cell_view; ETableItem *eti = E_TABLE_ITEM (ecv->e_table_item_view); ETableCol *ecol; gchar *old_text; @@ -991,10 +991,10 @@ e_cell_date_edit_hide_popup (ECellDateEdit *ecde) } /* These freeze and thaw the rebuilding of the time list. They are useful when - setting several properties which result in rebuilds of the list, e.g. the - lower_hour, upper_hour and use_24_hour_format properties. */ + * setting several properties which result in rebuilds of the list, e.g. the + * lower_hour, upper_hour and use_24_hour_format properties. */ void -e_cell_date_edit_freeze (ECellDateEdit *ecde) +e_cell_date_edit_freeze (ECellDateEdit *ecde) { g_return_if_fail (E_IS_CELL_DATE_EDIT (ecde)); @@ -1002,7 +1002,7 @@ e_cell_date_edit_freeze (ECellDateEdit *ecde) } void -e_cell_date_edit_thaw (ECellDateEdit *ecde) +e_cell_date_edit_thaw (ECellDateEdit *ecde) { g_return_if_fail (E_IS_CELL_DATE_EDIT (ecde)); @@ -1015,13 +1015,13 @@ e_cell_date_edit_thaw (ECellDateEdit *ecde) } /* Sets a callback to use to get the current time. This is useful if the - application needs to use its own timezone data rather than rely on the - Unix timezone. */ + * application needs to use its own timezone data rather than rely on the + * Unix timezone. */ void -e_cell_date_edit_set_get_time_callback (ECellDateEdit *ecde, - ECellDateEditGetTimeCallback cb, - gpointer data, - GDestroyNotify destroy) +e_cell_date_edit_set_get_time_callback (ECellDateEdit *ecde, + ECellDateEditGetTimeCallback cb, + gpointer data, + GDestroyNotify destroy) { g_return_if_fail (E_IS_CELL_DATE_EDIT (ecde)); diff --git a/widgets/table/e-cell-date-edit.h b/widgets/table/e-cell-date-edit.h index 5224b0ddff..186302d79a 100644 --- a/widgets/table/e-cell-date-edit.h +++ b/widgets/table/e-cell-date-edit.h @@ -84,7 +84,7 @@ struct _ECellDateEdit { gboolean need_time_list_rebuild; /* The freeze count for rebuilding the time list. We only rebuild when - this is 0. */ + * this is 0. */ gint freeze_count; ECellDateEditGetTimeCallback time_callback; @@ -100,14 +100,14 @@ GType e_cell_date_edit_get_type (void) G_GNUC_CONST; ECell * e_cell_date_edit_new (void); /* These freeze and thaw the rebuilding of the time list. They are useful when - setting several properties which result in rebuilds of the list, e.g. the - lower_hour, upper_hour and use_24_hour_format properties. */ + * setting several properties which result in rebuilds of the list, e.g. the + * lower_hour, upper_hour and use_24_hour_format properties. */ void e_cell_date_edit_freeze (ECellDateEdit *ecde); void e_cell_date_edit_thaw (ECellDateEdit *ecde); /* Sets a callback to use to get the current time. This is useful if the - application needs to use its own timezone data rather than rely on the - Unix timezone. */ + * application needs to use its own timezone data rather than rely on the + * Unix timezone. */ void e_cell_date_edit_set_get_time_callback (ECellDateEdit *ecde, ECellDateEditGetTimeCallback cb, diff --git a/widgets/table/e-cell-date.c b/widgets/table/e-cell-date.c index fb3dd9fc71..79534aff45 100644 --- a/widgets/table/e-cell-date.c +++ b/widgets/table/e-cell-date.c @@ -39,7 +39,10 @@ G_DEFINE_TYPE (ECellDate, e_cell_date, E_TYPE_CELL_TEXT) static gchar * -ecd_get_text (ECellText *cell, ETableModel *model, gint col, gint row) +ecd_get_text (ECellText *cell, + ETableModel *model, + gint col, + gint row) { time_t date = GPOINTER_TO_INT (e_table_model_value_at (model, col, row)); const gchar *fmt_component, *fmt_part = NULL; @@ -59,7 +62,8 @@ ecd_get_text (ECellText *cell, ETableModel *model, gint col, gint row) } static void -ecd_free_text (ECellText *cell, gchar *text) +ecd_free_text (ECellText *cell, + gchar *text) { g_free (text); } @@ -104,7 +108,8 @@ e_cell_date_init (ECellDate *ecd) * Returns: an ECell object that can be used to render dates. */ ECell * -e_cell_date_new (const gchar *fontname, GtkJustification justify) +e_cell_date_new (const gchar *fontname, + GtkJustification justify) { ECellDate *ecd = g_object_new (E_TYPE_CELL_DATE, NULL); @@ -114,7 +119,8 @@ e_cell_date_new (const gchar *fontname, GtkJustification justify) } void -e_cell_date_set_format_component (ECellDate *ecd, const gchar *fmt_component) +e_cell_date_set_format_component (ECellDate *ecd, + const gchar *fmt_component) { g_return_if_fail (ecd != NULL); diff --git a/widgets/table/e-cell-hbox.c b/widgets/table/e-cell-hbox.c index c8485b983a..a8eb4ccb76 100644 --- a/widgets/table/e-cell-hbox.c +++ b/widgets/table/e-cell-hbox.c @@ -50,7 +50,9 @@ G_DEFINE_TYPE (ECellHbox, e_cell_hbox, E_TYPE_CELL) * ECell::new_view method */ static ECellView * -ecv_new_view (ECell *ecell, ETableModel *table_model, gpointer e_table_item_view) +ecv_new_view (ECell *ecell, + ETableModel *table_model, + gpointer e_table_item_view) { ECellHbox *ecv = E_CELL_HBOX (ecell); ECellHboxView *hbox_view = g_new0 (ECellHboxView, 1); @@ -155,11 +157,11 @@ ecv_draw (ECellView *ecell_view, gint subcell_offset = 0; gint i; - gint allotted_width = x2-x1; + gint allotted_width = x2 - x1; for (i = 0; i < hbox_view->subcell_view_count; i++) { /* Now cause our subcells to draw their contents, - shifted by subcell_offset pixels */ + * shifted by subcell_offset pixels */ gint width = allotted_width * hbox_view->def_size_cols[i] / 100; /* e_cell_max_width_by_row (hbox_view->subcell_views[i], hbox_view->model_cols[i], view_col, row); if (width < hbox_view->def_size_cols[i]) @@ -180,7 +182,13 @@ ecv_draw (ECellView *ecell_view, * ECell::event method */ static gint -ecv_event (ECellView *ecell_view, GdkEvent *event, gint model_col, gint view_col, gint row, ECellFlags flags, ECellActions *actions) +ecv_event (ECellView *ecell_view, + GdkEvent *event, + gint model_col, + gint view_col, + gint row, + ECellFlags flags, + ECellActions *actions) { ECellHboxView *hbox_view = (ECellHboxView *) ecell_view; gint y = 0; @@ -217,7 +225,10 @@ ecv_event (ECellView *ecell_view, GdkEvent *event, gint model_col, gint view_col * ECell::height method */ static gint -ecv_height (ECellView *ecell_view, gint model_col, gint view_col, gint row) +ecv_height (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row) { ECellHboxView *hbox_view = (ECellHboxView *) ecell_view; gint height = 0, max_height = 0; @@ -234,7 +245,9 @@ ecv_height (ECellView *ecell_view, gint model_col, gint view_col, gint row) * ECell::max_width method */ static gint -ecv_max_width (ECellView *ecell_view, gint model_col, gint view_col) +ecv_max_width (ECellView *ecell_view, + gint model_col, + gint view_col) { ECellHboxView *hbox_view = (ECellHboxView *) ecell_view; gint width = 0; @@ -321,7 +334,10 @@ e_cell_hbox_new (void) } void -e_cell_hbox_append (ECellHbox *hbox, ECell *subcell, gint model_col, gint size) +e_cell_hbox_append (ECellHbox *hbox, + ECell *subcell, + gint model_col, + gint size) { hbox->subcell_count++; diff --git a/widgets/table/e-cell-number.c b/widgets/table/e-cell-number.c index 7944bbea51..6e2f685a86 100644 --- a/widgets/table/e-cell-number.c +++ b/widgets/table/e-cell-number.c @@ -35,7 +35,10 @@ G_DEFINE_TYPE (ECellNumber, e_cell_number, E_TYPE_CELL_TEXT) static gchar * -ecn_get_text (ECellText *cell, ETableModel *model, gint col, gint row) +ecn_get_text (ECellText *cell, + ETableModel *model, + gint col, + gint row) { gpointer value; @@ -45,7 +48,8 @@ ecn_get_text (ECellText *cell, ETableModel *model, gint col, gint row) } static void -ecn_free_text (ECellText *cell, gchar *text) +ecn_free_text (ECellText *cell, + gchar *text) { g_free (text); } @@ -78,7 +82,8 @@ e_cell_number_init (ECellNumber *cell_number) * Returns: an ECell object that can be used to render numbers. */ ECell * -e_cell_number_new (const gchar *fontname, GtkJustification justify) +e_cell_number_new (const gchar *fontname, + GtkJustification justify) { ECellNumber *ecn = g_object_new (E_TYPE_CELL_NUMBER, NULL); diff --git a/widgets/table/e-cell-percent.c b/widgets/table/e-cell-percent.c index 5b54527f67..61543b0e0c 100644 --- a/widgets/table/e-cell-percent.c +++ b/widgets/table/e-cell-percent.c @@ -41,7 +41,10 @@ G_DEFINE_TYPE (ECellPercent, e_cell_percent, E_TYPE_CELL_TEXT) static gchar * -ecp_get_text (ECellText *cell, ETableModel *model, gint col, gint row) +ecp_get_text (ECellText *cell, + ETableModel *model, + gint col, + gint row) { gint percent; static gchar buffer[8]; @@ -59,7 +62,8 @@ ecp_get_text (ECellText *cell, ETableModel *model, gint col, gint row) } static void -ecp_free_text (ECellText *cell, gchar *text) +ecp_free_text (ECellText *cell, + gchar *text) { /* Do Nothing. */ } @@ -79,8 +83,11 @@ show_percent_warning (void) } static void -ecp_set_value (ECellText *cell, ETableModel *model, gint col, gint row, - const gchar *text) +ecp_set_value (ECellText *cell, + ETableModel *model, + gint col, + gint row, + const gchar *text) { gint matched, percent; gboolean empty = TRUE; @@ -141,7 +148,8 @@ e_cell_percent_init (ECellPercent *ecp) * Returns: an ECell object that can be used to render numbers. */ ECell * -e_cell_percent_new (const gchar *fontname, GtkJustification justify) +e_cell_percent_new (const gchar *fontname, + GtkJustification justify) { ECellPercent *ecn = g_object_new (E_TYPE_CELL_PERCENT, NULL); diff --git a/widgets/table/e-cell-pixbuf.c b/widgets/table/e-cell-pixbuf.c index 9a9e31c7e4..b2cf3e2a2d 100644 --- a/widgets/table/e-cell-pixbuf.c +++ b/widgets/table/e-cell-pixbuf.c @@ -66,7 +66,9 @@ e_cell_pixbuf_new (void) */ static ECellView * -pixbuf_new_view (ECell *ecell, ETableModel *table_model, gpointer e_table_item_view) +pixbuf_new_view (ECell *ecell, + ETableModel *table_model, + gpointer e_table_item_view) { ECellPixbufView *pixbuf_view = g_new0 (ECellPixbufView, 1); ETableItem *eti = E_TABLE_ITEM (e_table_item_view); @@ -99,9 +101,16 @@ pixbuf_kill_view (ECellView *ecell_view) } static void -pixbuf_draw (ECellView *ecell_view, cairo_t *cr, - gint model_col, gint view_col, gint row, ECellFlags flags, - gint x1, gint y1, gint x2, gint y2) +pixbuf_draw (ECellView *ecell_view, + cairo_t *cr, + gint model_col, + gint view_col, + gint row, + ECellFlags flags, + gint x1, + gint y1, + gint x2, + gint y2) { GdkPixbuf *cell_pixbuf; gint real_x, real_y; @@ -124,14 +133,14 @@ pixbuf_draw (ECellView *ecell_view, cairo_t *cr, /* We center the pixbuf within our allocated space */ if (x2 - x1 > pix_w) { gint diff = (x2 - x1) - pix_w; - real_x = x1 + diff/2; + real_x = x1 + diff / 2; } else { real_x = x1; } if (y2 - y1 > pix_h) { gint diff = (y2 - y1) - pix_h; - real_y = y1 + diff/2; + real_y = y1 + diff / 2; } else { real_y = y1; } @@ -143,9 +152,13 @@ pixbuf_draw (ECellView *ecell_view, cairo_t *cr, } static gint -pixbuf_event (ECellView *ecell_view, GdkEvent *event, - gint model_col, gint view_col, gint row, - ECellFlags flags, ECellActions *actions) +pixbuf_event (ECellView *ecell_view, + GdkEvent *event, + gint model_col, + gint view_col, + gint row, + ECellFlags flags, + ECellActions *actions) { /* noop */ @@ -153,7 +166,10 @@ pixbuf_event (ECellView *ecell_view, GdkEvent *event, } static gint -pixbuf_height (ECellView *ecell_view, gint model_col, gint view_col, gint row) +pixbuf_height (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row) { GdkPixbuf *pixbuf; if (row == -1) { @@ -176,9 +192,13 @@ pixbuf_height (ECellView *ecell_view, gint model_col, gint view_col, gint row) * ECell::print method */ static void -pixbuf_print (ECellView *ecell_view, GtkPrintContext *context, - gint model_col, gint view_col, gint row, - gdouble width, gdouble height) +pixbuf_print (ECellView *ecell_view, + GtkPrintContext *context, + gint model_col, + gint view_col, + gint row, + gdouble width, + gdouble height) { GdkPixbuf *pixbuf; gint scale; @@ -197,9 +217,12 @@ pixbuf_print (ECellView *ecell_view, GtkPrintContext *context, } static gdouble -pixbuf_print_height (ECellView *ecell_view, GtkPrintContext *context, - gint model_col, gint view_col, gint row, - gdouble width) +pixbuf_print_height (ECellView *ecell_view, + GtkPrintContext *context, + gint model_col, + gint view_col, + gint row, + gdouble width) { GdkPixbuf *pixbuf; @@ -220,7 +243,9 @@ pixbuf_print_height (ECellView *ecell_view, GtkPrintContext *context, } static gint -pixbuf_max_width (ECellView *ecell_view, gint model_col, gint view_col) +pixbuf_max_width (ECellView *ecell_view, + gint model_col, + gint view_col) { gint pw; gint num_rows, i; @@ -249,15 +274,15 @@ pixbuf_max_width (ECellView *ecell_view, gint model_col, gint view_col) static void pixbuf_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec) + guint property_id, + const GValue *value, + GParamSpec *pspec) { ECellPixbuf *pixbuf; pixbuf = E_CELL_PIXBUF (object); - switch (prop_id) { + switch (property_id) { case PROP_SELECTED_COLUMN: pixbuf->selected_column = g_value_get_int (value); break; @@ -278,15 +303,15 @@ pixbuf_set_property (GObject *object, /* Get_arg handler for the pixbuf item */ static void pixbuf_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) + guint property_id, + GValue *value, + GParamSpec *pspec) { ECellPixbuf *pixbuf; pixbuf = E_CELL_PIXBUF (object); - switch (prop_id) { + switch (property_id) { case PROP_SELECTED_COLUMN: g_value_set_int (value, pixbuf->selected_column); break; @@ -300,7 +325,7 @@ pixbuf_get_property (GObject *object, break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } diff --git a/widgets/table/e-cell-popup.c b/widgets/table/e-cell-popup.c index b3ba9bdfac..65440b2465 100644 --- a/widgets/table/e-cell-popup.c +++ b/widgets/table/e-cell-popup.c @@ -49,7 +49,7 @@ static void e_cell_popup_dispose (GObject *object); -static ECellView* ecp_new_view (ECell *ecell, +static ECellView * ecp_new_view (ECell *ecell, ETableModel *table_model, void *e_table_item_view); static void ecp_kill_view (ECellView *ecv); @@ -111,7 +111,7 @@ static gint e_cell_popup_do_popup (ECellPopupView *ecp_view, G_DEFINE_TYPE (ECellPopup, e_cell_popup, E_TYPE_CELL) static void -e_cell_popup_class_init (ECellPopupClass *class) +e_cell_popup_class_init (ECellPopupClass *class) { ECellClass *ecc = E_CELL_CLASS (class); @@ -137,7 +137,7 @@ e_cell_popup_class_init (ECellPopupClass *class) } static void -e_cell_popup_init (ECellPopup *ecp) +e_cell_popup_init (ECellPopup *ecp) { ecp->popup_shown = FALSE; ecp->popup_model = NULL; @@ -172,7 +172,9 @@ e_cell_popup_dispose (GObject *object) * ECell::new_view method */ static ECellView * -ecp_new_view (ECell *ecell, ETableModel *table_model, gpointer e_table_item_view) +ecp_new_view (ECell *ecell, + ETableModel *table_model, + gpointer e_table_item_view) { ECellPopup *ecp = E_CELL_POPUP (ecell); ECellPopupView *ecp_view; @@ -191,7 +193,7 @@ ecp_new_view (ECell *ecell, ETableModel *table_model, gpointer e_table_item_view ecp_view->child_view = e_cell_new_view (ecp->child, table_model, e_table_item_view); - return (ECellView*) ecp_view; + return (ECellView *) ecp_view; } /* @@ -247,9 +249,16 @@ ecp_unrealize (ECellView *ecv) * ECell::draw method */ static void -ecp_draw (ECellView *ecv, cairo_t *cr, - gint model_col, gint view_col, gint row, ECellFlags flags, - gint x1, gint y1, gint x2, gint y2) +ecp_draw (ECellView *ecv, + cairo_t *cr, + gint model_col, + gint view_col, + gint row, + ECellFlags flags, + gint x1, + gint y1, + gint x2, + gint y2) { ECellPopup *ecp = E_CELL_POPUP (ecv->ecell); ECellPopupView *ecp_view = (ECellPopupView *) ecv; @@ -263,7 +272,7 @@ ecp_draw (ECellView *ecv, cairo_t *cr, canvas = GTK_WIDGET (GNOME_CANVAS_ITEM (ecv->e_table_item_view)->canvas); /* Display the popup arrow if we are the cursor cell, or the popup - is shown for this cell. */ + * is shown for this cell. */ show_popup_arrow = e_table_model_is_cell_editable ( ecv->e_table_model, model_col, row) && @@ -318,8 +327,13 @@ ecp_draw (ECellView *ecv, cairo_t *cr, * ECell::event method */ static gint -ecp_event (ECellView *ecv, GdkEvent *event, gint model_col, gint view_col, - gint row, ECellFlags flags, ECellActions *actions) +ecp_event (ECellView *ecv, + GdkEvent *event, + gint model_col, + gint view_col, + gint row, + ECellFlags flags, + ECellActions *actions) { ECellPopupView *ecp_view = (ECellPopupView *) ecv; ECellPopup *ecp = E_CELL_POPUP (ecp_view->cell_view.ecell); @@ -335,7 +349,7 @@ ecp_event (ECellView *ecv, GdkEvent *event, gint model_col, gint view_col, view_col + 1); /* FIXME: The event coords seem to be relative to the - text within the cell, so we have to add 4. */ + * text within the cell, so we have to add 4. */ if (event->button.x + 4 >= width - E_CELL_POPUP_ARROW_WIDTH) { return e_cell_popup_do_popup (ecp_view, event, row, view_col); } @@ -360,7 +374,10 @@ ecp_event (ECellView *ecv, GdkEvent *event, gint model_col, gint view_col, * ECell::height method */ static gint -ecp_height (ECellView *ecv, gint model_col, gint view_col, gint row) +ecp_height (ECellView *ecv, + gint model_col, + gint view_col, + gint row) { ECellPopupView *ecp_view = (ECellPopupView *) ecv; @@ -371,7 +388,10 @@ ecp_height (ECellView *ecv, gint model_col, gint view_col, gint row) * ECellView::enter_edit method */ static gpointer -ecp_enter_edit (ECellView *ecv, gint model_col, gint view_col, gint row) +ecp_enter_edit (ECellView *ecv, + gint model_col, + gint view_col, + gint row) { ECellPopupView *ecp_view = (ECellPopupView *) ecv; @@ -382,8 +402,11 @@ ecp_enter_edit (ECellView *ecv, gint model_col, gint view_col, gint row) * ECellView::leave_edit method */ static void -ecp_leave_edit (ECellView *ecv, gint model_col, gint view_col, gint row, - gpointer edit_context) +ecp_leave_edit (ECellView *ecv, + gint model_col, + gint view_col, + gint row, + gpointer edit_context) { ECellPopupView *ecp_view = (ECellPopupView *) ecv; @@ -392,8 +415,13 @@ ecp_leave_edit (ECellView *ecv, gint model_col, gint view_col, gint row, } static void -ecp_print (ECellView *ecv, GtkPrintContext *context, - gint model_col, gint view_col, gint row, gdouble width, gdouble height) +ecp_print (ECellView *ecv, + GtkPrintContext *context, + gint model_col, + gint view_col, + gint row, + gdouble width, + gdouble height) { ECellPopupView *ecp_view = (ECellPopupView *) ecv; @@ -402,9 +430,12 @@ ecp_print (ECellView *ecv, GtkPrintContext *context, } static gdouble -ecp_print_height (ECellView *ecv, GtkPrintContext *context, - gint model_col, gint view_col, gint row, - gdouble width) +ecp_print_height (ECellView *ecv, + GtkPrintContext *context, + gint model_col, + gint view_col, + gint row, + gdouble width) { ECellPopupView *ecp_view = (ECellPopupView *) ecv; @@ -414,8 +445,8 @@ ecp_print_height (ECellView *ecv, GtkPrintContext *context, static gint ecp_max_width (ECellView *ecv, - gint model_col, - gint view_col) + gint model_col, + gint view_col) { ECellPopupView *ecp_view = (ECellPopupView *) ecv; @@ -423,15 +454,16 @@ ecp_max_width (ECellView *ecv, } static gchar * -ecp_get_bg_color (ECellView *ecell_view, gint row) +ecp_get_bg_color (ECellView *ecell_view, + gint row) { ECellPopupView *ecp_view = (ECellPopupView *) ecell_view; return e_cell_get_bg_color (ecp_view->child_view, row); } -ECell* -e_cell_popup_get_child (ECellPopup *ecp) +ECell * +e_cell_popup_get_child (ECellPopup *ecp) { g_return_val_if_fail (E_IS_CELL_POPUP (ecp), NULL); @@ -439,8 +471,8 @@ e_cell_popup_get_child (ECellPopup *ecp) } void -e_cell_popup_set_child (ECellPopup *ecp, - ECell *child) +e_cell_popup_set_child (ECellPopup *ecp, + ECell *child) { g_return_if_fail (E_IS_CELL_POPUP (ecp)); @@ -452,10 +484,10 @@ e_cell_popup_set_child (ECellPopup *ecp, } static gint -e_cell_popup_do_popup (ECellPopupView *ecp_view, - GdkEvent *event, - gint row, - gint view_col) +e_cell_popup_do_popup (ECellPopupView *ecp_view, + GdkEvent *event, + gint row, + gint view_col) { ECellPopup *ecp = E_CELL_POPUP (ecp_view->cell_view.ecell); gint (*popup_func) (ECellPopup *ecp, GdkEvent *event, gint row, gint view_col); @@ -472,7 +504,7 @@ e_cell_popup_do_popup (ECellPopupView *ecp_view, } /* This redraws the popup cell. Only use this if you know popup_view_col and - popup_row are valid. */ + * popup_row are valid. */ void e_cell_popup_queue_cell_redraw (ECellPopup *ecp) { @@ -486,8 +518,8 @@ e_cell_popup_queue_cell_redraw (ECellPopup *ecp) } void -e_cell_popup_set_shown (ECellPopup *ecp, - gboolean shown) +e_cell_popup_set_shown (ECellPopup *ecp, + gboolean shown) { ecp->popup_shown = shown; e_cell_popup_queue_cell_redraw (ecp); diff --git a/widgets/table/e-cell-popup.h b/widgets/table/e-cell-popup.h index 6d04fb3c8d..bc99196eaf 100644 --- a/widgets/table/e-cell-popup.h +++ b/widgets/table/e-cell-popup.h @@ -66,13 +66,13 @@ struct _ECellPopup { ECell *child; /* This is TRUE if the popup window is shown for the cell being - edited. While shown we display the arrow indented. */ + * edited. While shown we display the arrow indented. */ gboolean popup_shown; /* This is TRUE if the popup arrow is shown for the cell being edited. - This is needed to stop the first click on the cell from popping up - the popup window. We only popup the window after we have drawn the - arrow. */ + * This is needed to stop the first click on the cell from popping up + * the popup window. We only popup the window after we have drawn the + * arrow. */ gboolean popup_arrow_shown; /* The view in which the popup is shown. */ diff --git a/widgets/table/e-cell-size.c b/widgets/table/e-cell-size.c index d596713977..b330a95a96 100644 --- a/widgets/table/e-cell-size.c +++ b/widgets/table/e-cell-size.c @@ -34,7 +34,10 @@ G_DEFINE_TYPE (ECellSize, e_cell_size, E_TYPE_CELL_TEXT) static gchar * -ecd_get_text (ECellText *cell, ETableModel *model, gint col, gint row) +ecd_get_text (ECellText *cell, + ETableModel *model, + gint col, + gint row) { gint size = GPOINTER_TO_INT (e_table_model_value_at (model, col, row)); gfloat fsize; @@ -53,7 +56,8 @@ ecd_get_text (ECellText *cell, ETableModel *model, gint col, gint row) } static void -ecd_free_text (ECellText *cell, gchar *text) +ecd_free_text (ECellText *cell, + gchar *text) { g_free (text); } @@ -98,7 +102,8 @@ e_cell_size_init (ECellSize *e_cell_size) * * Returns: an ECell object that can be used to render file sizes. */ ECell * -e_cell_size_new (const gchar *fontname, GtkJustification justify) +e_cell_size_new (const gchar *fontname, + GtkJustification justify) { ECellSize *ecd = g_object_new (E_TYPE_CELL_SIZE, NULL); diff --git a/widgets/table/e-cell-text.c b/widgets/table/e-cell-text.c index 9d652372d0..7e391c3ba9 100644 --- a/widgets/table/e-cell-text.c +++ b/widgets/table/e-cell-text.c @@ -205,33 +205,42 @@ static gboolean e_cell_text_retrieve_surrounding_cb (GtkIMContext *context, ECel static gboolean e_cell_text_delete_surrounding_cb (GtkIMContext *context, gint offset, gint n_chars, ECellTextView *text_view); static void _insert (ECellTextView *text_view, const gchar *string, gint value); static void _delete_selection (ECellTextView *text_view); -static PangoAttrList* build_attr_list (ECellTextView *text_view, gint row, gint text_length); +static PangoAttrList * build_attr_list (ECellTextView *text_view, gint row, gint text_length); static void update_im_cursor_location (ECellTextView *tv); static gchar * -ect_real_get_text (ECellText *cell, ETableModel *model, gint col, gint row) +ect_real_get_text (ECellText *cell, + ETableModel *model, + gint col, + gint row) { return e_table_model_value_at (model, col, row); } static void -ect_real_free_text (ECellText *cell, gchar *text) +ect_real_free_text (ECellText *cell, + gchar *text) { } /* This is the default method for setting the ETableModel value based on - the text in the ECellText. This simply uses the text as it is - it assumes - the value in the model is a gchar *. Subclasses may parse the text into - data structures to pass to the model. */ + * the text in the ECellText. This simply uses the text as it is - it assumes + * the value in the model is a gchar *. Subclasses may parse the text into + * data structures to pass to the model. */ static void -ect_real_set_value (ECellText *cell, ETableModel *model, gint col, gint row, - const gchar *text) +ect_real_set_value (ECellText *cell, + ETableModel *model, + gint col, + gint row, + const gchar *text) { e_table_model_set_value_at (model, col, row, text); } static void -ect_queue_redraw (ECellTextView *text_view, gint view_col, gint view_row) +ect_queue_redraw (ECellTextView *text_view, + gint view_col, + gint view_row) { e_table_item_redraw_range ( text_view->cell_view.e_table_item_view, @@ -242,7 +251,8 @@ ect_queue_redraw (ECellTextView *text_view, gint view_col, gint view_row) * Shuts down the editing process */ static void -ect_stop_editing (ECellTextView *text_view, gboolean commit) +ect_stop_editing (ECellTextView *text_view, + gboolean commit) { GdkWindow *window; CellEdit *edit = text_view->edit; @@ -319,7 +329,9 @@ ect_cancel_edit (ECellTextView *text_view) * ECell::new_view method */ static ECellView * -ect_new_view (ECell *ecell, ETableModel *table_model, gpointer e_table_item_view) +ect_new_view (ECell *ecell, + ETableModel *table_model, + gpointer e_table_item_view) { ECellTextView *text_view = g_new0 (ECellTextView, 1); GnomeCanvas *canvas = GNOME_CANVAS_ITEM (e_table_item_view)->canvas; @@ -388,8 +400,10 @@ ect_unrealize (ECellView *ecv) } -static PangoAttrList* -build_attr_list (ECellTextView *text_view, gint row, gint text_length) +static PangoAttrList * +build_attr_list (ECellTextView *text_view, + gint row, + gint text_length) { ECellView *ecell_view = (ECellView *) text_view; @@ -434,7 +448,10 @@ build_attr_list (ECellTextView *text_view, gint row, gint text_length) } static PangoLayout * -layout_with_preedit (ECellTextView *text_view, gint row, const gchar *text, gint width) +layout_with_preedit (ECellTextView *text_view, + gint row, + const gchar *text, + gint width) { CellEdit *edit = text_view->edit; PangoAttrList *attrs; @@ -463,9 +480,9 @@ layout_with_preedit (ECellTextView *text_view, gint row, const gchar *text, gint */ if (mlen < text_length) { - if (!g_utf8_validate (text+mlen, -1, NULL)) { + if (!g_utf8_validate (text + mlen, -1, NULL)) { gchar *tc; - tc = g_utf8_find_next_char (text+mlen,NULL); + tc = g_utf8_find_next_char (text + mlen,NULL); if (tc) { mlen = (gint) (tc - text); } @@ -495,7 +512,10 @@ layout_with_preedit (ECellTextView *text_view, gint row, const gchar *text, gint } static PangoLayout * -build_layout (ECellTextView *text_view, gint row, const gchar *text, gint width) +build_layout (ECellTextView *text_view, + gint row, + const gchar *text, + gint width) { ECellView *ecell_view = (ECellView *) text_view; ECellText *ect = E_CELL_TEXT (ecell_view->ecell); @@ -560,7 +580,11 @@ build_layout (ECellTextView *text_view, gint row, const gchar *text, gint width) } static PangoLayout * -generate_layout (ECellTextView *text_view, gint model_col, gint view_col, gint row, gint width) +generate_layout (ECellTextView *text_view, + gint model_col, + gint view_col, + gint row, + gint width) { ECellView *ecell_view = (ECellView *) text_view; ECellText *ect = E_CELL_TEXT (ecell_view->ecell); @@ -583,7 +607,10 @@ generate_layout (ECellTextView *text_view, gint model_col, gint view_col, gint r } static void -draw_cursor (cairo_t *cr, gint x1, gint y1, PangoRectangle rect) +draw_cursor (cairo_t *cr, + gint x1, + gint y1, + PangoRectangle rect) { gdouble scaled_x; gdouble scaled_y; @@ -602,7 +629,8 @@ draw_cursor (cairo_t *cr, gint x1, gint y1, PangoRectangle rect) } static gboolean -show_pango_rectangle (CellEdit *edit, PangoRectangle rect) +show_pango_rectangle (CellEdit *edit, + PangoRectangle rect) { gint x1 = rect.x / PANGO_SCALE; gint x2 = (rect.x + rect.width) / PANGO_SCALE; @@ -664,9 +692,16 @@ get_vertical_spacing (GtkWidget *canvas) * ECell::draw method */ static void -ect_draw (ECellView *ecell_view, cairo_t *cr, - gint model_col, gint view_col, gint row, ECellFlags flags, - gint x1, gint y1, gint x2, gint y2) +ect_draw (ECellView *ecell_view, + cairo_t *cr, + gint model_col, + gint view_col, + gint row, + ECellFlags flags, + gint x1, + gint y1, + gint x2, + gint y2) { PangoLayout *layout; ECellTextView *text_view = (ECellTextView *) ecell_view; @@ -771,7 +806,8 @@ ect_draw (ECellView *ecell_view, cairo_t *cr, * Get the background color */ static gchar * -ect_get_bg_color (ECellView *ecell_view, gint row) +ect_get_bg_color (ECellView *ecell_view, + gint row) { ECellText *ect = E_CELL_TEXT (ecell_view->ecell); gchar *color_spec; @@ -811,7 +847,13 @@ key_begins_editing (GdkEventKey *event) * ECell::event method */ static gint -ect_event (ECellView *ecell_view, GdkEvent *event, gint model_col, gint view_col, gint row, ECellFlags flags, ECellActions *actions) +ect_event (ECellView *ecell_view, + GdkEvent *event, + gint model_col, + gint view_col, + gint row, + ECellFlags flags, + ECellActions *actions) { ECellTextView *text_view = (ECellTextView *) ecell_view; ETextEventProcessorEvent e_tep_event; @@ -849,7 +891,7 @@ ect_event (ECellView *ecell_view, GdkEvent *event, gint model_col, gint view_col if (edit_display && edit->im_context && gtk_im_context_filter_keypress (\ edit->im_context, - (GdkEventKey*) event)) { + (GdkEventKey *) event)) { edit->need_im_reset = TRUE; if (preedit_len && flags & E_CELL_PREEDIT) @@ -1022,7 +1064,10 @@ ect_event (ECellView *ecell_view, GdkEvent *event, gint model_col, gint view_col * ECell::height method */ static gint -ect_height (ECellView *ecell_view, gint model_col, gint view_col, gint row) +ect_height (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row) { ECellTextView *text_view = (ECellTextView *) ecell_view; gint height; @@ -1038,7 +1083,10 @@ ect_height (ECellView *ecell_view, gint model_col, gint view_col, gint row) * ECellView::enter_edit method */ static gpointer -ect_enter_edit (ECellView *ecell_view, gint model_col, gint view_col, gint row) +ect_enter_edit (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row) { ECellTextView *text_view = (ECellTextView *) ecell_view; CellEdit *edit; @@ -1127,7 +1175,11 @@ ect_enter_edit (ECellView *ecell_view, gint model_col, gint view_col, gint row) * ECellView::leave_edit method */ static void -ect_leave_edit (ECellView *ecell_view, gint model_col, gint view_col, gint row, gpointer edit_context) +ect_leave_edit (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row, + gpointer edit_context) { ECellTextView *text_view = (ECellTextView *) ecell_view; CellEdit *edit = text_view->edit; @@ -1153,7 +1205,11 @@ ect_leave_edit (ECellView *ecell_view, gint model_col, gint view_col, gint row, * ECellView::save_state method */ static gpointer -ect_save_state (ECellView *ecell_view, gint model_col, gint view_col, gint row, gpointer edit_context) +ect_save_state (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row, + gpointer edit_context) { ECellTextView *text_view = (ECellTextView *) ecell_view; CellEdit *edit = text_view->edit; @@ -1169,7 +1225,12 @@ ect_save_state (ECellView *ecell_view, gint model_col, gint view_col, gint row, * ECellView::load_state method */ static void -ect_load_state (ECellView *ecell_view, gint model_col, gint view_col, gint row, gpointer edit_context, gpointer save_state) +ect_load_state (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row, + gpointer edit_context, + gpointer save_state) { ECellTextView *text_view = (ECellTextView *) ecell_view; CellEdit *edit = text_view->edit; @@ -1188,14 +1249,21 @@ ect_load_state (ECellView *ecell_view, gint model_col, gint view_col, gint row, * ECellView::free_state method */ static void -ect_free_state (ECellView *ecell_view, gint model_col, gint view_col, gint row, gpointer save_state) +ect_free_state (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row, + gpointer save_state) { g_free (save_state); } static void -get_font_size (PangoLayout *layout, PangoFontDescription *font, const gchar *text, - gdouble *width, gdouble *height) +get_font_size (PangoLayout *layout, + PangoFontDescription *font, + const gchar *text, + gdouble *width, + gdouble *height) { gint w; gint h; @@ -1213,9 +1281,13 @@ get_font_size (PangoLayout *layout, PangoFontDescription *font, const gchar *tex } static void -ect_print (ECellView *ecell_view, GtkPrintContext *context, - gint model_col, gint view_col, gint row, - gdouble width, gdouble height) +ect_print (ECellView *ecell_view, + GtkPrintContext *context, + gint model_col, + gint view_col, + gint row, + gdouble width, + gdouble height) { PangoFontDescription *font_des; PangoLayout *layout; @@ -1263,7 +1335,7 @@ ect_print (ECellView *ecell_view, GtkPrintContext *context, dir = pango_find_base_dir (string, strlen (string)); if (underline) { - ly = ty + (gdouble) pango_font_metrics_get_underline_position (font_metrics)/(gdouble) PANGO_SCALE; + ly = ty + (gdouble) pango_font_metrics_get_underline_position (font_metrics) / (gdouble) PANGO_SCALE; cairo_new_path (cr); if (dir == PANGO_DIRECTION_RTL) { cairo_move_to (cr, width - 2, ly + text_height + 6); @@ -1273,12 +1345,12 @@ ect_print (ECellView *ecell_view, GtkPrintContext *context, cairo_move_to (cr, 2, ly + text_height + 6); cairo_line_to (cr, MIN (2 + text_width, width - 2), ly + text_height + 6); } - cairo_set_line_width (cr, (gdouble) pango_font_metrics_get_underline_thickness (font_metrics)/(gdouble) PANGO_SCALE); + cairo_set_line_width (cr, (gdouble) pango_font_metrics_get_underline_thickness (font_metrics) / (gdouble) PANGO_SCALE); cairo_stroke (cr); } if (strikeout) { - ly = ty + (gdouble) pango_font_metrics_get_strikethrough_position (font_metrics)/(gdouble) PANGO_SCALE; + ly = ty + (gdouble) pango_font_metrics_get_strikethrough_position (font_metrics) / (gdouble) PANGO_SCALE; cairo_new_path (cr); if (dir == PANGO_DIRECTION_RTL) { cairo_move_to (cr, width - 2, ly + text_height + 6); @@ -1288,13 +1360,13 @@ ect_print (ECellView *ecell_view, GtkPrintContext *context, cairo_move_to (cr, 2, ly + text_height + 6); cairo_line_to (cr, MIN (2 + text_width, width - 2), ly + text_height + 6); } - cairo_set_line_width (cr,(gdouble) pango_font_metrics_get_strikethrough_thickness (font_metrics)/(gdouble) PANGO_SCALE); + cairo_set_line_width (cr,(gdouble) pango_font_metrics_get_strikethrough_thickness (font_metrics) / (gdouble) PANGO_SCALE); cairo_stroke (cr); } cairo_move_to (cr, 2, text_height- 5); - pango_layout_set_width (layout, (width - 4)*PANGO_SCALE); + pango_layout_set_width (layout, (width - 4) * PANGO_SCALE); pango_layout_set_wrap (layout, PANGO_WRAP_CHAR); pango_cairo_show_layout (cr, layout); cairo_restore (cr); @@ -1305,9 +1377,12 @@ ect_print (ECellView *ecell_view, GtkPrintContext *context, } static gdouble -ect_print_height (ECellView *ecell_view, GtkPrintContext *context, - gint model_col, gint view_col, gint row, - gdouble width) +ect_print_height (ECellView *ecell_view, + GtkPrintContext *context, + gint model_col, + gint view_col, + gint row, + gdouble width) { /* * Font size is 16 by default. To leave some margin for cell @@ -1321,7 +1396,7 @@ ect_print_height (ECellView *ecell_view, GtkPrintContext *context, ECellText *ect = E_CELL_TEXT (ecell_view->ecell); gchar *string; gdouble text_width = 0.0, text_height = 0.0; - gint lines=1; + gint lines = 1; string = e_cell_text_get_text (ect, ecell_view->e_table_model, model_col, row); @@ -1334,15 +1409,15 @@ ect_print_height (ECellView *ecell_view, GtkPrintContext *context, /* Checking if the text width goes beyond the column width to increase the * number of lines. */ - if ( text_width > width-4) - lines = (text_width / (width-4)) + 1; - return 16*lines + 8; + if ( text_width > width - 4) + lines = (text_width / (width - 4)) + 1; + return 16 *lines + 8; } static gint ect_max_width (ECellView *ecell_view, - gint model_col, - gint view_col) + gint model_col, + gint view_col) { /* New ECellText */ ECellTextView *text_view = (ECellTextView *) ecell_view; @@ -1367,9 +1442,9 @@ ect_max_width (ECellView *ecell_view, static gint ect_max_width_by_row (ECellView *ecell_view, - gint model_col, - gint view_col, - gint row) + gint model_col, + gint view_col, + gint row) { /* New ECellText */ ECellTextView *text_view = (ECellTextView *) ecell_view; @@ -1399,15 +1474,15 @@ ect_finalize (GObject *object) /* Set_arg handler for the text item */ static void ect_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec) + guint property_id, + const GValue *value, + GParamSpec *pspec) { ECellText *text; text = E_CELL_TEXT (object); - switch (prop_id) { + switch (property_id) { case PROP_STRIKEOUT_COLUMN: text->strikeout_column = g_value_get_int (value); break; @@ -1440,15 +1515,15 @@ ect_set_property (GObject *object, /* Get_arg handler for the text item */ static void ect_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) + guint property_id, + GValue *value, + GParamSpec *pspec) { ECellText *text; text = E_CELL_TEXT (object); - switch (prop_id) { + switch (property_id) { case PROP_STRIKEOUT_COLUMN: g_value_set_int (value, text->strikeout_column); break; @@ -1474,7 +1549,7 @@ ect_get_property (GObject *object, break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } @@ -1597,11 +1672,11 @@ e_cell_text_class_init (ECellTextClass *class) static void e_cell_text_get_cursor_locations (ECellTextView *tv, - GdkRectangle *strong_pos, - GdkRectangle *weak_pos) + GdkRectangle *strong_pos, + GdkRectangle *weak_pos) { GdkRectangle area; - CellEdit *edit=tv->edit; + CellEdit *edit = tv->edit; ECellView *cell_view = (ECellView *) tv; ETableItem *item = E_TABLE_ITEM ((cell_view)->e_table_item_view); GnomeCanvasItem *parent_item = GNOME_CANVAS_ITEM (item)->parent; @@ -1647,7 +1722,7 @@ e_cell_text_get_cursor_locations (ECellTextView *tv, static void update_im_cursor_location (ECellTextView *tv) { - CellEdit *edit=tv->edit; + CellEdit *edit = tv->edit; GdkRectangle area; e_cell_text_get_cursor_locations (tv, &area, NULL); @@ -1657,11 +1732,11 @@ update_im_cursor_location (ECellTextView *tv) static void e_cell_text_preedit_changed_cb (GtkIMContext *context, - ECellTextView *tv) + ECellTextView *tv) { gchar *preedit_string; gint cursor_pos; - CellEdit *edit=tv->edit; + CellEdit *edit = tv->edit; gtk_im_context_get_preedit_string (edit->im_context, &preedit_string, NULL, &cursor_pos); @@ -1675,8 +1750,8 @@ e_cell_text_preedit_changed_cb (GtkIMContext *context, static void e_cell_text_commit_cb (GtkIMContext *context, - const gchar *str, - ECellTextView *tv) + const gchar *str, + ECellTextView *tv) { CellEdit *edit = tv->edit; ETextEventProcessorCommand command; @@ -1693,7 +1768,7 @@ e_cell_text_commit_cb (GtkIMContext *context, static gboolean e_cell_text_retrieve_surrounding_cb (GtkIMContext *context, - ECellTextView *tv) + ECellTextView *tv) { CellEdit *edit = tv->edit; @@ -1707,10 +1782,10 @@ e_cell_text_retrieve_surrounding_cb (GtkIMContext *context, } static gboolean -e_cell_text_delete_surrounding_cb (GtkIMContext *context, - gint offset, - gint n_chars, - ECellTextView *tv) +e_cell_text_delete_surrounding_cb (GtkIMContext *context, + gint offset, + gint n_chars, + ECellTextView *tv) { gint begin_pos, end_pos; glong text_len; @@ -1774,7 +1849,8 @@ e_cell_text_init (ECellText *ect) * Returns: an ECell object that can be used to render strings. */ ECell * -e_cell_text_new (const gchar *fontname, GtkJustification justify) +e_cell_text_new (const gchar *fontname, + GtkJustification justify) { ECellText *ect = g_object_new (E_TYPE_CELL_TEXT, NULL); @@ -1861,7 +1937,9 @@ e_cell_text_set_value (ECellText *cell, /* position is in BYTES */ static gint -get_position_from_xy (CellEdit *edit, gint x, gint y) +get_position_from_xy (CellEdit *edit, + gint x, + gint y) { gint index; gint trailing; @@ -1955,7 +2033,8 @@ _blink_scroll_timeout (gpointer data) } static gint -next_word (CellEdit *edit, gint start) +next_word (CellEdit *edit, + gint start) { gchar *p; gint length; @@ -1977,7 +2056,8 @@ next_word (CellEdit *edit, gint start) } static gint -_get_position (ECellTextView *text_view, ETextEventProcessorCommand *command) +_get_position (ECellTextView *text_view, + ETextEventProcessorCommand *command) { gint length; CellEdit *edit = text_view->edit; @@ -2144,14 +2224,16 @@ _delete_selection (ECellTextView *text_view) edit->selection_end = edit->selection_start; - g_signal_emit (VIEW_TO_CELL (text_view), signals[TEXT_DELETED], 0, text_view, edit->selection_start, ep-sp, edit->row, edit->model_col); + g_signal_emit (VIEW_TO_CELL (text_view), signals[TEXT_DELETED], 0, text_view, edit->selection_start, ep - sp, edit->row, edit->model_col); } /* fixme: */ /* NB! We expect value to be length IN BYTES */ static void -_insert (ECellTextView *text_view, const gchar *string, gint value) +_insert (ECellTextView *text_view, + const gchar *string, + gint value) { CellEdit *edit = text_view->edit; gchar *temp; @@ -2173,11 +2255,14 @@ _insert (ECellTextView *text_view, const gchar *string, gint value) edit->selection_start += value; edit->selection_end = edit->selection_start; - g_signal_emit (VIEW_TO_CELL (text_view), signals[TEXT_INSERTED], 0, text_view, edit->selection_end-value, value, edit->row, edit->model_col); + g_signal_emit (VIEW_TO_CELL (text_view), signals[TEXT_INSERTED], 0, text_view, edit->selection_end - value, value, edit->row, edit->model_col); } static void -capitalize (CellEdit *edit, gint start, gint end, ETextEventProcessorCaps type) +capitalize (CellEdit *edit, + gint start, + gint end, + ETextEventProcessorCaps type) { ECellTextView *text_view = edit->text_view; @@ -2228,7 +2313,9 @@ capitalize (CellEdit *edit, gint start, gint end, ETextEventProcessorCaps type) } static void -e_cell_text_view_command (ETextEventProcessor *tep, ETextEventProcessorCommand *command, gpointer data) +e_cell_text_view_command (ETextEventProcessor *tep, + ETextEventProcessorCommand *command, + gpointer data) { CellEdit *edit = (CellEdit *) data; ECellTextView *text_view = edit->text_view; @@ -2240,7 +2327,7 @@ e_cell_text_view_command (ETextEventProcessor *tep, ETextEventProcessorCommand * gint sel_start, sel_end; /* If the EText isn't editable, then ignore any commands that would - modify the text. */ + * modify the text. */ if (!ect->editable && (command->action == E_TEP_DELETE || command->action == E_TEP_INSERT || command->action == E_TEP_PASTE @@ -2372,7 +2459,11 @@ e_cell_text_view_command (ETextEventProcessor *tep, ETextEventProcessorCommand * } static void -e_cell_text_view_supply_selection (CellEdit *edit, guint time, GdkAtom selection, gchar *data, gint length) +e_cell_text_view_supply_selection (CellEdit *edit, + guint time, + GdkAtom selection, + gchar *data, + gint length) { #if DO_SELECTION GtkClipboard *clipboard; @@ -2390,8 +2481,8 @@ e_cell_text_view_supply_selection (CellEdit *edit, guint time, GdkAtom selection #ifdef DO_SELECTION static void paste_received (GtkClipboard *clipboard, - const gchar *text, - gpointer data) + const gchar *text, + gpointer data) { CellEdit *edit; @@ -2412,7 +2503,9 @@ paste_received (GtkClipboard *clipboard, #endif static void -e_cell_text_view_get_selection (CellEdit *edit, GdkAtom selection, guint32 time) +e_cell_text_view_get_selection (CellEdit *edit, + GdkAtom selection, + guint32 time) { #if DO_SELECTION gtk_clipboard_request_text (gtk_widget_get_clipboard (GTK_WIDGET (edit->text_view->canvas), diff --git a/widgets/table/e-cell-text.h b/widgets/table/e-cell-text.h index 7645a0064b..850d0caf29 100644 --- a/widgets/table/e-cell-text.h +++ b/widgets/table/e-cell-text.h @@ -87,8 +87,8 @@ struct _ECellText { gint bold_column; /* This column in the ETable should return a string specifying a color, - either a color name like "red" or a color spec like "rgb:F/0/0". - See the XParseColor man page for the formats available. */ + * either a color name like "red" or a color spec like "rgb:F/0/0". + * See the XParseColor man page for the formats available. */ gint color_column; gint bg_color_column; }; @@ -132,8 +132,8 @@ ECell * e_cell_text_construct (ECellText *cell, GtkJustification justify); /* Gets the value from the model and converts it into a string. In ECellText - itself, the value is assumed to be a gchar * and so needs no conversion. - In subclasses the ETableModel value may be a more complicated datatype. */ + * itself, the value is assumed to be a gchar * and so needs no conversion. + * In subclasses the ETableModel value may be a more complicated datatype. */ gchar * e_cell_text_get_text (ECellText *cell, ETableModel *model, gint col, diff --git a/widgets/table/e-cell-tree.c b/widgets/table/e-cell-tree.c index 77f25ae387..e4bb093912 100644 --- a/widgets/table/e-cell-tree.c +++ b/widgets/table/e-cell-tree.c @@ -71,25 +71,29 @@ e_cell_tree_view_get_subcell_view (ECellView *ect) } static ETreePath -e_cell_tree_get_node (ETableModel *table_model, gint row) +e_cell_tree_get_node (ETableModel *table_model, + gint row) { return e_table_model_value_at (table_model, -1, row); } -static ETreeModel* -e_cell_tree_get_tree_model (ETableModel *table_model, gint row) +static ETreeModel * +e_cell_tree_get_tree_model (ETableModel *table_model, + gint row) { return e_table_model_value_at (table_model, -2, row); } static ETreeTableAdapter * -e_cell_tree_get_tree_table_adapter (ETableModel *table_model, gint row) +e_cell_tree_get_tree_table_adapter (ETableModel *table_model, + gint row) { return e_table_model_value_at (table_model, -3, row); } static gint -visible_depth_of_node (ETableModel *model, gint row) +visible_depth_of_node (ETableModel *model, + gint row) { ETreeModel *tree_model = e_cell_tree_get_tree_model (model, row); ETreeTableAdapter *adapter = e_cell_tree_get_tree_table_adapter (model, row); @@ -99,10 +103,11 @@ visible_depth_of_node (ETableModel *model, gint row) } /* If this is changed to not include the width of the expansion pixmap - if the path is not expandable, then max_width needs to change as - well. */ + * if the path is not expandable, then max_width needs to change as + * well. */ static gint -offset_of_node (ETableModel *table_model, gint row) +offset_of_node (ETableModel *table_model, + gint row) { ETreeModel *tree_model = e_cell_tree_get_tree_model (table_model, row); ETreePath path = e_cell_tree_get_node (table_model, row); @@ -119,7 +124,9 @@ offset_of_node (ETableModel *table_model, gint row) * ECell::new_view method */ static ECellView * -ect_new_view (ECell *ecell, ETableModel *table_model, gpointer e_table_item_view) +ect_new_view (ECell *ecell, + ETableModel *table_model, + gpointer e_table_item_view) { ECellTree *ect = E_CELL_TREE (ecell); ECellTreeView *tree_view = g_new0 (ECellTreeView, 1); @@ -283,7 +290,7 @@ ect_draw (ECellView *ecell_view, } /* Now cause our subcell to draw its contents, shifted by - subcell_offset pixels */ + * subcell_offset pixels */ e_cell_draw (tree_view->subcell_view, cr, model_col, view_col, row, flags, x1 + subcell_offset, y1, x2, y2); @@ -292,7 +299,8 @@ ect_draw (ECellView *ecell_view, } static void -adjust_event_position (GdkEvent *event, gint offset) +adjust_event_position (GdkEvent *event, + gint offset) { switch (event->type) { case GDK_BUTTON_PRESS: @@ -310,7 +318,9 @@ adjust_event_position (GdkEvent *event, gint offset) } static gboolean -event_in_expander (GdkEvent *event, gint offset, gint height) +event_in_expander (GdkEvent *event, + gint offset, + gint height) { switch (event->type) { case GDK_BUTTON_PRESS: @@ -329,7 +339,10 @@ event_in_expander (GdkEvent *event, gint offset, gint height) * ECell::height method */ static gint -ect_height (ECellView *ecell_view, gint model_col, gint view_col, gint row) +ect_height (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row) { ECellTreeView *tree_view = (ECellTreeView *) ecell_view; @@ -381,7 +394,13 @@ animate_expander (gpointer data) * ECell::event method */ static gint -ect_event (ECellView *ecell_view, GdkEvent *event, gint model_col, gint view_col, gint row, ECellFlags flags, ECellActions *actions) +ect_event (ECellView *ecell_view, + GdkEvent *event, + gint model_col, + gint view_col, + gint row, + ECellFlags flags, + ECellActions *actions) { GtkLayout *layout; GdkWindow *window; @@ -504,7 +523,9 @@ ect_event (ECellView *ecell_view, GdkEvent *event, gint model_col, gint view_col * ECell::max_width method */ static gint -ect_max_width (ECellView *ecell_view, gint model_col, gint view_col) +ect_max_width (ECellView *ecell_view, + gint model_col, + gint view_col) { ECellTreeView *tree_view = (ECellTreeView *) ecell_view; gint row; @@ -578,7 +599,8 @@ ect_max_width (ECellView *ecell_view, gint model_col, gint view_col) * ECellView::get_bg_color method */ static gchar * -ect_get_bg_color (ECellView *ecell_view, gint row) +ect_get_bg_color (ECellView *ecell_view, + gint row) { ECellTreeView *tree_view = (ECellTreeView *) ecell_view; @@ -589,7 +611,10 @@ ect_get_bg_color (ECellView *ecell_view, gint row) * ECellView::enter_edit method */ static gpointer -ect_enter_edit (ECellView *ecell_view, gint model_col, gint view_col, gint row) +ect_enter_edit (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row) { /* just defer to our subcell's view */ ECellTreeView *tree_view = (ECellTreeView *) ecell_view; @@ -601,7 +626,11 @@ ect_enter_edit (ECellView *ecell_view, gint model_col, gint view_col, gint row) * ECellView::leave_edit method */ static void -ect_leave_edit (ECellView *ecell_view, gint model_col, gint view_col, gint row, gpointer edit_context) +ect_leave_edit (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row, + gpointer edit_context) { /* just defer to our subcell's view */ ECellTreeView *tree_view = (ECellTreeView *) ecell_view; @@ -610,9 +639,13 @@ ect_leave_edit (ECellView *ecell_view, gint model_col, gint view_col, gint row, } static void -ect_print (ECellView *ecell_view, GtkPrintContext *context, - gint model_col, gint view_col, gint row, - gdouble width, gdouble height) +ect_print (ECellView *ecell_view, + GtkPrintContext *context, + gint model_col, + gint view_col, + gint row, + gdouble width, + gdouble height) { ECellTreeView *tree_view = (ECellTreeView *) ecell_view; cairo_t *cr = gtk_print_context_get_cairo_context (context); @@ -650,8 +683,8 @@ ect_print (ECellView *ecell_view, GtkPrintContext *context, } /* now traverse back up to the root of the tree, checking at - each level if the node has siblings, and drawing the - correct vertical pipe for it's configuration. */ + * each level if the node has siblings, and drawing the + * correct vertical pipe for it's configuration. */ node = e_tree_model_node_get_parent (tree_model, node); depth = visible_depth_of_node (ecell_view->e_table_model, row) - 1; offset -= INDENT_AMOUNT; @@ -700,9 +733,12 @@ ect_print (ECellView *ecell_view, GtkPrintContext *context, } static gdouble -ect_print_height (ECellView *ecell_view, GtkPrintContext *context, - gint model_col, gint view_col, gint row, - gdouble width) +ect_print_height (ECellView *ecell_view, + GtkPrintContext *context, + gint model_col, + gint view_col, + gint row, + gdouble width) { return 12; /* XXX */ } @@ -766,8 +802,8 @@ e_cell_tree_init (ECellTree *ect) **/ void e_cell_tree_construct (ECellTree *ect, - gboolean draw_lines, - ECell *subcell) + gboolean draw_lines, + ECell *subcell) { ect->subcell = subcell; if (subcell) @@ -792,7 +828,7 @@ e_cell_tree_construct (ECellTree *ect, **/ ECell * e_cell_tree_new (gboolean draw_lines, - ECell *subcell) + ECell *subcell) { ECellTree *ect = g_object_new (E_TYPE_CELL_TREE, NULL); diff --git a/widgets/table/e-cell-vbox.c b/widgets/table/e-cell-vbox.c index 1c0cbc62ca..9830a06aff 100644 --- a/widgets/table/e-cell-vbox.c +++ b/widgets/table/e-cell-vbox.c @@ -46,7 +46,9 @@ G_DEFINE_TYPE (ECellVbox, e_cell_vbox, E_TYPE_CELL) * ECell::new_view method */ static ECellView * -ecv_new_view (ECell *ecell, ETableModel *table_model, gpointer e_table_item_view) +ecv_new_view (ECell *ecell, + ETableModel *table_model, + gpointer e_table_item_view) { ECellVbox *ecv = E_CELL_VBOX (ecell); ECellVboxView *vbox_view = g_new0 (ECellVboxView, 1); @@ -151,7 +153,7 @@ ecv_draw (ECellView *ecell_view, for (i = 0; i < vbox_view->subcell_view_count; i++) { /* Now cause our subcells to draw their contents, - shifted by subcell_offset pixels */ + * shifted by subcell_offset pixels */ gint height; height = e_cell_height ( @@ -173,7 +175,13 @@ ecv_draw (ECellView *ecell_view, * ECell::event method */ static gint -ecv_event (ECellView *ecell_view, GdkEvent *event, gint model_col, gint view_col, gint row, ECellFlags flags, ECellActions *actions) +ecv_event (ECellView *ecell_view, + GdkEvent *event, + gint model_col, + gint view_col, + gint row, + ECellFlags flags, + ECellActions *actions) { ECellVboxView *vbox_view = (ECellVboxView *) ecell_view; gint y = 0; @@ -208,7 +216,10 @@ ecv_event (ECellView *ecell_view, GdkEvent *event, gint model_col, gint view_col * ECell::height method */ static gint -ecv_height (ECellView *ecell_view, gint model_col, gint view_col, gint row) +ecv_height (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row) { ECellVboxView *vbox_view = (ECellVboxView *) ecell_view; gint height = 0; @@ -224,7 +235,9 @@ ecv_height (ECellView *ecell_view, gint model_col, gint view_col, gint row) * ECell::max_width method */ static gint -ecv_max_width (ECellView *ecell_view, gint model_col, gint view_col) +ecv_max_width (ECellView *ecell_view, + gint model_col, + gint view_col) { ECellVboxView *vbox_view = (ECellVboxView *) ecell_view; gint max_width = 0; @@ -312,7 +325,9 @@ e_cell_vbox_new (void) } void -e_cell_vbox_append (ECellVbox *vbox, ECell *subcell, gint model_col) +e_cell_vbox_append (ECellVbox *vbox, + ECell *subcell, + gint model_col) { vbox->subcell_count++; diff --git a/widgets/table/e-cell.c b/widgets/table/e-cell.c index cbc0bfc0ae..88762f6a7a 100644 --- a/widgets/table/e-cell.c +++ b/widgets/table/e-cell.c @@ -36,7 +36,9 @@ G_DEFINE_TYPE (ECell, e_cell, G_TYPE_OBJECT) #define ECVIEW_EC_CLASS(v) (E_CELL_GET_CLASS (v->ecell)) static ECellView * -ec_new_view (ECell *ecell, ETableModel *table_model, gpointer e_table_item_view) +ec_new_view (ECell *ecell, + ETableModel *table_model, + gpointer e_table_item_view) { return NULL; } @@ -57,15 +59,28 @@ ec_unrealize (ECellView *e_cell) } static void -ec_draw (ECellView *ecell_view, cairo_t *cr, - gint model_col, gint view_col, gint row, ECellFlags flags, - gint x1, gint y1, gint x2, gint y2) +ec_draw (ECellView *ecell_view, + cairo_t *cr, + gint model_col, + gint view_col, + gint row, + ECellFlags flags, + gint x1, + gint y1, + gint x2, + gint y2) { g_critical ("e-cell-draw invoked"); } static gint -ec_event (ECellView *ecell_view, GdkEvent *event, gint model_col, gint view_col, gint row, ECellFlags flags, ECellActions *actions) +ec_event (ECellView *ecell_view, + GdkEvent *event, + gint model_col, + gint view_col, + gint row, + ECellFlags flags, + ECellActions *actions) { g_critical ("e-cell-event invoked"); @@ -73,7 +88,10 @@ ec_event (ECellView *ecell_view, GdkEvent *event, gint model_col, gint view_col, } static gint -ec_height (ECellView *ecell_view, gint model_col, gint view_col, gint row) +ec_height (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row) { g_critical ("e-cell-height invoked"); @@ -81,7 +99,14 @@ ec_height (ECellView *ecell_view, gint model_col, gint view_col, gint row) } static void -ec_focus (ECellView *ecell_view, gint model_col, gint view_col, gint row, gint x1, gint y1, gint x2, gint y2) +ec_focus (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row, + gint x1, + gint y1, + gint x2, + gint y2) { ecell_view->focus_col = view_col; ecell_view->focus_row = row; @@ -103,29 +128,49 @@ ec_unfocus (ECellView *ecell_view) } static gpointer -ec_enter_edit (ECellView *ecell_view, gint model_col, gint view_col, gint row) +ec_enter_edit (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row) { return NULL; } static void -ec_leave_edit (ECellView *ecell_view, gint model_col, gint view_col, gint row, gpointer context) +ec_leave_edit (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row, + gpointer context) { } static gpointer -ec_save_state (ECellView *ecell_view, gint model_col, gint view_col, gint row, gpointer context) +ec_save_state (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row, + gpointer context) { return NULL; } static void -ec_load_state (ECellView *ecell_view, gint model_col, gint view_col, gint row, gpointer context, gpointer save_state) +ec_load_state (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row, + gpointer context, + gpointer save_state) { } static void -ec_free_state (ECellView *ecell_view, gint model_col, gint view_col, gint row, gpointer save_state) +ec_free_state (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row, + gpointer save_state) { } @@ -172,7 +217,13 @@ e_cell_init (ECell *cell) * Returns: processing state from the GdkEvent handling. */ gint -e_cell_event (ECellView *ecell_view, GdkEvent *event, gint model_col, gint view_col, gint row, ECellFlags flags, ECellActions *actions) +e_cell_event (ECellView *ecell_view, + GdkEvent *event, + gint model_col, + gint view_col, + gint row, + ECellFlags flags, + ECellActions *actions) { return ECVIEW_EC_CLASS (ecell_view)->event ( ecell_view, event, model_col, view_col, row, flags, actions); @@ -194,7 +245,9 @@ e_cell_event (ECellView *ecell_view, GdkEvent *event, gint model_col, gint view_ * Returns: a new ECellView for this @ecell on the @table_model displayed on the @e_table_item_view. */ ECellView * -e_cell_new_view (ECell *ecell, ETableModel *table_model, gpointer e_table_item_view) +e_cell_new_view (ECell *ecell, + ETableModel *table_model, + gpointer e_table_item_view) { return E_CELL_GET_CLASS (ecell)->new_view ( ecell, table_model, e_table_item_view); @@ -260,9 +313,16 @@ e_cell_unrealize (ECellView *ecell_view) * flags include alignments and justifications. */ void -e_cell_draw (ECellView *ecell_view, cairo_t *cr, - gint model_col, gint view_col, gint row, ECellFlags flags, - gint x1, gint y1, gint x2, gint y2) +e_cell_draw (ECellView *ecell_view, + cairo_t *cr, + gint model_col, + gint view_col, + gint row, + ECellFlags flags, + gint x1, + gint y1, + gint x2, + gint y2) { g_return_if_fail (ecell_view != NULL); g_return_if_fail (row >= 0); @@ -288,9 +348,13 @@ e_cell_draw (ECellView *ecell_view, cairo_t *cr, * FIXME: */ void -e_cell_print (ECellView *ecell_view, GtkPrintContext *context, - gint model_col, gint view_col, gint row, - gdouble width, gdouble height) +e_cell_print (ECellView *ecell_view, + GtkPrintContext *context, + gint model_col, + gint view_col, + gint row, + gdouble width, + gdouble height) { if (ECVIEW_EC_CLASS (ecell_view)->print) ECVIEW_EC_CLASS (ecell_view)->print (ecell_view, context, model_col, view_col, row, width, height); @@ -302,9 +366,12 @@ e_cell_print (ECellView *ecell_view, GtkPrintContext *context, * FIXME: */ gdouble -e_cell_print_height (ECellView *ecell_view, GtkPrintContext *context, - gint model_col, gint view_col, gint row, - gdouble width) +e_cell_print_height (ECellView *ecell_view, + GtkPrintContext *context, + gint model_col, + gint view_col, + gint row, + gdouble width) { if (ECVIEW_EC_CLASS (ecell_view)->print_height) return ECVIEW_EC_CLASS (ecell_view)->print_height @@ -324,7 +391,10 @@ e_cell_print_height (ECellView *ecell_view, GtkPrintContext *context, * @view_col, @row. */ gint -e_cell_height (ECellView *ecell_view, gint model_col, gint view_col, gint row) +e_cell_height (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row) { return ECVIEW_EC_CLASS (ecell_view)->height (ecell_view, model_col, view_col, row); } @@ -340,7 +410,10 @@ e_cell_height (ECellView *ecell_view, gint model_col, gint view_col, gint row) * @model_col, @row rendered at @view_col, @row. */ gpointer -e_cell_enter_edit (ECellView *ecell_view, gint model_col, gint view_col, gint row) +e_cell_enter_edit (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row) { return ECVIEW_EC_CLASS (ecell_view)->enter_edit (ecell_view, model_col, view_col, row); } @@ -357,7 +430,11 @@ e_cell_enter_edit (ECellView *ecell_view, gint model_col, gint view_col, gint ro * rendered at @view_col, @row. */ void -e_cell_leave_edit (ECellView *ecell_view, gint model_col, gint view_col, gint row, gpointer edit_context) +e_cell_leave_edit (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row, + gpointer edit_context) { ECVIEW_EC_CLASS (ecell_view)->leave_edit (ecell_view, model_col, view_col, row, edit_context); } @@ -377,7 +454,11 @@ e_cell_leave_edit (ECellView *ecell_view, gint model_col, gint view_col, gint ro * or scrolling. */ gpointer -e_cell_save_state (ECellView *ecell_view, gint model_col, gint view_col, gint row, gpointer edit_context) +e_cell_save_state (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row, + gpointer edit_context) { if (ECVIEW_EC_CLASS (ecell_view)->save_state) return ECVIEW_EC_CLASS (ecell_view)->save_state (ecell_view, model_col, view_col, row, edit_context); @@ -397,7 +478,12 @@ e_cell_save_state (ECellView *ecell_view, gint model_col, gint view_col, gint ro * Requests that the ECellView load from the given save state. */ void -e_cell_load_state (ECellView *ecell_view, gint model_col, gint view_col, gint row, gpointer edit_context, gpointer save_state) +e_cell_load_state (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row, + gpointer edit_context, + gpointer save_state) { if (ECVIEW_EC_CLASS (ecell_view)->load_state) ECVIEW_EC_CLASS (ecell_view)->load_state (ecell_view, model_col, view_col, row, edit_context, save_state); @@ -415,7 +501,11 @@ e_cell_load_state (ECellView *ecell_view, gint model_col, gint view_col, gint ro * Requests that the ECellView free the given save state. */ void -e_cell_free_state (ECellView *ecell_view, gint model_col, gint view_col, gint row, gpointer save_state) +e_cell_free_state (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row, + gpointer save_state) { if (ECVIEW_EC_CLASS (ecell_view)->free_state) ECVIEW_EC_CLASS (ecell_view)->free_state (ecell_view, model_col, view_col, row, save_state); @@ -431,7 +521,9 @@ e_cell_free_state (ECellView *ecell_view, gint model_col, gint view_col, gint ro * is being rendered as @view_col */ gint -e_cell_max_width (ECellView *ecell_view, gint model_col, gint view_col) +e_cell_max_width (ECellView *ecell_view, + gint model_col, + gint view_col) { return ECVIEW_EC_CLASS (ecell_view)->max_width (ecell_view, model_col, view_col); @@ -448,7 +540,10 @@ e_cell_max_width (ECellView *ecell_view, gint model_col, gint view_col) * is being rendered as @view_col for the data in @row. */ gint -e_cell_max_width_by_row (ECellView *ecell_view, gint model_col, gint view_col, gint row) +e_cell_max_width_by_row (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row) { if (ECVIEW_EC_CLASS (ecell_view)->max_width_by_row) return ECVIEW_EC_CLASS (ecell_view)->max_width_by_row @@ -474,7 +569,8 @@ e_cell_max_width_by_row_implemented (ECellView *ecell_view) } gchar * -e_cell_get_bg_color (ECellView *ecell_view, gint row) +e_cell_get_bg_color (ECellView *ecell_view, + gint row) { if (ECVIEW_EC_CLASS (ecell_view)->get_bg_color) return ECVIEW_EC_CLASS (ecell_view)->get_bg_color (ecell_view, row); @@ -483,7 +579,8 @@ e_cell_get_bg_color (ECellView *ecell_view, gint row) } void -e_cell_style_set (ECellView *ecell_view, GtkStyle *previous_style) +e_cell_style_set (ECellView *ecell_view, + GtkStyle *previous_style) { if (ECVIEW_EC_CLASS (ecell_view)->style_set) ECVIEW_EC_CLASS (ecell_view)->style_set (ecell_view, previous_style); diff --git a/widgets/table/e-cell.h b/widgets/table/e-cell.h index 3a41db0afe..830184c06d 100644 --- a/widgets/table/e-cell.h +++ b/widgets/table/e-cell.h @@ -92,7 +92,7 @@ struct _ECellView { gint focus_x1, focus_y1, focus_x2, focus_y2; gint focus_col, focus_row; - void (*kill_view_cb) (struct _ECellView*, gpointer ); + void (*kill_view_cb) (struct _ECellView *, gpointer ); GList *kill_view_cb_data; }; diff --git a/widgets/table/e-popup-menu.c b/widgets/table/e-popup-menu.c index 07589b1589..a4cfec07e9 100644 --- a/widgets/table/e-popup-menu.c +++ b/widgets/table/e-popup-menu.c @@ -38,7 +38,9 @@ * Creates an item with an optional icon */ static void -make_item (GtkMenu *menu, GtkMenuItem *item, const gchar *name) +make_item (GtkMenu *menu, + GtkMenuItem *item, + const gchar *name) { GtkWidget *label; @@ -57,10 +59,10 @@ make_item (GtkMenu *menu, GtkMenuItem *item, const gchar *name) GtkMenu * e_popup_menu_create_with_domain (EPopupMenu *menu_list, - guint32 disable_mask, - guint32 hide_mask, - gpointer default_closure, - const gchar *domain) + guint32 disable_mask, + guint32 hide_mask, + gpointer default_closure, + const gchar *domain) { GtkMenu *menu = GTK_MENU (gtk_menu_new ()); gboolean last_item_separator = TRUE; diff --git a/widgets/table/e-table-click-to-add.c b/widgets/table/e-table-click-to-add.c index 662a9c50a5..8defc2c479 100644 --- a/widgets/table/e-table-click-to-add.c +++ b/widgets/table/e-table-click-to-add.c @@ -63,7 +63,10 @@ enum { }; static void -etcta_cursor_change (GObject *object, gint row, gint col, ETableClickToAdd *etcta) +etcta_cursor_change (GObject *object, + gint row, + gint col, + ETableClickToAdd *etcta) { g_signal_emit (etcta, etcta_signals[CURSOR_CHANGE], 0, @@ -71,7 +74,8 @@ etcta_cursor_change (GObject *object, gint row, gint col, ETableClickToAdd *etct } static void -etcta_style_set (ETableClickToAdd *etcta, GtkStyle *previous_style) +etcta_style_set (ETableClickToAdd *etcta, + GtkStyle *previous_style) { GtkWidget *widget; GtkStyle *style; @@ -94,7 +98,8 @@ etcta_style_set (ETableClickToAdd *etcta, GtkStyle *previous_style) } static void -etcta_add_table_header (ETableClickToAdd *etcta, ETableHeader *header) +etcta_add_table_header (ETableClickToAdd *etcta, + ETableHeader *header) { etcta->eth = header; if (etcta->eth) @@ -116,7 +121,8 @@ etcta_drop_table_header (ETableClickToAdd *etcta) } static void -etcta_add_one (ETableClickToAdd *etcta, ETableModel *one) +etcta_add_one (ETableClickToAdd *etcta, + ETableModel *one) { etcta->one = one; if (etcta->one) @@ -143,7 +149,8 @@ etcta_drop_one (ETableClickToAdd *etcta) } static void -etcta_add_model (ETableClickToAdd *etcta, ETableModel *model) +etcta_add_model (ETableClickToAdd *etcta, + ETableModel *model) { etcta->model = model; if (etcta->model) @@ -161,7 +168,8 @@ etcta_drop_model (ETableClickToAdd *etcta) } static void -etcta_add_message (ETableClickToAdd *etcta, const gchar *message) +etcta_add_message (ETableClickToAdd *etcta, + const gchar *message) { etcta->message = g_strdup (message); } @@ -191,7 +199,7 @@ etcta_dispose (GObject *object) static void etcta_set_property (GObject *object, - guint prop_id, + guint property_id, const GValue *value, GParamSpec *pspec) { @@ -201,7 +209,7 @@ etcta_set_property (GObject *object, item = GNOME_CANVAS_ITEM (object); etcta = E_TABLE_CLICK_TO_ADD (object); - switch (prop_id) { + switch (property_id) { case PROP_HEADER: etcta_drop_table_header (etcta); etcta_add_table_header (etcta, E_TABLE_HEADER (g_value_get_object (value))); @@ -230,7 +238,7 @@ etcta_set_property (GObject *object, NULL); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); return; } @@ -270,13 +278,16 @@ create_rect_and_text (ETableClickToAdd *etcta) } static void -etcta_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) +etcta_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) { ETableClickToAdd *etcta; etcta = E_TABLE_CLICK_TO_ADD (object); - switch (prop_id) { + switch (property_id) { case PROP_HEADER: g_value_set_object (value, etcta->eth); break; @@ -293,7 +304,7 @@ etcta_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *p g_value_set_double (value, etcta->height); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } @@ -376,7 +387,7 @@ finish_editing (ETableClickToAdd *etcta) "cursor_mode", E_CURSOR_SPREADSHEET, NULL); - g_signal_connect(etcta->row, "key_press", + g_signal_connect (etcta->row, "key_press", G_CALLBACK (item_key_press), etcta); set_initial_selection (etcta); @@ -386,7 +397,8 @@ finish_editing (ETableClickToAdd *etcta) /* Handles the events on the ETableClickToAdd, particularly * it creates the ETableItem and passes in some events. */ static gint -etcta_event (GnomeCanvasItem *item, GdkEvent *e) +etcta_event (GnomeCanvasItem *item, + GdkEvent *e) { ETableClickToAdd *etcta = E_TABLE_CLICK_TO_ADD (item); @@ -424,7 +436,7 @@ etcta_event (GnomeCanvasItem *item, GdkEvent *e) "cursor_mode", E_CURSOR_SPREADSHEET, NULL); - g_signal_connect(etcta->row, "key_press", + g_signal_connect (etcta->row, "key_press", G_CALLBACK (item_key_press), etcta); e_canvas_item_grab_focus (GNOME_CANVAS_ITEM (etcta->row), TRUE); @@ -462,7 +474,8 @@ etcta_event (GnomeCanvasItem *item, GdkEvent *e) } static void -etcta_reflow (GnomeCanvasItem *item, gint flags) +etcta_reflow (GnomeCanvasItem *item, + gint flags) { ETableClickToAdd *etcta = E_TABLE_CLICK_TO_ADD (item); @@ -583,7 +596,7 @@ etcta_init (ETableClickToAdd *etcta) etcta->height = 6; etcta->selection = e_table_selection_model_new (); - g_signal_connect(etcta->selection, "cursor_changed", + g_signal_connect (etcta->selection, "cursor_changed", G_CALLBACK (etcta_cursor_change), etcta); e_canvas_item_set_reflow_callback (GNOME_CANVAS_ITEM (etcta), etcta_reflow); diff --git a/widgets/table/e-table-col.c b/widgets/table/e-table-col.c index 7296408594..fc7da9c9f5 100644 --- a/widgets/table/e-table-col.c +++ b/widgets/table/e-table-col.c @@ -82,13 +82,13 @@ etc_dispose (GObject *object) static void etc_set_property (GObject *object, - guint prop_id, + guint property_id, const GValue *value, GParamSpec *pspec) { ETableCol *etc = E_TABLE_COL (object); - switch (prop_id) { + switch (property_id) { case PROP_COMPARE_COL: etc->compare_col = g_value_get_int (value); break; @@ -99,18 +99,18 @@ etc_set_property (GObject *object, static void etc_get_property (GObject *object, - guint prop_id, + guint property_id, GValue *value, GParamSpec *pspec) { ETableCol *etc = E_TABLE_COL (object); - switch (prop_id) { + switch (property_id) { case PROP_COMPARE_COL: g_value_set_int (value, etc->compare_col); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } diff --git a/widgets/table/e-table-col.h b/widgets/table/e-table-col.h index b82886a5ca..042137b40a 100644 --- a/widgets/table/e-table-col.h +++ b/widgets/table/e-table-col.h @@ -73,11 +73,11 @@ struct _ETableCol { GCompareDataFunc compare; ETableSearchFunc search; - guint selected:1; - guint resizable:1; - guint disabled:1; - guint sortable:1; - guint groupable:1; + guint selected : 1; + guint resizable : 1; + guint disabled : 1; + guint sortable : 1; + guint groupable : 1; gint col_idx; gint compare_col; diff --git a/widgets/table/e-table-column-specification.c b/widgets/table/e-table-column-specification.c index 7fb0756085..cd7e07acca 100644 --- a/widgets/table/e-table-column-specification.c +++ b/widgets/table/e-table-column-specification.c @@ -102,7 +102,7 @@ e_table_column_specification_new (void) void e_table_column_specification_load_from_node (ETableColumnSpecification *etcs, - const xmlNode *node) + const xmlNode *node) { free_strings (etcs); @@ -128,7 +128,7 @@ e_table_column_specification_load_from_node (ETableColumnSpecification *etcs, xmlNode * e_table_column_specification_save_to_node (ETableColumnSpecification *specification, - xmlNode *parent) + xmlNode *parent) { xmlNode *node; if (parent) diff --git a/widgets/table/e-table-config.c b/widgets/table/e-table-config.c index 4bfb80d1e9..4e9fe81117 100644 --- a/widgets/table/e-table-config.c +++ b/widgets/table/e-table-config.c @@ -94,7 +94,8 @@ config_finalize (GObject *object) } static void -e_table_config_changed (ETableConfig *config, ETableState *state) +e_table_config_changed (ETableConfig *config, + ETableState *state) { g_return_if_fail (E_IS_TABLE_CONFIG (config)); @@ -113,13 +114,13 @@ config_dialog_changed (ETableConfig *config) static void config_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) + guint property_id, + GValue *value, + GParamSpec *pspec) { ETableConfig *config = E_TABLE_CONFIG (object); - switch (prop_id) { + switch (property_id) { case PROP_STATE: g_value_set_object (value, config->state); break; @@ -156,7 +157,8 @@ e_table_config_class_init (ETableConfigClass *class) } static void -configure_combo_box_add (GtkComboBox *combo_box, const gchar *item, +configure_combo_box_add (GtkComboBox *combo_box, + const gchar *item, const gchar *value) { GtkTreeRowReference *reference; @@ -203,7 +205,8 @@ configure_combo_box_get_active (GtkComboBox *combo_box) } static void -configure_combo_box_set_active (GtkComboBox *combo_box, const gchar *value) +configure_combo_box_set_active (GtkComboBox *combo_box, + const gchar *value) { GtkTreeRowReference *reference; GHashTable *index; @@ -231,7 +234,8 @@ configure_combo_box_set_active (GtkComboBox *combo_box, const gchar *value) } static ETableColumnSpecification * -find_column_in_spec (ETableSpecification *spec, gint model_col) +find_column_in_spec (ETableSpecification *spec, + gint model_col) { ETableColumnSpecification **column; @@ -248,7 +252,8 @@ find_column_in_spec (ETableSpecification *spec, gint model_col) } static gint -find_model_column_by_name (ETableSpecification *spec, const gchar *s) +find_model_column_by_name (ETableSpecification *spec, + const gchar *s) { ETableColumnSpecification **column; @@ -263,7 +268,8 @@ find_model_column_by_name (ETableSpecification *spec, const gchar *s) } static void -update_sort_and_group_config_dialog (ETableConfig *config, gboolean is_sort) +update_sort_and_group_config_dialog (ETableConfig *config, + gboolean is_sort) { ETableConfigSortWidgets *widgets; gint count, i; @@ -328,7 +334,7 @@ update_sort_and_group_config_dialog (ETableConfig *config, gboolean is_sort) d = GTK_TOGGLE_BUTTON ( widgets[i].radio_descending); - gtk_toggle_button_set_active (col.ascending ? a:d, 1); + gtk_toggle_button_set_active (col.ascending ? a : d, 1); } else { GtkToggleButton *t; @@ -428,7 +434,7 @@ config_group_info_update (ETableConfig *config) col.ascending ? _("(Ascending)") : _("(Descending)")); - if ((i+1) != count) + if ((i + 1) != count) g_string_append (res, ", "); } if (res->str[0] == 0) @@ -492,7 +498,8 @@ config_fields_info_update (ETableConfig *config) } static void -do_sort_and_group_config_dialog (ETableConfig *config, gboolean is_sort) +do_sort_and_group_config_dialog (ETableConfig *config, + gboolean is_sort) { GtkDialog *dialog; gint response, running = 1; @@ -682,32 +689,38 @@ e_table_proxy_etable_available_new (ETableModel *store) } static void -config_button_fields (GtkWidget *widget, ETableConfig *config) +config_button_fields (GtkWidget *widget, + ETableConfig *config) { do_fields_config_dialog (config); } static void -config_button_sort (GtkWidget *widget, ETableConfig *config) +config_button_sort (GtkWidget *widget, + ETableConfig *config) { do_sort_and_group_config_dialog (config, TRUE); } static void -config_button_group (GtkWidget *widget, ETableConfig *config) +config_button_group (GtkWidget *widget, + ETableConfig *config) { do_sort_and_group_config_dialog (config, FALSE); } static void -dialog_destroyed (gpointer data, GObject *where_object_was) +dialog_destroyed (gpointer data, + GObject *where_object_was) { ETableConfig *config = data; g_object_unref (config); } static void -dialog_response (GtkWidget *dialog, gint response_id, ETableConfig *config) +dialog_response (GtkWidget *dialog, + gint response_id, + ETableConfig *config) { if (response_id == GTK_RESPONSE_APPLY || response_id == GTK_RESPONSE_OK) { @@ -760,14 +773,13 @@ connect_button (ETableConfig *config, { GtkWidget *button = e_builder_get_widget (builder, widget_name); - if (button) { - g_signal_connect (G_OBJECT (button), "clicked", - cback, config); - } + if (button) + g_signal_connect (button, "clicked", cback, config); } static gint -get_source_model_col_index (ETableConfig *config, gint idx) +get_source_model_col_index (ETableConfig *config, + gint idx) { gint visible_index; ETableModel *src_model; @@ -781,7 +793,8 @@ get_source_model_col_index (ETableConfig *config, gint idx) } static void -sort_combo_changed (GtkComboBox *combo_box, ETableConfigSortWidgets *sort) +sort_combo_changed (GtkComboBox *combo_box, + ETableConfigSortWidgets *sort) { ETableConfig *config = sort->e_table_config; ETableSortInfo *sort_info = config->temp_state->sort_info; @@ -819,7 +832,8 @@ sort_combo_changed (GtkComboBox *combo_box, ETableConfigSortWidgets *sort) } static void -sort_ascending_toggled (GtkToggleButton *t, ETableConfigSortWidgets *sort) +sort_ascending_toggled (GtkToggleButton *t, + ETableConfigSortWidgets *sort) { ETableConfig *config = sort->e_table_config; ETableSortInfo *si = config->temp_state->sort_info; @@ -833,7 +847,8 @@ sort_ascending_toggled (GtkToggleButton *t, ETableConfigSortWidgets *sort) } static void -configure_sort_dialog (ETableConfig *config, GtkBuilder *builder) +configure_sort_dialog (ETableConfig *config, + GtkBuilder *builder) { GSList *l; gint i; @@ -904,7 +919,8 @@ configure_sort_dialog (ETableConfig *config, GtkBuilder *builder) } static void -group_combo_changed (GtkComboBox *combo_box, ETableConfigSortWidgets *group) +group_combo_changed (GtkComboBox *combo_box, + ETableConfigSortWidgets *group) { ETableConfig *config = group->e_table_config; ETableSortInfo *sort_info = config->temp_state->sort_info; @@ -942,7 +958,8 @@ group_combo_changed (GtkComboBox *combo_box, ETableConfigSortWidgets *group) } static void -group_ascending_toggled (GtkToggleButton *t, ETableConfigSortWidgets *group) +group_ascending_toggled (GtkToggleButton *t, + ETableConfigSortWidgets *group) { ETableConfig *config = group->e_table_config; ETableSortInfo *si = config->temp_state->sort_info; @@ -956,7 +973,8 @@ group_ascending_toggled (GtkToggleButton *t, ETableConfigSortWidgets *group) } static void -configure_group_dialog (ETableConfig *config, GtkBuilder *builder) +configure_group_dialog (ETableConfig *config, + GtkBuilder *builder) { GSList *l; gint i; @@ -1027,14 +1045,16 @@ configure_group_dialog (ETableConfig *config, GtkBuilder *builder) } static void -add_column (gint model_row, gpointer closure) +add_column (gint model_row, + gpointer closure) { GList **columns = closure; *columns = g_list_prepend (*columns, GINT_TO_POINTER (model_row)); } static void -config_button_add (GtkWidget *widget, ETableConfig *config) +config_button_add (GtkWidget *widget, + ETableConfig *config) { GList *columns = NULL; GList *column; @@ -1070,7 +1090,8 @@ config_button_add (GtkWidget *widget, ETableConfig *config) } static void -config_button_remove (GtkWidget *widget, ETableConfig *config) +config_button_remove (GtkWidget *widget, + ETableConfig *config) { GList *columns = NULL; GList *column; @@ -1103,7 +1124,8 @@ config_button_remove (GtkWidget *widget, ETableConfig *config) } static void -config_button_up (GtkWidget *widget, ETableConfig *config) +config_button_up (GtkWidget *widget, + ETableConfig *config) { GList *columns = NULL; GList *column; @@ -1158,7 +1180,8 @@ config_button_up (GtkWidget *widget, ETableConfig *config) } static void -config_button_down (GtkWidget *widget, ETableConfig *config) +config_button_down (GtkWidget *widget, + ETableConfig *config) { GList *columns = NULL; GList *column; @@ -1211,7 +1234,8 @@ config_button_down (GtkWidget *widget, ETableConfig *config) } static void -configure_fields_dialog (ETableConfig *config, GtkBuilder *builder) +configure_fields_dialog (ETableConfig *config, + GtkBuilder *builder) { GtkWidget *scrolled; GtkWidget *etable; @@ -1341,11 +1365,11 @@ e_table_config_init (ETableConfig *config) } ETableConfig * -e_table_config_construct (ETableConfig *config, - const gchar *header, - ETableSpecification *spec, - ETableState *state, - GtkWindow *parent_window) +e_table_config_construct (ETableConfig *config, + const gchar *header, + ETableSpecification *spec, + ETableState *state, + GtkWindow *parent_window) { ETableColumnSpecification **column; diff --git a/widgets/table/e-table-extras.c b/widgets/table/e-table-extras.c index b07651a22c..f3e55cf8cf 100644 --- a/widgets/table/e-table-extras.c +++ b/widgets/table/e-table-extras.c @@ -156,7 +156,9 @@ e_string_search (gconstpointer haystack, } static gint -e_table_str_case_compare (gconstpointer x, gconstpointer y, gpointer cmp_cache) +e_table_str_case_compare (gconstpointer x, + gconstpointer y, + gpointer cmp_cache) { const gchar *cx = NULL, *cy = NULL; @@ -190,7 +192,9 @@ e_table_str_case_compare (gconstpointer x, gconstpointer y, gpointer cmp_cache) } static gint -e_table_collate_compare (gconstpointer x, gconstpointer y, gpointer cmp_cache) +e_table_collate_compare (gconstpointer x, + gconstpointer y, + gpointer cmp_cache) { const gchar *cx = NULL, *cy = NULL; diff --git a/widgets/table/e-table-field-chooser-dialog.c b/widgets/table/e-table-field-chooser-dialog.c index b4ac8e53ef..354095b0c8 100644 --- a/widgets/table/e-table-field-chooser-dialog.c +++ b/widgets/table/e-table-field-chooser-dialog.c @@ -32,8 +32,8 @@ #include "e-table-field-chooser-dialog.h" -static void e_table_field_chooser_dialog_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); -static void e_table_field_chooser_dialog_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); +static void e_table_field_chooser_dialog_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); +static void e_table_field_chooser_dialog_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); static void e_table_field_chooser_dialog_dispose (GObject *object); static void e_table_field_chooser_dialog_response (GtkDialog *dialog, gint id); @@ -53,7 +53,7 @@ e_table_field_chooser_dialog_class_init (ETableFieldChooserDialogClass *class) GObjectClass *object_class; GtkDialogClass *dialog_class; - object_class = (GObjectClass*) class; + object_class = (GObjectClass *) class; dialog_class = GTK_DIALOG_CLASS (class); object_class->dispose = e_table_field_chooser_dialog_dispose; @@ -119,7 +119,7 @@ e_table_field_chooser_dialog_init (ETableFieldChooserDialog *e_table_field_choos gtk_window_set_title (GTK_WINDOW (dialog), _("Add a Column")); } -GtkWidget* +GtkWidget * e_table_field_chooser_dialog_new (void) { return g_object_new (E_TYPE_TABLE_FIELD_CHOOSER_DIALOG, NULL); @@ -146,10 +146,13 @@ e_table_field_chooser_dialog_dispose (GObject *object) } static void -e_table_field_chooser_dialog_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) +e_table_field_chooser_dialog_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) { ETableFieldChooserDialog *etfcd = E_TABLE_FIELD_CHOOSER_DIALOG (object); - switch (prop_id) { + switch (property_id) { case PROP_DND_CODE: g_free (etfcd->dnd_code); etfcd->dnd_code = g_strdup (g_value_get_string (value)); @@ -192,10 +195,13 @@ e_table_field_chooser_dialog_set_property (GObject *object, guint prop_id, const } static void -e_table_field_chooser_dialog_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) +e_table_field_chooser_dialog_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) { ETableFieldChooserDialog *etfcd = E_TABLE_FIELD_CHOOSER_DIALOG (object); - switch (prop_id) { + switch (property_id) { case PROP_DND_CODE: g_value_set_string (value, etfcd->dnd_code); break; @@ -206,13 +212,14 @@ e_table_field_chooser_dialog_get_property (GObject *object, guint prop_id, GValu g_value_set_object (value, etfcd->header); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void -e_table_field_chooser_dialog_response (GtkDialog *dialog, gint id) +e_table_field_chooser_dialog_response (GtkDialog *dialog, + gint id) { if (id == GTK_RESPONSE_OK) gtk_widget_destroy (GTK_WIDGET (dialog)); diff --git a/widgets/table/e-table-field-chooser-item.c b/widgets/table/e-table-field-chooser-item.c index e2dc6f1721..ecc414853c 100644 --- a/widgets/table/e-table-field-chooser-item.c +++ b/widgets/table/e-table-field-chooser-item.c @@ -89,7 +89,8 @@ etfci_dispose (GObject *object) } static gint -etfci_find_button (ETableFieldChooserItem *etfci, gdouble loc) +etfci_find_button (ETableFieldChooserItem *etfci, + gdouble loc) { gint i; gint count; @@ -148,7 +149,8 @@ etfci_rebuild_combined (ETableFieldChooserItem *etfci) } static void -etfci_reflow (GnomeCanvasItem *item, gint flags) +etfci_reflow (GnomeCanvasItem *item, + gint flags) { ETableFieldChooserItem *etfci = E_TABLE_FIELD_CHOOSER_ITEM (item); gdouble old_height; @@ -345,7 +347,7 @@ etfci_add_table_header (ETableFieldChooserItem *etfci, static void etfci_set_property (GObject *object, - guint prop_id, + guint property_id, const GValue *value, GParamSpec *pspec) { @@ -355,7 +357,7 @@ etfci_set_property (GObject *object, item = GNOME_CANVAS_ITEM (object); etfci = E_TABLE_FIELD_CHOOSER_ITEM (object); - switch (prop_id) { + switch (property_id) { case PROP_FULL_HEADER: etfci_drop_full_header (etfci); if (g_value_get_object (value)) @@ -385,13 +387,16 @@ etfci_set_property (GObject *object, } static void -etfci_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) +etfci_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) { ETableFieldChooserItem *etfci; etfci = E_TABLE_FIELD_CHOOSER_ITEM (object); - switch (prop_id) { + switch (property_id) { case PROP_DND_CODE: g_value_set_string (value, etfci->dnd_code); @@ -403,18 +408,18 @@ etfci_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *p g_value_set_double (value, etfci->height); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void -etfci_drag_data_get (GtkWidget *widget, - GdkDragContext *context, - GtkSelectionData *selection_data, - guint info, - guint time, - ETableFieldChooserItem *etfci) +etfci_drag_data_get (GtkWidget *widget, + GdkDragContext *context, + GtkSelectionData *selection_data, + guint info, + guint time, + ETableFieldChooserItem *etfci) { if (etfci->drag_col != -1) { gchar *string = g_strdup_printf("%d", etfci->drag_col); @@ -428,9 +433,9 @@ etfci_drag_data_get (GtkWidget *widget, } static void -etfci_drag_end (GtkWidget *canvas, - GdkDragContext *context, - ETableFieldChooserItem *etfci) +etfci_drag_end (GtkWidget *canvas, + GdkDragContext *context, + ETableFieldChooserItem *etfci) { etfci->drag_col = -1; } @@ -529,13 +534,19 @@ etfci_draw (GnomeCanvasItem *item, } static GnomeCanvasItem * -etfci_point (GnomeCanvasItem *item, gdouble x, gdouble y, gint cx, gint cy) +etfci_point (GnomeCanvasItem *item, + gdouble x, + gdouble y, + gint cx, + gint cy) { return item; } static gboolean -etfci_maybe_start_drag (ETableFieldChooserItem *etfci, gint x, gint y) +etfci_maybe_start_drag (ETableFieldChooserItem *etfci, + gint x, + gint y) { if (!etfci->maybe_drag) return FALSE; @@ -548,7 +559,10 @@ etfci_maybe_start_drag (ETableFieldChooserItem *etfci, gint x, gint y) } static void -etfci_start_drag (ETableFieldChooserItem *etfci, GdkEvent *event, gdouble x, gdouble y) +etfci_start_drag (ETableFieldChooserItem *etfci, + GdkEvent *event, + gdouble x, + gdouble y) { GtkWidget *widget = GTK_WIDGET (GNOME_CANVAS_ITEM (etfci)->canvas); GtkTargetList *list; @@ -622,7 +636,8 @@ etfci_start_drag (ETableFieldChooserItem *etfci, GdkEvent *event, gdouble x, gdo * Handles the events on the ETableFieldChooserItem */ static gint -etfci_event (GnomeCanvasItem *item, GdkEvent *e) +etfci_event (GnomeCanvasItem *item, + GdkEvent *e) { ETableFieldChooserItem *etfci = E_TABLE_FIELD_CHOOSER_ITEM (item); GnomeCanvas *canvas = item->canvas; diff --git a/widgets/table/e-table-field-chooser-item.h b/widgets/table/e-table-field-chooser-item.h index 066dd52ffb..f08b94ac6f 100644 --- a/widgets/table/e-table-field-chooser-item.h +++ b/widgets/table/e-table-field-chooser-item.h @@ -74,7 +74,7 @@ struct _ETableFieldChooserItem { /* * For dragging columns */ - guint maybe_drag:1; + guint maybe_drag : 1; gint click_x, click_y; gint drag_col; guint drag_data_get_id; diff --git a/widgets/table/e-table-field-chooser.c b/widgets/table/e-table-field-chooser.c index 2f945bb079..5e2cb13880 100644 --- a/widgets/table/e-table-field-chooser.c +++ b/widgets/table/e-table-field-chooser.c @@ -36,8 +36,8 @@ #include "e-table-field-chooser.h" #include "e-table-field-chooser-item.h" -static void e_table_field_chooser_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); -static void e_table_field_chooser_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); +static void e_table_field_chooser_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); +static void e_table_field_chooser_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); static void e_table_field_chooser_dispose (GObject *object); /* The arguments we take */ @@ -55,7 +55,7 @@ e_table_field_chooser_class_init (ETableFieldChooserClass *class) { GObjectClass *object_class; - object_class = (GObjectClass*) class; + object_class = (GObjectClass *) class; object_class->set_property = e_table_field_chooser_set_property; object_class->get_property = e_table_field_chooser_get_property; @@ -202,7 +202,7 @@ e_table_field_chooser_init (ETableFieldChooser *etfc) "dnd_code", etfc->dnd_code, NULL ); - g_signal_connect( etfc->canvas, "reflow", + g_signal_connect ( etfc->canvas, "reflow", G_CALLBACK ( resize ), etfc); @@ -238,18 +238,21 @@ e_table_field_chooser_dispose (GObject *object) G_OBJECT_CLASS (e_table_field_chooser_parent_class)->dispose (object); } -GtkWidget* +GtkWidget * e_table_field_chooser_new (void) { return g_object_new (E_TYPE_TABLE_FIELD_CHOOSER, NULL); } static void -e_table_field_chooser_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) +e_table_field_chooser_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) { ETableFieldChooser *etfc = E_TABLE_FIELD_CHOOSER (object); - switch (prop_id) { + switch (property_id) { case PROP_DND_CODE: g_free (etfc->dnd_code); etfc->dnd_code = g_strdup (g_value_get_string (value)); @@ -292,11 +295,14 @@ e_table_field_chooser_set_property (GObject *object, guint prop_id, const GValue } static void -e_table_field_chooser_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) +e_table_field_chooser_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) { ETableFieldChooser *etfc = E_TABLE_FIELD_CHOOSER (object); - switch (prop_id) { + switch (property_id) { case PROP_DND_CODE: g_value_set_string (value, etfc->dnd_code); break; @@ -307,7 +313,7 @@ e_table_field_chooser_get_property (GObject *object, guint prop_id, GValue *valu g_value_set_object (value, etfc->header); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } diff --git a/widgets/table/e-table-group-container.c b/widgets/table/e-table-group-container.c index 0a933769f9..d874834db1 100644 --- a/widgets/table/e-table-group-container.c +++ b/widgets/table/e-table-group-container.c @@ -68,8 +68,8 @@ static EPrintable * etgc_get_printable (ETableGroup *etg); static void -e_table_group_container_child_node_free (ETableGroupContainer *etgc, - ETableGroupContainerChildNode *child_node) +e_table_group_container_child_node_free (ETableGroupContainer *etgc, + ETableGroupContainerChildNode *child_node) { ETableGroup *etg = E_TABLE_GROUP (etgc); ETableGroup *child = child_node->child; @@ -141,10 +141,13 @@ etgc_dispose (GObject *object) * This routine constructs the new %ETableGroupContainer. */ void -e_table_group_container_construct (GnomeCanvasGroup *parent, ETableGroupContainer *etgc, - ETableHeader *full_header, - ETableHeader *header, - ETableModel *model, ETableSortInfo *sort_info, gint n) +e_table_group_container_construct (GnomeCanvasGroup *parent, + ETableGroupContainer *etgc, + ETableHeader *full_header, + ETableHeader *header, + ETableModel *model, + ETableSortInfo *sort_info, + gint n) { ETableCol *col; ETableSortColumn column = e_table_sort_info_grouping_get_nth (sort_info, n); @@ -186,9 +189,12 @@ e_table_group_container_construct (GnomeCanvasGroup *parent, ETableGroupContaine * Returns: The new %ETableGroupContainer. */ ETableGroup * -e_table_group_container_new (GnomeCanvasGroup *parent, ETableHeader *full_header, - ETableHeader *header, - ETableModel *model, ETableSortInfo *sort_info, gint n) +e_table_group_container_new (GnomeCanvasGroup *parent, + ETableHeader *full_header, + ETableHeader *header, + ETableModel *model, + ETableSortInfo *sort_info, + gint n) { ETableGroupContainer *etgc; @@ -202,7 +208,8 @@ e_table_group_container_new (GnomeCanvasGroup *parent, ETableHeader *full_header } static gint -etgc_event (GnomeCanvasItem *item, GdkEvent *event) +etgc_event (GnomeCanvasItem *item, + GdkEvent *event) { ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (item); gboolean return_val = TRUE; @@ -338,17 +345,18 @@ etgc_unrealize (GnomeCanvasItem *item) } static void -compute_text (ETableGroupContainer *etgc, ETableGroupContainerChildNode *child_node) +compute_text (ETableGroupContainer *etgc, + ETableGroupContainerChildNode *child_node) { gchar *text; if (etgc->ecol->text) { /* Translators: This text is used as a special row when an ETable - has turned on grouping on a column, which has set a title. - The first %s is replaced with a column title. - The second %s is replaced with an actual group value. - Finally the %d is replaced with count of items in this group. - Example: "Family name: Smith (13 items)" + * has turned on grouping on a column, which has set a title. + * The first %s is replaced with a column title. + * The second %s is replaced with an actual group value. + * Finally the %d is replaced with count of items in this group. + * Example: "Family name: Smith (13 items)" */ text = g_strdup_printf (ngettext("%s: %s (%d item)", "%s: %s (%d items)", @@ -357,10 +365,10 @@ compute_text (ETableGroupContainer *etgc, ETableGroupContainerChildNode *child_n (gint) child_node->count); } else { /* Translators: This text is used as a special row when an ETable - has turned on grouping on a column, which doesn't have set a title. - The %s is replaced with an actual group value. - The %d is replaced with count of items in this group. - Example: "Smith (13 items)" + * has turned on grouping on a column, which doesn't have set a title. + * The %s is replaced with an actual group value. + * The %d is replaced with count of items in this group. + * Example: "Smith (13 items)" */ text = g_strdup_printf (ngettext("%s (%d item)", "%s (%d items)", @@ -375,56 +383,74 @@ compute_text (ETableGroupContainer *etgc, ETableGroupContainerChildNode *child_n } static void -child_cursor_change (ETableGroup *etg, gint row, - ETableGroupContainer *etgc) +child_cursor_change (ETableGroup *etg, + gint row, + ETableGroupContainer *etgc) { e_table_group_cursor_change (E_TABLE_GROUP (etgc), row); } static void -child_cursor_activated (ETableGroup *etg, gint row, - ETableGroupContainer *etgc) +child_cursor_activated (ETableGroup *etg, + gint row, + ETableGroupContainer *etgc) { e_table_group_cursor_activated (E_TABLE_GROUP (etgc), row); } static void -child_double_click (ETableGroup *etg, gint row, gint col, GdkEvent *event, - ETableGroupContainer *etgc) +child_double_click (ETableGroup *etg, + gint row, + gint col, + GdkEvent *event, + ETableGroupContainer *etgc) { e_table_group_double_click (E_TABLE_GROUP (etgc), row, col, event); } static gboolean -child_right_click (ETableGroup *etg, gint row, gint col, GdkEvent *event, - ETableGroupContainer *etgc) +child_right_click (ETableGroup *etg, + gint row, + gint col, + GdkEvent *event, + ETableGroupContainer *etgc) { return e_table_group_right_click (E_TABLE_GROUP (etgc), row, col, event); } static gboolean -child_click (ETableGroup *etg, gint row, gint col, GdkEvent *event, - ETableGroupContainer *etgc) +child_click (ETableGroup *etg, + gint row, + gint col, + GdkEvent *event, + ETableGroupContainer *etgc) { return e_table_group_click (E_TABLE_GROUP (etgc), row, col, event); } static gboolean -child_key_press (ETableGroup *etg, gint row, gint col, GdkEvent *event, - ETableGroupContainer *etgc) +child_key_press (ETableGroup *etg, + gint row, + gint col, + GdkEvent *event, + ETableGroupContainer *etgc) { return e_table_group_key_press (E_TABLE_GROUP (etgc), row, col, event); } static gboolean -child_start_drag (ETableGroup *etg, gint row, gint col, GdkEvent *event, - ETableGroupContainer *etgc) +child_start_drag (ETableGroup *etg, + gint row, + gint col, + GdkEvent *event, + ETableGroupContainer *etgc) { return e_table_group_start_drag (E_TABLE_GROUP (etgc), row, col, event); } static ETableGroupContainerChildNode * -create_child_node (ETableGroupContainer *etgc, gpointer val) +create_child_node (ETableGroupContainer *etgc, + gpointer val) { ETableGroup *child; ETableGroupContainerChildNode *child_node; @@ -478,7 +504,8 @@ create_child_node (ETableGroupContainer *etgc, gpointer val) } static void -etgc_add (ETableGroup *etg, gint row) +etgc_add (ETableGroup *etg, + gint row) { ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (etg); gpointer val = e_table_model_value_at (etg->model, etgc->ecol->col_idx, row); @@ -522,7 +549,9 @@ etgc_add (ETableGroup *etg, gint row) } static void -etgc_add_array (ETableGroup *etg, const gint *array, gint count) +etgc_add_array (ETableGroup *etg, + const gint *array, + gint count) { gint i; ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (etg); @@ -589,7 +618,8 @@ etgc_add_all (ETableGroup *etg) } static gboolean -etgc_remove (ETableGroup *etg, gint row) +etgc_remove (ETableGroup *etg, + gint row) { ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (etg); GList *list; @@ -630,7 +660,9 @@ etgc_row_count (ETableGroup *etg) } static void -etgc_increment (ETableGroup *etg, gint position, gint amount) +etgc_increment (ETableGroup *etg, + gint position, + gint amount) { ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (etg); GList *list; @@ -641,7 +673,9 @@ etgc_increment (ETableGroup *etg, gint position, gint amount) } static void -etgc_decrement (ETableGroup *etg, gint position, gint amount) +etgc_decrement (ETableGroup *etg, + gint position, + gint amount) { ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (etg); GList *list; @@ -652,7 +686,9 @@ etgc_decrement (ETableGroup *etg, gint position, gint amount) } static void -etgc_set_focus (ETableGroup *etg, EFocus direction, gint view_col) +etgc_set_focus (ETableGroup *etg, + EFocus direction, + gint view_col) { ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (etg); if (etgc->children) { @@ -683,7 +719,11 @@ etgc_get_focus_column (ETableGroup *etg) } static void -etgc_compute_location (ETableGroup *etg, gint *x, gint *y, gint *row, gint *col) +etgc_compute_location (ETableGroup *etg, + gint *x, + gint *y, + gint *row, + gint *col) { ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (etg); @@ -709,7 +749,9 @@ etgc_compute_location (ETableGroup *etg, gint *x, gint *y, gint *row, gint *col) } static void -etgc_get_mouse_over (ETableGroup *etg, gint *row, gint *col) +etgc_get_mouse_over (ETableGroup *etg, + gint *row, + gint *col) { ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (etg); @@ -740,7 +782,13 @@ etgc_get_mouse_over (ETableGroup *etg, gint *row, gint *col) } static void -etgc_get_cell_geometry (ETableGroup *etg, gint *row, gint *col, gint *x, gint *y, gint *width, gint *height) +etgc_get_cell_geometry (ETableGroup *etg, + gint *row, + gint *col, + gint *x, + gint *y, + gint *width, + gint *height) { ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (etg); @@ -773,13 +821,16 @@ static void etgc_thaw (ETableGroup *etg) } static void -etgc_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) +etgc_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) { ETableGroup *etg = E_TABLE_GROUP (object); ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (object); GList *list; - switch (prop_id) { + switch (property_id) { case PROP_FROZEN: if (g_value_get_boolean (value)) etg->frozen = TRUE; @@ -887,12 +938,15 @@ etgc_set_property (GObject *object, guint prop_id, const GValue *value, GParamSp } static void -etgc_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) +etgc_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) { ETableGroup *etg = E_TABLE_GROUP (object); ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (object); - switch (prop_id) { + switch (property_id) { case PROP_FROZEN: g_value_set_boolean (value, etg->frozen); break; @@ -909,7 +963,7 @@ etgc_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *ps g_value_set_boolean (value, etgc->uniform_row_height); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } @@ -1029,7 +1083,8 @@ etgc_class_init (ETableGroupContainerClass *class) } static void -etgc_reflow (GnomeCanvasItem *item, gint flags) +etgc_reflow (GnomeCanvasItem *item, + gint flags) { ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (item); gboolean frozen; @@ -1136,7 +1191,9 @@ etgc_init (ETableGroupContainer *container) } void -e_table_group_apply_to_leafs (ETableGroup *etg, ETableGroupLeafFn fn, gpointer closure) +e_table_group_apply_to_leafs (ETableGroup *etg, + ETableGroupLeafFn fn, + gpointer closure) { if (E_IS_TABLE_GROUP_CONTAINER (etg)) { ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (etg); @@ -1170,7 +1227,11 @@ typedef struct { #if 0 static gint -gp_draw_rect (GtkPrintContext *context, gdouble x, gdouble y, gdouble width, gdouble height) +gp_draw_rect (GtkPrintContext *context, + gdouble x, + gdouble y, + gdouble width, + gdouble height) { cairo_t *cr; cr = gtk_print_context_get_cairo_context (context); @@ -1184,12 +1245,12 @@ gp_draw_rect (GtkPrintContext *context, gdouble x, gdouble y, gdouble width, gdo #define TEXT_AREA_HEIGHT (TEXT_HEIGHT + 4) static void -e_table_group_container_print_page (EPrintable *ep, - GtkPrintContext *context, - gdouble width, - gdouble height, - gboolean quantize, - ETGCPrintContext *groupcontext) +e_table_group_container_print_page (EPrintable *ep, + GtkPrintContext *context, + gdouble width, + gdouble height, + gboolean quantize, + ETGCPrintContext *groupcontext) { cairo_t *cr; GtkPageSetup *setup; @@ -1283,7 +1344,7 @@ e_table_group_container_print_page (EPrintable *ep, cairo_rectangle (cr, 0, child_margin, width - 2 * TEXT_AREA_HEIGHT, child_height + child_margin + 20); cairo_clip (cr); - e_printable_print_page (child_printable, context, width-2 * TEXT_AREA_HEIGHT, child_margin, quantize); + e_printable_print_page (child_printable, context, width - 2 * TEXT_AREA_HEIGHT, child_margin, quantize); yd -= child_height + TEXT_AREA_HEIGHT; if (e_printable_data_left (child_printable)) { @@ -1319,16 +1380,16 @@ e_table_group_container_print_page (EPrintable *ep, } static gboolean -e_table_group_container_data_left (EPrintable *ep, - ETGCPrintContext *groupcontext) +e_table_group_container_data_left (EPrintable *ep, + ETGCPrintContext *groupcontext) { g_signal_stop_emission_by_name(ep, "data_left"); return groupcontext->child != NULL; } static void -e_table_group_container_reset (EPrintable *ep, - ETGCPrintContext *groupcontext) +e_table_group_container_reset (EPrintable *ep, + ETGCPrintContext *groupcontext) { groupcontext->child = groupcontext->etgc->children; if (groupcontext->child_printable) @@ -1337,12 +1398,12 @@ e_table_group_container_reset (EPrintable *ep, } static gdouble -e_table_group_container_height (EPrintable *ep, - GtkPrintContext *context, - gdouble width, - gdouble max_height, - gboolean quantize, - ETGCPrintContext *groupcontext) +e_table_group_container_height (EPrintable *ep, + GtkPrintContext *context, + gdouble width, + gdouble max_height, + gboolean quantize, + ETGCPrintContext *groupcontext) { gdouble height = 0; gdouble child_height; @@ -1405,12 +1466,12 @@ e_table_group_container_height (EPrintable *ep, } static gboolean -e_table_group_container_will_fit (EPrintable *ep, - GtkPrintContext *context, - gdouble width, - gdouble max_height, - gboolean quantize, - ETGCPrintContext *groupcontext) +e_table_group_container_will_fit (EPrintable *ep, + GtkPrintContext *context, + gdouble width, + gdouble max_height, + gboolean quantize, + ETGCPrintContext *groupcontext) { gboolean will_fit = TRUE; gdouble child_height; @@ -1476,7 +1537,7 @@ e_table_group_container_will_fit (EPrintable *ep, static void e_table_group_container_printable_destroy (gpointer data, - GObject *where_object_was) + GObject *where_object_was) { ETGCPrintContext *groupcontext = data; diff --git a/widgets/table/e-table-group-container.h b/widgets/table/e-table-group-container.h index 5ea0910ef0..ac5f7c9033 100644 --- a/widgets/table/e-table-group-container.h +++ b/widgets/table/e-table-group-container.h @@ -95,7 +95,7 @@ struct _ETableGroupContainer { /* * State: the ETableGroup is open or closed */ - guint open:1; + guint open : 1; }; struct _ETableGroupContainerClass { diff --git a/widgets/table/e-table-group-leaf.c b/widgets/table/e-table-group-leaf.c index bf4f1553aa..27a62bbb16 100644 --- a/widgets/table/e-table-group-leaf.c +++ b/widgets/table/e-table-group-leaf.c @@ -114,11 +114,11 @@ etgl_dispose (GObject *object) static void e_table_group_leaf_construct (GnomeCanvasGroup *parent, - ETableGroupLeaf *etgl, - ETableHeader *full_header, - ETableHeader *header, - ETableModel *model, - ETableSortInfo *sort_info) + ETableGroupLeaf *etgl, + ETableHeader *full_header, + ETableHeader *header, + ETableModel *model, + ETableSortInfo *sort_info) { etgl->is_grouped = (e_table_sort_info_grouping_get_count (sort_info) > 0); @@ -262,7 +262,8 @@ etgl_click (GObject *object, } static void -etgl_reflow (GnomeCanvasItem *item, gint flags) +etgl_reflow (GnomeCanvasItem *item, + gint flags) { ETableGroupLeaf *leaf = E_TABLE_GROUP_LEAF (item); @@ -330,7 +331,8 @@ etgl_realize (GnomeCanvasItem *item) } static void -etgl_add (ETableGroup *etg, gint row) +etgl_add (ETableGroup *etg, + gint row) { ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF (etg); @@ -341,7 +343,9 @@ etgl_add (ETableGroup *etg, gint row) } static void -etgl_add_array (ETableGroup *etg, const gint *array, gint count) +etgl_add_array (ETableGroup *etg, + const gint *array, + gint count) { ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF (etg); @@ -363,7 +367,8 @@ etgl_add_all (ETableGroup *etg) } static gboolean -etgl_remove (ETableGroup *etg, gint row) +etgl_remove (ETableGroup *etg, + gint row) { ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF (etg); @@ -375,7 +380,9 @@ etgl_remove (ETableGroup *etg, gint row) } static void -etgl_increment (ETableGroup *etg, gint position, gint amount) +etgl_increment (ETableGroup *etg, + gint position, + gint amount) { ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF (etg); @@ -387,7 +394,9 @@ etgl_increment (ETableGroup *etg, gint position, gint amount) } static void -etgl_decrement (ETableGroup *etg, gint position, gint amount) +etgl_decrement (ETableGroup *etg, + gint position, + gint amount) { ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF (etg); @@ -407,7 +416,9 @@ etgl_row_count (ETableGroup *etg) } static void -etgl_set_focus (ETableGroup *etg, EFocus direction, gint view_col) +etgl_set_focus (ETableGroup *etg, + EFocus direction, + gint view_col) { ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF (etg); @@ -437,7 +448,11 @@ etgl_get_printable (ETableGroup *etg) } static void -etgl_compute_location (ETableGroup *etg, gint *x, gint *y, gint *row, gint *col) +etgl_compute_location (ETableGroup *etg, + gint *x, + gint *y, + gint *row, + gint *col) { ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF (etg); @@ -445,7 +460,9 @@ etgl_compute_location (ETableGroup *etg, gint *x, gint *y, gint *row, gint *col) } static void -etgl_get_mouse_over (ETableGroup *etg, gint *row, gint *col) +etgl_get_mouse_over (ETableGroup *etg, + gint *row, + gint *col) { ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF (etg); @@ -473,14 +490,14 @@ etgl_get_cell_geometry (ETableGroup *etg, static void etgl_set_property (GObject *object, - guint prop_id, + guint property_id, const GValue *value, GParamSpec *pspec) { ETableGroup *etg = E_TABLE_GROUP (object); ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF (object); - switch (prop_id) { + switch (property_id) { case PROP_FROZEN: etg->frozen = g_value_get_boolean (value); break; @@ -574,12 +591,15 @@ etgl_set_property (GObject *object, } static void -etgl_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) +etgl_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) { ETableGroup *etg = E_TABLE_GROUP (object); ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF (object); - switch (prop_id) { + switch (property_id) { case PROP_FROZEN: g_value_set_boolean (value, etg->frozen); break; @@ -595,7 +615,7 @@ etgl_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *ps case PROP_UNIFORM_ROW_HEIGHT: g_value_set_boolean (value, etgl->uniform_row_height); default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } diff --git a/widgets/table/e-table-group.c b/widgets/table/e-table-group.c index 8fd56bc7b1..8d820f861a 100644 --- a/widgets/table/e-table-group.c +++ b/widgets/table/e-table-group.c @@ -99,11 +99,11 @@ etg_dispose (GObject *object) */ ETableGroup * e_table_group_new (GnomeCanvasGroup *parent, - ETableHeader *full_header, - ETableHeader *header, - ETableModel *model, - ETableSortInfo *sort_info, - gint n) + ETableHeader *full_header, + ETableHeader *header, + ETableModel *model, + ETableSortInfo *sort_info, + gint n) { g_return_val_if_fail (model != NULL, NULL); @@ -128,10 +128,10 @@ e_table_group_new (GnomeCanvasGroup *parent, */ void e_table_group_construct (GnomeCanvasGroup *parent, - ETableGroup *etg, - ETableHeader *full_header, - ETableHeader *header, - ETableModel *model) + ETableGroup *etg, + ETableHeader *full_header, + ETableHeader *header, + ETableModel *model) { etg->full_header = full_header; g_object_ref (etg->full_header); @@ -139,9 +139,7 @@ e_table_group_construct (GnomeCanvasGroup *parent, g_object_ref (etg->header); etg->model = model; g_object_ref (etg->model); - g_object_set (G_OBJECT (etg), - "parent", parent, - NULL); + g_object_set (etg, "parent", parent, NULL); } /** @@ -154,7 +152,7 @@ e_table_group_construct (GnomeCanvasGroup *parent, */ void e_table_group_add (ETableGroup *etg, - gint row) + gint row) { g_return_if_fail (etg != NULL); g_return_if_fail (E_IS_TABLE_GROUP (etg)); @@ -174,8 +172,8 @@ e_table_group_add (ETableGroup *etg, */ void e_table_group_add_array (ETableGroup *etg, - const gint *array, - gint count) + const gint *array, + gint count) { g_return_if_fail (etg != NULL); g_return_if_fail (E_IS_TABLE_GROUP (etg)); @@ -214,7 +212,7 @@ e_table_group_add_all (ETableGroup *etg) */ gboolean e_table_group_remove (ETableGroup *etg, - gint row) + gint row) { g_return_val_if_fail (etg != NULL, FALSE); g_return_val_if_fail (E_IS_TABLE_GROUP (etg), FALSE); @@ -235,8 +233,8 @@ e_table_group_remove (ETableGroup *etg, */ void e_table_group_increment (ETableGroup *etg, - gint position, - gint amount) + gint position, + gint amount) { g_return_if_fail (etg != NULL); g_return_if_fail (E_IS_TABLE_GROUP (etg)); @@ -257,8 +255,8 @@ e_table_group_increment (ETableGroup *etg, */ void e_table_group_decrement (ETableGroup *etg, - gint position, - gint amount) + gint position, + gint amount) { g_return_if_fail (etg != NULL); g_return_if_fail (E_IS_TABLE_GROUP (etg)); @@ -296,8 +294,8 @@ e_table_group_row_count (ETableGroup *etg) */ void e_table_group_set_focus (ETableGroup *etg, - EFocus direction, - gint view_col) + EFocus direction, + gint view_col) { g_return_if_fail (etg != NULL); g_return_if_fail (E_IS_TABLE_GROUP (etg)); @@ -390,7 +388,9 @@ e_table_group_compute_location (ETableGroup *etg, } void -e_table_group_get_mouse_over (ETableGroup *etg, gint *row, gint *col) +e_table_group_get_mouse_over (ETableGroup *etg, + gint *row, + gint *col) { g_return_if_fail (etg != NULL); g_return_if_fail (E_IS_TABLE_GROUP (etg)); @@ -414,13 +414,13 @@ e_table_group_get_mouse_over (ETableGroup *etg, gint *row, gint *col) * removed from the value row points to. */ void -e_table_group_get_cell_geometry (ETableGroup *etg, - gint *row, - gint *col, - gint *x, - gint *y, - gint *width, - gint *height) +e_table_group_get_cell_geometry (ETableGroup *etg, + gint *row, + gint *col, + gint *x, + gint *y, + gint *width, + gint *height) { g_return_if_fail (etg != NULL); g_return_if_fail (E_IS_TABLE_GROUP (etg)); @@ -437,7 +437,8 @@ e_table_group_get_cell_geometry (ETableGroup *etg, * This routine emits the "cursor_change" signal. */ void -e_table_group_cursor_change (ETableGroup *e_table_group, gint row) +e_table_group_cursor_change (ETableGroup *e_table_group, + gint row) { g_return_if_fail (e_table_group != NULL); g_return_if_fail (E_IS_TABLE_GROUP (e_table_group)); @@ -455,7 +456,8 @@ e_table_group_cursor_change (ETableGroup *e_table_group, gint row) * This routine emits the "cursor_activated" signal. */ void -e_table_group_cursor_activated (ETableGroup *e_table_group, gint row) +e_table_group_cursor_activated (ETableGroup *e_table_group, + gint row) { g_return_if_fail (e_table_group != NULL); g_return_if_fail (E_IS_TABLE_GROUP (e_table_group)); @@ -614,7 +616,8 @@ e_table_group_get_header (ETableGroup *etg) } static gint -etg_event (GnomeCanvasItem *item, GdkEvent *event) +etg_event (GnomeCanvasItem *item, + GdkEvent *event) { ETableGroup *etg = E_TABLE_GROUP (item); gboolean return_val = TRUE; @@ -638,7 +641,7 @@ etg_event (GnomeCanvasItem *item, GdkEvent *event) } static gboolean -etg_get_focus (ETableGroup *etg) +etg_get_focus (ETableGroup *etg) { return etg->has_focus; } diff --git a/widgets/table/e-table-header-item.c b/widgets/table/e-table-header-item.c index 16633f967c..11d8f31f81 100644 --- a/widgets/table/e-table-header-item.c +++ b/widgets/table/e-table-header-item.c @@ -101,7 +101,8 @@ static void scroll_off (ETableHeaderItem *ethi); static void scroll_on (ETableHeaderItem *ethi, guint scroll_direction); static void -ethi_dispose (GObject *object) { +ethi_dispose (GObject *object) +{ ETableHeaderItem *ethi = E_TABLE_HEADER_ITEM (object); ethi_drop_table_header (ethi); @@ -223,7 +224,8 @@ ethi_update (GnomeCanvasItem *item, } static void -ethi_font_set (ETableHeaderItem *ethi, PangoFontDescription *font_desc) +ethi_font_set (ETableHeaderItem *ethi, + PangoFontDescription *font_desc) { if (ethi->font_desc) pango_font_description_free (ethi->font_desc); @@ -252,19 +254,23 @@ ethi_drop_table_header (ETableHeaderItem *ethi) } static void -structure_changed (ETableHeader *header, ETableHeaderItem *ethi) +structure_changed (ETableHeader *header, + ETableHeaderItem *ethi) { gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (ethi)); } static void -dimension_changed (ETableHeader *header, gint col, ETableHeaderItem *ethi) +dimension_changed (ETableHeader *header, + gint col, + ETableHeaderItem *ethi) { gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (ethi)); } static void -ethi_add_table_header (ETableHeaderItem *ethi, ETableHeader *header) +ethi_add_table_header (ETableHeaderItem *ethi, + ETableHeader *header) { ethi->eth = header; g_object_ref (ethi->eth); @@ -282,16 +288,17 @@ ethi_add_table_header (ETableHeaderItem *ethi, ETableHeader *header) } static void -ethi_sort_info_changed (ETableSortInfo *sort_info, ETableHeaderItem *ethi) +ethi_sort_info_changed (ETableSortInfo *sort_info, + ETableHeaderItem *ethi) { gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (ethi)); } static void ethi_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec) + guint property_id, + const GValue *value, + GParamSpec *pspec) { GnomeCanvasItem *item; ETableHeaderItem *ethi; @@ -299,7 +306,7 @@ ethi_set_property (GObject *object, item = GNOME_CANVAS_ITEM (object); ethi = E_TABLE_HEADER_ITEM (object); - switch (prop_id) { + switch (property_id) { case PROP_TABLE_HEADER: ethi_drop_table_header (ethi); ethi_add_table_header (ethi, E_TABLE_HEADER (g_value_get_object (value))); @@ -364,15 +371,15 @@ ethi_set_property (GObject *object, static void ethi_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) + guint property_id, + GValue *value, + GParamSpec *pspec) { ETableHeaderItem *ethi; ethi = E_TABLE_HEADER_ITEM (object); - switch (prop_id) { + switch (property_id) { case PROP_FULL_HEADER: g_value_set_object (value, ethi->full_header); break; @@ -380,13 +387,14 @@ ethi_get_property (GObject *object, g_value_set_string (value, ethi->dnd_code); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static gint -ethi_find_col_by_x (ETableHeaderItem *ethi, gint x) +ethi_find_col_by_x (ETableHeaderItem *ethi, + gint x) { const gint cols = e_table_header_count (ethi->eth); gint x1 = 0; @@ -416,7 +424,8 @@ ethi_find_col_by_x (ETableHeaderItem *ethi, gint x) } static gint -ethi_find_col_by_x_nearest (ETableHeaderItem *ethi, gint x) +ethi_find_col_by_x_nearest (ETableHeaderItem *ethi, + gint x) { const gint cols = e_table_header_count (ethi->eth); gint x1 = 0; @@ -473,7 +482,9 @@ make_shaped_window_from_xpm (const gchar **xpm) } static void -ethi_add_drop_marker (ETableHeaderItem *ethi, gint col, gboolean recreate) +ethi_add_drop_marker (ETableHeaderItem *ethi, + gint col, + gboolean recreate) { GnomeCanvas *canvas; GtkAdjustment *adjustment; @@ -536,7 +547,7 @@ ethi_add_destroy_marker (ETableHeaderItem *ethi) "x1", x1 + 1, "y1", (gdouble) 1, "x2", (gdouble) x1 + e_table_header_col_diff ( - ethi->eth, ethi->drag_col, ethi->drag_col+1) - 2, + ethi->eth, ethi->drag_col, ethi->drag_col + 1) - 2, "y2", (gdouble) ethi->height - 2, "fill_color_rgba", 0xFF000080, @@ -555,7 +566,9 @@ ethi_remove_destroy_marker (ETableHeaderItem *ethi) #if 0 static gboolean -moved (ETableHeaderItem *ethi, guint col, guint model_col) +moved (ETableHeaderItem *ethi, + guint col, + guint model_col) { if (col == -1) return TRUE; @@ -667,7 +680,8 @@ scroll_timeout (gpointer data) } static void -scroll_on (ETableHeaderItem *ethi, guint scroll_direction) +scroll_on (ETableHeaderItem *ethi, + guint scroll_direction) { if (ethi->scroll_idle_id == 0 || scroll_direction != ethi->scroll_direction) { if (ethi->scroll_idle_id != 0) @@ -786,13 +800,13 @@ ethi_drag_end (GtkWidget *canvas, static void ethi_drag_data_received (GtkWidget *canvas, - GdkDragContext *drag_context, - gint x, - gint y, - GtkSelectionData *selection_data, - guint info, - guint time, - ETableHeaderItem *ethi) + GdkDragContext *drag_context, + gint x, + gint y, + GtkSelectionData *selection_data, + guint info, + guint time, + ETableHeaderItem *ethi) { const guchar *data; gint found = FALSE; @@ -836,11 +850,11 @@ ethi_drag_data_received (GtkWidget *canvas, static void ethi_drag_data_get (GtkWidget *canvas, - GdkDragContext *context, - GtkSelectionData *selection_data, - guint info, - guint time, - ETableHeaderItem *ethi) + GdkDragContext *context, + GtkSelectionData *selection_data, + guint info, + guint time, + ETableHeaderItem *ethi) { if (ethi->drag_col != -1) { ETableCol *ecol = e_table_header_get_column (ethi->eth, ethi->drag_col); @@ -857,11 +871,11 @@ ethi_drag_data_get (GtkWidget *canvas, static gboolean ethi_drag_drop (GtkWidget *canvas, - GdkDragContext *context, - gint x, - gint y, - guint time, - ETableHeaderItem *ethi) + GdkDragContext *context, + gint x, + gint y, + guint time, + ETableHeaderItem *ethi) { gboolean successful = FALSE; @@ -1059,7 +1073,11 @@ ethi_draw (GnomeCanvasItem *item, } static GnomeCanvasItem * -ethi_point (GnomeCanvasItem *item, gdouble x, gdouble y, gint cx, gint cy) +ethi_point (GnomeCanvasItem *item, + gdouble x, + gdouble y, + gint cx, + gint cy) { return item; } @@ -1089,7 +1107,7 @@ is_pointer_on_division (ETableHeaderItem *ethi, total += ecol->width; - if ((total - TOLERANCE < pos)&& (pos < total + TOLERANCE)) { + if ((total - TOLERANCE < pos) && (pos < total + TOLERANCE)) { if (return_col) *return_col = col; if (the_total) @@ -1110,7 +1128,8 @@ is_pointer_on_division (ETableHeaderItem *ethi, #define convert(c,sx,sy,x,y) gnome_canvas_w2c (c,sx,sy,x,y) static void -set_cursor (ETableHeaderItem *ethi, gint pos) +set_cursor (ETableHeaderItem *ethi, + gint pos) { GnomeCanvas *canvas; GdkWindow *window; @@ -1133,7 +1152,7 @@ set_cursor (ETableHeaderItem *ethi, gint pos) gint c = col + 1; /* Column is not resizable if all columns after it - are also not resizable */ + * are also not resizable */ for (; c <= last_col; c++) { ETableCol *ecol2; @@ -1162,7 +1181,8 @@ ethi_end_resize (ETableHeaderItem *ethi) } static gboolean -ethi_maybe_start_drag (ETableHeaderItem *ethi, GdkEventMotion *event) +ethi_maybe_start_drag (ETableHeaderItem *ethi, + GdkEventMotion *event) { if (!ethi->maybe_drag) return FALSE; @@ -1180,7 +1200,8 @@ ethi_maybe_start_drag (ETableHeaderItem *ethi, GdkEventMotion *event) } static void -ethi_start_drag (ETableHeaderItem *ethi, GdkEvent *event) +ethi_start_drag (ETableHeaderItem *ethi, + GdkEvent *event) { GtkWidget *widget = GTK_WIDGET (GNOME_CANVAS_ITEM (ethi)->canvas); GtkTargetList *list; @@ -1281,7 +1302,8 @@ typedef struct { } EthiHeaderInfo; static void -ethi_popup_sort_ascending (GtkWidget *widget, EthiHeaderInfo *info) +ethi_popup_sort_ascending (GtkWidget *widget, + EthiHeaderInfo *info) { ETableCol *col; gint model_col = -1; @@ -1336,7 +1358,8 @@ ethi_popup_sort_ascending (GtkWidget *widget, EthiHeaderInfo *info) } static void -ethi_popup_sort_descending (GtkWidget *widget, EthiHeaderInfo *info) +ethi_popup_sort_descending (GtkWidget *widget, + EthiHeaderInfo *info) { ETableCol *col; gint model_col=-1; @@ -1391,7 +1414,8 @@ ethi_popup_sort_descending (GtkWidget *widget, EthiHeaderInfo *info) } static void -ethi_popup_unsort (GtkWidget *widget, EthiHeaderInfo *info) +ethi_popup_unsort (GtkWidget *widget, + EthiHeaderInfo *info) { ETableHeaderItem *ethi = info->ethi; @@ -1400,7 +1424,8 @@ ethi_popup_unsort (GtkWidget *widget, EthiHeaderInfo *info) } static void -ethi_popup_group_field (GtkWidget *widget, EthiHeaderInfo *info) +ethi_popup_group_field (GtkWidget *widget, + EthiHeaderInfo *info) { ETableCol *col; gint model_col; @@ -1417,18 +1442,21 @@ ethi_popup_group_field (GtkWidget *widget, EthiHeaderInfo *info) } static void -ethi_popup_group_box (GtkWidget *widget, EthiHeaderInfo *info) +ethi_popup_group_box (GtkWidget *widget, + EthiHeaderInfo *info) { } static void -ethi_popup_remove_column (GtkWidget *widget, EthiHeaderInfo *info) +ethi_popup_remove_column (GtkWidget *widget, + EthiHeaderInfo *info) { e_table_header_remove (info->ethi->eth, info->col); } static void -ethi_popup_field_chooser (GtkWidget *widget, EthiHeaderInfo *info) +ethi_popup_field_chooser (GtkWidget *widget, + EthiHeaderInfo *info) { GtkWidget *etfcd = info->ethi->etfcd.widget; @@ -1453,12 +1481,14 @@ ethi_popup_field_chooser (GtkWidget *widget, EthiHeaderInfo *info) } static void -ethi_popup_alignment (GtkWidget *widget, EthiHeaderInfo *info) +ethi_popup_alignment (GtkWidget *widget, + EthiHeaderInfo *info) { } static void -ethi_popup_best_fit (GtkWidget *widget, EthiHeaderInfo *info) +ethi_popup_best_fit (GtkWidget *widget, + EthiHeaderInfo *info) { ETableHeaderItem *ethi = info->ethi; gint width; @@ -1474,19 +1504,22 @@ ethi_popup_best_fit (GtkWidget *widget, EthiHeaderInfo *info) } static void -ethi_popup_format_columns (GtkWidget *widget, EthiHeaderInfo *info) +ethi_popup_format_columns (GtkWidget *widget, + EthiHeaderInfo *info) { } static void -config_destroyed (gpointer data, GObject *where_object_was) +config_destroyed (gpointer data, + GObject *where_object_was) { ETableHeaderItem *ethi = data; ethi->config = NULL; } static void -apply_changes (ETableConfig *config, ETableHeaderItem *ethi) +apply_changes (ETableConfig *config, + ETableHeaderItem *ethi) { gchar *state = e_table_state_save_to_string (config->state); @@ -1501,7 +1534,8 @@ apply_changes (ETableConfig *config, ETableHeaderItem *ethi) } static void -ethi_popup_customize_view (GtkWidget *widget, EthiHeaderInfo *info) +ethi_popup_customize_view (GtkWidget *widget, + EthiHeaderInfo *info) { ETableHeaderItem *ethi = info->ethi; ETableState *state; @@ -1531,7 +1565,8 @@ ethi_popup_customize_view (GtkWidget *widget, EthiHeaderInfo *info) } static void -free_popup_info (GtkWidget *w, EthiHeaderInfo *info) +free_popup_info (GtkWidget *w, + EthiHeaderInfo *info) { g_free (info); } @@ -1580,7 +1615,8 @@ static EPopupMenu ethi_context_menu[] = { }; static void -sort_by_id (GtkWidget *menu_item, ETableHeaderItem *ethi) +sort_by_id (GtkWidget *menu_item, + ETableHeaderItem *ethi) { ETableCol *ecol; gboolean clearfirst; @@ -1606,13 +1642,15 @@ sort_by_id (GtkWidget *menu_item, ETableHeaderItem *ethi) } static void -popup_custom (GtkWidget *menu_item, EthiHeaderInfo *info) +popup_custom (GtkWidget *menu_item, + EthiHeaderInfo *info) { ethi_popup_customize_view (menu_item, info); } static void -ethi_header_context_menu (ETableHeaderItem *ethi, GdkEventButton *event) +ethi_header_context_menu (ETableHeaderItem *ethi, + GdkEventButton *event) { EthiHeaderInfo *info = g_new (EthiHeaderInfo, 1); GtkMenu *popup; @@ -1664,9 +1702,9 @@ ethi_header_context_menu (ETableHeaderItem *ethi, GdkEventButton *event) gtk_widget_show (menu_item); gtk_menu_shell_prepend (GTK_MENU_SHELL (sub_menu), menu_item); /* Headers */ - for (ncol = 0; ncolfull_header->col_count; ncol++) + for (ncol = 0; ncol < ethi->full_header->col_count; ncol++) { - gchar *text=NULL; + gchar *text = NULL; if (!ethi->full_header->columns[ncol]->sortable || ethi->full_header->columns[ncol]->disabled) @@ -1704,14 +1742,15 @@ ethi_header_context_menu (ETableHeaderItem *ethi, GdkEventButton *event) } static void -ethi_button_pressed (ETableHeaderItem *ethi, GdkEventButton *event) +ethi_button_pressed (ETableHeaderItem *ethi, + GdkEventButton *event) { - g_signal_emit (ethi, - ethi_signals[BUTTON_PRESSED], 0, event); + g_signal_emit (ethi, ethi_signals[BUTTON_PRESSED], 0, event); } void -ethi_change_sort_state (ETableHeaderItem *ethi, ETableCol *col) +ethi_change_sort_state (ETableHeaderItem *ethi, + ETableCol *col) { gint model_col = -1; gint length; @@ -1793,7 +1832,8 @@ ethi_change_sort_state (ETableHeaderItem *ethi, ETableCol *col) * Handles the events on the ETableHeaderItem, particularly it handles resizing */ static gint -ethi_event (GnomeCanvasItem *item, GdkEvent *e) +ethi_event (GnomeCanvasItem *item, + GdkEvent *e) { ETableHeaderItem *ethi = E_TABLE_HEADER_ITEM (item); GnomeCanvas *canvas = item->canvas; diff --git a/widgets/table/e-table-header-item.h b/widgets/table/e-table-header-item.h index 96f167b4e8..be8e10820a 100644 --- a/widgets/table/e-table-header-item.h +++ b/widgets/table/e-table-header-item.h @@ -84,8 +84,8 @@ struct _ETableHeaderItem { /* * For dragging columns */ - guint maybe_drag:1; - guint dnd_ready:1; + guint maybe_drag : 1; + guint dnd_ready : 1; gint click_x, click_y; gint drag_col, drop_col, drag_mark; guint drag_motion_id; diff --git a/widgets/table/e-table-header-utils.c b/widgets/table/e-table-header-utils.c index 659677eceb..34f93a701b 100644 --- a/widgets/table/e-table-header-utils.c +++ b/widgets/table/e-table-header-utils.c @@ -35,8 +35,9 @@ #include "e-table-defines.h" #include "e-table-header-utils.h" -static PangoLayout* -build_header_layout (GtkWidget *widget, const gchar *str) +static PangoLayout * +build_header_layout (GtkWidget *widget, + const gchar *str) { PangoLayout *layout; @@ -69,7 +70,8 @@ build_header_layout (GtkWidget *widget, const gchar *str) * Return value: The height of the button, in pixels. **/ gdouble -e_table_header_compute_height (ETableCol *ecol, GtkWidget *widget) +e_table_header_compute_height (ETableCol *ecol, + GtkWidget *widget) { gint ythick; gint height; @@ -112,9 +114,14 @@ e_table_header_width_extras (GtkStyle *style) */ #if 0 static GdkPixmap * -make_composite_pixmap (GdkDrawable *drawable, GdkGC *gc, - GdkPixbuf *pixbuf, GdkColor *bg, gint width, gint height, - gint dither_xofs, gint dither_yofs) +make_composite_pixmap (GdkDrawable *drawable, + GdkGC *gc, + GdkPixbuf *pixbuf, + GdkColor *bg, + gint width, + gint height, + gint dither_xofs, + gint dither_yofs) { gint pwidth, pheight; GdkPixmap *pixmap; @@ -240,12 +247,18 @@ make_composite_pixmap (GdkDrawable *drawable, GdkGC *gc, * Draws a button suitable for a table header. **/ void -e_table_header_draw_button (cairo_t *cr, ETableCol *ecol, - GtkStyle *style, GtkStateType state, - GtkWidget *widget, - gint x, gint y, gint width, gint height, - gint button_width, gint button_height, - ETableColArrow arrow) +e_table_header_draw_button (cairo_t *cr, + ETableCol *ecol, + GtkStyle *style, + GtkStateType state, + GtkWidget *widget, + gint x, + gint y, + gint width, + gint height, + gint button_width, + gint button_height, + ETableColArrow arrow) { gint xthick, ythick; gint inner_x, inner_y; diff --git a/widgets/table/e-table-header-utils.h b/widgets/table/e-table-header-utils.h index cfa568bcdd..c3b2de89c7 100644 --- a/widgets/table/e-table-header-utils.h +++ b/widgets/table/e-table-header-utils.h @@ -34,7 +34,7 @@ gdouble e_table_header_compute_height (ETableCol *ecol, GtkWidget *widget); gdouble e_table_header_width_extras (GtkStyle *style); void e_table_header_draw_button (cairo_t *cr, - ETableCol*ecol, + ETableCol *ecol, GtkStyle *style, GtkStateType state, GtkWidget *widget, diff --git a/widgets/table/e-table-header.c b/widgets/table/e-table-header.c index 90dec061c1..aab0971518 100644 --- a/widgets/table/e-table-header.c +++ b/widgets/table/e-table-header.c @@ -63,13 +63,16 @@ struct two_ints { }; static void -eth_set_width (ETableHeader *eth, gint width) +eth_set_width (ETableHeader *eth, + gint width) { eth->width = width; } static void -dequeue (ETableHeader *eth, gint *column, gint *width) +dequeue (ETableHeader *eth, + gint *column, + gint *width) { GSList *head; struct two_ints *store; @@ -110,7 +113,9 @@ dequeue_idle (ETableHeader *eth) } static void -enqueue (ETableHeader *eth, gint column, gint width) +enqueue (ETableHeader *eth, + gint column, + gint width) { struct two_ints *store; store = g_new (struct two_ints, 1); @@ -129,7 +134,9 @@ enqueue (ETableHeader *eth, gint column, gint width) } void -e_table_header_set_size (ETableHeader *eth, gint idx, gint size) +e_table_header_set_size (ETableHeader *eth, + gint idx, + gint size) { g_return_if_fail (eth != NULL); g_return_if_fail (E_IS_TABLE_HEADER (eth)); @@ -138,12 +145,14 @@ e_table_header_set_size (ETableHeader *eth, gint idx, gint size) } static void -eth_do_remove (ETableHeader *eth, gint idx, gboolean do_unref) +eth_do_remove (ETableHeader *eth, + gint idx, + gboolean do_unref) { if (do_unref) g_object_unref (eth->columns[idx]); - memmove (ð->columns[idx], ð->columns[idx+1], + memmove (ð->columns[idx], ð->columns[idx + 1], sizeof (ETableCol *) * (eth->col_count - idx - 1)); eth->col_count--; } @@ -189,17 +198,21 @@ eth_finalize (GObject *object) } static void -eth_group_info_changed (ETableSortInfo *info, ETableHeader *eth) +eth_group_info_changed (ETableSortInfo *info, + ETableHeader *eth) { enqueue (eth, -1, eth->nominal_width); } static void -eth_set_property (GObject *object, guint prop_id, const GValue *val, GParamSpec *pspec) +eth_set_property (GObject *object, + guint property_id, + const GValue *val, + GParamSpec *pspec) { ETableHeader *eth = E_TABLE_HEADER (object); - switch (prop_id) { + switch (property_id) { case PROP_WIDTH: eth->nominal_width = g_value_get_double (val); enqueue (eth, -1, eth->nominal_width); @@ -219,9 +232,9 @@ eth_set_property (GObject *object, guint prop_id, const GValue *val, GParamSpec eth->sort_info = E_TABLE_SORT_INFO (g_value_get_object (val)); if (eth->sort_info) { g_object_ref (eth->sort_info); - eth->sort_info_group_change_id - = g_signal_connect(G_OBJECT(eth->sort_info), "group_info_changed", - G_CALLBACK (eth_group_info_changed), eth); + eth->sort_info_group_change_id = g_signal_connect ( + eth->sort_info, "group_info_changed", + G_CALLBACK (eth_group_info_changed), eth); } enqueue (eth, -1, eth->nominal_width); break; @@ -231,11 +244,14 @@ eth_set_property (GObject *object, guint prop_id, const GValue *val, GParamSpec } static void -eth_get_property (GObject *object, guint prop_id, GValue *val, GParamSpec *pspec) +eth_get_property (GObject *object, + guint property_id, + GValue *val, + GParamSpec *pspec) { ETableHeader *eth = E_TABLE_HEADER (object); - switch (prop_id) { + switch (property_id) { case PROP_SORT_INFO: g_value_set_object (val, G_OBJECT (eth->sort_info)); break; @@ -246,7 +262,7 @@ eth_get_property (GObject *object, guint prop_id, GValue *val, GParamSpec *pspec g_value_set_double (val, eth->width_extras); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } @@ -363,9 +379,11 @@ eth_update_offsets (ETableHeader *eth) } static void -eth_do_insert (ETableHeader *eth, gint pos, ETableCol *val) +eth_do_insert (ETableHeader *eth, + gint pos, + ETableCol *val) { - memmove (ð->columns[pos+1], ð->columns[pos], + memmove (ð->columns[pos + 1], ð->columns[pos], sizeof (ETableCol *) * (eth->col_count - pos)); eth->columns[pos] = val; eth->col_count++; @@ -386,7 +404,9 @@ eth_do_insert (ETableHeader *eth, gint pos, ETableCol *val) * The ETableCol is assumed */ void -e_table_header_add_column (ETableHeader *eth, ETableCol *tc, gint pos) +e_table_header_add_column (ETableHeader *eth, + ETableCol *tc, + gint pos) { g_return_if_fail (eth != NULL); g_return_if_fail (E_IS_TABLE_HEADER (eth)); @@ -418,7 +438,8 @@ e_table_header_add_column (ETableHeader *eth, ETableCol *tc, gint pos) * Returns: The ETableCol at @column in the @eth object */ ETableCol * -e_table_header_get_column (ETableHeader *eth, gint column) +e_table_header_get_column (ETableHeader *eth, + gint column) { g_return_val_if_fail (eth != NULL, NULL); g_return_val_if_fail (E_IS_TABLE_HEADER (eth), NULL); @@ -440,7 +461,8 @@ e_table_header_get_column (ETableHeader *eth, gint column) * Returns: The ETableCol with col_idx = @col_idx in the @eth object */ ETableCol * -e_table_header_get_column_by_col_idx (ETableHeader *eth, gint col_idx) +e_table_header_get_column_by_col_idx (ETableHeader *eth, + gint col_idx) { gint i; g_return_val_if_fail (eth != NULL, NULL); @@ -483,7 +505,8 @@ e_table_header_count (ETableHeader *eth) * Returns: the column in the model that the @col column * in the ETableHeader points to. */ gint -e_table_header_index (ETableHeader *eth, gint col) +e_table_header_index (ETableHeader *eth, + gint col) { g_return_val_if_fail (eth != NULL, -1); g_return_val_if_fail (E_IS_TABLE_HEADER (eth), -1); @@ -504,7 +527,8 @@ e_table_header_index (ETableHeader *eth, gint col) * if no column inside this ETableHeader contains that pixel. */ gint -e_table_header_get_index_at (ETableHeader *eth, gint x_offset) +e_table_header_get_index_at (ETableHeader *eth, + gint x_offset) { gint i, total; @@ -629,7 +653,9 @@ e_table_header_min_width (ETableHeader *eth) * and "structure_change" will be emmited */ void -e_table_header_move (ETableHeader *eth, gint source_index, gint target_index) +e_table_header_move (ETableHeader *eth, + gint source_index, + gint target_index) { ETableCol *old; @@ -663,7 +689,8 @@ e_table_header_move (ETableHeader *eth, gint source_index, gint target_index) * This emmits the "structure_change" signal on the @eth object. */ void -e_table_header_remove (ETableHeader *eth, gint idx) +e_table_header_remove (ETableHeader *eth, + gint idx) { g_return_if_fail (eth != NULL); g_return_if_fail (E_IS_TABLE_HEADER (eth)); @@ -679,14 +706,17 @@ e_table_header_remove (ETableHeader *eth, gint idx) * FIXME: deprecated? */ void -e_table_header_set_selection (ETableHeader *eth, gboolean allow_selection) +e_table_header_set_selection (ETableHeader *eth, + gboolean allow_selection) { g_return_if_fail (eth != NULL); g_return_if_fail (E_IS_TABLE_HEADER (eth)); } static void -eth_set_size (ETableHeader *eth, gint idx, gint size) +eth_set_size (ETableHeader *eth, + gint idx, + gint size) { gdouble expansion; gdouble old_expansion; @@ -824,7 +854,9 @@ eth_set_size (ETableHeader *eth, gint idx, gint size) * @eth ETableHeader object */ gint -e_table_header_col_diff (ETableHeader *eth, gint start_col, gint end_col) +e_table_header_col_diff (ETableHeader *eth, + gint start_col, + gint end_col) { gint total, col; diff --git a/widgets/table/e-table-item.c b/widgets/table/e-table-item.c index ac46df2cd3..25ea433a66 100644 --- a/widgets/table/e-table-item.c +++ b/widgets/table/e-table-item.c @@ -67,8 +67,8 @@ static void eti_check_cursor_bounds (ETableItem *eti); static void eti_cancel_drag_due_to_model_change (ETableItem *eti); /* FIXME: Do an analysis of which cell functions are needed before - realize and make sure that all of them are doable by all the cells - and that all of the others are only done after realization. */ + * realize and make sure that all of them are doable by all the cells + * and that all of the others are only done after realization. */ enum { CURSOR_CHANGE, @@ -122,9 +122,9 @@ static void e_table_item_redraw_row (ETableItem *eti, gint row); #define ETI_ROW_HEIGHT(eti,row) ((eti)->uniform_row_height ? ETI_SINGLE_ROW_HEIGHT ((eti)) : ETI_MULTIPLE_ROW_HEIGHT((eti),(row))) /* tweak_hsv is a really tweaky function. it modifies its first argument, which - should be the color you want tweaked. delta_h, delta_s and delta_v specify - how much you want their respective channels modified (and in what direction). - if it can't do the specified modification, it does it in the oppositon direction */ + * should be the color you want tweaked. delta_h, delta_s and delta_v specify + * how much you want their respective channels modified (and in what direction). + * if it can't do the specified modification, it does it in the oppositon direction */ static void e_hsv_tweak (GdkColor *color, gdouble delta_h, @@ -165,7 +165,8 @@ e_hsv_tweak (GdkColor *color, } inline static gint -model_to_view_row (ETableItem *eti, gint row) +model_to_view_row (ETableItem *eti, + gint row) { gint i; if (row == -1) @@ -187,7 +188,8 @@ model_to_view_row (ETableItem *eti, gint row) } inline static gint -view_to_model_row (ETableItem *eti, gint row) +view_to_model_row (ETableItem *eti, + gint row) { if (eti->uses_source_model) { ETableSubset *etss = E_TABLE_SUBSET (eti->table_model); @@ -201,7 +203,8 @@ view_to_model_row (ETableItem *eti, gint row) } inline static gint -model_to_view_col (ETableItem *eti, gint col) +model_to_view_col (ETableItem *eti, + gint col) { gint i; if (col == -1) @@ -215,14 +218,17 @@ model_to_view_col (ETableItem *eti, gint col) } inline static gint -view_to_model_col (ETableItem *eti, gint col) +view_to_model_col (ETableItem *eti, + gint col) { ETableCol *ecol = e_table_header_get_column (eti->header, col); return ecol ? ecol->col_idx : -1; } static void -grab_cancelled (ECanvas *canvas, GnomeCanvasItem *item, gpointer data) +grab_cancelled (ECanvas *canvas, + GnomeCanvasItem *item, + gpointer data) { ETableItem *eti = data; @@ -230,7 +236,8 @@ grab_cancelled (ECanvas *canvas, GnomeCanvasItem *item, gpointer data) } inline static void -eti_grab (ETableItem *eti, guint32 time) +eti_grab (ETableItem *eti, + guint32 time) { GnomeCanvasItem *item = GNOME_CANVAS_ITEM (eti); d(g_print ("%s: time: %d\n", __FUNCTION__, time)); @@ -253,7 +260,8 @@ eti_grab (ETableItem *eti, guint32 time) } inline static void -eti_ungrab (ETableItem *eti, guint32 time) +eti_ungrab (ETableItem *eti, + guint32 time) { GnomeCanvasItem *item = GNOME_CANVAS_ITEM (eti); d(g_print ("%s: time: %d\n", __FUNCTION__, time)); @@ -286,7 +294,11 @@ eti_editing (ETableItem *eti) } inline static GdkColor * -eti_get_cell_background_color (ETableItem *eti, gint row, gint col, gboolean selected, gboolean *allocatedp) +eti_get_cell_background_color (ETableItem *eti, + gint row, + gint col, + gboolean selected, + gboolean *allocatedp) { ECellView *ecell_view = eti->cell_views[col]; GtkWidget *canvas; @@ -334,7 +346,11 @@ eti_get_cell_background_color (ETableItem *eti, gint row, gint col, gboolean sel } inline static GdkColor * -eti_get_cell_foreground_color (ETableItem *eti, gint row, gint col, gboolean selected, gboolean *allocated) +eti_get_cell_foreground_color (ETableItem *eti, + gint row, + gint col, + gboolean selected, + gboolean *allocated) { GtkWidget *canvas; GdkColor *foreground; @@ -381,7 +397,7 @@ eti_free_save_state (ETableItem *eti) * we might want to avoid realizing each e-cell. */ static void -eti_realize_cell_views ( ETableItem *eti) +eti_realize_cell_views (ETableItem *eti) { GnomeCanvasItem *item; gint i; @@ -470,7 +486,11 @@ eti_detach_cell_views (ETableItem *eti) } static void -eti_bounds (GnomeCanvasItem *item, gdouble *x1, gdouble *y1, gdouble *x2, gdouble *y2) +eti_bounds (GnomeCanvasItem *item, + gdouble *x1, + gdouble *y1, + gdouble *x2, + gdouble *y2) { cairo_matrix_t i2c; ETableItem *eti = E_TABLE_ITEM (item); @@ -487,7 +507,8 @@ eti_bounds (GnomeCanvasItem *item, gdouble *x1, gdouble *y1, gdouble *x2, gdoubl } static void -eti_reflow (GnomeCanvasItem *item, gint flags) +eti_reflow (GnomeCanvasItem *item, + gint flags) { ETableItem *eti = E_TABLE_ITEM (item); @@ -518,7 +539,9 @@ eti_reflow (GnomeCanvasItem *item, gint flags) * GnomeCanvasItem::update method */ static void -eti_update (GnomeCanvasItem *item, const cairo_matrix_t *i2c, gint flags) +eti_update (GnomeCanvasItem *item, + const cairo_matrix_t *i2c, + gint flags) { ETableItem *eti = E_TABLE_ITEM (item); gdouble x1, x2, y1, y2; @@ -652,7 +675,8 @@ eti_remove_header_model (ETableItem *eti) * used as a separator between rows */ static gint -eti_row_height_real (ETableItem *eti, gint row) +eti_row_height_real (ETableItem *eti, + gint row) { const gint cols = e_table_header_count (eti->header); gint col; @@ -744,7 +768,8 @@ calculate_height_cache (ETableItem *eti) * used as a separator between rows */ static gint -eti_row_height (ETableItem *eti, gint row) +eti_row_height (ETableItem *eti, + gint row) { if (eti->uniform_row_height) { eti->uniform_row_height_cache = eti_row_height_real (eti, -1); @@ -826,7 +851,11 @@ eti_get_height (ETableItem *eti) } static void -eti_item_region_redraw (ETableItem *eti, gint x0, gint y0, gint x1, gint y1) +eti_item_region_redraw (ETableItem *eti, + gint x0, + gint y0, + gint x1, + gint y1) { GnomeCanvasItem *item = GNOME_CANVAS_ITEM (eti); gdouble dx1, dy1, dx2, dy2; @@ -847,7 +876,9 @@ eti_item_region_redraw (ETableItem *eti, gint x0, gint y0, gint x1, gint y1) * Computes the distance between @start_row and @end_row in pixels */ gint -e_table_item_row_diff (ETableItem *eti, gint start_row, gint end_row) +e_table_item_row_diff (ETableItem *eti, + gint start_row, + gint end_row) { gint height_extra = eti->horizontal_draw_grid ? 1 : 0; @@ -870,10 +901,14 @@ e_table_item_row_diff (ETableItem *eti, gint start_row, gint end_row) static void eti_get_region (ETableItem *eti, - gint start_col, gint start_row, - gint end_col, gint end_row, - gint *x1p, gint *y1p, - gint *x2p, gint *y2p) + gint start_col, + gint start_row, + gint end_col, + gint end_row, + gint *x1p, + gint *y1p, + gint *x2p, + gint *y2p) { gint x1, y1, x2, y2; @@ -903,8 +938,11 @@ eti_get_region (ETableItem *eti, */ static void eti_request_region_redraw (ETableItem *eti, - gint start_col, gint start_row, - gint end_col, gint end_row, gint border) + gint start_col, + gint start_row, + gint end_col, + gint end_row, + gint border) { gint x1, y1, x2, y2; @@ -930,8 +968,11 @@ eti_request_region_redraw (ETableItem *eti, */ static void eti_request_region_show (ETableItem *eti, - gint start_col, gint start_row, - gint end_col, gint end_row, gint delay) + gint start_col, + gint start_row, + gint end_col, + gint end_row, + gint delay) { gint x1, y1, x2, y2; @@ -947,7 +988,8 @@ eti_request_region_show (ETableItem *eti, } static void -eti_show_cursor (ETableItem *eti, gint delay) +eti_show_cursor (ETableItem *eti, + gint delay) { GnomeCanvasItem *item; gint cursor_row; @@ -1028,7 +1070,8 @@ eti_check_cursor_bounds (ETableItem *eti) } static void -eti_maybe_show_cursor (ETableItem *eti, gint delay) +eti_maybe_show_cursor (ETableItem *eti, + gint delay) { d(g_print ("%s: cursor on screen: %s\n", __FUNCTION__, eti->cursor_on_screen ? "TRUE" : "FALSE")); if (eti->cursor_on_screen) @@ -1101,7 +1144,8 @@ eti_unfreeze (ETableItem *eti) * Callback routine: invoked before the ETableModel suffers a change */ static void -eti_table_model_pre_change (ETableModel *table_model, ETableItem *eti) +eti_table_model_pre_change (ETableModel *table_model, + ETableItem *eti) { eti_cancel_drag_due_to_model_change (eti); eti_check_cursor_bounds (eti); @@ -1116,7 +1160,8 @@ eti_table_model_pre_change (ETableModel *table_model, ETableItem *eti) * Callback routine: invoked when the ETableModel has not suffered a change */ static void -eti_table_model_no_change (ETableModel *table_model, ETableItem *eti) +eti_table_model_no_change (ETableModel *table_model, + ETableItem *eti) { eti_unfreeze (eti); } @@ -1126,7 +1171,8 @@ eti_table_model_no_change (ETableModel *table_model, ETableItem *eti) */ static void -eti_table_model_changed (ETableModel *table_model, ETableItem *eti) +eti_table_model_changed (ETableModel *table_model, + ETableItem *eti) { GnomeCanvasItem *item = GNOME_CANVAS_ITEM (eti); @@ -1150,7 +1196,9 @@ eti_table_model_changed (ETableModel *table_model, ETableItem *eti) } static void -eti_table_model_row_changed (ETableModel *table_model, gint row, ETableItem *eti) +eti_table_model_row_changed (ETableModel *table_model, + gint row, + ETableItem *eti) { GnomeCanvasItem *item = GNOME_CANVAS_ITEM (eti); @@ -1170,7 +1218,10 @@ eti_table_model_row_changed (ETableModel *table_model, gint row, ETableItem *eti } static void -eti_table_model_cell_changed (ETableModel *table_model, gint col, gint row, ETableItem *eti) +eti_table_model_cell_changed (ETableModel *table_model, + gint col, + gint row, + ETableItem *eti) { GnomeCanvasItem *item = GNOME_CANVAS_ITEM (eti); @@ -1190,7 +1241,10 @@ eti_table_model_cell_changed (ETableModel *table_model, gint col, gint row, ETab } static void -eti_table_model_rows_inserted (ETableModel *table_model, gint row, gint count, ETableItem *eti) +eti_table_model_rows_inserted (ETableModel *table_model, + gint row, + gint count, + ETableItem *eti) { GnomeCanvasItem *item = GNOME_CANVAS_ITEM (eti); @@ -1219,7 +1273,10 @@ eti_table_model_rows_inserted (ETableModel *table_model, gint row, gint count, E } static void -eti_table_model_rows_deleted (ETableModel *table_model, gint row, gint count, ETableItem *eti) +eti_table_model_rows_deleted (ETableModel *table_model, + gint row, + gint count, + ETableItem *eti) { GnomeCanvasItem *item = GNOME_CANVAS_ITEM (eti); @@ -1257,8 +1314,10 @@ eti_table_model_rows_deleted (ETableModel *table_model, gint row, gint count, ET */ void e_table_item_redraw_range (ETableItem *eti, - gint start_col, gint start_row, - gint end_col, gint end_row) + gint start_col, + gint start_row, + gint end_col, + gint end_row) { gint border; gint cursor_col, cursor_row; @@ -1284,14 +1343,15 @@ e_table_item_redraw_range (ETableItem *eti, static void e_table_item_redraw_row (ETableItem *eti, - gint row) + gint row) { if (row != -1) e_table_item_redraw_range (eti, 0, row, eti->cols - 1, row); } static void -eti_add_table_model (ETableItem *eti, ETableModel *table_model) +eti_add_table_model (ETableItem *eti, + ETableModel *table_model) { g_return_if_fail (eti->table_model == NULL); @@ -1344,7 +1404,8 @@ eti_add_table_model (ETableItem *eti, ETableModel *table_model) } static void -eti_add_selection_model (ETableItem *eti, ESelectionModel *selection) +eti_add_selection_model (ETableItem *eti, + ESelectionModel *selection) { g_return_if_fail (eti->selection == NULL); @@ -1373,7 +1434,9 @@ eti_add_selection_model (ETableItem *eti, ESelectionModel *selection) } static void -eti_header_dim_changed (ETableHeader *eth, gint col, ETableItem *eti) +eti_header_dim_changed (ETableHeader *eth, + gint col, + ETableItem *eti) { eti->needs_compute_width = 1; e_canvas_item_request_reflow (GNOME_CANVAS_ITEM (eti)); @@ -1382,7 +1445,8 @@ eti_header_dim_changed (ETableHeader *eth, gint col, ETableItem *eti) } static void -eti_header_structure_changed (ETableHeader *eth, ETableItem *eti) +eti_header_structure_changed (ETableHeader *eth, + ETableItem *eti) { eti->cols = e_table_header_count (eti->header); @@ -1409,7 +1473,9 @@ eti_header_structure_changed (ETableHeader *eth, ETableItem *eti) } static gint -eti_request_column_width (ETableHeader *eth, gint col, ETableItem *eti) +eti_request_column_width (ETableHeader *eth, + gint col, + ETableItem *eti) { gint width = 0; @@ -1421,7 +1487,8 @@ eti_request_column_width (ETableHeader *eth, gint col, ETableItem *eti) } static void -eti_add_header_model (ETableItem *eti, ETableHeader *header) +eti_add_header_model (ETableItem *eti, + ETableHeader *header) { g_return_if_fail (eti->header == NULL); @@ -1475,13 +1542,16 @@ eti_dispose (GObject *object) } static void -eti_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) +eti_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) { GnomeCanvasItem *item = GNOME_CANVAS_ITEM (object); ETableItem *eti = E_TABLE_ITEM (object); gint cursor_col; - switch (prop_id) { + switch (property_id) { case PROP_TABLE_HEADER: eti_remove_header_model (eti); eti_add_header_model (eti, E_TABLE_HEADER (g_value_get_object (value))); @@ -1558,14 +1628,17 @@ eti_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpe } static void -eti_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) +eti_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) { ETableItem *eti; gint row; eti = E_TABLE_ITEM (object); - switch (prop_id) { + switch (property_id) { case PROP_WIDTH: g_value_set_double (value, eti->width); break; @@ -1585,7 +1658,7 @@ eti_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *psp g_value_set_boolean (value, eti->uniform_row_height); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } @@ -1666,7 +1739,9 @@ static const gchar gray50_bits[] = { 0x02, 0x01, }; static gboolean -eti_tree_unfreeze (GtkWidget *widget, GdkEvent *event, ETableItem *eti) +eti_tree_unfreeze (GtkWidget *widget, + GdkEvent *event, + ETableItem *eti) { if (widget) @@ -1745,8 +1820,13 @@ eti_unrealize (GnomeCanvasItem *item) } static void -eti_draw_grid_line (ETableItem *eti, cairo_t *cr, GtkStyle *style, - gint x1, gint y1, gint x2, gint y2) +eti_draw_grid_line (ETableItem *eti, + cairo_t *cr, + GtkStyle *style, + gint x1, + gint y1, + gint x2, + gint y2) { cairo_save (cr); @@ -1761,7 +1841,12 @@ eti_draw_grid_line (ETableItem *eti, cairo_t *cr, GtkStyle *style, } static void -eti_draw (GnomeCanvasItem *item, cairo_t *cr, gint x, gint y, gint width, gint height) +eti_draw (GnomeCanvasItem *item, + cairo_t *cr, + gint x, + gint y, + gint width, + gint height) { ETableItem *eti = E_TABLE_ITEM (item); const gint rows = eti->rows; @@ -1915,26 +2000,26 @@ eti_draw (GnomeCanvasItem *item, cairo_t *cr, gint x, gint y, gint width, gint h } x1 = xd; - y1 = yd+1; + y1 = yd + 1; x2 = x1 + ecol->width; - y2 = yd+height; + y2 = yd + height; background = eti_get_cell_background_color (eti, row, col, col_selected, &free_background); cairo_save (cr); pat = cairo_pattern_create_linear (0, y1, 0, y2); - cairo_pattern_add_color_stop_rgba (pat, 0.0, background->red/65535.0 , - background->green/65535.0, - background->blue/65535.0, selected ? 0.8: 1.0); + cairo_pattern_add_color_stop_rgba (pat, 0.0, background->red / 65535.0 , + background->green / 65535.0, + background->blue / 65535.0, selected ? 0.8: 1.0); if (selected) - cairo_pattern_add_color_stop_rgba (pat, 0.5, background->red/65535.0 , - background->green/65535.0, - background->blue/65535.0, 0.9); - - cairo_pattern_add_color_stop_rgba (pat, 1, background->red/65535.0 , - background->green/65535.0, - background->blue/65535.0, selected ? 0.8 : 1.0); - cairo_rectangle (cr, x1, y1, ecol->width, height-1); + cairo_pattern_add_color_stop_rgba (pat, 0.5, background->red / 65535.0 , + background->green / 65535.0, + background->blue / 65535.0, 0.9); + + cairo_pattern_add_color_stop_rgba (pat, 1, background->red / 65535.0 , + background->green / 65535.0, + background->blue / 65535.0, selected ? 0.8 : 1.0); + cairo_rectangle (cr, x1, y1, ecol->width, height - 1); cairo_set_source (cr, pat); cairo_fill_preserve (cr); cairo_pattern_destroy (pat); @@ -1944,17 +2029,17 @@ eti_draw (GnomeCanvasItem *item, cairo_t *cr, gint x, gint y, gint width, gint h cairo_save (cr); cairo_set_line_width (cr, 1.0); - cairo_set_source_rgba (cr, background->red/65535.0 , - background->green/65535.0, - background->blue/65535.0, 1); + cairo_set_source_rgba (cr, background->red / 65535.0 , + background->green / 65535.0, + background->blue / 65535.0, 1); cairo_move_to (cr, x1, y1); cairo_line_to (cr, x2, y1); cairo_stroke (cr); cairo_set_line_width (cr, 1.0); - cairo_set_source_rgba (cr, background->red/65535.0 , - background->green/65535.0, - background->blue/65535.0, 1); + cairo_set_source_rgba (cr, background->red / 65535.0 , + background->green / 65535.0, + background->blue / 65535.0, 1); cairo_move_to (cr, x1, y2); cairo_line_to (cr, x2, y2); cairo_stroke (cr); @@ -1991,7 +2076,7 @@ eti_draw (GnomeCanvasItem *item, cairo_t *cr, gint x, gint y, gint width, gint h if (view_to_model_row (eti, row) == cursor_row) { f_x1 = floor (eti_base_x) - x; f_x2 = floor (lower_right_x) - x; - f_y1 = yd+1; + f_y1 = yd + 1; f_y2 = yd + height; f_found = TRUE; } @@ -2055,13 +2140,23 @@ eti_draw (GnomeCanvasItem *item, cairo_t *cr, gint x, gint y, gint width, gint h } static GnomeCanvasItem * -eti_point (GnomeCanvasItem *item, gdouble x, gdouble y, gint cx, gint cy) +eti_point (GnomeCanvasItem *item, + gdouble x, + gdouble y, + gint cx, + gint cy) { return item; } static gboolean -find_cell (ETableItem *eti, gdouble x, gdouble y, gint *view_col_res, gint *view_row_res, gdouble *x1_res, gdouble *y1_res) +find_cell (ETableItem *eti, + gdouble x, + gdouble y, + gint *view_col_res, + gint *view_row_res, + gdouble *x1_res, + gdouble *y1_res) { const gint cols = eti->cols; const gint rows = eti->rows; @@ -2127,7 +2222,9 @@ find_cell (ETableItem *eti, gdouble x, gdouble y, gint *view_col_res, gint *view } static void -eti_cursor_move (ETableItem *eti, gint row, gint column) +eti_cursor_move (ETableItem *eti, + gint row, + gint column) { e_table_item_leave_edit_(eti); e_table_item_focus (eti, view_to_model_col (eti, column), view_to_model_row (eti, row), 0); @@ -2158,7 +2255,14 @@ eti_cursor_move_right (ETableItem *eti) } static gint -eti_e_cell_event (ETableItem *item, ECellView *ecell_view, GdkEvent *event, gint time, gint model_col, gint view_col, gint row, ECellFlags flags) +eti_e_cell_event (ETableItem *item, + ECellView *ecell_view, + GdkEvent *event, + gint time, + gint model_col, + gint view_col, + gint row, + ECellFlags flags) { ECellActions actions = 0; gint ret_val; @@ -2184,7 +2288,8 @@ eti_e_cell_event (ETableItem *item, ECellView *ecell_view, GdkEvent *event, /* FIXME: cursor */ static gint -eti_event (GnomeCanvasItem *item, GdkEvent *e) +eti_event (GnomeCanvasItem *item, + GdkEvent *e) { ETableItem *eti = E_TABLE_ITEM (item); ECellView *ecell_view; @@ -2786,7 +2891,8 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) } static void -eti_style_set (ETableItem *eti, GtkStyle *previous_style) +eti_style_set (ETableItem *eti, + GtkStyle *previous_style) { GnomeCanvasItem *item = GNOME_CANVAS_ITEM (eti); @@ -3057,13 +3163,18 @@ eti_class_init (ETableItemClass *class) * This routine sets the cursor of the %ETableItem canvas item. */ void -e_table_item_set_cursor (ETableItem *eti, gint col, gint row) +e_table_item_set_cursor (ETableItem *eti, + gint col, + gint row) { e_table_item_focus (eti, col, view_to_model_row (eti, row), 0); } static void -e_table_item_focus (ETableItem *eti, gint col, gint row, GdkModifierType state) +e_table_item_focus (ETableItem *eti, + gint col, + gint row, + GdkModifierType state) { g_return_if_fail (eti != NULL); g_return_if_fail (E_IS_TABLE_ITEM (eti)); @@ -3107,7 +3218,10 @@ e_table_item_get_focused_column (ETableItem *eti) } static void -eti_cursor_change (ESelectionModel *selection, gint row, gint col, ETableItem *eti) +eti_cursor_change (ESelectionModel *selection, + gint row, + gint col, + ETableItem *eti) { GnomeCanvasItem *item = GNOME_CANVAS_ITEM (eti); gint view_row; @@ -3146,7 +3260,10 @@ eti_cursor_change (ESelectionModel *selection, gint row, gint col, ETableItem *e } static void -eti_cursor_activated (ESelectionModel *selection, gint row, gint col, ETableItem *eti) +eti_cursor_activated (ESelectionModel *selection, + gint row, + gint col, + ETableItem *eti) { GnomeCanvasItem *item = GNOME_CANVAS_ITEM (eti); gint view_row; @@ -3178,7 +3295,8 @@ eti_cursor_activated (ESelectionModel *selection, gint row, gint col, ETableItem } static void -eti_selection_change (ESelectionModel *selection, ETableItem *eti) +eti_selection_change (ESelectionModel *selection, + ETableItem *eti) { GnomeCanvasItem *item = GNOME_CANVAS_ITEM (eti); @@ -3190,7 +3308,9 @@ eti_selection_change (ESelectionModel *selection, ETableItem *eti) } static void -eti_selection_row_change (ESelectionModel *selection, gint row, ETableItem *eti) +eti_selection_row_change (ESelectionModel *selection, + gint row, + ETableItem *eti) { GnomeCanvasItem *item = GNOME_CANVAS_ITEM (eti); @@ -3212,7 +3332,9 @@ eti_selection_row_change (ESelectionModel *selection, gint row, ETableItem *eti) * column and row. */ void -e_table_item_enter_edit (ETableItem *eti, gint col, gint row) +e_table_item_enter_edit (ETableItem *eti, + gint col, + gint row) { g_return_if_fail (eti != NULL); g_return_if_fail (E_IS_TABLE_ITEM (eti)); @@ -3276,14 +3398,14 @@ e_table_item_leave_edit (ETableItem *eti) * is removed from the value y points to. */ void -e_table_item_compute_location (ETableItem *eti, - gint *x, - gint *y, - gint *row, - gint *col) +e_table_item_compute_location (ETableItem *eti, + gint *x, + gint *y, + gint *row, + gint *col) { /* Save the grabbed row but make sure that we don't get flawed - results because the cursor is grabbed. */ + * results because the cursor is grabbed. */ gint grabbed_row = eti->grabbed_row; eti->grabbed_row = -1; @@ -3300,15 +3422,15 @@ e_table_item_compute_location (ETableItem *eti, * the position inside the item too. **/ void -e_table_item_compute_mouse_over (ETableItem *eti, - gint x, - gint y, - gint *row, - gint *col) +e_table_item_compute_mouse_over (ETableItem *eti, + gint x, + gint y, + gint *row, + gint *col) { gdouble realx, realy; /* Save the grabbed row but make sure that we don't get flawed - results because the cursor is grabbed. */ + * results because the cursor is grabbed. */ gint grabbed_row = eti->grabbed_row; eti->grabbed_row = -1; @@ -3326,13 +3448,13 @@ e_table_item_compute_mouse_over (ETableItem *eti, } void -e_table_item_get_cell_geometry (ETableItem *eti, - gint *row, - gint *col, - gint *x, - gint *y, - gint *width, - gint *height) +e_table_item_get_cell_geometry (ETableItem *eti, + gint *row, + gint *col, + gint *x, + gint *y, + gint *width, + gint *height) { if (eti->rows > *row) { if (x) @@ -3356,7 +3478,8 @@ typedef struct { } ETableItemPrintContext; static gdouble * -e_table_item_calculate_print_widths (ETableHeader *eth, gdouble width) +e_table_item_calculate_print_widths (ETableHeader *eth, + gdouble width) { gint i; gdouble extra; @@ -3375,14 +3498,17 @@ e_table_item_calculate_print_widths (ETableHeader *eth, gdouble width) widths[i] = eth->columns[i]->min_width * scale; } for (i = 0; i <= last_resizable; i++) { - widths[i] += extra * (eth->columns[i]->resizable ? eth->columns[i]->expansion : 0)/expansion; + widths[i] += extra * (eth->columns[i]->resizable ? eth->columns[i]->expansion : 0) / expansion; } return widths; } static gdouble -eti_printed_row_height (ETableItem *eti, gdouble *widths, GtkPrintContext *context, gint row) +eti_printed_row_height (ETableItem *eti, + gdouble *widths, + GtkPrintContext *context, + gint row) { gint col; gint cols = eti->cols; @@ -3400,7 +3526,11 @@ eti_printed_row_height (ETableItem *eti, gdouble *widths, GtkPrintContext *conte #define CHECK(x) if((x) == -1) return -1; static gint -gp_draw_rect (GtkPrintContext *context, gdouble x, gdouble y, gdouble width, gdouble height) +gp_draw_rect (GtkPrintContext *context, + gdouble x, + gdouble y, + gdouble width, + gdouble height) { cairo_t *cr; cr = gtk_print_context_get_cairo_context (context); @@ -3413,12 +3543,12 @@ gp_draw_rect (GtkPrintContext *context, gdouble x, gdouble y, gdouble width, gdo } static void -e_table_item_print_page (EPrintable *ep, - GtkPrintContext *context, - gdouble width, - gdouble height, - gboolean quantize, - ETableItemPrintContext *itemcontext) +e_table_item_print_page (EPrintable *ep, + GtkPrintContext *context, + gdouble width, + gdouble height, + gboolean quantize, + ETableItemPrintContext *itemcontext) { ETableItem *eti = itemcontext->item; const gint rows = eti->rows; @@ -3503,8 +3633,8 @@ e_table_item_print_page (EPrintable *ep, } static gboolean -e_table_item_data_left (EPrintable *ep, - ETableItemPrintContext *itemcontext) +e_table_item_data_left (EPrintable *ep, + ETableItemPrintContext *itemcontext) { ETableItem *item = itemcontext->item; gint rows_printed = itemcontext->rows_printed; @@ -3514,19 +3644,19 @@ e_table_item_data_left (EPrintable *ep, } static void -e_table_item_reset (EPrintable *ep, - ETableItemPrintContext *itemcontext) +e_table_item_reset (EPrintable *ep, + ETableItemPrintContext *itemcontext) { itemcontext->rows_printed = 0; } static gdouble -e_table_item_height (EPrintable *ep, - GtkPrintContext *context, - gdouble width, - gdouble max_height, - gboolean quantize, - ETableItemPrintContext *itemcontext) +e_table_item_height (EPrintable *ep, + GtkPrintContext *context, + gdouble width, + gdouble max_height, + gboolean quantize, + ETableItemPrintContext *itemcontext) { ETableItem *item = itemcontext->item; const gint rows = item->rows; @@ -3571,12 +3701,12 @@ e_table_item_height (EPrintable *ep, } static gboolean -e_table_item_will_fit (EPrintable *ep, - GtkPrintContext *context, - gdouble width, - gdouble max_height, - gboolean quantize, - ETableItemPrintContext *itemcontext) +e_table_item_will_fit (EPrintable *ep, + GtkPrintContext *context, + gdouble width, + gdouble max_height, + gboolean quantize, + ETableItemPrintContext *itemcontext) { ETableItem *item = itemcontext->item; const gint rows = item->rows; @@ -3622,7 +3752,7 @@ e_table_item_will_fit (EPrintable *ep, static void e_table_item_printable_destroy (gpointer data, - GObject *where_object_was) + GObject *where_object_was) { ETableItemPrintContext *itemcontext = data; diff --git a/widgets/table/e-table-item.h b/widgets/table/e-table-item.h index d2fd2c56d6..26a181dd64 100644 --- a/widgets/table/e-table-item.h +++ b/widgets/table/e-table-item.h @@ -94,12 +94,12 @@ struct _ETableItem { /* View row, -1 means unknown */ gint old_cursor_row; - guint alternating_row_colors:1; - guint horizontal_draw_grid:1; - guint vertical_draw_grid:1; - guint draw_focus:1; - guint uniform_row_height:1; - guint cell_views_realized:1; + guint alternating_row_colors : 1; + guint horizontal_draw_grid : 1; + guint vertical_draw_grid : 1; + guint draw_focus : 1; + guint uniform_row_height : 1; + guint cell_views_realized : 1; guint needs_redraw : 1; guint needs_compute_height : 1; diff --git a/widgets/table/e-table-memory-callbacks.c b/widgets/table/e-table-memory-callbacks.c index bc85c7d39a..279d0a505e 100644 --- a/widgets/table/e-table-memory-callbacks.c +++ b/widgets/table/e-table-memory-callbacks.c @@ -43,7 +43,9 @@ etmc_column_count (ETableModel *etm) } static gpointer -etmc_value_at (ETableModel *etm, gint col, gint row) +etmc_value_at (ETableModel *etm, + gint col, + gint row) { ETableMemoryCallbacks *etmc = E_TABLE_MEMORY_CALLBACKS (etm); @@ -54,7 +56,10 @@ etmc_value_at (ETableModel *etm, gint col, gint row) } static void -etmc_set_value_at (ETableModel *etm, gint col, gint row, gconstpointer val) +etmc_set_value_at (ETableModel *etm, + gint col, + gint row, + gconstpointer val) { ETableMemoryCallbacks *etmc = E_TABLE_MEMORY_CALLBACKS (etm); @@ -63,7 +68,9 @@ etmc_set_value_at (ETableModel *etm, gint col, gint row, gconstpointer val) } static gboolean -etmc_is_cell_editable (ETableModel *etm, gint col, gint row) +etmc_is_cell_editable (ETableModel *etm, + gint col, + gint row) { ETableMemoryCallbacks *etmc = E_TABLE_MEMORY_CALLBACKS (etm); @@ -75,7 +82,9 @@ etmc_is_cell_editable (ETableModel *etm, gint col, gint row) /* The default for etmc_duplicate_value is to return the raw value. */ static gpointer -etmc_duplicate_value (ETableModel *etm, gint col, gconstpointer value) +etmc_duplicate_value (ETableModel *etm, + gint col, + gconstpointer value) { ETableMemoryCallbacks *etmc = E_TABLE_MEMORY_CALLBACKS (etm); @@ -86,7 +95,9 @@ etmc_duplicate_value (ETableModel *etm, gint col, gconstpointer value) } static void -etmc_free_value (ETableModel *etm, gint col, gpointer value) +etmc_free_value (ETableModel *etm, + gint col, + gpointer value) { ETableMemoryCallbacks *etmc = E_TABLE_MEMORY_CALLBACKS (etm); @@ -95,7 +106,8 @@ etmc_free_value (ETableModel *etm, gint col, gpointer value) } static gpointer -etmc_initialize_value (ETableModel *etm, gint col) +etmc_initialize_value (ETableModel *etm, + gint col) { ETableMemoryCallbacks *etmc = E_TABLE_MEMORY_CALLBACKS (etm); @@ -106,7 +118,9 @@ etmc_initialize_value (ETableModel *etm, gint col) } static gboolean -etmc_value_is_empty (ETableModel *etm, gint col, gconstpointer value) +etmc_value_is_empty (ETableModel *etm, + gint col, + gconstpointer value) { ETableMemoryCallbacks *etmc = E_TABLE_MEMORY_CALLBACKS (etm); @@ -117,7 +131,9 @@ etmc_value_is_empty (ETableModel *etm, gint col, gconstpointer value) } static gchar * -etmc_value_to_string (ETableModel *etm, gint col, gconstpointer value) +etmc_value_to_string (ETableModel *etm, + gint col, + gconstpointer value) { ETableMemoryCallbacks *etmc = E_TABLE_MEMORY_CALLBACKS (etm); @@ -128,7 +144,9 @@ etmc_value_to_string (ETableModel *etm, gint col, gconstpointer value) } static void -etmc_append_row (ETableModel *etm, ETableModel *source, gint row) +etmc_append_row (ETableModel *etm, + ETableModel *source, + gint row) { ETableMemoryCallbacks *etmc = E_TABLE_MEMORY_CALLBACKS (etm); @@ -189,15 +207,15 @@ e_table_memory_callbacks_init (ETableMemoryCallbacks *etmc) */ ETableModel * e_table_memory_callbacks_new (ETableMemoryCallbacksColumnCountFn col_count, - ETableMemoryCallbacksValueAtFn value_at, - ETableMemoryCallbacksSetValueAtFn set_value_at, - ETableMemoryCallbacksIsCellEditableFn is_cell_editable, - ETableMemoryCallbacksDuplicateValueFn duplicate_value, - ETableMemoryCallbacksFreeValueFn free_value, - ETableMemoryCallbacksInitializeValueFn initialize_value, - ETableMemoryCallbacksValueIsEmptyFn value_is_empty, - ETableMemoryCallbacksValueToStringFn value_to_string, - gpointer data) + ETableMemoryCallbacksValueAtFn value_at, + ETableMemoryCallbacksSetValueAtFn set_value_at, + ETableMemoryCallbacksIsCellEditableFn is_cell_editable, + ETableMemoryCallbacksDuplicateValueFn duplicate_value, + ETableMemoryCallbacksFreeValueFn free_value, + ETableMemoryCallbacksInitializeValueFn initialize_value, + ETableMemoryCallbacksValueIsEmptyFn value_is_empty, + ETableMemoryCallbacksValueToStringFn value_to_string, + gpointer data) { ETableMemoryCallbacks *et; diff --git a/widgets/table/e-table-memory-store.c b/widgets/table/e-table-memory-store.c index dc77e13410..55f96f5862 100644 --- a/widgets/table/e-table-memory-store.c +++ b/widgets/table/e-table-memory-store.c @@ -41,7 +41,9 @@ struct _ETableMemoryStorePrivate { G_DEFINE_TYPE (ETableMemoryStore, e_table_memory_store, E_TYPE_TABLE_MEMORY) static gpointer -duplicate_value (ETableMemoryStore *etms, gint col, gconstpointer val) +duplicate_value (ETableMemoryStore *etms, + gint col, + gconstpointer val) { switch (etms->priv->columns[col].type) { case E_TABLE_MEMORY_STORE_COLUMN_TYPE_STRING: @@ -65,7 +67,9 @@ duplicate_value (ETableMemoryStore *etms, gint col, gconstpointer val) } static void -free_value (ETableMemoryStore *etms, gint col, gpointer value) +free_value (ETableMemoryStore *etms, + gint col, + gpointer value) { switch (etms->priv->columns[col].type) { case E_TABLE_MEMORY_STORE_COLUMN_TYPE_STRING: @@ -97,7 +101,9 @@ etms_column_count (ETableModel *etm) } static gpointer -etms_value_at (ETableModel *etm, gint col, gint row) +etms_value_at (ETableModel *etm, + gint col, + gint row) { ETableMemoryStore *etms = E_TABLE_MEMORY_STORE (etm); @@ -105,7 +111,10 @@ etms_value_at (ETableModel *etm, gint col, gint row) } static void -etms_set_value_at (ETableModel *etm, gint col, gint row, gconstpointer val) +etms_set_value_at (ETableModel *etm, + gint col, + gint row, + gconstpointer val) { ETableMemoryStore *etms = E_TABLE_MEMORY_STORE (etm); @@ -117,7 +126,9 @@ etms_set_value_at (ETableModel *etm, gint col, gint row, gconstpointer val) } static gboolean -etms_is_cell_editable (ETableModel *etm, gint col, gint row) +etms_is_cell_editable (ETableModel *etm, + gint col, + gint row) { ETableMemoryStore *etms = E_TABLE_MEMORY_STORE (etm); @@ -126,7 +137,9 @@ etms_is_cell_editable (ETableModel *etm, gint col, gint row) /* The default for etms_duplicate_value is to return the raw value. */ static gpointer -etms_duplicate_value (ETableModel *etm, gint col, gconstpointer value) +etms_duplicate_value (ETableModel *etm, + gint col, + gconstpointer value) { ETableMemoryStore *etms = E_TABLE_MEMORY_STORE (etm); @@ -134,7 +147,9 @@ etms_duplicate_value (ETableModel *etm, gint col, gconstpointer value) } static void -etms_free_value (ETableModel *etm, gint col, gpointer value) +etms_free_value (ETableModel *etm, + gint col, + gpointer value) { ETableMemoryStore *etms = E_TABLE_MEMORY_STORE (etm); @@ -142,7 +157,8 @@ etms_free_value (ETableModel *etm, gint col, gpointer value) } static gpointer -etms_initialize_value (ETableModel *etm, gint col) +etms_initialize_value (ETableModel *etm, + gint col) { ETableMemoryStore *etms = E_TABLE_MEMORY_STORE (etm); @@ -163,7 +179,9 @@ etms_initialize_value (ETableModel *etm, gint col) } static gboolean -etms_value_is_empty (ETableModel *etm, gint col, gconstpointer value) +etms_value_is_empty (ETableModel *etm, + gint col, + gconstpointer value) { ETableMemoryStore *etms = E_TABLE_MEMORY_STORE (etm); @@ -184,7 +202,9 @@ etms_value_is_empty (ETableModel *etm, gint col, gconstpointer value) } static gchar * -etms_value_to_string (ETableModel *etm, gint col, gconstpointer value) +etms_value_to_string (ETableModel *etm, + gint col, + gconstpointer value) { ETableMemoryStore *etms = E_TABLE_MEMORY_STORE (etm); @@ -205,7 +225,9 @@ etms_value_to_string (ETableModel *etm, gint col, gconstpointer value) } static void -etms_append_row (ETableModel *etm, ETableModel *source, gint row) +etms_append_row (ETableModel *etm, + ETableModel *source, + gint row) { ETableMemoryStore *etms = E_TABLE_MEMORY_STORE (etm); gpointer *new_data; @@ -310,7 +332,8 @@ e_table_memory_store_new (ETableMemoryStoreColumnInfo *columns) } ETableModel * -e_table_memory_store_construct (ETableMemoryStore *etms, ETableMemoryStoreColumnInfo *columns) +e_table_memory_store_construct (ETableMemoryStore *etms, + ETableMemoryStoreColumnInfo *columns) { gint i; for (i = 0; columns[i].type != E_TABLE_MEMORY_STORE_COLUMN_TYPE_TERMINATOR; i++) @@ -325,7 +348,10 @@ e_table_memory_store_construct (ETableMemoryStore *etms, ETableMemoryStoreColumn } void -e_table_memory_store_adopt_value_at (ETableMemoryStore *etms, gint col, gint row, gpointer value) +e_table_memory_store_adopt_value_at (ETableMemoryStore *etms, + gint col, + gint row, + gpointer value) { e_table_model_pre_change (E_TABLE_MODEL (etms)); @@ -336,7 +362,10 @@ e_table_memory_store_adopt_value_at (ETableMemoryStore *etms, gint col, gint row /* The size of these arrays is the number of columns. */ void -e_table_memory_store_insert_array (ETableMemoryStore *etms, gint row, gpointer *store, gpointer data) +e_table_memory_store_insert_array (ETableMemoryStore *etms, + gint row, + gpointer *store, + gpointer data) { gint row_count; gint i; @@ -357,7 +386,10 @@ e_table_memory_store_insert_array (ETableMemoryStore *etms, gint row, gpointer * } void -e_table_memory_store_insert (ETableMemoryStore *etms, gint row, gpointer data, ...) +e_table_memory_store_insert (ETableMemoryStore *etms, + gint row, + gpointer data, + ...) { gpointer *store; va_list args; @@ -377,7 +409,10 @@ e_table_memory_store_insert (ETableMemoryStore *etms, gint row, gpointer data, . } void -e_table_memory_store_insert_adopt_array (ETableMemoryStore *etms, gint row, gpointer *store, gpointer data) +e_table_memory_store_insert_adopt_array (ETableMemoryStore *etms, + gint row, + gpointer *store, + gpointer data) { gint row_count; gint i; @@ -398,7 +433,10 @@ e_table_memory_store_insert_adopt_array (ETableMemoryStore *etms, gint row, gpoi } void -e_table_memory_store_insert_adopt (ETableMemoryStore *etms, gint row, gpointer data, ...) +e_table_memory_store_insert_adopt (ETableMemoryStore *etms, + gint row, + gpointer data, + ...) { gpointer *store; va_list args; @@ -429,7 +467,10 @@ e_table_memory_store_insert_adopt (ETableMemoryStore *etms, gint row, gpointer d * */ void -e_table_memory_store_change_array (ETableMemoryStore *etms, gint row, gpointer *store, gpointer data) +e_table_memory_store_change_array (ETableMemoryStore *etms, + gint row, + gpointer *store, + gpointer data) { gint i; @@ -456,7 +497,10 @@ e_table_memory_store_change_array (ETableMemoryStore *etms, gint row, gpointer * * pass in etms->col_count args. */ void -e_table_memory_store_change (ETableMemoryStore *etms, gint row, gpointer data, ...) +e_table_memory_store_change (ETableMemoryStore *etms, + gint row, + gpointer data, + ...) { gpointer *store; va_list args; @@ -490,7 +534,10 @@ e_table_memory_store_change (ETableMemoryStore *etms, gint row, gpointer data, . * duplicate the data. */ void -e_table_memory_store_change_adopt_array (ETableMemoryStore *etms, gint row, gpointer *store, gpointer data) +e_table_memory_store_change_adopt_array (ETableMemoryStore *etms, + gint row, + gpointer *store, + gpointer data) { gint i; @@ -515,7 +562,10 @@ e_table_memory_store_change_adopt_array (ETableMemoryStore *etms, gint row, gpoi * must pass in etms->col_count args. */ void -e_table_memory_store_change_adopt (ETableMemoryStore *etms, gint row, gpointer data, ...) +e_table_memory_store_change_adopt (ETableMemoryStore *etms, + gint row, + gpointer data, + ...) { gpointer *store; va_list args; @@ -537,7 +587,8 @@ e_table_memory_store_change_adopt (ETableMemoryStore *etms, gint row, gpointer d } void -e_table_memory_store_remove (ETableMemoryStore *etms, gint row) +e_table_memory_store_remove (ETableMemoryStore *etms, + gint row) { ETableModel *model; gint column_count, row_count; diff --git a/widgets/table/e-table-memory.c b/widgets/table/e-table-memory.c index cc62a6d0b5..28f10264f8 100644 --- a/widgets/table/e-table-memory.c +++ b/widgets/table/e-table-memory.c @@ -113,7 +113,8 @@ e_table_memory_new (void) * Return value: **/ gpointer -e_table_memory_get_data (ETableMemory *etmm, gint row) +e_table_memory_get_data (ETableMemory *etmm, + gint row) { g_return_val_if_fail (row >= 0, NULL); g_return_val_if_fail (row < etmm->priv->num_rows, NULL); @@ -130,7 +131,9 @@ e_table_memory_get_data (ETableMemory *etmm, gint row) * **/ void -e_table_memory_set_data (ETableMemory *etmm, gint row, gpointer data) +e_table_memory_set_data (ETableMemory *etmm, + gint row, + gpointer data) { g_return_if_fail (row >= 0); g_return_if_fail (row < etmm->priv->num_rows); @@ -151,8 +154,8 @@ e_table_memory_set_data (ETableMemory *etmm, gint row, gpointer data) **/ void e_table_memory_insert (ETableMemory *etmm, - gint row, - gpointer data) + gint row, + gpointer data) { g_return_if_fail (row >= -1); g_return_if_fail (row <= etmm->priv->num_rows); @@ -185,7 +188,8 @@ e_table_memory_insert (ETableMemory *etmm, * Return value: **/ gpointer -e_table_memory_remove (ETableMemory *etmm, gint row) +e_table_memory_remove (ETableMemory *etmm, + gint row) { gpointer ret; diff --git a/widgets/table/e-table-model.c b/widgets/table/e-table-model.c index 77b462ec2a..6f44379858 100644 --- a/widgets/table/e-table-model.c +++ b/widgets/table/e-table-model.c @@ -90,7 +90,9 @@ e_table_model_row_count (ETableModel *e_table_model) * */ void -e_table_model_append_row (ETableModel *e_table_model, ETableModel *source, gint row) +e_table_model_append_row (ETableModel *e_table_model, + ETableModel *source, + gint row) { g_return_if_fail (e_table_model != NULL); g_return_if_fail (E_IS_TABLE_MODEL (e_table_model)); @@ -119,7 +121,9 @@ e_table_model_append_row (ETableModel *e_table_model, ETableModel *source, gint * rows_inserted and no_change don't affect any data in this way. **/ gpointer -e_table_model_value_at (ETableModel *e_table_model, gint col, gint row) +e_table_model_value_at (ETableModel *e_table_model, + gint col, + gint row) { g_return_val_if_fail (e_table_model != NULL, NULL); g_return_val_if_fail (E_IS_TABLE_MODEL (e_table_model), NULL); @@ -143,7 +147,10 @@ e_table_model_value_at (ETableModel *e_table_model, gint col, gint row) * be a pointer to a set of data, or a datum that fits inside a gpointer . */ void -e_table_model_set_value_at (ETableModel *e_table_model, gint col, gint row, gconstpointer value) +e_table_model_set_value_at (ETableModel *e_table_model, + gint col, + gint row, + gconstpointer value) { g_return_if_fail (e_table_model != NULL); g_return_if_fail (E_IS_TABLE_MODEL (e_table_model)); @@ -161,7 +168,9 @@ e_table_model_set_value_at (ETableModel *e_table_model, gint col, gint row, gcon * edited, %FALSE otherwise */ gboolean -e_table_model_is_cell_editable (ETableModel *e_table_model, gint col, gint row) +e_table_model_is_cell_editable (ETableModel *e_table_model, + gint col, + gint row) { g_return_val_if_fail (e_table_model != NULL, FALSE); g_return_val_if_fail (E_IS_TABLE_MODEL (e_table_model), FALSE); @@ -170,7 +179,9 @@ e_table_model_is_cell_editable (ETableModel *e_table_model, gint col, gint row) } gpointer -e_table_model_duplicate_value (ETableModel *e_table_model, gint col, gconstpointer value) +e_table_model_duplicate_value (ETableModel *e_table_model, + gint col, + gconstpointer value) { g_return_val_if_fail (e_table_model != NULL, NULL); g_return_val_if_fail (E_IS_TABLE_MODEL (e_table_model), NULL); @@ -182,7 +193,9 @@ e_table_model_duplicate_value (ETableModel *e_table_model, gint col, gconstpoint } void -e_table_model_free_value (ETableModel *e_table_model, gint col, gpointer value) +e_table_model_free_value (ETableModel *e_table_model, + gint col, + gpointer value) { g_return_if_fail (e_table_model != NULL); g_return_if_fail (E_IS_TABLE_MODEL (e_table_model)); @@ -204,7 +217,8 @@ e_table_model_has_save_id (ETableModel *e_table_model) } gchar * -e_table_model_get_save_id (ETableModel *e_table_model, gint row) +e_table_model_get_save_id (ETableModel *e_table_model, + gint row) { g_return_val_if_fail (e_table_model != NULL, NULL); g_return_val_if_fail (E_IS_TABLE_MODEL (e_table_model), NULL); @@ -228,7 +242,8 @@ e_table_model_has_change_pending (ETableModel *e_table_model) } gpointer -e_table_model_initialize_value (ETableModel *e_table_model, gint col) +e_table_model_initialize_value (ETableModel *e_table_model, + gint col) { g_return_val_if_fail (e_table_model != NULL, NULL); g_return_val_if_fail (E_IS_TABLE_MODEL (e_table_model), NULL); @@ -240,7 +255,9 @@ e_table_model_initialize_value (ETableModel *e_table_model, gint col) } gboolean -e_table_model_value_is_empty (ETableModel *e_table_model, gint col, gconstpointer value) +e_table_model_value_is_empty (ETableModel *e_table_model, + gint col, + gconstpointer value) { g_return_val_if_fail (e_table_model != NULL, FALSE); g_return_val_if_fail (E_IS_TABLE_MODEL (e_table_model), FALSE); @@ -252,7 +269,9 @@ e_table_model_value_is_empty (ETableModel *e_table_model, gint col, gconstpointe } gchar * -e_table_model_value_to_string (ETableModel *e_table_model, gint col, gconstpointer value) +e_table_model_value_to_string (ETableModel *e_table_model, + gint col, + gconstpointer value) { g_return_val_if_fail (e_table_model != NULL, NULL); g_return_val_if_fail (E_IS_TABLE_MODEL (e_table_model), NULL); @@ -462,7 +481,8 @@ e_table_model_changed (ETableModel *e_table_model) * object */ void -e_table_model_row_changed (ETableModel *e_table_model, gint row) +e_table_model_row_changed (ETableModel *e_table_model, + gint row) { g_return_if_fail (e_table_model != NULL); g_return_if_fail (E_IS_TABLE_MODEL (e_table_model)); @@ -490,7 +510,9 @@ e_table_model_row_changed (ETableModel *e_table_model, gint row) * object */ void -e_table_model_cell_changed (ETableModel *e_table_model, gint col, gint row) +e_table_model_cell_changed (ETableModel *e_table_model, + gint col, + gint row) { g_return_if_fail (e_table_model != NULL); g_return_if_fail (E_IS_TABLE_MODEL (e_table_model)); @@ -518,7 +540,9 @@ e_table_model_cell_changed (ETableModel *e_table_model, gint col, gint row) * @e_table_model object */ void -e_table_model_rows_inserted (ETableModel *e_table_model, gint row, gint count) +e_table_model_rows_inserted (ETableModel *e_table_model, + gint row, + gint count) { g_return_if_fail (e_table_model != NULL); g_return_if_fail (E_IS_TABLE_MODEL (e_table_model)); @@ -544,7 +568,8 @@ e_table_model_rows_inserted (ETableModel *e_table_model, gint row, gint count) * the "model_rows_inserted" signal on the @e_table_model object */ void -e_table_model_row_inserted (ETableModel *e_table_model, gint row) +e_table_model_row_inserted (ETableModel *e_table_model, + gint row) { e_table_model_rows_inserted (e_table_model, row, 1); } @@ -561,7 +586,9 @@ e_table_model_row_inserted (ETableModel *e_table_model, gint row) * @e_table_model object */ void -e_table_model_rows_deleted (ETableModel *e_table_model, gint row, gint count) +e_table_model_rows_deleted (ETableModel *e_table_model, + gint row, + gint count) { g_return_if_fail (e_table_model != NULL); g_return_if_fail (E_IS_TABLE_MODEL (e_table_model)); @@ -587,7 +614,8 @@ e_table_model_rows_deleted (ETableModel *e_table_model, gint row, gint count) * the "model_rows_deleted" signal on the @e_table_model object */ void -e_table_model_row_deleted (ETableModel *e_table_model, gint row) +e_table_model_row_deleted (ETableModel *e_table_model, + gint row) { e_table_model_rows_deleted (e_table_model, row, 1); } diff --git a/widgets/table/e-table-one.c b/widgets/table/e-table-one.c index 7683b935a4..ff38d94131 100644 --- a/widgets/table/e-table-one.c +++ b/widgets/table/e-table-one.c @@ -49,7 +49,9 @@ one_row_count (ETableModel *etm) } static gpointer -one_value_at (ETableModel *etm, gint col, gint row) +one_value_at (ETableModel *etm, + gint col, + gint row) { ETableOne *one = E_TABLE_ONE (etm); @@ -60,7 +62,10 @@ one_value_at (ETableModel *etm, gint col, gint row) } static void -one_set_value_at (ETableModel *etm, gint col, gint row, gconstpointer val) +one_set_value_at (ETableModel *etm, + gint col, + gint row, + gconstpointer val) { ETableOne *one = E_TABLE_ONE (etm); @@ -71,7 +76,9 @@ one_set_value_at (ETableModel *etm, gint col, gint row, gconstpointer val) } static gboolean -one_is_cell_editable (ETableModel *etm, gint col, gint row) +one_is_cell_editable (ETableModel *etm, + gint col, + gint row) { ETableOne *one = E_TABLE_ONE (etm); @@ -83,7 +90,9 @@ one_is_cell_editable (ETableModel *etm, gint col, gint row) /* The default for one_duplicate_value is to return the raw value. */ static gpointer -one_duplicate_value (ETableModel *etm, gint col, gconstpointer value) +one_duplicate_value (ETableModel *etm, + gint col, + gconstpointer value) { ETableOne *one = E_TABLE_ONE (etm); @@ -94,7 +103,9 @@ one_duplicate_value (ETableModel *etm, gint col, gconstpointer value) } static void -one_free_value (ETableModel *etm, gint col, gpointer value) +one_free_value (ETableModel *etm, + gint col, + gpointer value) { ETableOne *one = E_TABLE_ONE (etm); @@ -103,7 +114,8 @@ one_free_value (ETableModel *etm, gint col, gpointer value) } static gpointer -one_initialize_value (ETableModel *etm, gint col) +one_initialize_value (ETableModel *etm, + gint col) { ETableOne *one = E_TABLE_ONE (etm); @@ -114,7 +126,9 @@ one_initialize_value (ETableModel *etm, gint col) } static gboolean -one_value_is_empty (ETableModel *etm, gint col, gconstpointer value) +one_value_is_empty (ETableModel *etm, + gint col, + gconstpointer value) { ETableOne *one = E_TABLE_ONE (etm); @@ -125,7 +139,9 @@ one_value_is_empty (ETableModel *etm, gint col, gconstpointer value) } static gchar * -one_value_to_string (ETableModel *etm, gint col, gconstpointer value) +one_value_to_string (ETableModel *etm, + gint col, + gconstpointer value) { ETableOne *one = E_TABLE_ONE (etm); diff --git a/widgets/table/e-table-search.c b/widgets/table/e-table-search.c index 955547fd7f..99f282c76f 100644 --- a/widgets/table/e-table-search.c +++ b/widgets/table/e-table-search.c @@ -32,8 +32,6 @@ #define d(x) -d (static gint depth = 0) - struct _ETableSearchPrivate { guint timeout_id; @@ -49,6 +47,8 @@ enum { LAST_SIGNAL }; +d (static gint depth = 0) + static guint e_table_search_signals[LAST_SIGNAL] = { 0, }; static gboolean @@ -174,7 +174,8 @@ e_table_search_new (void) * Returns: the number of columns in the table search. */ void -e_table_search_input_character (ETableSearch *ets, gunichar character) +e_table_search_input_character (ETableSearch *ets, + gunichar character) { gchar character_utf8[7]; gchar *temp_string; diff --git a/widgets/table/e-table-selection-model.c b/widgets/table/e-table-selection-model.c index b8f33c639e..0320663e8e 100644 --- a/widgets/table/e-table-selection-model.c +++ b/widgets/table/e-table-selection-model.c @@ -44,7 +44,8 @@ enum { }; static void -save_to_hash (gint model_row, gpointer closure) +save_to_hash (gint model_row, + gpointer closure) { ETableSelectionModel *etsm = closure; const gchar *key = e_table_model_get_save_id (etsm->model, model_row); @@ -65,7 +66,8 @@ free_hash (ETableSelectionModel *etsm) } static void -model_pre_change (ETableModel *etm, ETableSelectionModel *etsm) +model_pre_change (ETableModel *etm, + ETableSelectionModel *etsm) { free_hash (etsm); @@ -131,7 +133,8 @@ model_changed_idle (ETableSelectionModel *etsm) } static void -model_changed (ETableModel *etm, ETableSelectionModel *etsm) +model_changed (ETableModel *etm, + ETableSelectionModel *etsm) { e_selection_model_clear (E_SELECTION_MODEL (etsm)); if (!etsm->model_changed_idle_id && etm && e_table_model_has_save_id (etm)) { @@ -140,27 +143,38 @@ model_changed (ETableModel *etm, ETableSelectionModel *etsm) } static void -model_row_changed (ETableModel *etm, gint row, ETableSelectionModel *etsm) +model_row_changed (ETableModel *etm, + gint row, + ETableSelectionModel *etsm) { free_hash (etsm); } static void -model_cell_changed (ETableModel *etm, gint col, gint row, ETableSelectionModel *etsm) +model_cell_changed (ETableModel *etm, + gint col, + gint row, + ETableSelectionModel *etsm) { free_hash (etsm); } #if 1 static void -model_rows_inserted (ETableModel *etm, gint row, gint count, ETableSelectionModel *etsm) +model_rows_inserted (ETableModel *etm, + gint row, + gint count, + ETableSelectionModel *etsm) { e_selection_model_array_insert_rows (E_SELECTION_MODEL_ARRAY (etsm), row, count); free_hash (etsm); } static void -model_rows_deleted (ETableModel *etm, gint row, gint count, ETableSelectionModel *etsm) +model_rows_deleted (ETableModel *etm, + gint row, + gint count, + ETableSelectionModel *etsm) { e_selection_model_array_delete_rows (E_SELECTION_MODEL_ARRAY (etsm), row, count); free_hash (etsm); @@ -169,36 +183,49 @@ model_rows_deleted (ETableModel *etm, gint row, gint count, ETableSelectionModel #else static void -model_rows_inserted (ETableModel *etm, gint row, gint count, ETableSelectionModel *etsm) +model_rows_inserted (ETableModel *etm, + gint row, + gint count, + ETableSelectionModel *etsm) { model_changed (etm, etsm); } static void -model_rows_deleted (ETableModel *etm, gint row, gint count, ETableSelectionModel *etsm) +model_rows_deleted (ETableModel *etm, + gint row, + gint count, + ETableSelectionModel *etsm) { model_changed (etm, etsm); } #endif inline static void -add_model (ETableSelectionModel *etsm, ETableModel *model) +add_model (ETableSelectionModel *etsm, + ETableModel *model) { etsm->model = model; if (model) { g_object_ref (model); - etsm->model_pre_change_id = g_signal_connect(G_OBJECT(model), "model_pre_change", - G_CALLBACK (model_pre_change), etsm); - etsm->model_changed_id = g_signal_connect(G_OBJECT(model), "model_changed", - G_CALLBACK (model_changed), etsm); - etsm->model_row_changed_id = g_signal_connect(G_OBJECT(model), "model_row_changed", - G_CALLBACK (model_row_changed), etsm); - etsm->model_cell_changed_id = g_signal_connect(G_OBJECT(model), "model_cell_changed", - G_CALLBACK (model_cell_changed), etsm); - etsm->model_rows_inserted_id = g_signal_connect(G_OBJECT(model), "model_rows_inserted", - G_CALLBACK (model_rows_inserted), etsm); - etsm->model_rows_deleted_id = g_signal_connect(G_OBJECT(model), "model_rows_deleted", - G_CALLBACK (model_rows_deleted), etsm); + etsm->model_pre_change_id = g_signal_connect ( + model, "model_pre_change", + G_CALLBACK (model_pre_change), etsm); + etsm->model_changed_id = g_signal_connect ( + model, "model_changed", + G_CALLBACK (model_changed), etsm); + etsm->model_row_changed_id = g_signal_connect ( + model, "model_row_changed", + G_CALLBACK (model_row_changed), etsm); + etsm->model_cell_changed_id = g_signal_connect ( + model, "model_cell_changed", + G_CALLBACK (model_cell_changed), etsm); + etsm->model_rows_inserted_id = g_signal_connect ( + model, "model_rows_inserted", + G_CALLBACK (model_rows_inserted), etsm); + etsm->model_rows_deleted_id = g_signal_connect ( + model, "model_rows_deleted", + G_CALLBACK (model_rows_deleted), etsm); } e_selection_model_array_confirm_row_count (E_SELECTION_MODEL_ARRAY (etsm)); } @@ -244,11 +271,14 @@ etsm_dispose (GObject *object) } static void -etsm_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) +etsm_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) { ETableSelectionModel *etsm = E_TABLE_SELECTION_MODEL (object); - switch (prop_id) { + switch (property_id) { case PROP_MODEL: g_value_set_object (value, etsm->model); break; @@ -259,11 +289,14 @@ etsm_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *ps } static void -etsm_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) +etsm_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) { ETableSelectionModel *etsm = E_TABLE_SELECTION_MODEL (object); - switch (prop_id) { + switch (property_id) { case PROP_MODEL: drop_model (etsm); add_model (etsm, g_value_get_object (value) ? E_TABLE_MODEL (g_value_get_object (value)) : NULL); diff --git a/widgets/table/e-table-selection-model.h b/widgets/table/e-table-selection-model.h index f144980f03..02309c047a 100644 --- a/widgets/table/e-table-selection-model.h +++ b/widgets/table/e-table-selection-model.h @@ -35,7 +35,7 @@ (G_TYPE_CHECK_INSTANCE_CAST \ ((obj), E_TYPE_TABLE_SELECTION_MODEL, ETableSelectionModel)) #define E_TABLE_SELECTION_MODEL_CLASS(cls) \ - (G_TYPE-CHECK_CLASS_CAST \ + (G_TYPE - CHECK_CLASS_CAST \ ((cls), E_TYPE_TABLE_SELECTION_MODEL, ETableSelectionModelClass)) #define E_IS_TABLE_SELECTION_MODEL(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE \ diff --git a/widgets/table/e-table-sort-info.c b/widgets/table/e-table-sort-info.c index b488dbce06..cac2586b8a 100644 --- a/widgets/table/e-table-sort-info.c +++ b/widgets/table/e-table-sort-info.c @@ -141,7 +141,7 @@ e_table_sort_info_group_info_changed (ETableSortInfo *info) * trigger any signals that might have been queued. */ void -e_table_sort_info_freeze (ETableSortInfo *info) +e_table_sort_info_freeze (ETableSortInfo *info) { info->frozen++; } @@ -158,7 +158,7 @@ e_table_sort_info_freeze (ETableSortInfo *info) * this object. */ void -e_table_sort_info_thaw (ETableSortInfo *info) +e_table_sort_info_thaw (ETableSortInfo *info) { info->frozen--; if (info->frozen != 0) @@ -190,7 +190,8 @@ e_table_sort_info_grouping_get_count (ETableSortInfo *info) } static void -e_table_sort_info_grouping_real_truncate (ETableSortInfo *info, gint length) +e_table_sort_info_grouping_real_truncate (ETableSortInfo *info, + gint length) { if (length < info->group_count) { info->group_count = length; @@ -210,7 +211,8 @@ e_table_sort_info_grouping_real_truncate (ETableSortInfo *info, gint length) * criteria in the object. */ void -e_table_sort_info_grouping_truncate (ETableSortInfo *info, gint length) +e_table_sort_info_grouping_truncate (ETableSortInfo *info, + gint length) { e_table_sort_info_grouping_real_truncate (info, length); e_table_sort_info_group_info_changed (info); @@ -224,7 +226,8 @@ e_table_sort_info_grouping_truncate (ETableSortInfo *info, gint length) * Returns: the description of the @n-th grouping criteria in the @info object. */ ETableSortColumn -e_table_sort_info_grouping_get_nth (ETableSortInfo *info, gint n) +e_table_sort_info_grouping_get_nth (ETableSortInfo *info, + gint n) { if (info->can_group && n < info->group_count) { return info->groupings[n]; @@ -244,7 +247,9 @@ e_table_sort_info_grouping_get_nth (ETableSortInfo *info, gint n) * whether it is ascending or descending). */ void -e_table_sort_info_grouping_set_nth (ETableSortInfo *info, gint n, ETableSortColumn column) +e_table_sort_info_grouping_set_nth (ETableSortInfo *info, + gint n, + ETableSortColumn column) { if (n >= info->group_count) { e_table_sort_info_grouping_real_truncate (info, n + 1); @@ -266,7 +271,8 @@ e_table_sort_info_sorting_get_count (ETableSortInfo *info) } static void -e_table_sort_info_sorting_real_truncate (ETableSortInfo *info, gint length) +e_table_sort_info_sorting_real_truncate (ETableSortInfo *info, + gint length) { if (length < info->sort_count) { info->sort_count = length; @@ -286,7 +292,8 @@ e_table_sort_info_sorting_real_truncate (ETableSortInfo *info, gint length) * criteria in the object. */ void -e_table_sort_info_sorting_truncate (ETableSortInfo *info, gint length) +e_table_sort_info_sorting_truncate (ETableSortInfo *info, + gint length) { e_table_sort_info_sorting_real_truncate (info, length); e_table_sort_info_sort_info_changed (info); @@ -300,7 +307,8 @@ e_table_sort_info_sorting_truncate (ETableSortInfo *info, gint length) * Returns: the description of the @n-th grouping criteria in the @info object. */ ETableSortColumn -e_table_sort_info_sorting_get_nth (ETableSortInfo *info, gint n) +e_table_sort_info_sorting_get_nth (ETableSortInfo *info, + gint n) { if (n < info->sort_count) { return info->sortings[n]; @@ -320,7 +328,9 @@ e_table_sort_info_sorting_get_nth (ETableSortInfo *info, gint n) * column number and whether it is ascending or descending). */ void -e_table_sort_info_sorting_set_nth (ETableSortInfo *info, gint n, ETableSortColumn column) +e_table_sort_info_sorting_set_nth (ETableSortInfo *info, + gint n, + ETableSortColumn column) { if (n >= info->sort_count) { e_table_sort_info_sorting_real_truncate (info, n + 1); @@ -356,8 +366,8 @@ e_table_sort_info_new (void) */ void e_table_sort_info_load_from_node (ETableSortInfo *info, - xmlNode *node, - gdouble state_version) + xmlNode *node, + gdouble state_version) { gint i; xmlNode *grouping; @@ -412,7 +422,7 @@ e_table_sort_info_load_from_node (ETableSortInfo *info, */ xmlNode * e_table_sort_info_save_to_node (ETableSortInfo *info, - xmlNode *parent) + xmlNode *parent) { xmlNode *grouping; gint i; @@ -461,14 +471,14 @@ e_table_sort_info_duplicate (ETableSortInfo *info) } void -e_table_sort_info_set_can_group (ETableSortInfo *info, - gboolean can_group) +e_table_sort_info_set_can_group (ETableSortInfo *info, + gboolean can_group) { info->can_group = can_group; } gboolean -e_table_sort_info_get_can_group (ETableSortInfo *info) +e_table_sort_info_get_can_group (ETableSortInfo *info) { return info->can_group; } diff --git a/widgets/table/e-table-sorted-variable.c b/widgets/table/e-table-sorted-variable.c index 0ed35c95a6..7792795477 100644 --- a/widgets/table/e-table-sorted-variable.c +++ b/widgets/table/e-table-sorted-variable.c @@ -122,8 +122,8 @@ etsv_insert_idle (ETableSortedVariable *etsv) } static void -etsv_add (ETableSubsetVariable *etssv, - gint row) +etsv_add (ETableSubsetVariable *etssv, + gint row) { ETableModel *etm = E_TABLE_MODEL (etssv); ETableSubset *etss = E_TABLE_SUBSET (etssv); @@ -139,7 +139,7 @@ etsv_add (ETableSubsetVariable *etssv, i = etss->n_map; if (etsv->sort_idle_id == 0) { /* this is to see if we're inserting a lot of things between idle loops. - If we are, we're busy, its faster to just append and perform a full sort later */ + * If we are, we're busy, its faster to just append and perform a full sort later */ etsv->insert_count++; if (etsv->insert_count > ETSV_INSERT_MAX) { /* schedule a sort, and append instead */ @@ -160,7 +160,7 @@ etsv_add (ETableSubsetVariable *etssv, } static void -etsv_add_all (ETableSubsetVariable *etssv) +etsv_add_all (ETableSubsetVariable *etssv) { ETableModel *etm = E_TABLE_MODEL (etssv); ETableSubset *etss = E_TABLE_SUBSET (etssv); @@ -187,7 +187,9 @@ etsv_add_all (ETableSubsetVariable *etssv) } ETableModel * -e_table_sorted_variable_new (ETableModel *source, ETableHeader *full_header, ETableSortInfo *sort_info) +e_table_sorted_variable_new (ETableModel *source, + ETableHeader *full_header, + ETableSortInfo *sort_info) { ETableSortedVariable *etsv = g_object_new (E_TYPE_TABLE_SORTED_VARIABLE, NULL); ETableSubsetVariable *etssv = E_TABLE_SUBSET_VARIABLE (etsv); @@ -202,14 +204,16 @@ e_table_sorted_variable_new (ETableModel *source, ETableHeader *full_header, ETa etsv->full_header = full_header; g_object_ref (etsv->full_header); - etsv->sort_info_changed_id = g_signal_connect (G_OBJECT (sort_info), "sort_info_changed", - G_CALLBACK (etsv_sort_info_changed), etsv); + etsv->sort_info_changed_id = g_signal_connect ( + sort_info, "sort_info_changed", + G_CALLBACK (etsv_sort_info_changed), etsv); return E_TABLE_MODEL (etsv); } static void -etsv_sort_info_changed (ETableSortInfo *info, ETableSortedVariable *etsv) +etsv_sort_info_changed (ETableSortInfo *info, + ETableSortedVariable *etsv) { etsv_sort (etsv); } diff --git a/widgets/table/e-table-sorted.c b/widgets/table/e-table-sorted.c index 61ea10c082..fe5f644dbf 100644 --- a/widgets/table/e-table-sorted.c +++ b/widgets/table/e-table-sorted.c @@ -125,7 +125,9 @@ ets_insert_idle (ETableSorted *ets) } ETableModel * -e_table_sorted_new (ETableModel *source, ETableHeader *full_header, ETableSortInfo *sort_info) +e_table_sorted_new (ETableModel *source, + ETableHeader *full_header, + ETableSortInfo *sort_info) { ETableSorted *ets = g_object_new (E_TYPE_TABLE_SORTED, NULL); ETableSubset *etss = E_TABLE_SUBSET (ets); @@ -145,20 +147,23 @@ e_table_sorted_new (ETableModel *source, ETableHeader *full_header, ETableSortIn ets_proxy_model_changed (etss, source); - ets->sort_info_changed_id = g_signal_connect (G_OBJECT (sort_info), "sort_info_changed", - G_CALLBACK (ets_sort_info_changed), ets); + ets->sort_info_changed_id = g_signal_connect ( + sort_info, "sort_info_changed", + G_CALLBACK (ets_sort_info_changed), ets); return E_TABLE_MODEL (ets); } static void -ets_sort_info_changed (ETableSortInfo *info, ETableSorted *ets) +ets_sort_info_changed (ETableSortInfo *info, + ETableSorted *ets) { ets_sort (ets); } static void -ets_proxy_model_changed (ETableSubset *subset, ETableModel *source) +ets_proxy_model_changed (ETableSubset *subset, + ETableModel *source) { gint rows, i; @@ -179,7 +184,9 @@ ets_proxy_model_changed (ETableSubset *subset, ETableModel *source) } static void -ets_proxy_model_row_changed (ETableSubset *subset, ETableModel *source, gint row) +ets_proxy_model_row_changed (ETableSubset *subset, + ETableModel *source, + gint row) { if (!E_TABLE_SORTED (subset)->sort_idle_id) E_TABLE_SORTED (subset)->sort_idle_id = g_idle_add_full (50, (GSourceFunc) ets_sort_idle, subset, NULL); @@ -189,7 +196,10 @@ ets_proxy_model_row_changed (ETableSubset *subset, ETableModel *source, gint row } static void -ets_proxy_model_cell_changed (ETableSubset *subset, ETableModel *source, gint col, gint row) +ets_proxy_model_cell_changed (ETableSubset *subset, + ETableModel *source, + gint col, + gint row) { ETableSorted *ets = E_TABLE_SORTED (subset); if (e_table_sorting_utils_affects_sort (ets->sort_info, ets->full_header, col)) @@ -199,7 +209,10 @@ ets_proxy_model_cell_changed (ETableSubset *subset, ETableModel *source, gint co } static void -ets_proxy_model_rows_inserted (ETableSubset *etss, ETableModel *source, gint row, gint count) +ets_proxy_model_rows_inserted (ETableSubset *etss, + ETableModel *source, + gint row, + gint count) { ETableModel *etm = E_TABLE_MODEL (etss); ETableSorted *ets = E_TABLE_SORTED (etss); @@ -228,7 +241,7 @@ ets_proxy_model_rows_inserted (ETableSubset *etss, ETableModel *source, gint row i = etss->n_map; if (ets->sort_idle_id == 0) { /* this is to see if we're inserting a lot of things between idle loops. - If we are, we're busy, its faster to just append and perform a full sort later */ + * If we are, we're busy, its faster to just append and perform a full sort later */ ets->insert_count++; if (ets->insert_count > ETS_INSERT_MAX) { /* schedule a sort, and append instead */ @@ -259,7 +272,10 @@ ets_proxy_model_rows_inserted (ETableSubset *etss, ETableModel *source, gint row } static void -ets_proxy_model_rows_deleted (ETableSubset *etss, ETableModel *source, gint row, gint count) +ets_proxy_model_rows_deleted (ETableSubset *etss, + ETableModel *source, + gint row, + gint count) { ETableModel *etm = E_TABLE_MODEL (etss); gint i; diff --git a/widgets/table/e-table-sorter.c b/widgets/table/e-table-sorter.c index d74dbd3d04..418ce3a5e8 100644 --- a/widgets/table/e-table-sorter.c +++ b/widgets/table/e-table-sorter.c @@ -115,11 +115,14 @@ ets_dispose (GObject *object) } static void -ets_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) +ets_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) { ETableSorter *ets = E_TABLE_SORTER (object); - switch (prop_id) { + switch (property_id) { case PROP_SORT_INFO: if (ets->sort_info) { if (ets->sort_info_changed_id) @@ -144,10 +147,13 @@ ets_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpe } static void -ets_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) +ets_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) { ETableSorter *ets = E_TABLE_SORTER (object); - switch (prop_id) { + switch (property_id) { case PROP_SORT_INFO: g_value_set_object (value, ets->sort_info); break; @@ -197,7 +203,9 @@ ets_init (ETableSorter *ets) } ETableSorter * -e_table_sorter_new (ETableModel *source, ETableHeader *full_header, ETableSortInfo *sort_info) +e_table_sorter_new (ETableModel *source, + ETableHeader *full_header, + ETableSortInfo *sort_info) { ETableSorter *ets = g_object_new (E_TYPE_TABLE_SORTER, NULL); @@ -227,37 +235,50 @@ e_table_sorter_new (ETableModel *source, ETableHeader *full_header, ETableSortIn } static void -ets_model_changed (ETableModel *etm, ETableSorter *ets) +ets_model_changed (ETableModel *etm, + ETableSorter *ets) { ets_clean (ets); } static void -ets_model_row_changed (ETableModel *etm, gint row, ETableSorter *ets) +ets_model_row_changed (ETableModel *etm, + gint row, + ETableSorter *ets) { ets_clean (ets); } static void -ets_model_cell_changed (ETableModel *etm, gint col, gint row, ETableSorter *ets) +ets_model_cell_changed (ETableModel *etm, + gint col, + gint row, + ETableSorter *ets) { ets_clean (ets); } static void -ets_model_rows_inserted (ETableModel *etm, gint row, gint count, ETableSorter *ets) +ets_model_rows_inserted (ETableModel *etm, + gint row, + gint count, + ETableSorter *ets) { ets_clean (ets); } static void -ets_model_rows_deleted (ETableModel *etm, gint row, gint count, ETableSorter *ets) +ets_model_rows_deleted (ETableModel *etm, + gint row, + gint count, + ETableSorter *ets) { ets_clean (ets); } static void -ets_sort_info_changed (ETableSortInfo *info, ETableSorter *ets) +ets_sort_info_changed (ETableSortInfo *info, + ETableSorter *ets) { d(g_print ("sort info changed\n")); ets_clean (ets); @@ -275,7 +296,9 @@ struct qsort_data { /* FIXME: Make it not cache the second and later columns (as if anyone cares.) */ static gint -qsort_callback (gconstpointer data1, gconstpointer data2, gpointer user_data) +qsort_callback (gconstpointer data1, + gconstpointer data2, + gpointer user_data) { struct qsort_data *qd = (struct qsort_data *) user_data; gint row1 = *(gint *) data1; @@ -390,7 +413,8 @@ ets_backsort (ETableSorter *ets) } static gint -ets_model_to_sorted (ESorter *es, gint row) +ets_model_to_sorted (ESorter *es, + gint row) { ETableSorter *ets = E_TABLE_SORTER (es); gint rows = e_table_model_row_count (ets->source); @@ -408,7 +432,8 @@ ets_model_to_sorted (ESorter *es, gint row) } static gint -ets_sorted_to_model (ESorter *es, gint row) +ets_sorted_to_model (ESorter *es, + gint row) { ETableSorter *ets = E_TABLE_SORTER (es); gint rows = e_table_model_row_count (ets->source); @@ -426,7 +451,9 @@ ets_sorted_to_model (ESorter *es, gint row) } static void -ets_get_model_to_sorted_array (ESorter *es, gint **array, gint *count) +ets_get_model_to_sorted_array (ESorter *es, + gint **array, + gint *count) { ETableSorter *ets = E_TABLE_SORTER (es); if (array || count) { @@ -440,7 +467,9 @@ ets_get_model_to_sorted_array (ESorter *es, gint **array, gint *count) } static void -ets_get_sorted_to_model_array (ESorter *es, gint **array, gint *count) +ets_get_sorted_to_model_array (ESorter *es, + gint **array, + gint *count) { ETableSorter *ets = E_TABLE_SORTER (es); if (array || count) { diff --git a/widgets/table/e-table-sorting-utils.c b/widgets/table/e-table-sorting-utils.c index e654f94b9c..a94c45f7b0 100644 --- a/widgets/table/e-table-sorting-utils.c +++ b/widgets/table/e-table-sorting-utils.c @@ -35,7 +35,12 @@ /* This takes source rows. */ static gint -etsu_compare (ETableModel *source, ETableSortInfo *sort_info, ETableHeader *full_header, gint row1, gint row2, gpointer cmp_cache) +etsu_compare (ETableModel *source, + ETableSortInfo *sort_info, + ETableHeader *full_header, + gint row1, + gint row2, + gpointer cmp_cache) { gint j; gint sort_count = e_table_sort_info_sorting_get_count (sort_info); @@ -84,7 +89,9 @@ typedef struct { /* FIXME: Make it not cache the second and later columns (as if anyone cares.) */ static gint -e_sort_callback (gconstpointer data1, gconstpointer data2, gpointer user_data) +e_sort_callback (gconstpointer data1, + gconstpointer data2, + gpointer user_data) { gint row1 = *(gint *) data1; gint row2 = *(gint *) data2; @@ -111,7 +118,11 @@ e_sort_callback (gconstpointer data1, gconstpointer data2, gpointer user_data) } void -e_table_sorting_utils_sort (ETableModel *source, ETableSortInfo *sort_info, ETableHeader *full_header, gint *map_table, gint rows) +e_table_sorting_utils_sort (ETableModel *source, + ETableSortInfo *sort_info, + ETableHeader *full_header, + gint *map_table, + gint rows) { gint total_rows; gint i; @@ -158,9 +169,9 @@ e_table_sorting_utils_sort (ETableModel *source, ETableSortInfo *sort_info, ETab } gboolean -e_table_sorting_utils_affects_sort (ETableSortInfo *sort_info, - ETableHeader *full_header, - gint col) +e_table_sorting_utils_affects_sort (ETableSortInfo *sort_info, + ETableHeader *full_header, + gint col) { gint j; gint cols; @@ -186,7 +197,12 @@ e_table_sorting_utils_affects_sort (ETableSortInfo *sort_info, /* FIXME: This could be done in time log n instead of time n with a binary search. */ gint -e_table_sorting_utils_insert (ETableModel *source, ETableSortInfo *sort_info, ETableHeader *full_header, gint *map_table, gint rows, gint row) +e_table_sorting_utils_insert (ETableModel *source, + ETableSortInfo *sort_info, + ETableHeader *full_header, + gint *map_table, + gint rows, + gint row) { gint i; gpointer cmp_cache = e_table_sorting_utils_create_cmp_cache (); @@ -203,7 +219,12 @@ e_table_sorting_utils_insert (ETableModel *source, ETableSortInfo *sort_info, ET /* FIXME: This could be done in time log n instead of time n with a binary search. */ gint -e_table_sorting_utils_check_position (ETableModel *source, ETableSortInfo *sort_info, ETableHeader *full_header, gint *map_table, gint rows, gint view_row) +e_table_sorting_utils_check_position (ETableModel *source, + ETableSortInfo *sort_info, + ETableHeader *full_header, + gint *map_table, + gint rows, + gint view_row) { gint i; gint row; @@ -231,7 +252,12 @@ e_table_sorting_utils_check_position (ETableModel *source, ETableSortInfo *sort_ /* This takes source rows. */ static gint -etsu_tree_compare (ETreeModel *source, ETableSortInfo *sort_info, ETableHeader *full_header, ETreePath path1, ETreePath path2, gpointer cmp_cache) +etsu_tree_compare (ETreeModel *source, + ETableSortInfo *sort_info, + ETableHeader *full_header, + ETreePath path1, + ETreePath path2, + gpointer cmp_cache) { gint j; gint sort_count = e_table_sort_info_sorting_get_count (sort_info); @@ -257,7 +283,9 @@ etsu_tree_compare (ETreeModel *source, ETableSortInfo *sort_info, ETableHeader * } static gint -e_sort_tree_callback (gconstpointer data1, gconstpointer data2, gpointer user_data) +e_sort_tree_callback (gconstpointer data1, + gconstpointer data2, + gpointer user_data) { ETreePath *path1 = *(ETreePath *) data1; ETreePath *path2 = *(ETreePath *) data2; @@ -267,7 +295,11 @@ e_sort_tree_callback (gconstpointer data1, gconstpointer data2, gpointer user_da } void -e_table_sorting_utils_tree_sort (ETreeModel *source, ETableSortInfo *sort_info, ETableHeader *full_header, ETreePath *map_table, gint count) +e_table_sorting_utils_tree_sort (ETreeModel *source, + ETableSortInfo *sort_info, + ETableHeader *full_header, + ETreePath *map_table, + gint count) { ETableSortClosure closure; gint cols; @@ -331,7 +363,12 @@ e_table_sorting_utils_tree_sort (ETreeModel *source, ETableSortInfo *sort_info, /* FIXME: This could be done in time log n instead of time n with a binary search. */ gint -e_table_sorting_utils_tree_check_position (ETreeModel *source, ETableSortInfo *sort_info, ETableHeader *full_header, ETreePath *map_table, gint count, gint old_index) +e_table_sorting_utils_tree_check_position (ETreeModel *source, + ETableSortInfo *sort_info, + ETableHeader *full_header, + ETreePath *map_table, + gint count, + gint old_index) { gint i; ETreePath path; @@ -357,7 +394,12 @@ e_table_sorting_utils_tree_check_position (ETreeModel *source, ETableSortInfo *s /* FIXME: This does not pay attention to making sure that it's a stable insert. This needs to be fixed. */ gint -e_table_sorting_utils_tree_insert (ETreeModel *source, ETableSortInfo *sort_info, ETableHeader *full_header, ETreePath *map_table, gint count, ETreePath path) +e_table_sorting_utils_tree_insert (ETreeModel *source, + ETableSortInfo *sort_info, + ETableHeader *full_header, + ETreePath *map_table, + gint count, + ETreePath path) { gsize start; gsize end; @@ -418,7 +460,9 @@ e_table_sorting_utils_free_cmp_cache (gpointer cmp_cache) * Note: Given @value will be stolen and later freed with g_free. **/ void -e_table_sorting_utils_add_to_cmp_cache (gpointer cmp_cache, const gchar *key, gchar *value) +e_table_sorting_utils_add_to_cmp_cache (gpointer cmp_cache, + const gchar *key, + gchar *value) { g_return_if_fail (cmp_cache != NULL); g_return_if_fail (key != NULL); @@ -436,7 +480,8 @@ e_table_sorting_utils_add_to_cmp_cache (gpointer cmp_cache, const gchar *key, gc * with a key. **/ const gchar * -e_table_sorting_utils_lookup_cmp_cache (gpointer cmp_cache, const gchar *key) +e_table_sorting_utils_lookup_cmp_cache (gpointer cmp_cache, + const gchar *key) { g_return_val_if_fail (key != NULL, NULL); diff --git a/widgets/table/e-table-specification.c b/widgets/table/e-table-specification.c index 76c268ad11..03f0e4503b 100644 --- a/widgets/table/e-table-specification.c +++ b/widgets/table/e-table-specification.c @@ -129,7 +129,7 @@ e_table_specification_new (void) */ gboolean e_table_specification_load_from_file (ETableSpecification *specification, - const gchar *filename) + const gchar *filename) { xmlDoc *doc; @@ -156,7 +156,7 @@ e_table_specification_load_from_file (ETableSpecification *specification, */ gboolean e_table_specification_load_from_string (ETableSpecification *specification, - const gchar *xml) + const gchar *xml) { xmlDoc *doc; doc = xmlParseMemory ( (gchar *) xml, strlen (xml)); @@ -180,7 +180,7 @@ e_table_specification_load_from_string (ETableSpecification *specification, */ void e_table_specification_load_from_node (ETableSpecification *specification, - const xmlNode *node) + const xmlNode *node) { gchar *temp; xmlNode *children; @@ -285,7 +285,7 @@ e_table_specification_load_from_node (ETableSpecification *specification, */ gint e_table_specification_save_to_file (ETableSpecification *specification, - const gchar *filename) + const gchar *filename) { xmlDoc *doc; gint ret; @@ -349,7 +349,7 @@ e_table_specification_save_to_string (ETableSpecification *specification) */ xmlNode * e_table_specification_save_to_node (ETableSpecification *specification, - xmlDoc *doc) + xmlDoc *doc) { xmlNode *node; const gchar *s; diff --git a/widgets/table/e-table-state.c b/widgets/table/e-table-state.c index 0bb311b8c4..785c807442 100644 --- a/widgets/table/e-table-state.c +++ b/widgets/table/e-table-state.c @@ -116,8 +116,8 @@ e_table_state_vanilla (gint col_count) } gboolean -e_table_state_load_from_file (ETableState *state, - const gchar *filename) +e_table_state_load_from_file (ETableState *state, + const gchar *filename) { xmlDoc *doc; @@ -135,8 +135,8 @@ e_table_state_load_from_file (ETableState *state, } void -e_table_state_load_from_string (ETableState *state, - const gchar *xml) +e_table_state_load_from_string (ETableState *state, + const gchar *xml) { xmlDoc *doc; @@ -158,7 +158,7 @@ typedef struct { void e_table_state_load_from_node (ETableState *state, - const xmlNode *node) + const xmlNode *node) { xmlNode *children; GList *list = NULL, *iterator; @@ -215,8 +215,8 @@ e_table_state_load_from_node (ETableState *state, } void -e_table_state_save_to_file (ETableState *state, - const gchar *filename) +e_table_state_save_to_file (ETableState *state, + const gchar *filename) { xmlDoc *doc; @@ -231,7 +231,7 @@ e_table_state_save_to_file (ETableState *state, } gchar * -e_table_state_save_to_string (ETableState *state) +e_table_state_save_to_string (ETableState *state) { gchar *ret_val; xmlChar *string; @@ -251,8 +251,8 @@ e_table_state_save_to_string (ETableState *state) } xmlNode * -e_table_state_save_to_node (ETableState *state, - xmlNode *parent) +e_table_state_save_to_node (ETableState *state, + xmlNode *parent) { gint i; xmlNode *node; diff --git a/widgets/table/e-table-subset-variable.c b/widgets/table/e-table-subset-variable.c index 99fed4ba02..a40859b492 100644 --- a/widgets/table/e-table-subset-variable.c +++ b/widgets/table/e-table-subset-variable.c @@ -40,8 +40,8 @@ G_DEFINE_TYPE (ETableSubsetVariable, etssv, E_TYPE_TABLE_SUBSET) #define INCREMENT_AMOUNT 10 static void -etssv_add (ETableSubsetVariable *etssv, - gint row) +etssv_add (ETableSubsetVariable *etssv, + gint row) { ETableModel *etm = E_TABLE_MODEL (etssv); ETableSubset *etss = E_TABLE_SUBSET (etssv); @@ -62,8 +62,8 @@ etssv_add (ETableSubsetVariable *etssv, static void etssv_add_array (ETableSubsetVariable *etssv, - const gint *array, - gint count) + const gint *array, + gint count) { ETableModel *etm = E_TABLE_MODEL (etssv); ETableSubset *etss = E_TABLE_SUBSET (etssv); @@ -84,7 +84,7 @@ etssv_add_array (ETableSubsetVariable *etssv, } static void -etssv_add_all (ETableSubsetVariable *etssv) +etssv_add_all (ETableSubsetVariable *etssv) { ETableModel *etm = E_TABLE_MODEL (etssv); ETableSubset *etss = E_TABLE_SUBSET (etssv); @@ -107,8 +107,8 @@ etssv_add_all (ETableSubsetVariable *etssv) } static gboolean -etssv_remove (ETableSubsetVariable *etssv, - gint row) +etssv_remove (ETableSubsetVariable *etssv, + gint row) { ETableModel *etm = E_TABLE_MODEL (etssv); ETableSubset *etss = E_TABLE_SUBSET (etssv); @@ -147,7 +147,7 @@ etssv_init (ETableSubsetVariable *etssv) ETableModel * e_table_subset_variable_construct (ETableSubsetVariable *etssv, - ETableModel *source) + ETableModel *source) { if (e_table_subset_construct (E_TABLE_SUBSET (etssv), source, 1) == NULL) return NULL; @@ -170,8 +170,8 @@ e_table_subset_variable_new (ETableModel *source) } void -e_table_subset_variable_add (ETableSubsetVariable *etssv, - gint row) +e_table_subset_variable_add (ETableSubsetVariable *etssv, + gint row) { g_return_if_fail (etssv != NULL); g_return_if_fail (E_IS_TABLE_SUBSET_VARIABLE (etssv)); @@ -181,9 +181,9 @@ e_table_subset_variable_add (ETableSubsetVariable *etssv, } void -e_table_subset_variable_add_array (ETableSubsetVariable *etssv, - const gint *array, - gint count) +e_table_subset_variable_add_array (ETableSubsetVariable *etssv, + const gint *array, + gint count) { g_return_if_fail (etssv != NULL); g_return_if_fail (E_IS_TABLE_SUBSET_VARIABLE (etssv)); @@ -193,7 +193,7 @@ e_table_subset_variable_add_array (ETableSubsetVariable *etssv, } void -e_table_subset_variable_add_all (ETableSubsetVariable *etssv) +e_table_subset_variable_add_all (ETableSubsetVariable *etssv) { g_return_if_fail (etssv != NULL); g_return_if_fail (E_IS_TABLE_SUBSET_VARIABLE (etssv)); @@ -203,8 +203,8 @@ e_table_subset_variable_add_all (ETableSubsetVariable *etssv) } gboolean -e_table_subset_variable_remove (ETableSubsetVariable *etssv, - gint row) +e_table_subset_variable_remove (ETableSubsetVariable *etssv, + gint row) { g_return_val_if_fail (etssv != NULL, FALSE); g_return_val_if_fail (E_IS_TABLE_SUBSET_VARIABLE (etssv), FALSE); @@ -224,7 +224,7 @@ e_table_subset_variable_clear (ETableSubsetVariable *etssv) e_table_model_pre_change (etm); etss->n_map = 0; g_free (etss->map_table); - etss->map_table = (gint *) g_new (unsigned int, 1); + etss->map_table = (gint *) g_new (guint, 1); etssv->n_vals_allocated = 1; e_table_model_changed (etm); @@ -232,8 +232,8 @@ e_table_subset_variable_clear (ETableSubsetVariable *etssv) void e_table_subset_variable_increment (ETableSubsetVariable *etssv, - gint position, - gint amount) + gint position, + gint amount) { gint i; ETableSubset *etss = E_TABLE_SUBSET (etssv); @@ -245,8 +245,8 @@ e_table_subset_variable_increment (ETableSubsetVariable *etssv, void e_table_subset_variable_decrement (ETableSubsetVariable *etssv, - gint position, - gint amount) + gint position, + gint amount) { gint i; ETableSubset *etss = E_TABLE_SUBSET (etssv); @@ -258,7 +258,7 @@ e_table_subset_variable_decrement (ETableSubsetVariable *etssv, void e_table_subset_variable_set_allocation (ETableSubsetVariable *etssv, - gint total) + gint total) { ETableSubset *etss = E_TABLE_SUBSET (etssv); if (total <= 0) diff --git a/widgets/table/e-table-subset.c b/widgets/table/e-table-subset.c index 03871771f6..9a26020296 100644 --- a/widgets/table/e-table-subset.c +++ b/widgets/table/e-table-subset.c @@ -52,7 +52,8 @@ G_DEFINE_TYPE (ETableSubset, etss, E_TYPE_TABLE_MODEL) #define MAP_ROW(etss, row) (row == -1 ? -1 : etss->map_table[row]) static gint -etss_get_view_row (ETableSubset *etss, gint row) +etss_get_view_row (ETableSubset *etss, + gint row) { const gint n = etss->n_map; const gint * const map_table = etss->map_table; @@ -150,7 +151,9 @@ etss_row_count (ETableModel *etm) } static gpointer -etss_value_at (ETableModel *etm, gint col, gint row) +etss_value_at (ETableModel *etm, + gint col, + gint row) { ETableSubset *etss = (ETableSubset *) etm; @@ -162,7 +165,10 @@ etss_value_at (ETableModel *etm, gint col, gint row) } static void -etss_set_value_at (ETableModel *etm, gint col, gint row, gconstpointer val) +etss_set_value_at (ETableModel *etm, + gint col, + gint row, + gconstpointer val) { ETableSubset *etss = (ETableSubset *) etm; @@ -174,7 +180,9 @@ etss_set_value_at (ETableModel *etm, gint col, gint row, gconstpointer val) } static gboolean -etss_is_cell_editable (ETableModel *etm, gint col, gint row) +etss_is_cell_editable (ETableModel *etm, + gint col, + gint row) { ETableSubset *etss = (ETableSubset *) etm; @@ -190,7 +198,8 @@ etss_has_save_id (ETableModel *etm) } static gchar * -etss_get_save_id (ETableModel *etm, gint row) +etss_get_save_id (ETableModel *etm, + gint row) { ETableSubset *etss = (ETableSubset *) etm; @@ -203,14 +212,18 @@ etss_get_save_id (ETableModel *etm, gint row) } static void -etss_append_row (ETableModel *etm, ETableModel *source, gint row) +etss_append_row (ETableModel *etm, + ETableModel *source, + gint row) { ETableSubset *etss = (ETableSubset *) etm; e_table_model_append_row (etss->source, source, row); } static gpointer -etss_duplicate_value (ETableModel *etm, gint col, gconstpointer value) +etss_duplicate_value (ETableModel *etm, + gint col, + gconstpointer value) { ETableSubset *etss = (ETableSubset *) etm; @@ -218,7 +231,9 @@ etss_duplicate_value (ETableModel *etm, gint col, gconstpointer value) } static void -etss_free_value (ETableModel *etm, gint col, gpointer value) +etss_free_value (ETableModel *etm, + gint col, + gpointer value) { ETableSubset *etss = (ETableSubset *) etm; @@ -226,7 +241,8 @@ etss_free_value (ETableModel *etm, gint col, gpointer value) } static gpointer -etss_initialize_value (ETableModel *etm, gint col) +etss_initialize_value (ETableModel *etm, + gint col) { ETableSubset *etss = (ETableSubset *) etm; @@ -234,7 +250,9 @@ etss_initialize_value (ETableModel *etm, gint col) } static gboolean -etss_value_is_empty (ETableModel *etm, gint col, gconstpointer value) +etss_value_is_empty (ETableModel *etm, + gint col, + gconstpointer value) { ETableSubset *etss = (ETableSubset *) etm; @@ -242,7 +260,9 @@ etss_value_is_empty (ETableModel *etm, gint col, gconstpointer value) } static gchar * -etss_value_to_string (ETableModel *etm, gint col, gconstpointer value) +etss_value_to_string (ETableModel *etm, + gint col, + gconstpointer value) { ETableSubset *etss = (ETableSubset *) etm; @@ -291,25 +311,30 @@ etss_init (ETableSubset *etss) } static void -etss_proxy_model_pre_change_real (ETableSubset *etss, ETableModel *etm) +etss_proxy_model_pre_change_real (ETableSubset *etss, + ETableModel *etm) { e_table_model_pre_change (E_TABLE_MODEL (etss)); } static void -etss_proxy_model_no_change_real (ETableSubset *etss, ETableModel *etm) +etss_proxy_model_no_change_real (ETableSubset *etss, + ETableModel *etm) { e_table_model_no_change (E_TABLE_MODEL (etss)); } static void -etss_proxy_model_changed_real (ETableSubset *etss, ETableModel *etm) +etss_proxy_model_changed_real (ETableSubset *etss, + ETableModel *etm) { e_table_model_changed (E_TABLE_MODEL (etss)); } static void -etss_proxy_model_row_changed_real (ETableSubset *etss, ETableModel *etm, gint row) +etss_proxy_model_row_changed_real (ETableSubset *etss, + ETableModel *etm, + gint row) { gint view_row = etss_get_view_row (etss, row); if (view_row != -1) @@ -319,7 +344,10 @@ etss_proxy_model_row_changed_real (ETableSubset *etss, ETableModel *etm, gint ro } static void -etss_proxy_model_cell_changed_real (ETableSubset *etss, ETableModel *etm, gint col, gint row) +etss_proxy_model_cell_changed_real (ETableSubset *etss, + ETableModel *etm, + gint col, + gint row) { gint view_row = etss_get_view_row (etss, row); if (view_row != -1) @@ -329,68 +357,90 @@ etss_proxy_model_cell_changed_real (ETableSubset *etss, ETableModel *etm, gint c } static void -etss_proxy_model_rows_inserted_real (ETableSubset *etss, ETableModel *etm, gint row, gint count) +etss_proxy_model_rows_inserted_real (ETableSubset *etss, + ETableModel *etm, + gint row, + gint count) { e_table_model_no_change (E_TABLE_MODEL (etss)); } static void -etss_proxy_model_rows_deleted_real (ETableSubset *etss, ETableModel *etm, gint row, gint count) +etss_proxy_model_rows_deleted_real (ETableSubset *etss, + ETableModel *etm, + gint row, + gint count) { e_table_model_no_change (E_TABLE_MODEL (etss)); } static void -etss_proxy_model_pre_change (ETableModel *etm, ETableSubset *etss) +etss_proxy_model_pre_change (ETableModel *etm, + ETableSubset *etss) { if (ETSS_CLASS (etss)->proxy_model_pre_change) (ETSS_CLASS (etss)->proxy_model_pre_change) (etss, etm); } static void -etss_proxy_model_no_change (ETableModel *etm, ETableSubset *etss) +etss_proxy_model_no_change (ETableModel *etm, + ETableSubset *etss) { if (ETSS_CLASS (etss)->proxy_model_no_change) (ETSS_CLASS (etss)->proxy_model_no_change) (etss, etm); } static void -etss_proxy_model_changed (ETableModel *etm, ETableSubset *etss) +etss_proxy_model_changed (ETableModel *etm, + ETableSubset *etss) { if (ETSS_CLASS (etss)->proxy_model_changed) (ETSS_CLASS (etss)->proxy_model_changed) (etss, etm); } static void -etss_proxy_model_row_changed (ETableModel *etm, gint row, ETableSubset *etss) +etss_proxy_model_row_changed (ETableModel *etm, + gint row, + ETableSubset *etss) { if (ETSS_CLASS (etss)->proxy_model_row_changed) (ETSS_CLASS (etss)->proxy_model_row_changed) (etss, etm, row); } static void -etss_proxy_model_cell_changed (ETableModel *etm, gint col, gint row, ETableSubset *etss) +etss_proxy_model_cell_changed (ETableModel *etm, + gint col, + gint row, + ETableSubset *etss) { if (ETSS_CLASS (etss)->proxy_model_cell_changed) (ETSS_CLASS (etss)->proxy_model_cell_changed) (etss, etm, col, row); } static void -etss_proxy_model_rows_inserted (ETableModel *etm, gint row, gint col, ETableSubset *etss) +etss_proxy_model_rows_inserted (ETableModel *etm, + gint row, + gint col, + ETableSubset *etss) { if (ETSS_CLASS (etss)->proxy_model_rows_inserted) (ETSS_CLASS (etss)->proxy_model_rows_inserted) (etss, etm, row, col); } static void -etss_proxy_model_rows_deleted (ETableModel *etm, gint row, gint col, ETableSubset *etss) +etss_proxy_model_rows_deleted (ETableModel *etm, + gint row, + gint col, + ETableSubset *etss) { if (ETSS_CLASS (etss)->proxy_model_rows_deleted) (ETSS_CLASS (etss)->proxy_model_rows_deleted) (etss, etm, row, col); } ETableModel * -e_table_subset_construct (ETableSubset *etss, ETableModel *source, gint nvals) +e_table_subset_construct (ETableSubset *etss, + ETableModel *source, + gint nvals) { guint *buffer; gint i; @@ -410,26 +460,34 @@ e_table_subset_construct (ETableSubset *etss, ETableModel *source, gint nvals) for (i = 0; i < nvals; i++) etss->map_table[i] = i; - etss->table_model_pre_change_id = g_signal_connect (G_OBJECT (source), "model_pre_change", - G_CALLBACK (etss_proxy_model_pre_change), etss); - etss->table_model_no_change_id = g_signal_connect (G_OBJECT (source), "model_no_change", - G_CALLBACK (etss_proxy_model_no_change), etss); - etss->table_model_changed_id = g_signal_connect (G_OBJECT (source), "model_changed", - G_CALLBACK (etss_proxy_model_changed), etss); - etss->table_model_row_changed_id = g_signal_connect (G_OBJECT (source), "model_row_changed", - G_CALLBACK (etss_proxy_model_row_changed), etss); - etss->table_model_cell_changed_id = g_signal_connect (G_OBJECT (source), "model_cell_changed", - G_CALLBACK (etss_proxy_model_cell_changed), etss); - etss->table_model_rows_inserted_id = g_signal_connect (G_OBJECT (source), "model_rows_inserted", - G_CALLBACK (etss_proxy_model_rows_inserted), etss); - etss->table_model_rows_deleted_id = g_signal_connect (G_OBJECT (source), "model_rows_deleted", - G_CALLBACK (etss_proxy_model_rows_deleted), etss); + etss->table_model_pre_change_id = g_signal_connect ( + source, "model_pre_change", + G_CALLBACK (etss_proxy_model_pre_change), etss); + etss->table_model_no_change_id = g_signal_connect ( + source, "model_no_change", + G_CALLBACK (etss_proxy_model_no_change), etss); + etss->table_model_changed_id = g_signal_connect ( + source, "model_changed", + G_CALLBACK (etss_proxy_model_changed), etss); + etss->table_model_row_changed_id = g_signal_connect ( + source, "model_row_changed", + G_CALLBACK (etss_proxy_model_row_changed), etss); + etss->table_model_cell_changed_id = g_signal_connect ( + source, "model_cell_changed", + G_CALLBACK (etss_proxy_model_cell_changed), etss); + etss->table_model_rows_inserted_id = g_signal_connect ( + source, "model_rows_inserted", + G_CALLBACK (etss_proxy_model_rows_inserted), etss); + etss->table_model_rows_deleted_id = g_signal_connect ( + source, "model_rows_deleted", + G_CALLBACK (etss_proxy_model_rows_deleted), etss); return E_TABLE_MODEL (etss); } ETableModel * -e_table_subset_new (ETableModel *source, const gint nvals) +e_table_subset_new (ETableModel *source, + const gint nvals) { ETableSubset *etss = g_object_new (E_TYPE_TABLE_SUBSET, NULL); @@ -442,8 +500,8 @@ e_table_subset_new (ETableModel *source, const gint nvals) } gint -e_table_subset_model_to_view_row (ETableSubset *ets, - gint model_row) +e_table_subset_model_to_view_row (ETableSubset *ets, + gint model_row) { gint i; for (i = 0; i < ets->n_map; i++) { @@ -454,8 +512,8 @@ e_table_subset_model_to_view_row (ETableSubset *ets, } gint -e_table_subset_view_to_model_row (ETableSubset *ets, - gint view_row) +e_table_subset_view_to_model_row (ETableSubset *ets, + gint view_row) { if (view_row >= 0 && view_row < ets->n_map) return ets->map_table[view_row]; @@ -476,7 +534,7 @@ e_table_subset_get_toplevel (ETableSubset *table) } void -e_table_subset_print_debugging (ETableSubset *table_model) +e_table_subset_print_debugging (ETableSubset *table_model) { gint i; for (i = 0; i < table_model->n_map; i++) { diff --git a/widgets/table/e-table-utils.c b/widgets/table/e-table-utils.c index d84b244fdf..007803585e 100644 --- a/widgets/table/e-table-utils.c +++ b/widgets/table/e-table-utils.c @@ -81,8 +81,8 @@ e_table_state_to_header (GtkWidget *widget, static ETableCol * et_col_spec_to_col (ETableColumnSpecification *col_spec, - ETableExtras *ete, - const gchar *domain) + ETableExtras *ete, + const gchar *domain) { ETableCol *col = NULL; ECell *cell = NULL; @@ -146,7 +146,7 @@ et_col_spec_to_col (ETableColumnSpecification *col_spec, ETableHeader * e_table_spec_to_full_header (ETableSpecification *spec, - ETableExtras *ete) + ETableExtras *ete) { ETableHeader *nh; gint column; @@ -170,7 +170,8 @@ e_table_spec_to_full_header (ETableSpecification *spec, } static gboolean -check_col (ETableCol *col, gpointer user_data) +check_col (ETableCol *col, + gpointer user_data) { return col->search ? TRUE : FALSE; } diff --git a/widgets/table/e-table-without.c b/widgets/table/e-table-without.c index 59d254c862..785feb456b 100644 --- a/widgets/table/e-table-without.c +++ b/widgets/table/e-table-without.c @@ -53,7 +53,8 @@ struct _ETableWithoutPrivate { }; static gboolean -check (ETableWithout *etw, gint model_row) +check (ETableWithout *etw, + gint model_row) { gboolean ret_val; gpointer key; @@ -70,7 +71,9 @@ check (ETableWithout *etw, gint model_row) } static gboolean -check_with_key (ETableWithout *etw, gpointer key, gint model_row) +check_with_key (ETableWithout *etw, + gpointer key, + gint model_row) { gboolean ret_val; gpointer key2; @@ -90,14 +93,16 @@ check_with_key (ETableWithout *etw, gpointer key, gint model_row) } static gint -etw_view_to_model_row (ETableWithout *etw, gint view_row) +etw_view_to_model_row (ETableWithout *etw, + gint view_row) { ETableSubset *etss = E_TABLE_SUBSET (etw); return etss->map_table[view_row]; } static void -add_row (ETableWithout *etw, gint model_row) +add_row (ETableWithout *etw, + gint model_row) { ETableSubset *etss = E_TABLE_SUBSET (etw); @@ -111,7 +116,8 @@ add_row (ETableWithout *etw, gint model_row) } static void -remove_row (ETableWithout *etw, gint view_row) +remove_row (ETableWithout *etw, + gint view_row) { ETableSubset *etss = E_TABLE_SUBSET (etw); @@ -126,8 +132,8 @@ remove_row (ETableWithout *etw, gint view_row) static void delete_hash_element (gpointer key, - gpointer value, - gpointer closure) + gpointer value, + gpointer closure) { ETableWithout *etw = closure; if (etw->priv->free_duplicated_key_func) @@ -209,7 +215,8 @@ etw_proxy_model_rows_deleted (ETableSubset *etss, } static void -etw_proxy_model_changed (ETableSubset *etss, ETableModel *etm) +etw_proxy_model_changed (ETableSubset *etss, + ETableModel *etm) { gint i; /* Model row */ gint j; /* View row */ @@ -256,15 +263,15 @@ etw_init (ETableWithout *etw) } ETableModel * -e_table_without_construct (ETableWithout *etw, - ETableModel *source, - GHashFunc hash_func, - GCompareFunc compare_func, - ETableWithoutGetKeyFunc get_key_func, - ETableWithoutDuplicateKeyFunc duplicate_key_func, - ETableWithoutFreeKeyFunc free_gotten_key_func, - ETableWithoutFreeKeyFunc free_duplicated_key_func, - void *closure) +e_table_without_construct (ETableWithout *etw, + ETableModel *source, + GHashFunc hash_func, + GCompareFunc compare_func, + ETableWithoutGetKeyFunc get_key_func, + ETableWithoutDuplicateKeyFunc duplicate_key_func, + ETableWithoutFreeKeyFunc free_gotten_key_func, + ETableWithoutFreeKeyFunc free_duplicated_key_func, + gpointer closure) { if (e_table_subset_construct (E_TABLE_SUBSET (etw), source, 1) == NULL) return NULL; @@ -284,14 +291,14 @@ e_table_without_construct (ETableWithout *etw, } ETableModel * -e_table_without_new (ETableModel *source, - GHashFunc hash_func, - GCompareFunc compare_func, - ETableWithoutGetKeyFunc get_key_func, - ETableWithoutDuplicateKeyFunc duplicate_key_func, - ETableWithoutFreeKeyFunc free_gotten_key_func, - ETableWithoutFreeKeyFunc free_duplicated_key_func, - void *closure) +e_table_without_new (ETableModel *source, + GHashFunc hash_func, + GCompareFunc compare_func, + ETableWithoutGetKeyFunc get_key_func, + ETableWithoutDuplicateKeyFunc duplicate_key_func, + ETableWithoutFreeKeyFunc free_gotten_key_func, + ETableWithoutFreeKeyFunc free_duplicated_key_func, + gpointer closure) { ETableWithout *etw = g_object_new (E_TYPE_TABLE_WITHOUT, NULL); @@ -312,8 +319,9 @@ e_table_without_new (ETableModel *source, return (ETableModel *) etw; } -void e_table_without_hide (ETableWithout *etw, - void *key) +void +e_table_without_hide (ETableWithout *etw, + gpointer key) { gint i; /* View row */ ETableSubset *etss = E_TABLE_SUBSET (etw); @@ -331,8 +339,9 @@ void e_table_without_hide (ETableWithout *etw, } /* An adopted key will later be freed using the free_duplicated_key function. */ -void e_table_without_hide_adopt (ETableWithout *etw, - void *key) +void +e_table_without_hide_adopt (ETableWithout *etw, + gpointer key) { gint i; /* View row */ ETableSubset *etss = E_TABLE_SUBSET (etw); @@ -347,8 +356,8 @@ void e_table_without_hide_adopt (ETableWithout *etw, } void -e_table_without_show (ETableWithout *etw, - void *key) +e_table_without_show (ETableWithout *etw, + gpointer key) { gint i; /* Model row */ ETableSubset *etss = E_TABLE_SUBSET (etw); @@ -372,7 +381,7 @@ e_table_without_show (ETableWithout *etw, } void -e_table_without_show_all (ETableWithout *etw) +e_table_without_show_all (ETableWithout *etw) { gint i; /* Model row */ gint row_count; diff --git a/widgets/table/e-table.c b/widgets/table/e-table.c index f755cbc451..472681796f 100644 --- a/widgets/table/e-table.c +++ b/widgets/table/e-table.c @@ -232,7 +232,9 @@ current_search_col (ETable *et) } static void -et_get_preferred_width (GtkWidget *widget, gint *minimum, gint *natural) +et_get_preferred_width (GtkWidget *widget, + gint *minimum, + gint *natural) { ETable *et = E_TABLE (widget); @@ -246,7 +248,9 @@ et_get_preferred_width (GtkWidget *widget, gint *minimum, gint *natural) } static void -et_get_preferred_height (GtkWidget *widget, gint *minimum, gint *natural) +et_get_preferred_height (GtkWidget *widget, + gint *minimum, + gint *natural) { GTK_WIDGET_CLASS (e_table_parent_class)-> get_preferred_height (widget, minimum, natural); @@ -262,7 +266,8 @@ set_header_width (ETable *et) } static void -structure_changed (ETableHeader *header, ETable *et) +structure_changed (ETableHeader *header, + ETable *et) { e_table_state_change (et); set_header_width (et); @@ -270,14 +275,17 @@ structure_changed (ETableHeader *header, ETable *et) } static void -expansion_changed (ETableHeader *header, ETable *et) +expansion_changed (ETableHeader *header, + ETable *et) { e_table_state_change (et); set_header_width (et); } static void -dimension_changed (ETableHeader *header, gint total_width, ETable *et) +dimension_changed (ETableHeader *header, + gint total_width, + ETable *et) { set_header_width (et); } @@ -303,7 +311,8 @@ disconnect_header (ETable *e_table) } static void -connect_header (ETable *e_table, ETableState *state) +connect_header (ETable *e_table, + ETableState *state) { if (e_table->header != NULL) disconnect_header (e_table); @@ -311,15 +320,15 @@ connect_header (ETable *e_table, ETableState *state) e_table->header = e_table_state_to_header ( GTK_WIDGET (e_table), e_table->full_header, state); - e_table->structure_change_id = - g_signal_connect (G_OBJECT (e_table->header), "structure_change", - G_CALLBACK (structure_changed), e_table); - e_table->expansion_change_id = - g_signal_connect (G_OBJECT (e_table->header), "expansion_change", - G_CALLBACK (expansion_changed), e_table); - e_table->dimension_change_id = - g_signal_connect (G_OBJECT (e_table->header), "dimension_change", - G_CALLBACK (dimension_changed), e_table); + e_table->structure_change_id = g_signal_connect ( + e_table->header, "structure_change", + G_CALLBACK (structure_changed), e_table); + e_table->expansion_change_id = g_signal_connect ( + e_table->header, "expansion_change", + G_CALLBACK (expansion_changed), e_table); + e_table->dimension_change_id = g_signal_connect ( + e_table->header, "dimension_change", + G_CALLBACK (dimension_changed), e_table); } static void @@ -499,7 +508,8 @@ et_search_search (ETableSearch *search, } static void -et_search_accept (ETableSearch *search, ETable *et) +et_search_accept (ETableSearch *search, + ETable *et) { gint cursor; ETableCol *col = current_search_col (et); @@ -521,12 +531,12 @@ init_search (ETable *e_table) e_table->search = e_table_search_new (); - e_table->search_search_id = - g_signal_connect (G_OBJECT (e_table->search), "search", - G_CALLBACK (et_search_search), e_table); - e_table->search_accept_id = - g_signal_connect (G_OBJECT (e_table->search), "accept", - G_CALLBACK (et_search_accept), e_table); + e_table->search_search_id = g_signal_connect ( + e_table->search, "search", + G_CALLBACK (et_search_search), e_table); + e_table->search_accept_id = g_signal_connect ( + e_table->search, "accept", + G_CALLBACK (et_search_accept), e_table); } static void @@ -610,7 +620,8 @@ et_grab_focus (GtkWidget *widget) /* Focus handler for the ETable */ static gint -et_focus (GtkWidget *container, GtkDirectionType direction) +et_focus (GtkWidget *container, + GtkDirectionType direction) { ETable *e_table; @@ -647,7 +658,9 @@ set_header_canvas_width (ETable *e_table) } static void -header_canvas_size_allocate (GtkWidget *widget, GtkAllocation *alloc, ETable *e_table) +header_canvas_size_allocate (GtkWidget *widget, + GtkAllocation *alloc, + ETable *e_table) { GtkAllocation allocation; @@ -657,9 +670,9 @@ header_canvas_size_allocate (GtkWidget *widget, GtkAllocation *alloc, ETable *e_ GTK_WIDGET (e_table->header_canvas), &allocation); /* When the header item is created ->height == 0, - as the font is only created when everything is realized. - So we set the usize here as well, so that the size of the - header is correct */ + * as the font is only created when everything is realized. + * So we set the usize here as well, so that the size of the + * header is correct */ if (allocation.height != E_TABLE_HEADER_ITEM (e_table->header_item)->height) g_object_set ( e_table->header_canvas, "height-request", @@ -668,7 +681,8 @@ header_canvas_size_allocate (GtkWidget *widget, GtkAllocation *alloc, ETable *e_ } static void -group_info_changed (ETableSortInfo *info, ETable *et) +group_info_changed (ETableSortInfo *info, + ETable *et) { gboolean will_be_grouped = e_table_sort_info_grouping_get_count (info) > 0; clear_current_search_col (et); @@ -684,7 +698,8 @@ group_info_changed (ETableSortInfo *info, ETable *et) } static void -sort_info_changed (ETableSortInfo *info, ETable *et) +sort_info_changed (ETableSortInfo *info, + ETable *et) { clear_current_search_col (et); e_table_state_change (et); @@ -751,8 +766,9 @@ table_canvas_reflow_idle (ETable *e_table) } static void -table_canvas_size_allocate (GtkWidget *widget, GtkAllocation *alloc, - ETable *e_table) +table_canvas_size_allocate (GtkWidget *widget, + GtkAllocation *alloc, + ETable *e_table) { gdouble width; gdouble height; @@ -782,7 +798,8 @@ table_canvas_size_allocate (GtkWidget *widget, GtkAllocation *alloc, } static void -table_canvas_reflow (GnomeCanvas *canvas, ETable *e_table) +table_canvas_reflow (GnomeCanvas *canvas, + ETable *e_table) { if (!e_table->reflow_idle_id) e_table->reflow_idle_id = g_idle_add_full ( @@ -791,7 +808,10 @@ table_canvas_reflow (GnomeCanvas *canvas, ETable *e_table) } static void -click_to_add_cursor_change (ETableClickToAdd *etcta, gint row, gint col, ETable *et) +click_to_add_cursor_change (ETableClickToAdd *etcta, + gint row, + gint col, + ETable *et) { if (et->cursor_loc == E_TABLE_CURSOR_LOC_TABLE) { e_selection_model_clear (E_SELECTION_MODEL (et->selection)); @@ -800,7 +820,9 @@ click_to_add_cursor_change (ETableClickToAdd *etcta, gint row, gint col, ETable } static void -group_cursor_change (ETableGroup *etg, gint row, ETable *et) +group_cursor_change (ETableGroup *etg, + gint row, + ETable *et) { ETableCursorLoc old_cursor_loc; @@ -814,19 +836,29 @@ group_cursor_change (ETableGroup *etg, gint row, ETable *et) } static void -group_cursor_activated (ETableGroup *etg, gint row, ETable *et) +group_cursor_activated (ETableGroup *etg, + gint row, + ETable *et) { g_signal_emit (G_OBJECT (et), et_signals[CURSOR_ACTIVATED], 0, row); } static void -group_double_click (ETableGroup *etg, gint row, gint col, GdkEvent *event, ETable *et) +group_double_click (ETableGroup *etg, + gint row, + gint col, + GdkEvent *event, + ETable *et) { g_signal_emit (G_OBJECT (et), et_signals[DOUBLE_CLICK], 0, row, col, event); } static gboolean -group_right_click (ETableGroup *etg, gint row, gint col, GdkEvent *event, ETable *et) +group_right_click (ETableGroup *etg, + gint row, + gint col, + GdkEvent *event, + ETable *et) { gboolean return_val = FALSE; @@ -838,7 +870,11 @@ group_right_click (ETableGroup *etg, gint row, gint col, GdkEvent *event, ETable } static gboolean -group_click (ETableGroup *etg, gint row, gint col, GdkEvent *event, ETable *et) +group_click (ETableGroup *etg, + gint row, + gint col, + GdkEvent *event, + ETable *et) { gboolean return_val = 0; g_signal_emit (G_OBJECT (et), et_signals[CLICK], 0, row, col, event, &return_val); @@ -846,7 +882,11 @@ group_click (ETableGroup *etg, gint row, gint col, GdkEvent *event, ETable *et) } static gboolean -group_key_press (ETableGroup *etg, gint row, gint col, GdkEvent *event, ETable *et) +group_key_press (ETableGroup *etg, + gint row, + gint col, + GdkEvent *event, + ETable *et) { gboolean return_val = FALSE; GdkEventKey *key = (GdkEventKey *) event; @@ -923,7 +963,11 @@ group_key_press (ETableGroup *etg, gint row, gint col, GdkEvent *event, ETable * } static gboolean -group_start_drag (ETableGroup *etg, gint row, gint col, GdkEvent *event, ETable *et) +group_start_drag (ETableGroup *etg, + gint row, + gint col, + GdkEvent *event, + ETable *et) { gboolean return_val = TRUE; g_signal_emit (G_OBJECT (et), et_signals[START_DRAG], 0, @@ -932,7 +976,8 @@ group_start_drag (ETableGroup *etg, gint row, gint col, GdkEvent *event, ETable } static void -et_table_model_changed (ETableModel *model, ETable *et) +et_table_model_changed (ETableModel *model, + ETable *et) { et->need_rebuild = TRUE; if (!et->rebuild_idle_id) { @@ -943,7 +988,9 @@ et_table_model_changed (ETableModel *model, ETable *et) } static void -et_table_row_changed (ETableModel *table_model, gint row, ETable *et) +et_table_row_changed (ETableModel *table_model, + gint row, + ETable *et) { if (!et->need_rebuild) { if (e_table_group_remove (et->group, row)) @@ -953,13 +1000,19 @@ et_table_row_changed (ETableModel *table_model, gint row, ETable *et) } static void -et_table_cell_changed (ETableModel *table_model, gint view_col, gint row, ETable *et) +et_table_cell_changed (ETableModel *table_model, + gint view_col, + gint row, + ETable *et) { et_table_row_changed (table_model, row, et); } static void -et_table_rows_inserted (ETableModel *table_model, gint row, gint count, ETable *et) +et_table_rows_inserted (ETableModel *table_model, + gint row, + gint count, + ETable *et) { /* This number has already been decremented. */ gint row_count = e_table_model_row_count (table_model); @@ -974,7 +1027,10 @@ et_table_rows_inserted (ETableModel *table_model, gint row, gint count, ETable * } static void -et_table_rows_deleted (ETableModel *table_model, gint row, gint count, ETable *et) +et_table_rows_deleted (ETableModel *table_model, + gint row, + gint count, + ETable *et) { gint row_count = e_table_model_row_count (table_model); if (!et->need_rebuild) { @@ -1022,20 +1078,27 @@ et_build_groups (ETable *et) "selection_model", et->selection, NULL); - g_signal_connect (G_OBJECT (et->group), "cursor_change", - G_CALLBACK (group_cursor_change), et); - g_signal_connect (G_OBJECT (et->group), "cursor_activated", - G_CALLBACK (group_cursor_activated), et); - g_signal_connect (G_OBJECT (et->group), "double_click", - G_CALLBACK (group_double_click), et); - g_signal_connect (G_OBJECT (et->group), "right_click", - G_CALLBACK (group_right_click), et); - g_signal_connect (G_OBJECT (et->group), "click", - G_CALLBACK (group_click), et); - g_signal_connect (G_OBJECT (et->group), "key_press", - G_CALLBACK (group_key_press), et); - g_signal_connect (G_OBJECT (et->group), "start_drag", - G_CALLBACK (group_start_drag), et); + g_signal_connect ( + et->group, "cursor_change", + G_CALLBACK (group_cursor_change), et); + g_signal_connect ( + et->group, "cursor_activated", + G_CALLBACK (group_cursor_activated), et); + g_signal_connect ( + et->group, "double_click", + G_CALLBACK (group_double_click), et); + g_signal_connect ( + et->group, "right_click", + G_CALLBACK (group_right_click), et); + g_signal_connect ( + et->group, "click", + G_CALLBACK (group_click), et); + g_signal_connect ( + et->group, "key_press", + G_CALLBACK (group_key_press), et); + g_signal_connect ( + et->group, "start_drag", + G_CALLBACK (group_start_drag), et); if (!(et->is_grouped) && was_grouped) et_disconnect_model (et); @@ -1102,7 +1165,8 @@ changed_idle (gpointer data) } static void -et_canvas_realize (GtkWidget *canvas, ETable *e_table) +et_canvas_realize (GtkWidget *canvas, + ETable *e_table) { GtkWidget *widget; GtkStyle *style; @@ -1120,7 +1184,9 @@ et_canvas_realize (GtkWidget *canvas, ETable *e_table) } static gboolean -white_item_event (GnomeCanvasItem *white_item, GdkEvent *event, ETable *e_table) +white_item_event (GnomeCanvasItem *white_item, + GdkEvent *event, + ETable *e_table) { gboolean return_val = 0; g_signal_emit (G_OBJECT (e_table), et_signals[WHITE_SPACE_EVENT], 0, @@ -1143,7 +1209,9 @@ et_eti_leave_edit (ETable *et) } static gint -et_canvas_root_event (GnomeCanvasItem *root, GdkEvent *event, ETable *e_table) +et_canvas_root_event (GnomeCanvasItem *root, + GdkEvent *event, + ETable *e_table) { switch (event->type) { case GDK_BUTTON_PRESS: @@ -1188,7 +1256,9 @@ focus_first_etable_item (ETableGroup *group) * always, and also give the focus to some ETableItem if we get focused. */ static gint -table_canvas_focus_event_cb (GtkWidget *widget, GdkEventFocus *event, gpointer data) +table_canvas_focus_event_cb (GtkWidget *widget, + GdkEventFocus *event, + gpointer data) { GnomeCanvas *canvas; ECanvas *ecanvas; @@ -1232,7 +1302,9 @@ table_canvas_focus_event_cb (GtkWidget *widget, GdkEventFocus *event, gpointer d } static gboolean -canvas_vbox_event (ECanvasVbox *vbox, GdkEventKey *key, ETable *etable) +canvas_vbox_event (ECanvasVbox *vbox, + GdkEventKey *key, + ETable *etable) { if (key->type != GDK_KEY_PRESS && key->type != GDK_KEY_RELEASE) { @@ -1254,7 +1326,9 @@ canvas_vbox_event (ECanvasVbox *vbox, GdkEventKey *key, ETable *etable) } static gboolean -click_to_add_event (ETableClickToAdd *etcta, GdkEventKey *key, ETable *etable) +click_to_add_event (ETableClickToAdd *etcta, + GdkEventKey *key, + ETable *etable) { if (key->type != GDK_KEY_PRESS && key->type != GDK_KEY_RELEASE) { @@ -1284,50 +1358,53 @@ click_to_add_event (ETableClickToAdd *etcta, GdkEventKey *key, ETable *etable) } static void -e_table_setup_table (ETable *e_table, ETableHeader *full_header, ETableHeader *header, - ETableModel *model) +e_table_setup_table (ETable *e_table, + ETableHeader *full_header, + ETableHeader *header, + ETableModel *model) { GtkWidget *widget; GtkStyle *style; e_table->table_canvas = GNOME_CANVAS (e_canvas_new ()); g_signal_connect ( - G_OBJECT (e_table->table_canvas), "size_allocate", + e_table->table_canvas, "size_allocate", G_CALLBACK (table_canvas_size_allocate), e_table); g_signal_connect ( - G_OBJECT (e_table->table_canvas), "focus_in_event", + e_table->table_canvas, "focus_in_event", G_CALLBACK (table_canvas_focus_event_cb), e_table); g_signal_connect ( - G_OBJECT (e_table->table_canvas), "focus_out_event", + e_table->table_canvas, "focus_out_event", G_CALLBACK (table_canvas_focus_event_cb), e_table); g_signal_connect ( - G_OBJECT (e_table), "drag_begin", + e_table, "drag_begin", G_CALLBACK (et_drag_begin), e_table); g_signal_connect ( - G_OBJECT (e_table), "drag_end", + e_table, "drag_end", G_CALLBACK (et_drag_end), e_table); g_signal_connect ( - G_OBJECT (e_table), "drag_data_get", + e_table, "drag_data_get", G_CALLBACK (et_drag_data_get), e_table); g_signal_connect ( - G_OBJECT (e_table), "drag_data_delete", + e_table, "drag_data_delete", G_CALLBACK (et_drag_data_delete), e_table); g_signal_connect ( - G_OBJECT (e_table), "drag_motion", + e_table, "drag_motion", G_CALLBACK (et_drag_motion), e_table); g_signal_connect ( - G_OBJECT (e_table), "drag_leave", + e_table, "drag_leave", G_CALLBACK (et_drag_leave), e_table); g_signal_connect ( - G_OBJECT (e_table), "drag_drop", + e_table, "drag_drop", G_CALLBACK (et_drag_drop), e_table); g_signal_connect ( - G_OBJECT (e_table), "drag_data_received", + e_table, "drag_data_received", G_CALLBACK (et_drag_data_received), e_table); - g_signal_connect (G_OBJECT(e_table->table_canvas), "reflow", - G_CALLBACK (table_canvas_reflow), e_table); + g_signal_connect ( + e_table->table_canvas, "reflow", + G_CALLBACK (table_canvas_reflow), e_table); widget = GTK_WIDGET (e_table->table_canvas); style = gtk_widget_get_style (widget); @@ -1340,14 +1417,17 @@ e_table_setup_table (ETable *e_table, ETableHeader *full_header, ETableHeader *h "fill_color_gdk", &style->base[GTK_STATE_NORMAL], NULL); - g_signal_connect (G_OBJECT (e_table->white_item), "event", - G_CALLBACK (white_item_event), e_table); + g_signal_connect ( + e_table->white_item, "event", + G_CALLBACK (white_item_event), e_table); - g_signal_connect (G_OBJECT(e_table->table_canvas), "realize", - G_CALLBACK (et_canvas_realize), e_table); + g_signal_connect ( + e_table->table_canvas, "realize", + G_CALLBACK (et_canvas_realize), e_table); - g_signal_connect (G_OBJECT(gnome_canvas_root (e_table->table_canvas)), "event", - G_CALLBACK (et_canvas_root_event), e_table); + g_signal_connect ( + gnome_canvas_root (e_table->table_canvas), "event", + G_CALLBACK (et_canvas_root_event), e_table); e_table->canvas_vbox = gnome_canvas_item_new ( gnome_canvas_root (e_table->table_canvas), @@ -1389,7 +1469,8 @@ e_table_setup_table (ETable *e_table, ETableHeader *full_header, ETableHeader *h } static void -e_table_fill_table (ETable *e_table, ETableModel *model) +e_table_fill_table (ETable *e_table, + ETableModel *model) { e_table_group_add_all (e_table->group); } @@ -1404,7 +1485,8 @@ e_table_fill_table (ETable *e_table, ETableModel *model) * **/ void -e_table_set_state_object (ETable *e_table, ETableState *state) +e_table_set_state_object (ETable *e_table, + ETableState *state) { GValue *val; GtkWidget *widget; @@ -1434,12 +1516,13 @@ e_table_set_state_object (ETable *e_table, ETableState *state) if (state->sort_info) { e_table->sort_info = e_table_sort_info_duplicate (state->sort_info); e_table_sort_info_set_can_group (e_table->sort_info, e_table->allow_grouping); - e_table->group_info_change_id = - g_signal_connect (G_OBJECT (e_table->sort_info), "group_info_changed", - G_CALLBACK (group_info_changed), e_table); - e_table->sort_info_change_id = - g_signal_connect (G_OBJECT (e_table->sort_info), "sort_info_changed", - G_CALLBACK (sort_info_changed), e_table); + e_table->group_info_change_id = g_signal_connect ( + e_table->sort_info, "group_info_changed", + G_CALLBACK (group_info_changed), e_table); + + e_table->sort_info_change_id = g_signal_connect ( + e_table->sort_info, "sort_info_changed", + G_CALLBACK (sort_info_changed), e_table); } else e_table->sort_info = NULL; @@ -1474,8 +1557,8 @@ e_table_set_state_object (ETable *e_table, ETableState *state) * **/ void -e_table_set_state (ETable *e_table, - const gchar *state_str) +e_table_set_state (ETable *e_table, + const gchar *state_str) { ETableState *state; @@ -1501,8 +1584,8 @@ e_table_set_state (ETable *e_table, * **/ void -e_table_load_state (ETable *e_table, - const gchar *filename) +e_table_load_state (ETable *e_table, + const gchar *filename) { ETableState *state; @@ -1592,8 +1675,8 @@ gchar *e_table_get_state (ETable *e_table * **/ void -e_table_save_state (ETable *e_table, - const gchar *filename) +e_table_save_state (ETable *e_table, + const gchar *filename) { ETableState *state; @@ -1603,20 +1686,26 @@ e_table_save_state (ETable *e_table, } static void -et_selection_model_selection_changed (ETableGroup *etg, ETable *et) +et_selection_model_selection_changed (ETableGroup *etg, + ETable *et) { g_signal_emit (G_OBJECT (et), et_signals[SELECTION_CHANGE], 0); } static void -et_selection_model_selection_row_changed (ETableGroup *etg, gint row, ETable *et) +et_selection_model_selection_row_changed (ETableGroup *etg, + gint row, + ETable *et) { g_signal_emit (G_OBJECT (et), et_signals[SELECTION_CHANGE], 0); } static ETable * -et_real_construct (ETable *e_table, ETableModel *etm, ETableExtras *ete, - ETableSpecification *specification, ETableState *state) +et_real_construct (ETable *e_table, + ETableModel *etm, + ETableExtras *ete, + ETableSpecification *specification, + ETableState *state) { gint row = 0; gint col_count, i; @@ -1751,8 +1840,11 @@ et_real_construct (ETable *e_table, ETableModel *etm, ETableExtras *ete, * The passed in value @e_table or %NULL if there's an error. **/ ETable * -e_table_construct (ETable *e_table, ETableModel *etm, ETableExtras *ete, - const gchar *spec_str, const gchar *state_str) +e_table_construct (ETable *e_table, + ETableModel *etm, + ETableExtras *ete, + const gchar *spec_str, + const gchar *state_str) { ETableSpecification *specification; ETableState *state; @@ -1811,8 +1903,11 @@ e_table_construct (ETable *e_table, ETableModel *etm, ETableExtras *ete, * The passed in value @e_table or %NULL if there's an error. **/ ETable * -e_table_construct_from_spec_file (ETable *e_table, ETableModel *etm, ETableExtras *ete, - const gchar *spec_fn, const gchar *state_fn) +e_table_construct_from_spec_file (ETable *e_table, + ETableModel *etm, + ETableExtras *ete, + const gchar *spec_fn, + const gchar *state_fn) { ETableSpecification *specification; ETableState *state; @@ -2027,7 +2122,8 @@ e_table_get_specification (ETable *e_table) } gint -e_table_set_specification (ETable *e_table, const gchar *spec) +e_table_set_specification (ETable *e_table, + const gchar *spec) { xmlDoc *xmlSpec; gint ret; @@ -2045,7 +2141,8 @@ e_table_set_specification (ETable *e_table, const gchar *spec) } void -e_table_save_specification (ETable *e_table, const gchar *filename) +e_table_save_specification (ETable *e_table, + const gchar *filename) { xmlDoc *doc = et_build_tree (e_table); @@ -2059,7 +2156,8 @@ e_table_save_specification (ETable *e_table, const gchar *filename) } gint -e_table_load_specification (ETable *e_table, gchar *filename) +e_table_load_specification (ETable *e_table, + gchar *filename) { xmlDoc *xmlSpec; gint ret; @@ -2093,7 +2191,8 @@ e_table_load_specification (ETable *e_table, gchar *filename) * Sets the cursor row and the selection to the given row number. **/ void -e_table_set_cursor_row (ETable *e_table, gint row) +e_table_set_cursor_row (ETable *e_table, + gint row) { g_return_if_fail (e_table != NULL); g_return_if_fail (E_IS_TABLE (e_table)); @@ -2140,9 +2239,9 @@ e_table_get_cursor_row (ETable *e_table) * and then act upon that list. (In inverse order if it's rows.) **/ void -e_table_selected_row_foreach (ETable *e_table, - EForeachFunc callback, - gpointer closure) +e_table_selected_row_foreach (ETable *e_table, + EForeachFunc callback, + gpointer closure) { g_return_if_fail (e_table != NULL); g_return_if_fail (E_IS_TABLE (e_table)); @@ -2162,7 +2261,7 @@ e_table_selected_row_foreach (ETable *e_table, * The number of rows selected. **/ gint -e_table_selected_count (ETable *e_table) +e_table_selected_count (ETable *e_table) { g_return_val_if_fail (e_table != NULL, -1); g_return_val_if_fail (E_IS_TABLE (e_table), -1); @@ -2248,13 +2347,13 @@ e_table_commit_click_to_add (ETable *table) static void et_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) + guint property_id, + GValue *value, + GParamSpec *pspec) { ETable *etable = E_TABLE (object); - switch (prop_id) { + switch (property_id) { case PROP_MODEL: g_value_set_object (value, etable->model); break; @@ -2311,13 +2410,13 @@ typedef struct { static void et_set_property (GObject *object, - guint prop_id, + guint property_id, const GValue *value, GParamSpec *pspec) { ETable *etable = E_TABLE (object); - switch (prop_id) { + switch (property_id) { case PROP_LENGTH_THRESHOLD: etable->length_threshold = g_value_get_int (value); if (etable->group) { @@ -2418,8 +2517,8 @@ et_set_property (GObject *object, * The model row number. **/ gint -e_table_get_next_row (ETable *e_table, - gint model_row) +e_table_get_next_row (ETable *e_table, + gint model_row) { g_return_val_if_fail (e_table != NULL, -1); g_return_val_if_fail (E_IS_TABLE (e_table), -1); @@ -2452,8 +2551,8 @@ e_table_get_next_row (ETable *e_table, * The model row number. **/ gint -e_table_get_prev_row (ETable *e_table, - gint model_row) +e_table_get_prev_row (ETable *e_table, + gint model_row) { g_return_val_if_fail (e_table != NULL, -1); g_return_val_if_fail (E_IS_TABLE (e_table), -1); @@ -2481,8 +2580,8 @@ e_table_get_prev_row (ETable *e_table, * The view row number. **/ gint -e_table_model_to_view_row (ETable *e_table, - gint model_row) +e_table_model_to_view_row (ETable *e_table, + gint model_row) { g_return_val_if_fail (e_table != NULL, -1); g_return_val_if_fail (E_IS_TABLE (e_table), -1); @@ -2504,8 +2603,8 @@ e_table_model_to_view_row (ETable *e_table, * The model row number. **/ gint -e_table_view_to_model_row (ETable *e_table, - gint view_row) +e_table_view_to_model_row (ETable *e_table, + gint view_row) { g_return_val_if_fail (e_table != NULL, -1); g_return_val_if_fail (E_IS_TABLE (e_table), -1); @@ -2529,8 +2628,10 @@ e_table_view_to_model_row (ETable *e_table, **/ void e_table_get_cell_at (ETable *table, - gint x, gint y, - gint *row_return, gint *col_return) + gint x, + gint y, + gint *row_return, + gint *col_return) { GtkAdjustment *adjustment; GtkScrollable *scrollable; @@ -2571,9 +2672,12 @@ e_table_get_cell_at (ETable *table, **/ void e_table_get_cell_geometry (ETable *table, - gint row, gint col, - gint *x_return, gint *y_return, - gint *width_return, gint *height_return) + gint row, + gint col, + gint *x_return, + gint *y_return, + gint *width_return, + gint *height_return) { GtkAllocation allocation; GtkAdjustment *adjustment; @@ -2614,7 +2718,9 @@ e_table_get_cell_geometry (ETable *table, * based on the mouse motion information in the group. **/ void -e_table_get_mouse_over_cell (ETable *table, gint *row, gint *col) +e_table_get_mouse_over_cell (ETable *table, + gint *row, + gint *col) { g_return_if_fail (table != NULL); g_return_if_fail (E_IS_TABLE (table)); @@ -2724,12 +2830,12 @@ struct _GtkDragSourceInfo * **/ void -e_table_drag_get_data (ETable *table, - gint row, - gint col, - GdkDragContext *context, - GdkAtom target, - guint32 time) +e_table_drag_get_data (ETable *table, + gint row, + gint col, + GdkDragContext *context, + GdkAtom target, + guint32 time) { g_return_if_fail (table != NULL); g_return_if_fail (E_IS_TABLE (table)); @@ -2751,8 +2857,8 @@ e_table_drag_get_data (ETable *table, **/ void e_table_drag_highlight (ETable *table, - gint row, - gint col) + gint row, + gint col) { GtkAllocation allocation; GtkAdjustment *adjustment; @@ -2867,7 +2973,10 @@ e_table_drag_dest_unset (GtkWidget *widget) /* Source side */ static gint -et_real_start_drag (ETable *table, gint row, gint col, GdkEvent *event) +et_real_start_drag (ETable *table, + gint row, + gint col, + GdkEvent *event) { GtkDragSourceInfo *info; GdkDragContext *context; @@ -2910,11 +3019,11 @@ et_real_start_drag (ETable *table, gint row, gint col, GdkEvent *event) * Registers this table as a drag site, and possibly adds default behaviors. **/ void -e_table_drag_source_set (ETable *table, - GdkModifierType start_button_mask, - const GtkTargetEntry *targets, - gint n_targets, - GdkDragAction actions) +e_table_drag_source_set (ETable *table, + GdkModifierType start_button_mask, + const GtkTargetEntry *targets, + gint n_targets, + GdkDragAction actions) { ETableDragSourceSite *site; GtkWidget *canvas; @@ -2995,13 +3104,13 @@ e_table_drag_source_unset (ETable *table) * The drag context. **/ GdkDragContext * -e_table_drag_begin (ETable *table, - gint row, - gint col, - GtkTargetList *targets, - GdkDragAction actions, - gint button, - GdkEvent *event) +e_table_drag_begin (ETable *table, + gint row, + gint col, + GtkTargetList *targets, + GdkDragAction actions, + gint button, + GdkEvent *event) { g_return_val_if_fail (table != NULL, NULL); g_return_val_if_fail (E_IS_TABLE (table), NULL); @@ -3018,8 +3127,8 @@ e_table_drag_begin (ETable *table, static void et_drag_begin (GtkWidget *widget, - GdkDragContext *context, - ETable *et) + GdkDragContext *context, + ETable *et) { g_signal_emit (G_OBJECT (et), et_signals[TABLE_DRAG_BEGIN], 0, et->drag_row, et->drag_col, context); @@ -3027,8 +3136,8 @@ et_drag_begin (GtkWidget *widget, static void et_drag_end (GtkWidget *widget, - GdkDragContext *context, - ETable *et) + GdkDragContext *context, + ETable *et) { g_signal_emit (G_OBJECT (et), et_signals[TABLE_DRAG_END], 0, et->drag_row, et->drag_col, context); @@ -3036,11 +3145,11 @@ et_drag_end (GtkWidget *widget, static void et_drag_data_get (GtkWidget *widget, - GdkDragContext *context, - GtkSelectionData *selection_data, - guint info, - guint time, - ETable *et) + GdkDragContext *context, + GtkSelectionData *selection_data, + guint info, + guint time, + ETable *et) { g_signal_emit (G_OBJECT (et), et_signals[TABLE_DRAG_DATA_GET], 0, et->drag_row, et->drag_col, context, selection_data, @@ -3049,8 +3158,8 @@ et_drag_data_get (GtkWidget *widget, static void et_drag_data_delete (GtkWidget *widget, - GdkDragContext *context, - ETable *et) + GdkDragContext *context, + ETable *et) { g_signal_emit (G_OBJECT (et), et_signals[TABLE_DRAG_DATA_DELETE], 0, et->drag_row, et->drag_col, context); @@ -3058,10 +3167,10 @@ et_drag_data_delete (GtkWidget *widget, static gboolean do_drag_motion (ETable *et, - GdkDragContext *context, - gint x, - gint y, - guint time) + GdkDragContext *context, + gint x, + gint y, + guint time) { gboolean ret_val; gint row = -1, col = -1; @@ -3141,7 +3250,8 @@ scroll_timeout (gpointer data) } static void -scroll_on (ETable *et, guint scroll_direction) +scroll_on (ETable *et, + guint scroll_direction) { if (et->scroll_idle_id == 0 || scroll_direction != et->scroll_direction) { if (et->scroll_idle_id != 0) @@ -3177,7 +3287,8 @@ context_destroyed (gpointer data) } static void -context_connect (ETable *et, GdkDragContext *context) +context_connect (ETable *et, + GdkDragContext *context) { if (g_dataset_get_data (context, "e-table") == NULL) { g_object_ref (et); @@ -3187,9 +3298,9 @@ context_connect (ETable *et, GdkDragContext *context) static void et_drag_leave (GtkWidget *widget, - GdkDragContext *context, - guint time, - ETable *et) + GdkDragContext *context, + guint time, + ETable *et) { g_signal_emit (G_OBJECT (et), et_signals[TABLE_DRAG_LEAVE], 0, et->drop_row, et->drop_col, context, time); @@ -3201,11 +3312,11 @@ et_drag_leave (GtkWidget *widget, static gboolean et_drag_motion (GtkWidget *widget, - GdkDragContext *context, - gint x, - gint y, - guint time, - ETable *et) + GdkDragContext *context, + gint x, + gint y, + guint time, + ETable *et) { GtkAllocation allocation; gboolean ret_val; @@ -3240,11 +3351,11 @@ et_drag_motion (GtkWidget *widget, static gboolean et_drag_drop (GtkWidget *widget, - GdkDragContext *context, - gint x, - gint y, - guint time, - ETable *et) + GdkDragContext *context, + gint x, + gint y, + guint time, + ETable *et) { gboolean ret_val; gint row, col; @@ -3271,13 +3382,13 @@ et_drag_drop (GtkWidget *widget, static void et_drag_data_received (GtkWidget *widget, - GdkDragContext *context, - gint x, - gint y, - GtkSelectionData *selection_data, - guint info, - guint time, - ETable *et) + GdkDragContext *context, + gint x, + gint y, + GtkSelectionData *selection_data, + guint info, + guint time, + ETable *et) { gint row, col; diff --git a/widgets/table/e-table.h b/widgets/table/e-table.h index 99daf6d1e5..e1e4e0eb8f 100644 --- a/widgets/table/e-table.h +++ b/widgets/table/e-table.h @@ -121,8 +121,8 @@ struct _ETable { gint length_threshold; gint rebuild_idle_id; - guint need_rebuild:1; - guint size_allocated:1; + guint need_rebuild : 1; + guint size_allocated : 1; /* * Configuration settings diff --git a/widgets/table/e-tree-memory-callbacks.c b/widgets/table/e-tree-memory-callbacks.c index 7281f3d327..9f8d7d468a 100644 --- a/widgets/table/e-tree-memory-callbacks.c +++ b/widgets/table/e-tree-memory-callbacks.c @@ -34,7 +34,8 @@ G_DEFINE_TYPE (ETreeMemoryCallbacks, e_tree_memory_callbacks, E_TYPE_TREE_MEMORY) static GdkPixbuf * -etmc_icon_at (ETreeModel *etm, ETreePath node) +etmc_icon_at (ETreeModel *etm, + ETreePath node) { ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS (etm); @@ -64,7 +65,8 @@ etmc_has_save_id (ETreeModel *etm) } static gchar * -etmc_get_save_id (ETreeModel *etm, ETreePath node) +etmc_get_save_id (ETreeModel *etm, + ETreePath node) { ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS (etm); @@ -86,7 +88,8 @@ etmc_has_get_node_by_id (ETreeModel *etm) } static ETreePath -etmc_get_node_by_id (ETreeModel *etm, const gchar *save_id) +etmc_get_node_by_id (ETreeModel *etm, + const gchar *save_id) { ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS (etm); @@ -97,7 +100,9 @@ etmc_get_node_by_id (ETreeModel *etm, const gchar *save_id) } static gpointer -etmc_sort_value_at (ETreeModel *etm, ETreePath node, gint col) +etmc_sort_value_at (ETreeModel *etm, + ETreePath node, + gint col) { ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS (etm); @@ -108,7 +113,9 @@ etmc_sort_value_at (ETreeModel *etm, ETreePath node, gint col) } static gpointer -etmc_value_at (ETreeModel *etm, ETreePath node, gint col) +etmc_value_at (ETreeModel *etm, + ETreePath node, + gint col) { ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS (etm); @@ -116,7 +123,10 @@ etmc_value_at (ETreeModel *etm, ETreePath node, gint col) } static void -etmc_set_value_at (ETreeModel *etm, ETreePath node, gint col, gconstpointer val) +etmc_set_value_at (ETreeModel *etm, + ETreePath node, + gint col, + gconstpointer val) { ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS (etm); @@ -124,7 +134,9 @@ etmc_set_value_at (ETreeModel *etm, ETreePath node, gint col, gconstpointer val) } static gboolean -etmc_is_editable (ETreeModel *etm, ETreePath node, gint col) +etmc_is_editable (ETreeModel *etm, + ETreePath node, + gint col) { ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS (etm); @@ -133,7 +145,9 @@ etmc_is_editable (ETreeModel *etm, ETreePath node, gint col) /* The default for etmc_duplicate_value is to return the raw value. */ static gpointer -etmc_duplicate_value (ETreeModel *etm, gint col, gconstpointer value) +etmc_duplicate_value (ETreeModel *etm, + gint col, + gconstpointer value) { ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS (etm); @@ -144,7 +158,9 @@ etmc_duplicate_value (ETreeModel *etm, gint col, gconstpointer value) } static void -etmc_free_value (ETreeModel *etm, gint col, gpointer value) +etmc_free_value (ETreeModel *etm, + gint col, + gpointer value) { ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS (etm); @@ -153,7 +169,8 @@ etmc_free_value (ETreeModel *etm, gint col, gpointer value) } static gpointer -etmc_initialize_value (ETreeModel *etm, gint col) +etmc_initialize_value (ETreeModel *etm, + gint col) { ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS (etm); @@ -164,7 +181,9 @@ etmc_initialize_value (ETreeModel *etm, gint col) } static gboolean -etmc_value_is_empty (ETreeModel *etm, gint col, gconstpointer value) +etmc_value_is_empty (ETreeModel *etm, + gint col, + gconstpointer value) { ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS (etm); @@ -175,7 +194,9 @@ etmc_value_is_empty (ETreeModel *etm, gint col, gconstpointer value) } static gchar * -etmc_value_to_string (ETreeModel *etm, gint col, gconstpointer value) +etmc_value_to_string (ETreeModel *etm, + gint col, + gconstpointer value) { ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS (etm); @@ -240,28 +261,28 @@ e_tree_memory_callbacks_init (ETreeMemoryCallbacks *etmc) * */ ETreeModel * -e_tree_memory_callbacks_new (ETreeMemoryCallbacksIconAtFn icon_at, +e_tree_memory_callbacks_new (ETreeMemoryCallbacksIconAtFn icon_at, - ETreeMemoryCallbacksColumnCountFn column_count, + ETreeMemoryCallbacksColumnCountFn column_count, - ETreeMemoryCallbacksHasSaveIdFn has_save_id, - ETreeMemoryCallbacksGetSaveIdFn get_save_id, + ETreeMemoryCallbacksHasSaveIdFn has_save_id, + ETreeMemoryCallbacksGetSaveIdFn get_save_id, - ETreeMemoryCallbacksHasGetNodeByIdFn has_get_node_by_id, - ETreeMemoryCallbacksGetNodeByIdFn get_node_by_id, + ETreeMemoryCallbacksHasGetNodeByIdFn has_get_node_by_id, + ETreeMemoryCallbacksGetNodeByIdFn get_node_by_id, - ETreeMemoryCallbacksValueAtFn sort_value_at, - ETreeMemoryCallbacksValueAtFn value_at, - ETreeMemoryCallbacksSetValueAtFn set_value_at, - ETreeMemoryCallbacksIsEditableFn is_editable, + ETreeMemoryCallbacksValueAtFn sort_value_at, + ETreeMemoryCallbacksValueAtFn value_at, + ETreeMemoryCallbacksSetValueAtFn set_value_at, + ETreeMemoryCallbacksIsEditableFn is_editable, - ETreeMemoryCallbacksDuplicateValueFn duplicate_value, - ETreeMemoryCallbacksFreeValueFn free_value, - ETreeMemoryCallbacksInitializeValueFn initialize_value, - ETreeMemoryCallbacksValueIsEmptyFn value_is_empty, - ETreeMemoryCallbacksValueToStringFn value_to_string, + ETreeMemoryCallbacksDuplicateValueFn duplicate_value, + ETreeMemoryCallbacksFreeValueFn free_value, + ETreeMemoryCallbacksInitializeValueFn initialize_value, + ETreeMemoryCallbacksValueIsEmptyFn value_is_empty, + ETreeMemoryCallbacksValueToStringFn value_to_string, - gpointer model_data) + gpointer model_data) { ETreeMemoryCallbacks *etmc; @@ -290,6 +311,6 @@ e_tree_memory_callbacks_new (ETreeMemoryCallbacksIconAtFn icon_at, etmc->model_data = model_data; - return (ETreeModel*) etmc; + return (ETreeModel *) etmc; } diff --git a/widgets/table/e-tree-memory.c b/widgets/table/e-tree-memory.c index 4b9a977f05..43fb41b29c 100644 --- a/widgets/table/e-tree-memory.c +++ b/widgets/table/e-tree-memory.c @@ -81,7 +81,8 @@ struct _ETreeMemoryPrivate { /* ETreeMemoryPath functions */ static inline void -check_children (ETreeMemory *memory, ETreePath node) +check_children (ETreeMemory *memory, + ETreePath node) { ETreeMemoryPath *path = node; if (!path->children_computed) { @@ -236,14 +237,16 @@ etmm_get_root (ETreeModel *etm) } static ETreePath -etmm_get_parent (ETreeModel *etm, ETreePath node) +etmm_get_parent (ETreeModel *etm, + ETreePath node) { ETreeMemoryPath *path = node; return path->parent; } static ETreePath -etmm_get_first_child (ETreeModel *etm, ETreePath node) +etmm_get_first_child (ETreeModel *etm, + ETreePath node) { ETreeMemoryPath *path = node; @@ -252,7 +255,8 @@ etmm_get_first_child (ETreeModel *etm, ETreePath node) } static ETreePath -etmm_get_last_child (ETreeModel *etm, ETreePath node) +etmm_get_last_child (ETreeModel *etm, + ETreePath node) { ETreeMemoryPath *path = node; @@ -261,28 +265,32 @@ etmm_get_last_child (ETreeModel *etm, ETreePath node) } static ETreePath -etmm_get_next (ETreeModel *etm, ETreePath node) +etmm_get_next (ETreeModel *etm, + ETreePath node) { ETreeMemoryPath *path = node; return path->next_sibling; } static ETreePath -etmm_get_prev (ETreeModel *etm, ETreePath node) +etmm_get_prev (ETreeModel *etm, + ETreePath node) { ETreeMemoryPath *path = node; return path->prev_sibling; } static gboolean -etmm_is_root (ETreeModel *etm, ETreePath node) +etmm_is_root (ETreeModel *etm, + ETreePath node) { ETreeMemoryPath *path = node; return e_tree_memory_path_depth (path) == 0; } static gboolean -etmm_is_expandable (ETreeModel *etm, ETreePath node) +etmm_is_expandable (ETreeModel *etm, + ETreePath node) { ETreeMemoryPath *path = node; @@ -291,7 +299,9 @@ etmm_is_expandable (ETreeModel *etm, ETreePath node) } static guint -etmm_get_children (ETreeModel *etm, ETreePath node, ETreePath **nodes) +etmm_get_children (ETreeModel *etm, + ETreePath node, + ETreePath **nodes) { ETreeMemoryPath *path = node; guint n_children; @@ -314,7 +324,8 @@ etmm_get_children (ETreeModel *etm, ETreePath node, ETreePath **nodes) } static guint -etmm_depth (ETreeModel *etm, ETreePath path) +etmm_depth (ETreeModel *etm, + ETreePath path) { return e_tree_memory_path_depth (path); } @@ -338,7 +349,8 @@ etmm_clear_children_computed (ETreeMemoryPath *path) } static void -etmm_node_request_collapse (ETreeModel *etm, ETreePath node) +etmm_node_request_collapse (ETreeModel *etm, + ETreePath node) { ETreeModelClass *parent_class; @@ -430,7 +442,8 @@ e_tree_memory_new (void) * the value of @expanded. */ void -e_tree_memory_set_expanded_default (ETreeMemory *etree, gboolean expanded) +e_tree_memory_set_expanded_default (ETreeMemory *etree, + gboolean expanded) { g_return_if_fail (etree != NULL); @@ -447,7 +460,8 @@ e_tree_memory_set_expanded_default (ETreeMemory *etree, gboolean expande * Return value: **/ gpointer -e_tree_memory_node_get_data (ETreeMemory *etmm, ETreePath node) +e_tree_memory_node_get_data (ETreeMemory *etmm, + ETreePath node) { ETreeMemoryPath *path = node; @@ -465,7 +479,9 @@ e_tree_memory_node_get_data (ETreeMemory *etmm, ETreePath node) * **/ void -e_tree_memory_node_set_data (ETreeMemory *etmm, ETreePath node, gpointer node_data) +e_tree_memory_node_set_data (ETreeMemory *etmm, + ETreePath node, + gpointer node_data) { ETreeMemoryPath *path = node; @@ -487,9 +503,9 @@ e_tree_memory_node_set_data (ETreeMemory *etmm, ETreePath node, gpointer node_da **/ ETreePath e_tree_memory_node_insert (ETreeMemory *tree_model, - ETreePath parent_node, - gint position, - gpointer node_data) + ETreePath parent_node, + gint position, + gpointer node_data) { ETreeMemoryPrivate *priv; ETreeMemoryPath *new_path; @@ -550,9 +566,9 @@ e_tree_memory_node_insert_id (ETreeMemory *etree, **/ ETreePath e_tree_memory_node_insert_before (ETreeMemory *etree, - ETreePath parent, - ETreePath sibling, - gpointer node_data) + ETreePath parent, + ETreePath sibling, + gpointer node_data) { ETreeMemoryPath *child; ETreeMemoryPath *parent_path = parent; @@ -574,7 +590,8 @@ e_tree_memory_node_insert_before (ETreeMemory *etree, /* just blows away child data, doesn't take into account unlinking/etc */ static void -child_free (ETreeMemory *etree, ETreeMemoryPath *node) +child_free (ETreeMemory *etree, + ETreeMemoryPath *node) { ETreeMemoryPath *child, *next; @@ -602,7 +619,8 @@ child_free (ETreeMemory *etree, ETreeMemoryPath *node) * Return value: **/ gpointer -e_tree_memory_node_remove (ETreeMemory *etree, ETreePath node) +e_tree_memory_node_remove (ETreeMemory *etree, + ETreePath node) { ETreeMemoryPath *path = node; ETreeMemoryPath *parent = path->parent; @@ -622,7 +640,7 @@ e_tree_memory_node_remove (ETreeMemory *etree, ETreePath node) } /* unlink this node - we only have to unlink the root node being removed, - since the others are only references from this node */ + * since the others are only references from this node */ e_tree_path_unlink (path); /*printf("removing %d nodes from position %d\n", visible, base);*/ @@ -647,7 +665,9 @@ typedef struct { } MemoryAndClosure; static gint -sort_callback (gconstpointer data1, gconstpointer data2, gpointer user_data) +sort_callback (gconstpointer data1, + gconstpointer data2, + gpointer user_data) { ETreePath path1 = *(ETreePath *) data1; ETreePath path2 = *(ETreePath *) data2; @@ -656,10 +676,10 @@ sort_callback (gconstpointer data1, gconstpointer data2, gpointer user_data) } void -e_tree_memory_sort_node (ETreeMemory *etmm, - ETreePath node, - ETreeMemorySortCallback callback, - gpointer user_data) +e_tree_memory_sort_node (ETreeMemory *etmm, + ETreePath node, + ETreeMemorySortCallback callback, + gpointer user_data) { ETreeMemoryPath **children; ETreeMemoryPath *child; @@ -716,9 +736,9 @@ e_tree_memory_sort_node (ETreeMemory *etmm, } void -e_tree_memory_set_node_destroy_func (ETreeMemory *etmm, - GFunc destroy_func, - gpointer user_data) +e_tree_memory_set_node_destroy_func (ETreeMemory *etmm, + GFunc destroy_func, + gpointer user_data) { etmm->priv->destroy_func = destroy_func; etmm->priv->destroy_user_data = user_data; diff --git a/widgets/table/e-tree-model.c b/widgets/table/e-tree-model.c index 8772e5309f..b37ce4bf17 100644 --- a/widgets/table/e-tree-model.c +++ b/widgets/table/e-tree-model.c @@ -223,7 +223,7 @@ e_tree_model_init (ETreeModel *tree_model) * Return value: **/ void -e_tree_model_pre_change (ETreeModel *tree_model) +e_tree_model_pre_change (ETreeModel *tree_model) { g_return_if_fail (tree_model != NULL); g_return_if_fail (E_IS_TREE_MODEL (tree_model)); @@ -243,7 +243,7 @@ e_tree_model_pre_change (ETreeModel *tree_model) * Return value: **/ void -e_tree_model_no_change (ETreeModel *tree_model) +e_tree_model_no_change (ETreeModel *tree_model) { g_return_if_fail (tree_model != NULL); g_return_if_fail (E_IS_TREE_MODEL (tree_model)); @@ -263,7 +263,7 @@ e_tree_model_no_change (ETreeModel *tree_model) * Return value: **/ void -e_tree_model_rebuilt (ETreeModel *tree_model) +e_tree_model_rebuilt (ETreeModel *tree_model) { g_return_if_fail (tree_model != NULL); g_return_if_fail (E_IS_TREE_MODEL (tree_model)); @@ -282,7 +282,8 @@ e_tree_model_rebuilt (ETreeModel *tree_model) * Return value: **/ void -e_tree_model_node_changed (ETreeModel *tree_model, ETreePath node) +e_tree_model_node_changed (ETreeModel *tree_model, + ETreePath node) { g_return_if_fail (tree_model != NULL); g_return_if_fail (E_IS_TREE_MODEL (tree_model)); @@ -302,7 +303,8 @@ e_tree_model_node_changed (ETreeModel *tree_model, ETreePath node) * Return value: **/ void -e_tree_model_node_data_changed (ETreeModel *tree_model, ETreePath node) +e_tree_model_node_data_changed (ETreeModel *tree_model, + ETreePath node) { g_return_if_fail (tree_model != NULL); g_return_if_fail (E_IS_TREE_MODEL (tree_model)); @@ -322,7 +324,9 @@ e_tree_model_node_data_changed (ETreeModel *tree_model, ETreePath node) * Return value: **/ void -e_tree_model_node_col_changed (ETreeModel *tree_model, ETreePath node, gint col) +e_tree_model_node_col_changed (ETreeModel *tree_model, + ETreePath node, + gint col) { g_return_if_fail (tree_model != NULL); g_return_if_fail (E_IS_TREE_MODEL (tree_model)); @@ -342,8 +346,8 @@ e_tree_model_node_col_changed (ETreeModel *tree_model, ETreePath node, gint col **/ void e_tree_model_node_inserted (ETreeModel *tree_model, - ETreePath parent_node, - ETreePath inserted_node) + ETreePath parent_node, + ETreePath inserted_node) { g_return_if_fail (tree_model != NULL); g_return_if_fail (E_IS_TREE_MODEL (tree_model)); @@ -363,7 +367,10 @@ e_tree_model_node_inserted (ETreeModel *tree_model, * **/ void -e_tree_model_node_removed (ETreeModel *tree_model, ETreePath parent_node, ETreePath removed_node, gint old_position) +e_tree_model_node_removed (ETreeModel *tree_model, + ETreePath parent_node, + ETreePath removed_node, + gint old_position) { g_return_if_fail (tree_model != NULL); g_return_if_fail (E_IS_TREE_MODEL (tree_model)); @@ -382,7 +389,8 @@ e_tree_model_node_removed (ETreeModel *tree_model, ETreePath parent_node, ETree * **/ void -e_tree_model_node_deleted (ETreeModel *tree_model, ETreePath deleted_node) +e_tree_model_node_deleted (ETreeModel *tree_model, + ETreePath deleted_node) { g_return_if_fail (tree_model != NULL); g_return_if_fail (E_IS_TREE_MODEL (tree_model)); @@ -400,7 +408,8 @@ e_tree_model_node_deleted (ETreeModel *tree_model, ETreePath deleted_node) * **/ void -e_tree_model_node_request_collapse (ETreeModel *tree_model, ETreePath collapsed_node) +e_tree_model_node_request_collapse (ETreeModel *tree_model, + ETreePath collapsed_node) { g_return_if_fail (tree_model != NULL); g_return_if_fail (E_IS_TREE_MODEL (tree_model)); @@ -455,7 +464,8 @@ e_tree_model_get_root (ETreeModel *etree) * Return value: **/ ETreePath -e_tree_model_node_get_parent (ETreeModel *etree, ETreePath node) +e_tree_model_node_get_parent (ETreeModel *etree, + ETreePath node) { g_return_val_if_fail (etree != NULL, NULL); if (ETM_CLASS (etree)->get_parent) @@ -474,7 +484,8 @@ e_tree_model_node_get_parent (ETreeModel *etree, ETreePath node) * Return value: **/ ETreePath -e_tree_model_node_get_first_child (ETreeModel *etree, ETreePath node) +e_tree_model_node_get_first_child (ETreeModel *etree, + ETreePath node) { g_return_val_if_fail (etree != NULL, NULL); g_return_val_if_fail (E_IS_TREE_MODEL (etree), NULL); @@ -495,7 +506,8 @@ e_tree_model_node_get_first_child (ETreeModel *etree, ETreePath node) * Return value: **/ ETreePath -e_tree_model_node_get_last_child (ETreeModel *etree, ETreePath node) +e_tree_model_node_get_last_child (ETreeModel *etree, + ETreePath node) { g_return_val_if_fail (etree != NULL, NULL); g_return_val_if_fail (E_IS_TREE_MODEL (etree), NULL); @@ -516,7 +528,8 @@ e_tree_model_node_get_last_child (ETreeModel *etree, ETreePath node) * Return value: **/ ETreePath -e_tree_model_node_get_next (ETreeModel *etree, ETreePath node) +e_tree_model_node_get_next (ETreeModel *etree, + ETreePath node) { g_return_val_if_fail (etree != NULL, NULL); g_return_val_if_fail (E_IS_TREE_MODEL (etree), NULL); @@ -537,7 +550,8 @@ e_tree_model_node_get_next (ETreeModel *etree, ETreePath node) * Return value: **/ ETreePath -e_tree_model_node_get_prev (ETreeModel *etree, ETreePath node) +e_tree_model_node_get_prev (ETreeModel *etree, + ETreePath node) { g_return_val_if_fail (etree != NULL, NULL); g_return_val_if_fail (E_IS_TREE_MODEL (etree), NULL); @@ -558,7 +572,8 @@ e_tree_model_node_get_prev (ETreeModel *etree, ETreePath node) * Return value: **/ gboolean -e_tree_model_node_is_root (ETreeModel *etree, ETreePath node) +e_tree_model_node_is_root (ETreeModel *etree, + ETreePath node) { g_return_val_if_fail (etree != NULL, FALSE); @@ -578,7 +593,8 @@ e_tree_model_node_is_root (ETreeModel *etree, ETreePath node) * Return value: **/ gboolean -e_tree_model_node_is_expandable (ETreeModel *etree, ETreePath node) +e_tree_model_node_is_expandable (ETreeModel *etree, + ETreePath node) { g_return_val_if_fail (etree != NULL, FALSE); g_return_val_if_fail (node != NULL, FALSE); @@ -590,7 +606,9 @@ e_tree_model_node_is_expandable (ETreeModel *etree, ETreePath node) } guint -e_tree_model_node_get_children (ETreeModel *etree, ETreePath node, ETreePath **nodes) +e_tree_model_node_get_children (ETreeModel *etree, + ETreePath node, + ETreePath **nodes) { g_return_val_if_fail (etree != NULL, 0); if (ETM_CLASS (etree)->get_children) @@ -609,7 +627,8 @@ e_tree_model_node_get_children (ETreeModel *etree, ETreePath node, ETreePath **n * Return value: **/ guint -e_tree_model_node_depth (ETreeModel *etree, ETreePath node) +e_tree_model_node_depth (ETreeModel *etree, + ETreePath node) { g_return_val_if_fail (etree != NULL, 0); g_return_val_if_fail (E_IS_TREE_MODEL (etree), 0); @@ -630,7 +649,8 @@ e_tree_model_node_depth (ETreeModel *etree, ETreePath node) * return values: the GdkPixbuf associated with this node. */ GdkPixbuf * -e_tree_model_icon_at (ETreeModel *etree, ETreePath node) +e_tree_model_icon_at (ETreeModel *etree, + ETreePath node) { g_return_val_if_fail (etree != NULL, NULL); g_return_val_if_fail (E_IS_TREE_MODEL (etree), NULL); @@ -711,7 +731,8 @@ e_tree_model_has_save_id (ETreeModel *etree) * return values: The save id for this path. */ gchar * -e_tree_model_get_save_id (ETreeModel *etree, ETreePath node) +e_tree_model_get_save_id (ETreeModel *etree, + ETreePath node) { g_return_val_if_fail (etree != NULL, NULL); g_return_val_if_fail (E_IS_TREE_MODEL (etree), NULL); @@ -755,7 +776,8 @@ e_tree_model_has_get_node_by_id (ETreeModel *etree) * return values: The path for this save id. */ ETreePath -e_tree_model_get_node_by_id (ETreeModel *etree, const gchar *save_id) +e_tree_model_get_node_by_id (ETreeModel *etree, + const gchar *save_id) { g_return_val_if_fail (etree != NULL, NULL); g_return_val_if_fail (E_IS_TREE_MODEL (etree), NULL); @@ -807,7 +829,9 @@ e_tree_model_has_change_pending (ETreeModel *etree) * node_removed, and no_change don't affect any data in this way. **/ gpointer -e_tree_model_sort_value_at (ETreeModel *etree, ETreePath node, gint col) +e_tree_model_sort_value_at (ETreeModel *etree, + ETreePath node, + gint col) { g_return_val_if_fail (etree != NULL, NULL); g_return_val_if_fail (E_IS_TREE_MODEL (etree), NULL); @@ -838,7 +862,9 @@ e_tree_model_sort_value_at (ETreeModel *etree, ETreePath node, gint col) * node_removed, and no_change don't affect any data in this way. **/ gpointer -e_tree_model_value_at (ETreeModel *etree, ETreePath node, gint col) +e_tree_model_value_at (ETreeModel *etree, + ETreePath node, + gint col) { g_return_val_if_fail (etree != NULL, NULL); g_return_val_if_fail (E_IS_TREE_MODEL (etree), NULL); @@ -850,7 +876,10 @@ e_tree_model_value_at (ETreeModel *etree, ETreePath node, gint col) } void -e_tree_model_set_value_at (ETreeModel *etree, ETreePath node, gint col, gconstpointer val) +e_tree_model_set_value_at (ETreeModel *etree, + ETreePath node, + gint col, + gconstpointer val) { g_return_if_fail (etree != NULL); g_return_if_fail (E_IS_TREE_MODEL (etree)); @@ -869,7 +898,9 @@ e_tree_model_set_value_at (ETreeModel *etree, ETreePath node, gint col, gconstpo * Return value: **/ gboolean -e_tree_model_node_is_editable (ETreeModel *etree, ETreePath node, gint col) +e_tree_model_node_is_editable (ETreeModel *etree, + ETreePath node, + gint col) { g_return_val_if_fail (etree != NULL, FALSE); @@ -889,7 +920,9 @@ e_tree_model_node_is_editable (ETreeModel *etree, ETreePath node, gint col) * Return value: **/ gpointer -e_tree_model_duplicate_value (ETreeModel *etree, gint col, gconstpointer value) +e_tree_model_duplicate_value (ETreeModel *etree, + gint col, + gconstpointer value) { g_return_val_if_fail (etree != NULL, NULL); @@ -909,7 +942,9 @@ e_tree_model_duplicate_value (ETreeModel *etree, gint col, gconstpointer value) * Return value: **/ void -e_tree_model_free_value (ETreeModel *etree, gint col, gpointer value) +e_tree_model_free_value (ETreeModel *etree, + gint col, + gpointer value) { g_return_if_fail (etree != NULL); @@ -927,7 +962,8 @@ e_tree_model_free_value (ETreeModel *etree, gint col, gpointer value) * Return value: **/ gpointer -e_tree_model_initialize_value (ETreeModel *etree, gint col) +e_tree_model_initialize_value (ETreeModel *etree, + gint col) { g_return_val_if_fail (etree != NULL, NULL); @@ -947,7 +983,9 @@ e_tree_model_initialize_value (ETreeModel *etree, gint col) * Return value: **/ gboolean -e_tree_model_value_is_empty (ETreeModel *etree, gint col, gconstpointer value) +e_tree_model_value_is_empty (ETreeModel *etree, + gint col, + gconstpointer value) { g_return_val_if_fail (etree != NULL, TRUE); @@ -967,7 +1005,9 @@ e_tree_model_value_is_empty (ETreeModel *etree, gint col, gconstpointer value) * Return value: **/ gchar * -e_tree_model_value_to_string (ETreeModel *etree, gint col, gconstpointer value) +e_tree_model_value_to_string (ETreeModel *etree, + gint col, + gconstpointer value) { g_return_val_if_fail(etree != NULL, g_strdup("")); @@ -987,7 +1027,10 @@ e_tree_model_value_to_string (ETreeModel *etree, gint col, gconstpointer value) * **/ void -e_tree_model_node_traverse (ETreeModel *model, ETreePath path, ETreePathFunc func, gpointer data) +e_tree_model_node_traverse (ETreeModel *model, + ETreePath path, + ETreePathFunc func, + gpointer data) { ETreePath child; @@ -1019,7 +1062,10 @@ e_tree_model_node_traverse (ETreeModel *model, ETreePath path, ETreePathFunc fun * **/ void -e_tree_model_node_traverse_preorder (ETreeModel *model, ETreePath path, ETreePathFunc func, gpointer data) +e_tree_model_node_traverse_preorder (ETreeModel *model, + ETreePath path, + ETreePathFunc func, + gpointer data) { ETreePath child; @@ -1052,7 +1098,12 @@ e_tree_model_node_traverse_preorder (ETreeModel *model, ETreePath path, ETreePat * **/ static ETreePath -e_tree_model_node_real_traverse (ETreeModel *model, ETreePath path, ETreePath end_path, gboolean forward_direction, ETreePathFunc func, gpointer data) +e_tree_model_node_real_traverse (ETreeModel *model, + ETreePath path, + ETreePath end_path, + gboolean forward_direction, + ETreePathFunc func, + gpointer data) { ETreePath child; @@ -1095,7 +1146,12 @@ e_tree_model_node_real_traverse (ETreeModel *model, ETreePath path, ETreePath en * **/ ETreePath -e_tree_model_node_find (ETreeModel *model, ETreePath path, ETreePath end_path, gboolean forward_direction, ETreePathFunc func, gpointer data) +e_tree_model_node_find (ETreeModel *model, + ETreePath path, + ETreePath end_path, + gboolean forward_direction, + ETreePathFunc func, + gpointer data) { ETreePath result; ETreePath next; diff --git a/widgets/table/e-tree-selection-model.c b/widgets/table/e-tree-selection-model.c index dd00fca2e0..9d04086b2f 100644 --- a/widgets/table/e-tree-selection-model.c +++ b/widgets/table/e-tree-selection-model.c @@ -79,7 +79,9 @@ clear_selection (ETreeSelectionModel *etsm) } static void -change_one_path (ETreeSelectionModel *etsm, ETreePath path, gboolean grow) +change_one_path (ETreeSelectionModel *etsm, + ETreePath path, + gboolean grow) { if (!path) return; @@ -91,7 +93,8 @@ change_one_path (ETreeSelectionModel *etsm, ETreePath path, gboolean grow) } static void -select_single_path (ETreeSelectionModel *etsm, ETreePath path) +select_single_path (ETreeSelectionModel *etsm, + ETreePath path) { clear_selection (etsm); change_one_path (etsm, path, TRUE); @@ -100,7 +103,9 @@ select_single_path (ETreeSelectionModel *etsm, ETreePath path) } static void -select_range (ETreeSelectionModel *etsm, gint start, gint end) +select_range (ETreeSelectionModel *etsm, + gint start, + gint end) { gint i; @@ -125,7 +130,8 @@ free_id (ETreeSelectionModel *etsm) } static void -restore_cursor (ETreeSelectionModel *etsm, ETreeModel *etm) +restore_cursor (ETreeSelectionModel *etsm, + ETreeModel *etm) { clear_selection (etsm); etsm->priv->cursor_path = NULL; @@ -153,7 +159,8 @@ restore_cursor (ETreeSelectionModel *etsm, ETreeModel *etm) } static void -etsm_pre_change (ETreeModel *etm, ETreeSelectionModel *etsm) +etsm_pre_change (ETreeModel *etm, + ETreeSelectionModel *etsm) { g_free (etsm->priv->cursor_save_id); etsm->priv->cursor_save_id = NULL; @@ -164,49 +171,67 @@ etsm_pre_change (ETreeModel *etm, ETreeSelectionModel *etsm) } static void -etsm_no_change (ETreeModel *etm, ETreeSelectionModel *etsm) +etsm_no_change (ETreeModel *etm, + ETreeSelectionModel *etsm) { free_id (etsm); } static void -etsm_node_changed (ETreeModel *etm, ETreePath node, ETreeSelectionModel *etsm) +etsm_node_changed (ETreeModel *etm, + ETreePath node, + ETreeSelectionModel *etsm) { restore_cursor (etsm, etm); } static void -etsm_node_data_changed (ETreeModel *etm, ETreePath node, ETreeSelectionModel *etsm) +etsm_node_data_changed (ETreeModel *etm, + ETreePath node, + ETreeSelectionModel *etsm) { free_id (etsm); } static void -etsm_node_col_changed (ETreeModel *etm, ETreePath node, gint col, ETreeSelectionModel *etsm) +etsm_node_col_changed (ETreeModel *etm, + ETreePath node, + gint col, + ETreeSelectionModel *etsm) { free_id (etsm); } static void -etsm_node_inserted (ETreeModel *etm, ETreePath parent, ETreePath child, ETreeSelectionModel *etsm) +etsm_node_inserted (ETreeModel *etm, + ETreePath parent, + ETreePath child, + ETreeSelectionModel *etsm) { restore_cursor (etsm, etm); } static void -etsm_node_removed (ETreeModel *etm, ETreePath parent, ETreePath child, gint old_position, ETreeSelectionModel *etsm) +etsm_node_removed (ETreeModel *etm, + ETreePath parent, + ETreePath child, + gint old_position, + ETreeSelectionModel *etsm) { restore_cursor (etsm, etm); } static void -etsm_node_deleted (ETreeModel *etm, ETreePath child, ETreeSelectionModel *etsm) +etsm_node_deleted (ETreeModel *etm, + ETreePath child, + ETreeSelectionModel *etsm) { restore_cursor (etsm, etm); } static void -add_model (ETreeSelectionModel *etsm, ETreeModel *model) +add_model (ETreeSelectionModel *etsm, + ETreeModel *model) { ETreeSelectionModelPrivate *priv = etsm->priv; @@ -298,11 +323,14 @@ etsm_finalize (GObject *object) } static void -etsm_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) +etsm_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) { ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL (object); - switch (prop_id) { + switch (property_id) { case PROP_CURSOR_ROW: g_value_set_int (value, get_cursor_row (etsm)); break; @@ -322,12 +350,15 @@ etsm_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *ps } static void -etsm_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) +etsm_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) { ESelectionModel *esm = E_SELECTION_MODEL (object); ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL (object); - switch (prop_id) { + switch (property_id) { case PROP_CURSOR_ROW: e_selection_model_do_something (esm, g_value_get_int (value), etsm->priv->cursor_col, 0); break; @@ -348,7 +379,8 @@ etsm_set_property (GObject *object, guint prop_id, const GValue *value, GParamSp } static gboolean -etsm_is_path_selected (ETreeSelectionModel *etsm, ETreePath path) +etsm_is_path_selected (ETreeSelectionModel *etsm, + ETreePath path) { if (path && g_hash_table_lookup (etsm->priv->paths, path)) return TRUE; @@ -367,7 +399,7 @@ etsm_is_path_selected (ETreeSelectionModel *etsm, ETreePath path) */ static gboolean etsm_is_row_selected (ESelectionModel *selection, - gint row) + gint row) { ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL (selection); ETreePath path; @@ -387,7 +419,9 @@ typedef struct { } ModelAndCallback; static void -etsm_row_foreach_cb (gpointer key, gpointer value, gpointer user_data) +etsm_row_foreach_cb (gpointer key, + gpointer value, + gpointer user_data) { ETreePath path = key; ModelAndCallback *mac = user_data; @@ -407,8 +441,8 @@ etsm_row_foreach_cb (gpointer key, gpointer value, gpointer user_data) */ static void etsm_foreach (ESelectionModel *selection, - EForeachFunc callback, - gpointer closure) + EForeachFunc callback, + gpointer closure) { ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL (selection); ModelAndCallback mac; @@ -520,7 +554,9 @@ etsm_invert_selection (ESelectionModel *selection) } static void -etsm_change_one_row (ESelectionModel *selection, gint row, gboolean grow) +etsm_change_one_row (ESelectionModel *selection, + gint row, + gboolean grow) { ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL (selection); ETreePath path; @@ -538,7 +574,9 @@ etsm_change_one_row (ESelectionModel *selection, gint row, gboolean grow) } static void -etsm_change_cursor (ESelectionModel *selection, gint row, gint col) +etsm_change_cursor (ESelectionModel *selection, + gint row, + gint col) { ETreeSelectionModel *etsm; @@ -569,7 +607,8 @@ etsm_cursor_col (ESelectionModel *selection) } static void -etsm_get_rows (gint row, gpointer d) +etsm_get_rows (gint row, + gpointer d) { gint **rowp = d; @@ -578,7 +617,8 @@ etsm_get_rows (gint row, gpointer d) } static void -etsm_select_single_row (ESelectionModel *selection, gint row) +etsm_select_single_row (ESelectionModel *selection, + gint row) { ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL (selection); ETreePath path = e_tree_table_adapter_node_at_row (etsm->priv->etta, row); @@ -587,7 +627,7 @@ etsm_select_single_row (ESelectionModel *selection, gint row) g_return_if_fail (path != NULL); /* we really only care about the size=1 case (cursor changed), - but this doesn't cost much */ + * but this doesn't cost much */ size = g_hash_table_size (etsm->priv->paths); if (size > 0 && size <= 5) { rowp = rows; @@ -596,13 +636,13 @@ etsm_select_single_row (ESelectionModel *selection, gint row) select_single_path (etsm, path); - if (size>5) { + if (size > 5) { e_selection_model_selection_changed (E_SELECTION_MODEL (etsm)); } else { if (rowp) { gint *p = rows; - while (ppriv->etta, row); @@ -628,7 +669,8 @@ etsm_toggle_single_row (ESelectionModel *selection, gint row) } static void -etsm_real_move_selection_end (ETreeSelectionModel *etsm, gint row) +etsm_real_move_selection_end (ETreeSelectionModel *etsm, + gint row) { ETreePath end_path = e_tree_table_adapter_node_at_row (etsm->priv->etta, row); gint start; @@ -641,7 +683,8 @@ etsm_real_move_selection_end (ETreeSelectionModel *etsm, gint row) } static void -etsm_move_selection_end (ESelectionModel *selection, gint row) +etsm_move_selection_end (ESelectionModel *selection, + gint row) { ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL (selection); @@ -652,7 +695,8 @@ etsm_move_selection_end (ESelectionModel *selection, gint row) } static void -etsm_set_selection_end (ESelectionModel *selection, gint row) +etsm_set_selection_end (ESelectionModel *selection, + gint row) { ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL (selection); @@ -670,7 +714,9 @@ struct foreach_path_t { }; static void -foreach_path (gpointer key, gpointer value, gpointer data) +foreach_path (gpointer key, + gpointer value, + gpointer data) { ETreePath path = key; struct foreach_path_t *c = data; @@ -678,7 +724,9 @@ foreach_path (gpointer key, gpointer value, gpointer data) } void -e_tree_selection_model_foreach (ETreeSelectionModel *etsm, ETreeForeachFunc callback, gpointer closure) +e_tree_selection_model_foreach (ETreeSelectionModel *etsm, + ETreeForeachFunc callback, + gpointer closure) { if (etsm->priv->paths) { struct foreach_path_t c; @@ -690,7 +738,8 @@ e_tree_selection_model_foreach (ETreeSelectionModel *etsm, ETreeForeachFunc call } void -e_tree_selection_model_select_single_path (ETreeSelectionModel *etsm, ETreePath path) +e_tree_selection_model_select_single_path (ETreeSelectionModel *etsm, + ETreePath path) { select_single_path (etsm, path); @@ -698,12 +747,13 @@ e_tree_selection_model_select_single_path (ETreeSelectionModel *etsm, ETreePath } void -e_tree_selection_model_select_paths (ETreeSelectionModel *etsm, GPtrArray *paths) +e_tree_selection_model_select_paths (ETreeSelectionModel *etsm, + GPtrArray *paths) { ETreePath path; gint i; - for (i=0;ilen;i++) { + for (i = 0; i < paths->len; i++) { path = paths->pdata[i]; change_one_path (etsm, path, TRUE); } @@ -712,7 +762,8 @@ e_tree_selection_model_select_paths (ETreeSelectionModel *etsm, GPtrArray *paths } void -e_tree_selection_model_add_to_selection (ETreeSelectionModel *etsm, ETreePath path) +e_tree_selection_model_add_to_selection (ETreeSelectionModel *etsm, + ETreePath path) { change_one_path (etsm, path, TRUE); @@ -720,7 +771,8 @@ e_tree_selection_model_add_to_selection (ETreeSelectionModel *etsm, ETreePath pa } void -e_tree_selection_model_change_cursor (ETreeSelectionModel *etsm, ETreePath path) +e_tree_selection_model_change_cursor (ETreeSelectionModel *etsm, + ETreePath path) { gint row; diff --git a/widgets/table/e-tree-sorted.c b/widgets/table/e-tree-sorted.c index c92bb45c65..72b4cba091 100644 --- a/widgets/table/e-tree-sorted.c +++ b/widgets/table/e-tree-sorted.c @@ -169,7 +169,8 @@ ets_insert_idle (ETreeSorted *ets) #define CHECK_AROUND_LAST_ACCESS static inline ETreeSortedPath * -check_last_access (ETreeSorted *ets, ETreePath corresponding) +check_last_access (ETreeSorted *ets, + ETreePath corresponding) { #ifdef CHECK_AROUND_LAST_ACCESS ETreeSortedPath *parent; @@ -211,7 +212,8 @@ check_last_access (ETreeSorted *ets, ETreePath corresponding) } static ETreeSortedPath * -find_path (ETreeSorted *ets, ETreePath corresponding) +find_path (ETreeSorted *ets, + ETreePath corresponding) { gint depth; ETreePath *sequence; @@ -268,7 +270,9 @@ find_path (ETreeSorted *ets, ETreePath corresponding) } static ETreeSortedPath * -find_child_path (ETreeSorted *ets, ETreeSortedPath *parent, ETreePath corresponding) +find_child_path (ETreeSorted *ets, + ETreeSortedPath *parent, + ETreePath corresponding) { gint i; @@ -287,7 +291,8 @@ find_child_path (ETreeSorted *ets, ETreeSortedPath *parent, ETreePath correspond } static ETreeSortedPath * -find_or_create_path (ETreeSorted *ets, ETreePath corresponding) +find_or_create_path (ETreeSorted *ets, + ETreePath corresponding) { gint depth; ETreePath *sequence; @@ -367,7 +372,8 @@ free_path (ETreeSortedPath *path) } static ETreeSortedPath * -new_path (ETreeSortedPath *parent, ETreePath corresponding) +new_path (ETreeSortedPath *parent, + ETreePath corresponding) { ETreeSortedPath *path; @@ -388,7 +394,8 @@ new_path (ETreeSortedPath *parent, ETreePath corresponding) } static gboolean -reposition_path (ETreeSorted *ets, ETreeSortedPath *path) +reposition_path (ETreeSorted *ets, + ETreeSortedPath *path) { gint new_index; gint old_index = path->position; @@ -442,7 +449,8 @@ reposition_path (ETreeSorted *ets, ETreeSortedPath *path) } static void -regenerate_children (ETreeSorted *ets, ETreeSortedPath *path) +regenerate_children (ETreeSorted *ets, + ETreeSortedPath *path) { ETreeSortedPath **children; gint i; @@ -455,7 +463,8 @@ regenerate_children (ETreeSorted *ets, ETreeSortedPath *path) } static void -generate_children (ETreeSorted *ets, ETreeSortedPath *path) +generate_children (ETreeSorted *ets, + ETreeSortedPath *path) { ETreePath child; gint i; @@ -484,7 +493,11 @@ generate_children (ETreeSorted *ets, ETreeSortedPath *path) } static void -resort_node (ETreeSorted *ets, ETreeSortedPath *path, gboolean resort_all_children, gboolean needs_regen, gboolean send_signals) +resort_node (ETreeSorted *ets, + ETreeSortedPath *path, + gboolean resort_all_children, + gboolean needs_regen, + gboolean send_signals) { gboolean needs_resort; if (path) { @@ -532,7 +545,8 @@ resort_node (ETreeSorted *ets, ETreeSortedPath *path, gboolean resort_all_childr } static void -mark_path_child_needs_resort (ETreeSorted *ets, ETreeSortedPath *path) +mark_path_child_needs_resort (ETreeSorted *ets, + ETreeSortedPath *path) { if (path == NULL) return; @@ -543,7 +557,10 @@ mark_path_child_needs_resort (ETreeSorted *ets, ETreeSortedPath *path) } static void -mark_path_needs_resort (ETreeSorted *ets, ETreeSortedPath *path, gboolean needs_regen, gboolean resort_all_children) +mark_path_needs_resort (ETreeSorted *ets, + ETreeSortedPath *path, + gboolean needs_regen, + gboolean resort_all_children) { if (path == NULL) return; @@ -556,7 +573,10 @@ mark_path_needs_resort (ETreeSorted *ets, ETreeSortedPath *path, gboolean needs_ } static void -schedule_resort (ETreeSorted *ets, ETreeSortedPath *path, gboolean needs_regen, gboolean resort_all_children) +schedule_resort (ETreeSorted *ets, + ETreeSortedPath *path, + gboolean needs_regen, + gboolean resort_all_children) { ets->priv->insert_count = 0; if (ets->priv->insert_idle_id != 0) { @@ -681,14 +701,16 @@ ets_get_root (ETreeModel *etm) } static ETreePath -ets_get_parent (ETreeModel *etm, ETreePath node) +ets_get_parent (ETreeModel *etm, + ETreePath node) { ETreeSortedPath *path = node; return path->parent; } static ETreePath -ets_get_first_child (ETreeModel *etm, ETreePath node) +ets_get_first_child (ETreeModel *etm, + ETreePath node) { ETreeSortedPath *path = node; ETreeSorted *ets = E_TREE_SORTED (etm); @@ -703,7 +725,8 @@ ets_get_first_child (ETreeModel *etm, ETreePath node) } static ETreePath -ets_get_last_child (ETreeModel *etm, ETreePath node) +ets_get_last_child (ETreeModel *etm, + ETreePath node) { ETreeSortedPath *path = node; ETreeSorted *ets = E_TREE_SORTED (etm); @@ -718,7 +741,8 @@ ets_get_last_child (ETreeModel *etm, ETreePath node) } static ETreePath -ets_get_next (ETreeModel *etm, ETreePath node) +ets_get_next (ETreeModel *etm, + ETreePath node) { ETreeSortedPath *path = node; ETreeSortedPath *parent = path->parent; @@ -732,7 +756,8 @@ ets_get_next (ETreeModel *etm, ETreePath node) } static ETreePath -ets_get_prev (ETreeModel *etm, ETreePath node) +ets_get_prev (ETreeModel *etm, + ETreePath node) { ETreeSortedPath *path = node; ETreeSortedPath *parent = path->parent; @@ -746,7 +771,8 @@ ets_get_prev (ETreeModel *etm, ETreePath node) } static gboolean -ets_is_root (ETreeModel *etm, ETreePath node) +ets_is_root (ETreeModel *etm, + ETreePath node) { ETreeSortedPath *path = node; ETreeSorted *ets = E_TREE_SORTED (etm); @@ -755,7 +781,8 @@ ets_is_root (ETreeModel *etm, ETreePath node) } static gboolean -ets_is_expandable (ETreeModel *etm, ETreePath node) +ets_is_expandable (ETreeModel *etm, + ETreePath node) { ETreeSortedPath *path = node; ETreeSorted *ets = E_TREE_SORTED (etm); @@ -769,7 +796,9 @@ ets_is_expandable (ETreeModel *etm, ETreePath node) } static guint -ets_get_children (ETreeModel *etm, ETreePath node, ETreePath **nodes) +ets_get_children (ETreeModel *etm, + ETreePath node, + ETreePath **nodes) { ETreeSortedPath *path = node; guint n_children; @@ -793,7 +822,8 @@ ets_get_children (ETreeModel *etm, ETreePath node, ETreePath **nodes) } static guint -ets_depth (ETreeModel *etm, ETreePath node) +ets_depth (ETreeModel *etm, + ETreePath node) { ETreeSortedPath *path = node; ETreeSorted *ets = E_TREE_SORTED (etm); @@ -802,7 +832,8 @@ ets_depth (ETreeModel *etm, ETreePath node) } static GdkPixbuf * -ets_icon_at (ETreeModel *etm, ETreePath node) +ets_icon_at (ETreeModel *etm, + ETreePath node) { ETreeSortedPath *path = node; ETreeSorted *ets = E_TREE_SORTED (etm); @@ -833,7 +864,8 @@ ets_has_save_id (ETreeModel *etm) } static gchar * -ets_get_save_id (ETreeModel *etm, ETreePath node) +ets_get_save_id (ETreeModel *etm, + ETreePath node) { ETreeSorted *ets = E_TREE_SORTED (etm); ETreeSortedPath *path = node; @@ -852,7 +884,8 @@ ets_has_get_node_by_id (ETreeModel *etm) } static ETreePath -ets_get_node_by_id (ETreeModel *etm, const gchar *save_id) +ets_get_node_by_id (ETreeModel *etm, + const gchar *save_id) { ETreeSorted *ets = E_TREE_SORTED (etm); ETreePath node; @@ -871,7 +904,9 @@ ets_has_change_pending (ETreeModel *etm) } static gpointer -ets_value_at (ETreeModel *etm, ETreePath node, gint col) +ets_value_at (ETreeModel *etm, + ETreePath node, + gint col) { ETreeSorted *ets = E_TREE_SORTED (etm); ETreeSortedPath *path = node; @@ -880,7 +915,10 @@ ets_value_at (ETreeModel *etm, ETreePath node, gint col) } static void -ets_set_value_at (ETreeModel *etm, ETreePath node, gint col, gconstpointer val) +ets_set_value_at (ETreeModel *etm, + ETreePath node, + gint col, + gconstpointer val) { ETreeSorted *ets = E_TREE_SORTED (etm); ETreeSortedPath *path = node; @@ -889,7 +927,9 @@ ets_set_value_at (ETreeModel *etm, ETreePath node, gint col, gconstpointer val) } static gboolean -ets_is_editable (ETreeModel *etm, ETreePath node, gint col) +ets_is_editable (ETreeModel *etm, + ETreePath node, + gint col) { ETreeSorted *ets = E_TREE_SORTED (etm); ETreeSortedPath *path = node; @@ -899,7 +939,9 @@ ets_is_editable (ETreeModel *etm, ETreePath node, gint col) /* The default for ets_duplicate_value is to return the raw value. */ static gpointer -ets_duplicate_value (ETreeModel *etm, gint col, gconstpointer value) +ets_duplicate_value (ETreeModel *etm, + gint col, + gconstpointer value) { ETreeSorted *ets = E_TREE_SORTED (etm); @@ -907,7 +949,9 @@ ets_duplicate_value (ETreeModel *etm, gint col, gconstpointer value) } static void -ets_free_value (ETreeModel *etm, gint col, gpointer value) +ets_free_value (ETreeModel *etm, + gint col, + gpointer value) { ETreeSorted *ets = E_TREE_SORTED (etm); @@ -915,7 +959,8 @@ ets_free_value (ETreeModel *etm, gint col, gpointer value) } static gpointer -ets_initialize_value (ETreeModel *etm, gint col) +ets_initialize_value (ETreeModel *etm, + gint col) { ETreeSorted *ets = E_TREE_SORTED (etm); @@ -923,7 +968,9 @@ ets_initialize_value (ETreeModel *etm, gint col) } static gboolean -ets_value_is_empty (ETreeModel *etm, gint col, gconstpointer value) +ets_value_is_empty (ETreeModel *etm, + gint col, + gconstpointer value) { ETreeSorted *ets = E_TREE_SORTED (etm); @@ -931,7 +978,9 @@ ets_value_is_empty (ETreeModel *etm, gint col, gconstpointer value) } static gchar * -ets_value_to_string (ETreeModel *etm, gint col, gconstpointer value) +ets_value_to_string (ETreeModel *etm, + gint col, + gconstpointer value) { ETreeSorted *ets = E_TREE_SORTED (etm); @@ -941,19 +990,23 @@ ets_value_to_string (ETreeModel *etm, gint col, gconstpointer value) /* Proxy functions */ static void -ets_proxy_pre_change (ETreeModel *etm, ETreeSorted *ets) +ets_proxy_pre_change (ETreeModel *etm, + ETreeSorted *ets) { e_tree_model_pre_change (E_TREE_MODEL (ets)); } static void -ets_proxy_no_change (ETreeModel *etm, ETreeSorted *ets) +ets_proxy_no_change (ETreeModel *etm, + ETreeSorted *ets) { e_tree_model_no_change (E_TREE_MODEL (ets)); } static void -ets_proxy_node_changed (ETreeModel *etm, ETreePath node, ETreeSorted *ets) +ets_proxy_node_changed (ETreeModel *etm, + ETreePath node, + ETreeSorted *ets) { ets->priv->last_access = NULL; d(g_print("Setting last access %p. (ets_proxy_node_changed)\n", ets->priv->last_access)); @@ -984,7 +1037,9 @@ ets_proxy_node_changed (ETreeModel *etm, ETreePath node, ETreeSorted *ets) } static void -ets_proxy_node_data_changed (ETreeModel *etm, ETreePath node, ETreeSorted *ets) +ets_proxy_node_data_changed (ETreeModel *etm, + ETreePath node, + ETreeSorted *ets) { ETreeSortedPath *path = find_path (ets, node); @@ -998,7 +1053,10 @@ ets_proxy_node_data_changed (ETreeModel *etm, ETreePath node, ETreeSorted *ets) } static void -ets_proxy_node_col_changed (ETreeModel *etm, ETreePath node, gint col, ETreeSorted *ets) +ets_proxy_node_col_changed (ETreeModel *etm, + ETreePath node, + gint col, + ETreeSorted *ets) { ETreeSortedPath *path = find_path (ets, node); @@ -1015,7 +1073,10 @@ ets_proxy_node_col_changed (ETreeModel *etm, ETreePath node, gint col, ETreeSort } static void -ets_proxy_node_inserted (ETreeModel *etm, ETreePath parent, ETreePath child, ETreeSorted *ets) +ets_proxy_node_inserted (ETreeModel *etm, + ETreePath parent, + ETreePath child, + ETreeSorted *ets) { ETreeSortedPath *parent_path = find_path (ets, parent); @@ -1083,7 +1144,11 @@ ets_proxy_node_inserted (ETreeModel *etm, ETreePath parent, ETreePath child, ETr } static void -ets_proxy_node_removed (ETreeModel *etm, ETreePath parent, ETreePath child, gint old_position, ETreeSorted *ets) +ets_proxy_node_removed (ETreeModel *etm, + ETreePath parent, + ETreePath child, + gint old_position, + ETreeSorted *ets) { ETreeSortedPath *parent_path = find_path (ets, parent); ETreeSortedPath *path; @@ -1120,13 +1185,17 @@ ets_proxy_node_removed (ETreeModel *etm, ETreePath parent, ETreePath child, gint } static void -ets_proxy_node_deleted (ETreeModel *etm, ETreePath child, ETreeSorted *ets) +ets_proxy_node_deleted (ETreeModel *etm, + ETreePath child, + ETreeSorted *ets) { e_tree_model_node_deleted (E_TREE_MODEL (ets), NULL); } static void -ets_proxy_node_request_collapse (ETreeModel *etm, ETreePath node, ETreeSorted *ets) +ets_proxy_node_request_collapse (ETreeModel *etm, + ETreePath node, + ETreeSorted *ets) { ETreeSortedPath *path = find_path (ets, node); if (path) { @@ -1135,7 +1204,8 @@ ets_proxy_node_request_collapse (ETreeModel *etm, ETreePath node, ETreeSorted *e } static void -ets_sort_info_changed (ETableSortInfo *sort_info, ETreeSorted *ets) +ets_sort_info_changed (ETableSortInfo *sort_info, + ETreeSorted *ets) { schedule_resort (ets, ets->priv->root, TRUE, TRUE); } @@ -1216,7 +1286,10 @@ e_tree_sorted_init (ETreeSorted *ets) * **/ void -e_tree_sorted_construct (ETreeSorted *ets, ETreeModel *source, ETableHeader *full_header, ETableSortInfo *sort_info) +e_tree_sorted_construct (ETreeSorted *ets, + ETreeModel *source, + ETableHeader *full_header, + ETableSortInfo *sort_info) { ets->priv->source = source; if (source) @@ -1228,24 +1301,33 @@ e_tree_sorted_construct (ETreeSorted *ets, ETreeModel *source, ETableHeader *ful e_tree_sorted_set_sort_info (ets, sort_info); - ets->priv->tree_model_pre_change_id = g_signal_connect (G_OBJECT (source), "pre_change", - G_CALLBACK (ets_proxy_pre_change), ets); - ets->priv->tree_model_no_change_id = g_signal_connect (G_OBJECT (source), "no_change", - G_CALLBACK (ets_proxy_no_change), ets); - ets->priv->tree_model_node_changed_id = g_signal_connect (G_OBJECT (source), "node_changed", - G_CALLBACK (ets_proxy_node_changed), ets); - ets->priv->tree_model_node_data_changed_id = g_signal_connect (G_OBJECT (source), "node_data_changed", - G_CALLBACK (ets_proxy_node_data_changed), ets); - ets->priv->tree_model_node_col_changed_id = g_signal_connect (G_OBJECT (source), "node_col_changed", - G_CALLBACK (ets_proxy_node_col_changed), ets); - ets->priv->tree_model_node_inserted_id = g_signal_connect (G_OBJECT (source), "node_inserted", - G_CALLBACK (ets_proxy_node_inserted), ets); - ets->priv->tree_model_node_removed_id = g_signal_connect (G_OBJECT (source), "node_removed", - G_CALLBACK (ets_proxy_node_removed), ets); - ets->priv->tree_model_node_deleted_id = g_signal_connect (G_OBJECT (source), "node_deleted", - G_CALLBACK (ets_proxy_node_deleted), ets); - ets->priv->tree_model_node_request_collapse_id = g_signal_connect (G_OBJECT (source), "node_request_collapse", - G_CALLBACK (ets_proxy_node_request_collapse), ets); + ets->priv->tree_model_pre_change_id = g_signal_connect ( + source, "pre_change", + G_CALLBACK (ets_proxy_pre_change), ets); + ets->priv->tree_model_no_change_id = g_signal_connect ( + source, "no_change", + G_CALLBACK (ets_proxy_no_change), ets); + ets->priv->tree_model_node_changed_id = g_signal_connect ( + source, "node_changed", + G_CALLBACK (ets_proxy_node_changed), ets); + ets->priv->tree_model_node_data_changed_id = g_signal_connect ( + source, "node_data_changed", + G_CALLBACK (ets_proxy_node_data_changed), ets); + ets->priv->tree_model_node_col_changed_id = g_signal_connect ( + source, "node_col_changed", + G_CALLBACK (ets_proxy_node_col_changed), ets); + ets->priv->tree_model_node_inserted_id = g_signal_connect ( + source, "node_inserted", + G_CALLBACK (ets_proxy_node_inserted), ets); + ets->priv->tree_model_node_removed_id = g_signal_connect ( + source, "node_removed", + G_CALLBACK (ets_proxy_node_removed), ets); + ets->priv->tree_model_node_deleted_id = g_signal_connect ( + source, "node_deleted", + G_CALLBACK (ets_proxy_node_deleted), ets); + ets->priv->tree_model_node_request_collapse_id = g_signal_connect ( + source, "node_request_collapse", + G_CALLBACK (ets_proxy_node_request_collapse), ets); } @@ -1257,7 +1339,9 @@ e_tree_sorted_construct (ETreeSorted *ets, ETreeModel *source, ETableHeader *ful * return values: a newly constructed ETreeSorted. */ ETreeSorted * -e_tree_sorted_new (ETreeModel *source, ETableHeader *full_header, ETableSortInfo *sort_info) +e_tree_sorted_new (ETreeModel *source, + ETableHeader *full_header, + ETableSortInfo *sort_info) { ETreeSorted *ets = g_object_new (E_TYPE_TREE_SORTED, NULL); @@ -1267,8 +1351,8 @@ e_tree_sorted_new (ETreeModel *source, ETableHeader *full_header, ETableSortInfo } ETreePath -e_tree_sorted_view_to_model_path (ETreeSorted *ets, - ETreePath view_path) +e_tree_sorted_view_to_model_path (ETreeSorted *ets, + ETreePath view_path) { ETreeSortedPath *path = view_path; if (path) { @@ -1280,23 +1364,23 @@ e_tree_sorted_view_to_model_path (ETreeSorted *ets, } ETreePath -e_tree_sorted_model_to_view_path (ETreeSorted *ets, - ETreePath model_path) +e_tree_sorted_model_to_view_path (ETreeSorted *ets, + ETreePath model_path) { return find_or_create_path (ets, model_path); } gint -e_tree_sorted_orig_position (ETreeSorted *ets, - ETreePath path) +e_tree_sorted_orig_position (ETreeSorted *ets, + ETreePath path) { ETreeSortedPath *sorted_path = path; return sorted_path->orig_position; } gint -e_tree_sorted_node_num_children (ETreeSorted *ets, - ETreePath path) +e_tree_sorted_node_num_children (ETreeSorted *ets, + ETreePath path) { ETreeSortedPath *sorted_path = path; @@ -1308,7 +1392,8 @@ e_tree_sorted_node_num_children (ETreeSorted *ets, } void -e_tree_sorted_node_resorted (ETreeSorted *sorted, ETreePath node) +e_tree_sorted_node_resorted (ETreeSorted *sorted, + ETreePath node) { g_return_if_fail (sorted != NULL); g_return_if_fail (E_IS_TREE_SORTED (sorted)); @@ -1317,7 +1402,8 @@ e_tree_sorted_node_resorted (ETreeSorted *sorted, ETreePath node) } void -e_tree_sorted_set_sort_info (ETreeSorted *ets, ETableSortInfo *sort_info) +e_tree_sorted_set_sort_info (ETreeSorted *ets, + ETableSortInfo *sort_info) { g_return_if_fail (ets != NULL); @@ -1333,15 +1419,16 @@ e_tree_sorted_set_sort_info (ETreeSorted *ets, ETableSortInfo *sort_info) ets->priv->sort_info = sort_info; if (sort_info) { g_object_ref (sort_info); - ets->priv->sort_info_changed_id = g_signal_connect (G_OBJECT (ets->priv->sort_info), "sort_info_changed", - G_CALLBACK (ets_sort_info_changed), ets); + ets->priv->sort_info_changed_id = g_signal_connect ( + ets->priv->sort_info, "sort_info_changed", + G_CALLBACK (ets_sort_info_changed), ets); } if (ets->priv->root) schedule_resort (ets, ets->priv->root, TRUE, TRUE); } -ETableSortInfo* +ETableSortInfo * e_tree_sorted_get_sort_info (ETreeSorted *ets) { return ets->priv->sort_info; diff --git a/widgets/table/e-tree-table-adapter.c b/widgets/table/e-tree-table-adapter.c index 4cfd74fe68..1b87211c7b 100644 --- a/widgets/table/e-tree-table-adapter.c +++ b/widgets/table/e-tree-table-adapter.c @@ -98,7 +98,8 @@ struct _ETreeTableAdapterPrivate { static void etta_sort_info_changed (ETableSortInfo *sort_info, ETreeTableAdapter *etta); static GNode * -lookup_gnode (ETreeTableAdapter *etta, ETreePath path) +lookup_gnode (ETreeTableAdapter *etta, + ETreePath path) { GNode *gnode; @@ -111,7 +112,8 @@ lookup_gnode (ETreeTableAdapter *etta, ETreePath path) } static void -resize_map (ETreeTableAdapter *etta, gint size) +resize_map (ETreeTableAdapter *etta, + gint size) { if (size > etta->priv->n_vals_allocated) { etta->priv->n_vals_allocated = MAX (etta->priv->n_vals_allocated + INCREMENT_AMOUNT, size); @@ -122,7 +124,10 @@ resize_map (ETreeTableAdapter *etta, gint size) } static void -move_map_elements (ETreeTableAdapter *etta, gint to, gint from, gint count) +move_map_elements (ETreeTableAdapter *etta, + gint to, + gint from, + gint count) { if (count <= 0 || from >= etta->priv->n_map) return; @@ -131,7 +136,9 @@ move_map_elements (ETreeTableAdapter *etta, gint to, gint from, gint count) } static gint -fill_map (ETreeTableAdapter *etta, gint index, GNode *gnode) +fill_map (ETreeTableAdapter *etta, + gint index, + GNode *gnode) { GNode *p; @@ -155,7 +162,8 @@ remap_indices (ETreeTableAdapter *etta) } static node_t * -get_node (ETreeTableAdapter *etta, ETreePath path) +get_node (ETreeTableAdapter *etta, + ETreePath path) { GNode *gnode = lookup_gnode (etta, path); @@ -166,7 +174,9 @@ get_node (ETreeTableAdapter *etta, ETreePath path) } static void -resort_node (ETreeTableAdapter *etta, GNode *gnode, gboolean recurse) +resort_node (ETreeTableAdapter *etta, + GNode *gnode, + gboolean recurse) { node_t *node = (node_t *) gnode->data; ETreePath *paths, path; @@ -217,7 +227,8 @@ resort_node (ETreeTableAdapter *etta, GNode *gnode, gboolean recurse) } static gint -get_row (ETreeTableAdapter *etta, ETreePath path) +get_row (ETreeTableAdapter *etta, + ETreePath path) { node_t *node = get_node (etta, path); if (!node) @@ -230,7 +241,8 @@ get_row (ETreeTableAdapter *etta, ETreePath path) } static ETreePath -get_path (ETreeTableAdapter *etta, gint row) +get_path (ETreeTableAdapter *etta, + gint row) { if (row == -1 && etta->priv->n_map > 0) row = etta->priv->n_map - 1; @@ -241,7 +253,8 @@ get_path (ETreeTableAdapter *etta, gint row) } static void -kill_gnode (GNode *node, ETreeTableAdapter *etta) +kill_gnode (GNode *node, + ETreeTableAdapter *etta) { g_hash_table_remove (etta->priv->nodes, ((node_t *) node->data)->path); @@ -258,7 +271,8 @@ kill_gnode (GNode *node, ETreeTableAdapter *etta) } static void -update_child_counts (GNode *gnode, gint delta) +update_child_counts (GNode *gnode, + gint delta) { while (gnode) { node_t *node = (node_t *) gnode->data; @@ -268,7 +282,8 @@ update_child_counts (GNode *gnode, gint delta) } static gint -delete_children (ETreeTableAdapter *etta, GNode *gnode) +delete_children (ETreeTableAdapter *etta, + GNode *gnode) { node_t *node = (node_t *) gnode->data; gint to_remove = node ? node->num_visible_children : 0; @@ -286,7 +301,9 @@ delete_children (ETreeTableAdapter *etta, GNode *gnode) } static void -delete_node (ETreeTableAdapter *etta, ETreePath parent, ETreePath path) +delete_node (ETreeTableAdapter *etta, + ETreePath parent, + ETreePath path) { gint to_remove = 1; gint parent_row = get_row (etta, parent); @@ -325,7 +342,8 @@ delete_node (ETreeTableAdapter *etta, ETreePath parent, ETreePath path) } static GNode * -create_gnode (ETreeTableAdapter *etta, ETreePath path) +create_gnode (ETreeTableAdapter *etta, + ETreePath path) { GNode *gnode; node_t *node; @@ -343,7 +361,8 @@ create_gnode (ETreeTableAdapter *etta, ETreePath path) } static gint -insert_children (ETreeTableAdapter *etta, GNode *gnode) +insert_children (ETreeTableAdapter *etta, + GNode *gnode) { ETreePath path, tmp; gint count = 0; @@ -365,7 +384,8 @@ insert_children (ETreeTableAdapter *etta, GNode *gnode) } static void -generate_tree (ETreeTableAdapter *etta, ETreePath path) +generate_tree (ETreeTableAdapter *etta, + ETreePath path) { GNode *gnode; node_t *node; @@ -394,7 +414,9 @@ generate_tree (ETreeTableAdapter *etta, ETreePath path) } static void -insert_node (ETreeTableAdapter *etta, ETreePath parent, ETreePath path) +insert_node (ETreeTableAdapter *etta, + ETreePath parent, + ETreePath path) { GNode *gnode, *parent_gnode; node_t *node, *parent_node; @@ -467,7 +489,8 @@ typedef struct { } check_expanded_closure; static gboolean -check_expanded (GNode *gnode, gpointer data) +check_expanded (GNode *gnode, + gpointer data) { check_expanded_closure *closure = (check_expanded_closure *) data; node_t *node = (node_t *) gnode->data; @@ -479,7 +502,8 @@ check_expanded (GNode *gnode, gpointer data) } static void -update_node (ETreeTableAdapter *etta, ETreePath path) +update_node (ETreeTableAdapter *etta, + ETreePath path) { check_expanded_closure closure; ETreePath parent = e_tree_model_node_get_parent (etta->priv->source, path); @@ -595,7 +619,8 @@ etta_has_save_id (ETableModel *etm) } static gchar * -etta_get_save_id (ETableModel *etm, gint row) +etta_get_save_id (ETableModel *etm, + gint row) { ETreeTableAdapter *etta = (ETreeTableAdapter *) etm; @@ -619,7 +644,9 @@ etta_row_count (ETableModel *etm) } static gpointer -etta_value_at (ETableModel *etm, gint col, gint row) +etta_value_at (ETableModel *etm, + gint col, + gint row) { ETreeTableAdapter *etta = (ETreeTableAdapter *) etm; @@ -638,7 +665,10 @@ etta_value_at (ETableModel *etm, gint col, gint row) } static void -etta_set_value_at (ETableModel *etm, gint col, gint row, gconstpointer val) +etta_set_value_at (ETableModel *etm, + gint col, + gint row, + gconstpointer val) { ETreeTableAdapter *etta = (ETreeTableAdapter *) etm; @@ -646,7 +676,9 @@ etta_set_value_at (ETableModel *etm, gint col, gint row, gconstpointer val) } static gboolean -etta_is_cell_editable (ETableModel *etm, gint col, gint row) +etta_is_cell_editable (ETableModel *etm, + gint col, + gint row) { ETreeTableAdapter *etta = (ETreeTableAdapter *) etm; @@ -654,12 +686,16 @@ etta_is_cell_editable (ETableModel *etm, gint col, gint row) } static void -etta_append_row (ETableModel *etm, ETableModel *source, gint row) +etta_append_row (ETableModel *etm, + ETableModel *source, + gint row) { } static gpointer -etta_duplicate_value (ETableModel *etm, gint col, gconstpointer value) +etta_duplicate_value (ETableModel *etm, + gint col, + gconstpointer value) { ETreeTableAdapter *etta = (ETreeTableAdapter *) etm; @@ -667,7 +703,9 @@ etta_duplicate_value (ETableModel *etm, gint col, gconstpointer value) } static void -etta_free_value (ETableModel *etm, gint col, gpointer value) +etta_free_value (ETableModel *etm, + gint col, + gpointer value) { ETreeTableAdapter *etta = (ETreeTableAdapter *) etm; @@ -675,7 +713,8 @@ etta_free_value (ETableModel *etm, gint col, gpointer value) } static gpointer -etta_initialize_value (ETableModel *etm, gint col) +etta_initialize_value (ETableModel *etm, + gint col) { ETreeTableAdapter *etta = (ETreeTableAdapter *) etm; @@ -683,7 +722,9 @@ etta_initialize_value (ETableModel *etm, gint col) } static gboolean -etta_value_is_empty (ETableModel *etm, gint col, gconstpointer value) +etta_value_is_empty (ETableModel *etm, + gint col, + gconstpointer value) { ETreeTableAdapter *etta = (ETreeTableAdapter *) etm; @@ -691,7 +732,9 @@ etta_value_is_empty (ETableModel *etm, gint col, gconstpointer value) } static gchar * -etta_value_to_string (ETableModel *etm, gint col, gconstpointer value) +etta_value_to_string (ETableModel *etm, + gint col, + gconstpointer value) { ETreeTableAdapter *etta = (ETreeTableAdapter *) etm; @@ -752,19 +795,22 @@ etta_init (ETreeTableAdapter *etta) } static void -etta_proxy_pre_change (ETreeModel *etm, ETreeTableAdapter *etta) +etta_proxy_pre_change (ETreeModel *etm, + ETreeTableAdapter *etta) { e_table_model_pre_change (E_TABLE_MODEL (etta)); } static void -etta_proxy_no_change (ETreeModel *etm, ETreeTableAdapter *etta) +etta_proxy_no_change (ETreeModel *etm, + ETreeTableAdapter *etta) { e_table_model_no_change (E_TABLE_MODEL (etta)); } static void -etta_proxy_rebuilt (ETreeModel *etm, ETreeTableAdapter *etta) +etta_proxy_rebuilt (ETreeModel *etm, + ETreeTableAdapter *etta) { if (!etta->priv->root) return; @@ -783,7 +829,9 @@ resort_model (ETreeTableAdapter *etta) } static void -etta_proxy_node_changed (ETreeModel *etm, ETreePath path, ETreeTableAdapter *etta) +etta_proxy_node_changed (ETreeModel *etm, + ETreePath path, + ETreeTableAdapter *etta) { update_node (etta, path); e_table_model_changed (E_TABLE_MODEL (etta)); @@ -796,7 +844,9 @@ etta_proxy_node_changed (ETreeModel *etm, ETreePath path, ETreeTableAdapter *ett } static void -etta_proxy_node_data_changed (ETreeModel *etm, ETreePath path, ETreeTableAdapter *etta) +etta_proxy_node_data_changed (ETreeModel *etm, + ETreePath path, + ETreeTableAdapter *etta) { gint row = get_row (etta, path); @@ -809,7 +859,10 @@ etta_proxy_node_data_changed (ETreeModel *etm, ETreePath path, ETreeTableAdapter } static void -etta_proxy_node_col_changed (ETreeModel *etm, ETreePath path, gint col, ETreeTableAdapter *etta) +etta_proxy_node_col_changed (ETreeModel *etm, + ETreePath path, + gint col, + ETreeTableAdapter *etta) { gint row = get_row (etta, path); @@ -822,7 +875,10 @@ etta_proxy_node_col_changed (ETreeModel *etm, ETreePath path, gint col, ETreeTab } static void -etta_proxy_node_inserted (ETreeModel *etm, ETreePath parent, ETreePath child, ETreeTableAdapter *etta) +etta_proxy_node_inserted (ETreeModel *etm, + ETreePath parent, + ETreePath child, + ETreeTableAdapter *etta) { if (e_tree_model_node_is_root (etm, child)) generate_tree (etta, child); @@ -833,26 +889,33 @@ etta_proxy_node_inserted (ETreeModel *etm, ETreePath parent, ETreePath child, ET } static void -etta_proxy_node_removed (ETreeModel *etm, ETreePath parent, ETreePath child, gint old_position, ETreeTableAdapter *etta) +etta_proxy_node_removed (ETreeModel *etm, + ETreePath parent, + ETreePath child, + gint old_position, + ETreeTableAdapter *etta) { delete_node (etta, parent, child); e_table_model_changed (E_TABLE_MODEL (etta)); } static void -etta_proxy_node_request_collapse (ETreeModel *etm, ETreePath node, ETreeTableAdapter *etta) +etta_proxy_node_request_collapse (ETreeModel *etm, + ETreePath node, + ETreeTableAdapter *etta) { e_tree_table_adapter_node_set_expanded (etta, node, FALSE); } static void -etta_sort_info_changed (ETableSortInfo *sort_info, ETreeTableAdapter *etta) +etta_sort_info_changed (ETableSortInfo *sort_info, + ETreeTableAdapter *etta) { if (!etta->priv->root) return; /* the function is called also internally, with sort_info = NULL, - thus skip those in signal emit */ + * thus skip those in signal emit */ if (sort_info) { gboolean handled = FALSE; @@ -869,7 +932,10 @@ etta_sort_info_changed (ETableSortInfo *sort_info, ETreeTableAdapter *etta) } ETableModel * -e_tree_table_adapter_construct (ETreeTableAdapter *etta, ETreeModel *source, ETableSortInfo *sort_info, ETableHeader *header) +e_tree_table_adapter_construct (ETreeTableAdapter *etta, + ETreeModel *source, + ETableSortInfo *sort_info, + ETableHeader *header) { ETreePath root; @@ -879,8 +945,9 @@ e_tree_table_adapter_construct (ETreeTableAdapter *etta, ETreeModel *source, ETa etta->priv->sort_info = sort_info; if (sort_info) { g_object_ref (sort_info); - etta->priv->sort_info_changed_id = g_signal_connect (G_OBJECT (sort_info), "sort_info_changed", - G_CALLBACK (etta_sort_info_changed), etta); + etta->priv->sort_info_changed_id = g_signal_connect ( + sort_info, "sort_info_changed", + G_CALLBACK (etta_sort_info_changed), etta); } etta->priv->header = header; @@ -894,30 +961,41 @@ e_tree_table_adapter_construct (ETreeTableAdapter *etta, ETreeModel *source, ETa if (root) generate_tree (etta, root); - etta->priv->pre_change_id = g_signal_connect(G_OBJECT(source), "pre_change", - G_CALLBACK (etta_proxy_pre_change), etta); - etta->priv->no_change_id = g_signal_connect (G_OBJECT (source), "no_change", - G_CALLBACK (etta_proxy_no_change), etta); - etta->priv->rebuilt_id = g_signal_connect (G_OBJECT (source), "rebuilt", - G_CALLBACK (etta_proxy_rebuilt), etta); - etta->priv->node_changed_id = g_signal_connect (G_OBJECT (source), "node_changed", - G_CALLBACK (etta_proxy_node_changed), etta); - etta->priv->node_data_changed_id = g_signal_connect (G_OBJECT (source), "node_data_changed", - G_CALLBACK (etta_proxy_node_data_changed), etta); - etta->priv->node_col_changed_id = g_signal_connect (G_OBJECT (source), "node_col_changed", - G_CALLBACK (etta_proxy_node_col_changed), etta); - etta->priv->node_inserted_id = g_signal_connect (G_OBJECT (source), "node_inserted", - G_CALLBACK (etta_proxy_node_inserted), etta); - etta->priv->node_removed_id = g_signal_connect (G_OBJECT (source), "node_removed", - G_CALLBACK (etta_proxy_node_removed), etta); - etta->priv->node_request_collapse_id = g_signal_connect (G_OBJECT (source), "node_request_collapse", - G_CALLBACK (etta_proxy_node_request_collapse), etta); + etta->priv->pre_change_id = g_signal_connect ( + source, "pre_change", + G_CALLBACK (etta_proxy_pre_change), etta); + etta->priv->no_change_id = g_signal_connect ( + source, "no_change", + G_CALLBACK (etta_proxy_no_change), etta); + etta->priv->rebuilt_id = g_signal_connect ( + source, "rebuilt", + G_CALLBACK (etta_proxy_rebuilt), etta); + etta->priv->node_changed_id = g_signal_connect ( + source, "node_changed", + G_CALLBACK (etta_proxy_node_changed), etta); + etta->priv->node_data_changed_id = g_signal_connect ( + source, "node_data_changed", + G_CALLBACK (etta_proxy_node_data_changed), etta); + etta->priv->node_col_changed_id = g_signal_connect ( + source, "node_col_changed", + G_CALLBACK (etta_proxy_node_col_changed), etta); + etta->priv->node_inserted_id = g_signal_connect ( + source, "node_inserted", + G_CALLBACK (etta_proxy_node_inserted), etta); + etta->priv->node_removed_id = g_signal_connect ( + source, "node_removed", + G_CALLBACK (etta_proxy_node_removed), etta); + etta->priv->node_request_collapse_id = g_signal_connect ( + source, "node_request_collapse", + G_CALLBACK (etta_proxy_node_request_collapse), etta); return E_TABLE_MODEL (etta); } ETableModel * -e_tree_table_adapter_new (ETreeModel *source, ETableSortInfo *sort_info, ETableHeader *header) +e_tree_table_adapter_new (ETreeModel *source, + ETableSortInfo *sort_info, + ETableHeader *header) { ETreeTableAdapter *etta = g_object_new (E_TYPE_TREE_TABLE_ADAPTER, NULL); @@ -933,7 +1011,9 @@ typedef struct { } TreeAndRoot; static void -save_expanded_state_func (gpointer keyp, gpointer value, gpointer data) +save_expanded_state_func (gpointer keyp, + gpointer value, + gpointer data) { ETreePath path = keyp; node_t *node = ((GNode *) value)->data; @@ -974,7 +1054,8 @@ e_tree_table_adapter_save_expanded_state_xml (ETreeTableAdapter *etta) } void -e_tree_table_adapter_save_expanded_state (ETreeTableAdapter *etta, const gchar *filename) +e_tree_table_adapter_save_expanded_state (ETreeTableAdapter *etta, + const gchar *filename) { xmlDoc *doc; @@ -988,7 +1069,8 @@ e_tree_table_adapter_save_expanded_state (ETreeTableAdapter *etta, const gchar * } static xmlDoc * -open_file (ETreeTableAdapter *etta, const gchar *filename) +open_file (ETreeTableAdapter *etta, + const gchar *filename) { xmlDoc *doc; xmlNode *root; @@ -1034,7 +1116,8 @@ open_file (ETreeTableAdapter *etta, const gchar *filename) /* state: <0 ... collapse; 0 ... use default; >0 ... expand */ void -e_tree_table_adapter_force_expanded_state (ETreeTableAdapter *etta, gint state) +e_tree_table_adapter_force_expanded_state (ETreeTableAdapter *etta, + gint state) { g_return_if_fail (etta != NULL); @@ -1042,7 +1125,8 @@ e_tree_table_adapter_force_expanded_state (ETreeTableAdapter *etta, gint state) } void -e_tree_table_adapter_load_expanded_state_xml (ETreeTableAdapter *etta, xmlDoc *doc) +e_tree_table_adapter_load_expanded_state_xml (ETreeTableAdapter *etta, + xmlDoc *doc) { xmlNode *root, *child; gboolean model_default; @@ -1104,7 +1188,8 @@ e_tree_table_adapter_load_expanded_state_xml (ETreeTableAdapter *etta, xmlDoc *d } void -e_tree_table_adapter_load_expanded_state (ETreeTableAdapter *etta, const gchar *filename) +e_tree_table_adapter_load_expanded_state (ETreeTableAdapter *etta, + const gchar *filename) { xmlDoc *doc; @@ -1120,7 +1205,8 @@ e_tree_table_adapter_load_expanded_state (ETreeTableAdapter *etta, const gchar * } void -e_tree_table_adapter_root_node_set_visible (ETreeTableAdapter *etta, gboolean visible) +e_tree_table_adapter_root_node_set_visible (ETreeTableAdapter *etta, + gboolean visible) { gint size; @@ -1145,7 +1231,9 @@ e_tree_table_adapter_root_node_set_visible (ETreeTableAdapter *etta, gboolean vi } void -e_tree_table_adapter_node_set_expanded (ETreeTableAdapter *etta, ETreePath path, gboolean expanded) +e_tree_table_adapter_node_set_expanded (ETreeTableAdapter *etta, + ETreePath path, + gboolean expanded) { GNode *gnode = lookup_gnode (etta, path); node_t *node; @@ -1203,7 +1291,9 @@ e_tree_table_adapter_node_set_expanded (ETreeTableAdapter *etta, ETreePath path, } void -e_tree_table_adapter_node_set_expanded_recurse (ETreeTableAdapter *etta, ETreePath path, gboolean expanded) +e_tree_table_adapter_node_set_expanded_recurse (ETreeTableAdapter *etta, + ETreePath path, + gboolean expanded) { ETreePath children; @@ -1217,13 +1307,15 @@ e_tree_table_adapter_node_set_expanded_recurse (ETreeTableAdapter *etta, ETreePa } ETreePath -e_tree_table_adapter_node_at_row (ETreeTableAdapter *etta, gint row) +e_tree_table_adapter_node_at_row (ETreeTableAdapter *etta, + gint row) { return get_path (etta, row); } gint -e_tree_table_adapter_row_of_node (ETreeTableAdapter *etta, ETreePath path) +e_tree_table_adapter_row_of_node (ETreeTableAdapter *etta, + ETreePath path) { return get_row (etta, path); } @@ -1235,7 +1327,8 @@ e_tree_table_adapter_root_node_is_visible (ETreeTableAdapter *etta) } void -e_tree_table_adapter_show_node (ETreeTableAdapter *etta, ETreePath path) +e_tree_table_adapter_show_node (ETreeTableAdapter *etta, + ETreePath path) { ETreePath parent; @@ -1248,7 +1341,8 @@ e_tree_table_adapter_show_node (ETreeTableAdapter *etta, ETreePath path) } gboolean -e_tree_table_adapter_node_is_expanded (ETreeTableAdapter *etta, ETreePath path) +e_tree_table_adapter_node_is_expanded (ETreeTableAdapter *etta, + ETreePath path) { node_t *node = get_node (etta, path); if (!e_tree_model_node_is_expandable (etta->priv->source, path) || !node) @@ -1258,7 +1352,8 @@ e_tree_table_adapter_node_is_expanded (ETreeTableAdapter *etta, ETreePath path) } void -e_tree_table_adapter_set_sort_info (ETreeTableAdapter *etta, ETableSortInfo *sort_info) +e_tree_table_adapter_set_sort_info (ETreeTableAdapter *etta, + ETableSortInfo *sort_info) { if (etta->priv->sort_info) { g_signal_handler_disconnect (G_OBJECT (etta->priv->sort_info), @@ -1269,8 +1364,9 @@ e_tree_table_adapter_set_sort_info (ETreeTableAdapter *etta, ETableSortInfo *sor etta->priv->sort_info = sort_info; if (sort_info) { g_object_ref (sort_info); - etta->priv->sort_info_changed_id = g_signal_connect(G_OBJECT(sort_info), "sort_info_changed", - G_CALLBACK (etta_sort_info_changed), etta); + etta->priv->sort_info_changed_id = g_signal_connect ( + sort_info, "sort_info_changed", + G_CALLBACK (etta_sort_info_changed), etta); } if (!etta->priv->root) @@ -1299,7 +1395,8 @@ e_tree_table_adapter_get_header (ETreeTableAdapter *etta) } ETreePath -e_tree_table_adapter_node_get_next (ETreeTableAdapter *etta, ETreePath path) +e_tree_table_adapter_node_get_next (ETreeTableAdapter *etta, + ETreePath path) { GNode *node = lookup_gnode (etta, path); diff --git a/widgets/table/e-tree.c b/widgets/table/e-tree.c index 996a6b1e51..770b2ad653 100644 --- a/widgets/table/e-tree.c +++ b/widgets/table/e-tree.c @@ -303,13 +303,15 @@ e_tree_state_change (ETree *et) } static void -change_trigger (GObject *object, ETree *et) +change_trigger (GObject *object, + ETree *et) { e_tree_state_change (et); } static void -search_col_change_trigger (GObject *object, ETree *et) +search_col_change_trigger (GObject *object, + ETree *et) { clear_current_search_col (et); e_tree_state_change (et); @@ -343,7 +345,8 @@ disconnect_header (ETree *e_tree) } static void -connect_header (ETree *e_tree, ETableState *state) +connect_header (ETree *e_tree, + ETableState *state) { GValue *val = g_new0 (GValue, 1); @@ -489,7 +492,9 @@ typedef struct { } SearchSearchStruct; static gboolean -search_search_callback (ETreeModel *model, ETreePath path, gpointer data) +search_search_callback (ETreeModel *model, + ETreePath path, + gpointer data) { SearchSearchStruct *cb_data = data; gconstpointer value; @@ -561,7 +566,8 @@ et_search_search (ETableSearch *search, } static void -et_search_accept (ETableSearch *search, ETree *et) +et_search_accept (ETableSearch *search, + ETree *et) { ETableCol *col = current_search_col (et); gint cursor; @@ -609,12 +615,13 @@ e_tree_init (ETree *e_tree) e_tree->priv->search = e_table_search_new (); - e_tree->priv->search_search_id = - g_signal_connect (G_OBJECT (e_tree->priv->search), "search", - G_CALLBACK (et_search_search), e_tree); - e_tree->priv->search_accept_id = - g_signal_connect (G_OBJECT (e_tree->priv->search), "accept", - G_CALLBACK (et_search_accept), e_tree); + e_tree->priv->search_search_id = g_signal_connect ( + e_tree->priv->search, "search", + G_CALLBACK (et_search_search), e_tree); + + e_tree->priv->search_accept_id = g_signal_connect ( + e_tree->priv->search, "accept", + G_CALLBACK (et_search_accept), e_tree); e_tree->priv->always_search = g_getenv ("GAL_ALWAYS_SEARCH") ? TRUE : FALSE; } @@ -632,7 +639,8 @@ et_grab_focus (GtkWidget *widget) /* Focus handler for the ETree */ static gint -et_focus (GtkWidget *container, GtkDirectionType direction) +et_focus (GtkWidget *container, + GtkDirectionType direction) { ETree *e_tree; @@ -670,7 +678,9 @@ set_header_canvas_width (ETree *e_tree) } static void -header_canvas_size_allocate (GtkWidget *widget, GtkAllocation *alloc, ETree *e_tree) +header_canvas_size_allocate (GtkWidget *widget, + GtkAllocation *alloc, + ETree *e_tree) { GtkAllocation allocation; @@ -680,9 +690,9 @@ header_canvas_size_allocate (GtkWidget *widget, GtkAllocation *alloc, ETree *e_t gtk_widget_get_allocation (widget, &allocation); /* When the header item is created ->height == 0, - as the font is only created when everything is realized. - So we set the usize here as well, so that the size of the - header is correct */ + * as the font is only created when everything is realized. + * So we set the usize here as well, so that the size of the + * header is correct */ if (allocation.height != E_TABLE_HEADER_ITEM (e_tree->priv->header_item)->height) gtk_widget_set_size_request ( widget, -1, @@ -804,8 +814,9 @@ tree_canvas_reflow_idle (ETree *e_tree) } static void -tree_canvas_size_allocate (GtkWidget *widget, GtkAllocation *alloc, - ETree *e_tree) +tree_canvas_size_allocate (GtkWidget *widget, + GtkAllocation *alloc, + ETree *e_tree) { gdouble width; gdouble height; @@ -831,7 +842,8 @@ tree_canvas_size_allocate (GtkWidget *widget, GtkAllocation *alloc, } static void -tree_canvas_reflow (GnomeCanvas *canvas, ETree *e_tree) +tree_canvas_reflow (GnomeCanvas *canvas, + ETree *e_tree) { if (!e_tree->priv->reflow_idle_id) e_tree->priv->reflow_idle_id = g_idle_add_full ( @@ -840,7 +852,9 @@ tree_canvas_reflow (GnomeCanvas *canvas, ETree *e_tree) } static void -item_cursor_change (ETableItem *eti, gint row, ETree *et) +item_cursor_change (ETableItem *eti, + gint row, + ETree *et) { ETreePath path = e_tree_table_adapter_node_at_row (et->priv->etta, row); @@ -848,7 +862,9 @@ item_cursor_change (ETableItem *eti, gint row, ETree *et) } static void -item_cursor_activated (ETableItem *eti, gint row, ETree *et) +item_cursor_activated (ETableItem *eti, + gint row, + ETree *et) { ETreePath path = e_tree_table_adapter_node_at_row (et->priv->etta, row); @@ -856,7 +872,11 @@ item_cursor_activated (ETableItem *eti, gint row, ETree *et) } static void -item_double_click (ETableItem *eti, gint row, gint col, GdkEvent *event, ETree *et) +item_double_click (ETableItem *eti, + gint row, + gint col, + GdkEvent *event, + ETree *et) { ETreePath path = e_tree_table_adapter_node_at_row (et->priv->etta, row); @@ -864,7 +884,11 @@ item_double_click (ETableItem *eti, gint row, gint col, GdkEvent *event, ETree * } static gboolean -item_right_click (ETableItem *eti, gint row, gint col, GdkEvent *event, ETree *et) +item_right_click (ETableItem *eti, + gint row, + gint col, + GdkEvent *event, + ETree *et) { ETreePath path = e_tree_table_adapter_node_at_row (et->priv->etta, row); gboolean return_val = 0; @@ -877,7 +901,11 @@ item_right_click (ETableItem *eti, gint row, gint col, GdkEvent *event, ETree *e } static gboolean -item_click (ETableItem *eti, gint row, gint col, GdkEvent *event, ETree *et) +item_click (ETableItem *eti, + gint row, + gint col, + GdkEvent *event, + ETree *et) { gboolean return_val = 0; ETreePath path = e_tree_table_adapter_node_at_row (et->priv->etta, row); @@ -889,7 +917,11 @@ item_click (ETableItem *eti, gint row, gint col, GdkEvent *event, ETree *et) } static gint -item_key_press (ETableItem *eti, gint row, gint col, GdkEvent *event, ETree *et) +item_key_press (ETableItem *eti, + gint row, + gint col, + GdkEvent *event, + ETree *et) { gint return_val = 0; GdkEventKey *key = (GdkEventKey *) event; @@ -1000,7 +1032,11 @@ item_key_press (ETableItem *eti, gint row, gint col, GdkEvent *event, ETree *et) } static gint -item_start_drag (ETableItem *eti, gint row, gint col, GdkEvent *event, ETree *et) +item_start_drag (ETableItem *eti, + gint row, + gint col, + GdkEvent *event, + ETree *et) { ETreePath path; gint return_val = 0; @@ -1015,7 +1051,8 @@ item_start_drag (ETableItem *eti, gint row, gint col, GdkEvent *event, ETree *et } static void -et_selection_model_selection_changed (ETableSelectionModel *etsm, ETree *et) +et_selection_model_selection_changed (ETableSelectionModel *etsm, + ETree *et) { g_signal_emit (et, et_signals[SELECTION_CHANGE], 0); } @@ -1064,7 +1101,8 @@ et_build_item (ETree *et) } static void -et_canvas_style_set (GtkWidget *widget, GtkStyle *prev_style) +et_canvas_style_set (GtkWidget *widget, + GtkStyle *prev_style) { GtkStyle *style; @@ -1077,7 +1115,9 @@ et_canvas_style_set (GtkWidget *widget, GtkStyle *prev_style) } static gboolean -white_item_event (GnomeCanvasItem *white_item, GdkEvent *event, ETree *e_tree) +white_item_event (GnomeCanvasItem *white_item, + GdkEvent *event, + ETree *e_tree) { gboolean return_val = 0; g_signal_emit (e_tree, @@ -1087,7 +1127,9 @@ white_item_event (GnomeCanvasItem *white_item, GdkEvent *event, ETree *e_tree) } static gint -et_canvas_root_event (GnomeCanvasItem *root, GdkEvent *event, ETree *e_tree) +et_canvas_root_event (GnomeCanvasItem *root, + GdkEvent *event, + ETree *e_tree) { switch (event->type) { case GDK_BUTTON_PRESS: @@ -1115,7 +1157,9 @@ et_canvas_root_event (GnomeCanvasItem *root, GdkEvent *event, ETree *e_tree) * and give the focus to some ETableItem. */ static gint -table_canvas_focus_event_cb (GtkWidget *widget, GdkEventFocus *event, gpointer data) +table_canvas_focus_event_cb (GtkWidget *widget, + GdkEventFocus *event, + gpointer data) { GnomeCanvas *canvas; ETree *tree; @@ -1213,7 +1257,8 @@ e_tree_setup_table (ETree *e_tree) * search column is cleared. */ void -e_tree_set_search_column (ETree *e_tree, gint col) +e_tree_set_search_column (ETree *e_tree, + gint col) { if (col == -1) { clear_current_search_col (e_tree); @@ -1226,7 +1271,8 @@ e_tree_set_search_column (ETree *e_tree, gint col) } void -e_tree_set_state_object (ETree *e_tree, ETableState *state) +e_tree_set_state_object (ETree *e_tree, + ETableState *state) { GValue *val; GtkAllocation allocation; @@ -1271,8 +1317,8 @@ e_tree_set_state_object (ETree *e_tree, ETableState *state) * #ETree object. */ void -e_tree_set_state (ETree *e_tree, - const gchar *state_str) +e_tree_set_state (ETree *e_tree, + const gchar *state_str) { ETableState *state; @@ -1298,8 +1344,8 @@ e_tree_set_state (ETree *e_tree, * @e_tree object. */ void -e_tree_load_state (ETree *e_tree, - const gchar *filename) +e_tree_load_state (ETree *e_tree, + const gchar *filename) { ETableState *state; @@ -1388,8 +1434,8 @@ e_tree_get_state (ETree *e_tree) * @filename. **/ void -e_tree_save_state (ETree *e_tree, - const gchar *filename) +e_tree_save_state (ETree *e_tree, + const gchar *filename) { ETableState *state; @@ -1413,26 +1459,35 @@ e_tree_get_spec (ETree *e_tree) } static void -et_table_model_changed (ETableModel *model, ETree *et) +et_table_model_changed (ETableModel *model, + ETree *et) { if (et->priv->horizontal_scrolling) e_table_header_update_horizontal (et->priv->header); } static void -et_table_row_changed (ETableModel *table_model, gint row, ETree *et) +et_table_row_changed (ETableModel *table_model, + gint row, + ETree *et) { et_table_model_changed (table_model, et); } static void -et_table_cell_changed (ETableModel *table_model, gint view_col, gint row, ETree *et) +et_table_cell_changed (ETableModel *table_model, + gint view_col, + gint row, + ETree *et) { et_table_model_changed (table_model, et); } static void -et_table_rows_deleted (ETableModel *table_model, gint row, gint count, ETree *et) +et_table_rows_deleted (ETableModel *table_model, + gint row, + gint count, + ETree *et) { ETreePath * node, * prev_node; @@ -1441,7 +1496,7 @@ et_table_rows_deleted (ETableModel *table_model, gint row, gint count, ETree *et || row == 0) return; - prev_node = e_tree_node_at_row (et, row-1); + prev_node = e_tree_node_at_row (et, row - 1); node = e_tree_get_cursor (et); /* Check if the cursor is a child of the node directly before the @@ -1479,8 +1534,11 @@ et_connect_to_etta (ETree *et) } static gboolean -et_real_construct (ETree *e_tree, ETreeModel *etm, ETableExtras *ete, - ETableSpecification *specification, ETableState *state) +et_real_construct (ETree *e_tree, + ETreeModel *etm, + ETableExtras *ete, + ETableSpecification *specification, + ETableState *state) { GtkAdjustment *adjustment; GtkScrollable *scrollable; @@ -1525,9 +1583,9 @@ et_real_construct (ETree *e_tree, ETreeModel *etm, ETableExtras *ete, "cursor_mode", specification->cursor_mode, NULL); - g_signal_connect(e_tree->priv->selection, "selection_changed", + g_signal_connect (e_tree->priv->selection, "selection_changed", G_CALLBACK (et_selection_model_selection_changed), e_tree); - g_signal_connect(e_tree->priv->selection, "selection_row_changed", + g_signal_connect (e_tree->priv->selection, "selection_row_changed", G_CALLBACK (et_selection_model_selection_row_changed), e_tree); if (!specification->no_headers) { @@ -1578,8 +1636,11 @@ et_real_construct (ETree *e_tree, ETreeModel *etm, ETableExtras *ete, * Return value: %TRUE on success, %FALSE if an error occurred **/ gboolean -e_tree_construct (ETree *e_tree, ETreeModel *etm, ETableExtras *ete, - const gchar *spec_str, const gchar *state_str) +e_tree_construct (ETree *e_tree, + ETreeModel *etm, + ETableExtras *ete, + const gchar *spec_str, + const gchar *state_str) { ETableSpecification *specification; ETableState *state; @@ -1637,8 +1698,11 @@ e_tree_construct (ETree *e_tree, ETreeModel *etm, ETableExtras *ete, * Return value: %TRUE on success, %FALSE if an error occurred **/ gboolean -e_tree_construct_from_spec_file (ETree *e_tree, ETreeModel *etm, ETableExtras *ete, - const gchar *spec_fn, const gchar *state_fn) +e_tree_construct_from_spec_file (ETree *e_tree, + ETreeModel *etm, + ETableExtras *ete, + const gchar *spec_fn, + const gchar *state_fn) { ETableSpecification *specification; ETableState *state; @@ -1707,7 +1771,10 @@ e_tree_construct_from_spec_file (ETree *e_tree, ETreeModel *etm, ETableExtras *e * The newly created #ETree or %NULL if there's an error. **/ GtkWidget * -e_tree_new (ETreeModel *etm, ETableExtras *ete, const gchar *spec, const gchar *state) +e_tree_new (ETreeModel *etm, + ETableExtras *ete, + const gchar *spec, + const gchar *state) { ETree *e_tree; @@ -1779,7 +1846,8 @@ e_tree_show_cursor_after_reflow (ETree *e_tree) } void -e_tree_set_cursor (ETree *e_tree, ETreePath path) +e_tree_set_cursor (ETree *e_tree, + ETreePath path) { #ifndef E_TREE_USE_TREE_SELECTION gint row; @@ -1829,9 +1897,9 @@ e_tree_get_cursor (ETree *e_tree) } void -e_tree_selected_row_foreach (ETree *e_tree, - EForeachFunc callback, - gpointer closure) +e_tree_selected_row_foreach (ETree *e_tree, + EForeachFunc callback, + gpointer closure) { g_return_if_fail (e_tree != NULL); g_return_if_fail (E_IS_TREE (e_tree)); @@ -1843,9 +1911,9 @@ e_tree_selected_row_foreach (ETree *e_tree, #ifdef E_TREE_USE_TREE_SELECTION void -e_tree_selected_path_foreach (ETree *e_tree, - ETreeForeachFunc callback, - gpointer closure) +e_tree_selected_path_foreach (ETree *e_tree, + ETreeForeachFunc callback, + gpointer closure) { g_return_if_fail (e_tree != NULL); g_return_if_fail (E_IS_TREE (e_tree)); @@ -1858,9 +1926,9 @@ e_tree_selected_path_foreach (ETree *e_tree, /* Standard functions */ static void et_foreach_recurse (ETreeModel *model, - ETreePath path, - ETreeForeachFunc callback, - gpointer closure) + ETreePath path, + ETreeForeachFunc callback, + gpointer closure) { ETreePath child; @@ -1874,8 +1942,8 @@ et_foreach_recurse (ETreeModel *model, void e_tree_path_foreach (ETree *e_tree, - ETreeForeachFunc callback, - gpointer closure) + ETreeForeachFunc callback, + gpointer closure) { ETreePath root; @@ -1903,13 +1971,13 @@ e_tree_get_printable (ETree *e_tree) static void et_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) + guint property_id, + GValue *value, + GParamSpec *pspec) { ETree *etree = E_TREE (object); - switch (prop_id) { + switch (property_id) { case PROP_ETTA: g_value_set_object (value, etree->priv->etta); break; @@ -1952,7 +2020,7 @@ et_get_property (GObject *object, g_value_set_enum (value, 0); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } @@ -1964,13 +2032,13 @@ typedef struct { static void et_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec) + guint property_id, + const GValue *value, + GParamSpec *pspec) { ETree *etree = E_TREE (object); - switch (prop_id) { + switch (property_id) { case PROP_LENGTH_THRESHOLD: etree->priv->length_threshold = g_value_get_int (value); if (etree->priv->item) { @@ -2051,8 +2119,8 @@ et_set_property (GObject *object, } gint -e_tree_get_next_row (ETree *e_tree, - gint model_row) +e_tree_get_next_row (ETree *e_tree, + gint model_row) { g_return_val_if_fail (e_tree != NULL, -1); g_return_val_if_fail (E_IS_TREE (e_tree), -1); @@ -2079,8 +2147,8 @@ e_tree_get_next_row (ETree *e_tree, } gint -e_tree_get_prev_row (ETree *e_tree, - gint model_row) +e_tree_get_prev_row (ETree *e_tree, + gint model_row) { g_return_val_if_fail (e_tree != NULL, -1); g_return_val_if_fail (E_IS_TREE (e_tree), -1); @@ -2098,8 +2166,8 @@ e_tree_get_prev_row (ETree *e_tree, } gint -e_tree_model_to_view_row (ETree *e_tree, - gint model_row) +e_tree_model_to_view_row (ETree *e_tree, + gint model_row) { g_return_val_if_fail (e_tree != NULL, -1); g_return_val_if_fail (E_IS_TREE (e_tree), -1); @@ -2111,8 +2179,8 @@ e_tree_model_to_view_row (ETree *e_tree, } gint -e_tree_view_to_model_row (ETree *e_tree, - gint view_row) +e_tree_view_to_model_row (ETree *e_tree, + gint view_row) { g_return_val_if_fail (e_tree != NULL, -1); g_return_val_if_fail (E_IS_TREE (e_tree), -1); @@ -2124,7 +2192,8 @@ e_tree_view_to_model_row (ETree *e_tree, } gboolean -e_tree_node_is_expanded (ETree *et, ETreePath path) +e_tree_node_is_expanded (ETree *et, + ETreePath path) { g_return_val_if_fail (path, FALSE); @@ -2132,7 +2201,9 @@ e_tree_node_is_expanded (ETree *et, ETreePath path) } void -e_tree_node_set_expanded (ETree *et, ETreePath path, gboolean expanded) +e_tree_node_set_expanded (ETree *et, + ETreePath path, + gboolean expanded) { g_return_if_fail (et != NULL); g_return_if_fail (E_IS_TREE (et)); @@ -2141,7 +2212,9 @@ e_tree_node_set_expanded (ETree *et, ETreePath path, gboolean expanded) } void -e_tree_node_set_expanded_recurse (ETree *et, ETreePath path, gboolean expanded) +e_tree_node_set_expanded_recurse (ETree *et, + ETreePath path, + gboolean expanded) { g_return_if_fail (et != NULL); g_return_if_fail (E_IS_TREE (et)); @@ -2150,7 +2223,8 @@ e_tree_node_set_expanded_recurse (ETree *et, ETreePath path, gboolean expanded) } void -e_tree_root_node_set_visible (ETree *et, gboolean visible) +e_tree_root_node_set_visible (ETree *et, + gboolean visible) { g_return_if_fail (et != NULL); g_return_if_fail (E_IS_TREE (et)); @@ -2159,7 +2233,8 @@ e_tree_root_node_set_visible (ETree *et, gboolean visible) } ETreePath -e_tree_node_at_row (ETree *et, gint row) +e_tree_node_at_row (ETree *et, + gint row) { ETreePath path; @@ -2169,7 +2244,8 @@ e_tree_node_at_row (ETree *et, gint row) } gint -e_tree_row_of_node (ETree *et, ETreePath path) +e_tree_row_of_node (ETree *et, + ETreePath path) { return e_tree_table_adapter_row_of_node (et->priv->etta, path); } @@ -2181,7 +2257,8 @@ e_tree_root_node_is_visible (ETree *et) } void -e_tree_show_node (ETree *et, ETreePath path) +e_tree_show_node (ETree *et, + ETreePath path) { g_return_if_fail (et != NULL); g_return_if_fail (E_IS_TREE (et)); @@ -2190,7 +2267,8 @@ e_tree_show_node (ETree *et, ETreePath path) } void -e_tree_save_expanded_state (ETree *et, gchar *filename) +e_tree_save_expanded_state (ETree *et, + gchar *filename) { g_return_if_fail (et != NULL); g_return_if_fail (E_IS_TREE (et)); @@ -2199,7 +2277,8 @@ e_tree_save_expanded_state (ETree *et, gchar *filename) } void -e_tree_load_expanded_state (ETree *et, gchar *filename) +e_tree_load_expanded_state (ETree *et, + gchar *filename) { e_tree_table_adapter_load_expanded_state (et->priv->etta, filename); } @@ -2214,7 +2293,8 @@ e_tree_save_expanded_state_xml (ETree *et) } void -e_tree_load_expanded_state_xml (ETree *et, xmlDoc *doc) +e_tree_load_expanded_state_xml (ETree *et, + xmlDoc *doc) { g_return_if_fail (et != NULL); g_return_if_fail (E_IS_TREE (et)); @@ -2224,10 +2304,11 @@ e_tree_load_expanded_state_xml (ETree *et, xmlDoc *doc) } /* state: <0 ... collapse; 0 ... no force - use default; >0 ... expand; - when using this, be sure to reset to 0 once no forcing is required - anymore, aka the build of the tree is done */ + * when using this, be sure to reset to 0 once no forcing is required + * anymore, aka the build of the tree is done */ void -e_tree_force_expanded_state (ETree *et, gint state) +e_tree_force_expanded_state (ETree *et, + gint state) { e_tree_table_adapter_force_expanded_state (et->priv->etta, state); } @@ -2245,7 +2326,11 @@ e_tree_get_tooltip (ETree *et) } static ETreePath -find_next_in_range (ETree *et, gint start, gint end, ETreePathFunc func, gpointer data) +find_next_in_range (ETree *et, + gint start, + gint end, + ETreePathFunc func, + gpointer data) { ETreePath path; gint row; @@ -2260,7 +2345,11 @@ find_next_in_range (ETree *et, gint start, gint end, ETreePathFunc func, gpointe } static ETreePath -find_prev_in_range (ETree *et, gint start, gint end, ETreePathFunc func, gpointer data) +find_prev_in_range (ETree *et, + gint start, + gint end, + ETreePathFunc func, + gpointer data) { ETreePath path; gint row; @@ -2372,7 +2461,7 @@ e_tree_get_table_adapter (ETree *et) } ETableItem * -e_tree_get_item (ETree * et) +e_tree_get_item (ETree *et) { g_return_val_if_fail (et != NULL, NULL); g_return_val_if_fail (E_IS_TREE (et), NULL); @@ -2381,7 +2470,7 @@ e_tree_get_item (ETree * et) } GnomeCanvasItem * -e_tree_get_header_item (ETree * et) +e_tree_get_header_item (ETree *et) { g_return_val_if_fail (et != NULL, NULL); g_return_val_if_fail (E_IS_TREE (et), NULL); @@ -2458,12 +2547,12 @@ struct _GtkDragSourceInfo /* Target */ void -e_tree_drag_get_data (ETree *tree, - gint row, - gint col, - GdkDragContext *context, - GdkAtom target, - guint32 time) +e_tree_drag_get_data (ETree *tree, + gint row, + gint col, + GdkDragContext *context, + GdkAtom target, + guint32 time) { g_return_if_fail (tree != NULL); g_return_if_fail (E_IS_TREE (tree)); @@ -2486,8 +2575,8 @@ e_tree_drag_get_data (ETree *tree, */ void e_tree_drag_highlight (ETree *tree, - gint row, - gint col) + gint row, + gint col) { GtkAllocation allocation; GtkAdjustment *adjustment; @@ -2596,7 +2685,11 @@ e_tree_drag_dest_unset (GtkWidget *widget) /* Source side */ static gint -et_real_start_drag (ETree *tree, gint row, ETreePath path, gint col, GdkEvent *event) +et_real_start_drag (ETree *tree, + gint row, + ETreePath path, + gint col, + GdkEvent *event) { GtkDragSourceInfo *info; GdkDragContext *context; @@ -2629,11 +2722,11 @@ et_real_start_drag (ETree *tree, gint row, ETreePath path, gint col, GdkEvent *e } void -e_tree_drag_source_set (ETree *tree, - GdkModifierType start_button_mask, - const GtkTargetEntry *targets, - gint n_targets, - GdkDragAction actions) +e_tree_drag_source_set (ETree *tree, + GdkModifierType start_button_mask, + const GtkTargetEntry *targets, + gint n_targets, + GdkDragAction actions) { ETreeDragSourceSite *site; GtkWidget *canvas; @@ -2692,13 +2785,13 @@ e_tree_drag_source_unset (ETree *tree) */ GdkDragContext * -e_tree_drag_begin (ETree *tree, - gint row, - gint col, - GtkTargetList *targets, - GdkDragAction actions, - gint button, - GdkEvent *event) +e_tree_drag_begin (ETree *tree, + gint row, + gint col, + GtkTargetList *targets, + GdkDragAction actions, + gint button, + GdkEvent *event) { ETreePath path; g_return_val_if_fail (tree != NULL, NULL); @@ -2730,8 +2823,10 @@ e_tree_drag_begin (ETree *tree, **/ void e_tree_get_cell_at (ETree *tree, - gint x, gint y, - gint *row_return, gint *col_return) + gint x, + gint y, + gint *row_return, + gint *col_return) { GtkAdjustment *adjustment; GtkScrollable *scrollable; @@ -2777,9 +2872,12 @@ e_tree_get_cell_at (ETree *tree, **/ void e_tree_get_cell_geometry (ETree *tree, - gint row, gint col, - gint *x_return, gint *y_return, - gint *width_return, gint *height_return) + gint row, + gint col, + gint *x_return, + gint *y_return, + gint *width_return, + gint *height_return) { GtkAdjustment *adjustment; GtkScrollable *scrollable; @@ -2811,8 +2909,8 @@ e_tree_get_cell_geometry (ETree *tree, static void et_drag_begin (GtkWidget *widget, - GdkDragContext *context, - ETree *et) + GdkDragContext *context, + ETree *et) { g_signal_emit (et, et_signals[TREE_DRAG_BEGIN], 0, @@ -2824,8 +2922,8 @@ et_drag_begin (GtkWidget *widget, static void et_drag_end (GtkWidget *widget, - GdkDragContext *context, - ETree *et) + GdkDragContext *context, + ETree *et) { g_signal_emit (et, et_signals[TREE_DRAG_END], 0, @@ -2837,11 +2935,11 @@ et_drag_end (GtkWidget *widget, static void et_drag_data_get (GtkWidget *widget, - GdkDragContext *context, - GtkSelectionData *selection_data, - guint info, - guint time, - ETree *et) + GdkDragContext *context, + GtkSelectionData *selection_data, + guint info, + guint time, + ETree *et) { g_signal_emit (et, et_signals[TREE_DRAG_DATA_GET], 0, @@ -2856,8 +2954,8 @@ et_drag_data_get (GtkWidget *widget, static void et_drag_data_delete (GtkWidget *widget, - GdkDragContext *context, - ETree *et) + GdkDragContext *context, + ETree *et) { g_signal_emit (et, et_signals[TREE_DRAG_DATA_DELETE], 0, @@ -2869,10 +2967,10 @@ et_drag_data_delete (GtkWidget *widget, static gboolean do_drag_motion (ETree *et, - GdkDragContext *context, - gint x, - gint y, - guint time) + GdkDragContext *context, + gint x, + gint y, + guint time) { gboolean ret_val = FALSE; gint row, col; @@ -2973,7 +3071,8 @@ scroll_timeout (gpointer data) } static void -scroll_on (ETree *et, guint scroll_direction) +scroll_on (ETree *et, + guint scroll_direction) { if (et->priv->scroll_idle_id == 0 || scroll_direction != et->priv->scroll_direction) { @@ -3027,7 +3126,9 @@ hover_timeout (gpointer data) } static void -hover_on (ETree *et, gint x, gint y) +hover_on (ETree *et, + gint x, + gint y) { et->priv->hover_x = x; et->priv->hover_y = y; @@ -3046,7 +3147,8 @@ hover_off (ETree *et) } static void -collapse_drag (ETree *et, ETreePath drop) +collapse_drag (ETree *et, + ETreePath drop) { GList *list; @@ -3085,7 +3187,8 @@ collapse_drag (ETree *et, ETreePath drop) } static void -context_destroyed (gpointer data, GObject *ctx) +context_destroyed (gpointer data, + GObject *ctx) { ETree *et = data; if (et->priv) { @@ -3101,7 +3204,8 @@ context_destroyed (gpointer data, GObject *ctx) } static void -context_connect (ETree *et, GdkDragContext *context) +context_connect (ETree *et, + GdkDragContext *context) { if (context == et->priv->last_drop_context) return; @@ -3118,9 +3222,9 @@ context_connect (ETree *et, GdkDragContext *context) static void et_drag_leave (GtkWidget *widget, - GdkDragContext *context, - guint time, - ETree *et) + GdkDragContext *context, + guint time, + ETree *et) { g_signal_emit (et, et_signals[TREE_DRAG_LEAVE], 0, @@ -3138,11 +3242,11 @@ et_drag_leave (GtkWidget *widget, static gboolean et_drag_motion (GtkWidget *widget, - GdkDragContext *context, - gint x, - gint y, - guint time, - ETree *et) + GdkDragContext *context, + gint x, + gint y, + guint time, + ETree *et) { GtkAllocation allocation; gint ret_val; @@ -3186,11 +3290,11 @@ et_drag_motion (GtkWidget *widget, static gboolean et_drag_drop (GtkWidget *widget, - GdkDragContext *context, - gint x, - gint y, - guint time, - ETree *et) + GdkDragContext *context, + gint x, + gint y, + guint time, + ETree *et) { gboolean ret_val = FALSE; gint row, col; @@ -3248,13 +3352,13 @@ et_drag_drop (GtkWidget *widget, static void et_drag_data_received (GtkWidget *widget, - GdkDragContext *context, - gint x, - gint y, - GtkSelectionData *selection_data, - guint info, - guint time, - ETree *et) + GdkDragContext *context, + gint x, + gint y, + GtkSelectionData *selection_data, + guint info, + guint time, + ETree *et) { gint row, col; ETreePath path; @@ -3602,7 +3706,9 @@ e_tree_class_init (ETreeClass *class) } static void -tree_size_allocate (GtkWidget *widget, GtkAllocation *alloc, ETree *tree) +tree_size_allocate (GtkWidget *widget, + GtkAllocation *alloc, + ETree *tree) { gdouble width; @@ -3629,7 +3735,8 @@ tree_size_allocate (GtkWidget *widget, GtkAllocation *alloc, ETree *tree) * Creates an info message in table area, or removes old. **/ void -e_tree_set_info_message (ETree *tree, const gchar *info_message) +e_tree_set_info_message (ETree *tree, + const gchar *info_message) { GtkAllocation allocation; GtkWidget *widget; diff --git a/widgets/table/gal-a11y-e-cell-popup.c b/widgets/table/gal-a11y-e-cell-popup.c index f1c2540820..b1232a6b84 100644 --- a/widgets/table/gal-a11y-e-cell-popup.c +++ b/widgets/table/gal-a11y-e-cell-popup.c @@ -83,16 +83,16 @@ gal_a11y_e_cell_popup_class_init (GalA11yECellPopupClass *class) AtkObject * gal_a11y_e_cell_popup_new (ETableItem *item, - ECellView *cell_view, - AtkObject *parent, - gint model_col, - gint view_col, - gint row) + ECellView *cell_view, + AtkObject *parent, + gint model_col, + gint view_col, + gint row) { AtkObject *a11y; GalA11yECell *cell; ECellPopup *popupcell; - ECellView* child_view = NULL; + ECellView * child_view = NULL; popupcell= E_CELL_POPUP (cell_view->ecell); diff --git a/widgets/table/gal-a11y-e-cell-registry.c b/widgets/table/gal-a11y-e-cell-registry.c index 79ad4cacb2..ce533882ab 100644 --- a/widgets/table/gal-a11y-e-cell-registry.c +++ b/widgets/table/gal-a11y-e-cell-registry.c @@ -108,13 +108,13 @@ init_default_registry (void) } AtkObject * -gal_a11y_e_cell_registry_get_object (GalA11yECellRegistry *registry, - ETableItem *item, - ECellView *cell_view, - AtkObject *parent, - gint model_col, - gint view_col, - gint row) +gal_a11y_e_cell_registry_get_object (GalA11yECellRegistry *registry, + ETableItem *item, + ECellView *cell_view, + AtkObject *parent, + gint model_col, + gint view_col, + gint row) { GalA11yECellRegistryFunc func = NULL; GType type; @@ -137,9 +137,9 @@ gal_a11y_e_cell_registry_get_object (GalA11yECellRegistry *registry, } void -gal_a11y_e_cell_registry_add_cell_type (GalA11yECellRegistry *registry, - GType type, - GalA11yECellRegistryFunc func) +gal_a11y_e_cell_registry_add_cell_type (GalA11yECellRegistry *registry, + GType type, + GalA11yECellRegistryFunc func) { if (registry == NULL) { init_default_registry (); diff --git a/widgets/table/gal-a11y-e-cell-toggle.c b/widgets/table/gal-a11y-e-cell-toggle.c index 98fcdcd92f..991d3c0721 100644 --- a/widgets/table/gal-a11y-e-cell-toggle.c +++ b/widgets/table/gal-a11y-e-cell-toggle.c @@ -122,9 +122,9 @@ toggle_cell_action (GalA11yECell *cell) static void model_change_cb (ETableModel *etm, - gint col, - gint row, - GalA11yECell *cell) + gint col, + gint row, + GalA11yECell *cell) { gint value; @@ -143,13 +143,13 @@ model_change_cb (ETableModel *etm, } } -AtkObject* +AtkObject * gal_a11y_e_cell_toggle_new (ETableItem *item, - ECellView *cell_view, - AtkObject *parent, - gint model_col, - gint view_col, - gint row) + ECellView *cell_view, + AtkObject *parent, + gint model_col, + gint view_col, + gint row) { AtkObject *a11y; GalA11yECell *cell; diff --git a/widgets/table/gal-a11y-e-cell-tree.c b/widgets/table/gal-a11y-e-cell-tree.c index 70880fc0cc..148731d4b8 100644 --- a/widgets/table/gal-a11y-e-cell-tree.c +++ b/widgets/table/gal-a11y-e-cell-tree.c @@ -43,8 +43,8 @@ static AtkObjectClass *a11y_parent_class; static void ectr_model_row_changed_cb (ETableModel *etm, - gint row, - GalA11yECell *a11y) + gint row, + GalA11yECell *a11y) { ETreePath node; ETreeModel *tree_model; @@ -88,7 +88,7 @@ kill_view_cb (ECellView *subcell_view, static void ectr_subcell_weak_ref (GalA11yECellTree *a11y, - GalA11yECell *subcell_a11y) + GalA11yECell *subcell_a11y) { ECellView *subcell_view = subcell_a11y ? subcell_a11y->cell_view : NULL; if (subcell_a11y && subcell_view && subcell_view->kill_view_cb_data) @@ -184,11 +184,11 @@ gal_a11y_e_cell_tree_get_type (void) AtkObject * gal_a11y_e_cell_tree_new (ETableItem *item, - ECellView *cell_view, - AtkObject *parent, - gint model_col, - gint view_col, - gint row) + ECellView *cell_view, + AtkObject *parent, + gint model_col, + gint view_col, + gint row) { AtkObject *subcell_a11y; GalA11yECellTree *a11y; @@ -236,8 +236,8 @@ gal_a11y_e_cell_tree_new (ETableItem *item, subcell_a11y = NULL; /* create a companion a11y object, this object has type GalA11yECellTree - and it connects to some signals to determine whether a tree cell is - expanded or collapsed */ + * and it connects to some signals to determine whether a tree cell is + * expanded or collapsed */ a11y = g_object_new (gal_a11y_e_cell_tree_get_type (), NULL); gal_a11y_e_cell_construct (ATK_OBJECT (a11y), item, diff --git a/widgets/table/gal-a11y-e-cell-vbox.c b/widgets/table/gal-a11y-e-cell-vbox.c index e663bb1f1f..d0b9d26036 100644 --- a/widgets/table/gal-a11y-e-cell-vbox.c +++ b/widgets/table/gal-a11y-e-cell-vbox.c @@ -63,8 +63,9 @@ subcell_destroyed (gpointer data) gaev->a11y_subcells[cell->view_col] = NULL; } -static AtkObject* -ecv_ref_child (AtkObject *a11y, gint i) +static AtkObject * +ecv_ref_child (AtkObject *a11y, + gint i) { GalA11yECellVbox *gaev = GAL_A11Y_E_CELL_VBOX (a11y); GalA11yECell *gaec = GAL_A11Y_E_CELL (a11y); @@ -117,11 +118,11 @@ ecv_dispose (GObject *object) } /* AtkComponet interface */ -static AtkObject* +static AtkObject * ecv_ref_accessible_at_point (AtkComponent *component, - gint x, - gint y, - AtkCoordType coord_type) + gint x, + gint y, + AtkCoordType coord_type) { gint x0, y0, width, height; gint subcell_height, i; @@ -227,6 +228,6 @@ AtkObject *gal_a11y_e_cell_vbox_new (ETableItem *item, gaev = GAL_A11Y_E_CELL_VBOX (a11y); ecvv = (ECellVboxView *) (gaec->cell_view); gaev->a11y_subcell_count = ecvv->subcell_view_count; - gaev->a11y_subcells = g_malloc0 (sizeof (AtkObject *)*gaev->a11y_subcell_count); + gaev->a11y_subcells = g_malloc0 (sizeof (AtkObject *) * gaev->a11y_subcell_count); return a11y; } diff --git a/widgets/table/gal-a11y-e-cell.c b/widgets/table/gal-a11y-e-cell.c index e48977f026..4a75c97ce4 100644 --- a/widgets/table/gal-a11y-e-cell.c +++ b/widgets/table/gal-a11y-e-cell.c @@ -42,7 +42,8 @@ static GObjectClass *parent_class; #if 0 static void -unref_item (gpointer user_data, GObject *obj_loc) +unref_item (gpointer user_data, + GObject *obj_loc) { GalA11yECell *a11y = GAL_A11Y_E_CELL (user_data); a11y->item = NULL; @@ -50,7 +51,8 @@ unref_item (gpointer user_data, GObject *obj_loc) } static void -unref_cell (gpointer user_data, GObject *obj_loc) +unref_cell (gpointer user_data, + GObject *obj_loc) { GalA11yECell *a11y = GAL_A11Y_E_CELL (user_data); a11y->cell_view = NULL; @@ -104,7 +106,7 @@ gal_a11y_e_cell_dispose (GObject *object) /* Static functions */ static const gchar * -gal_a11y_e_cell_get_name (AtkObject * a11y) +gal_a11y_e_cell_get_name (AtkObject *a11y) { GalA11yECell *cell = GAL_A11Y_E_CELL (a11y); ETableCol *ecol; @@ -133,7 +135,7 @@ gal_a11y_e_cell_ref_state_set (AtkObject *accessible) return cell->state_set; } -static AtkObject* +static AtkObject * gal_a11y_e_cell_get_parent (AtkObject *accessible) { GalA11yECell *a11y = GAL_A11Y_E_CELL (accessible); @@ -154,11 +156,11 @@ gal_a11y_e_cell_get_index_in_parent (AtkObject *accessible) /* Component IFace */ static void gal_a11y_e_cell_get_extents (AtkComponent *component, - gint *x, - gint *y, - gint *width, - gint *height, - AtkCoordType coord_type) + gint *x, + gint *y, + gint *width, + gint *height, + AtkCoordType coord_type) { GalA11yECell *a11y = GAL_A11Y_E_CELL (component); GtkWidget *tableOrTree; @@ -267,7 +269,7 @@ gal_a11y_e_cell_init (GalA11yECell *a11y) static ActionInfo * _gal_a11y_e_cell_get_action_info (GalA11yECell *cell, - gint index) + gint index) { GList *list_node; @@ -282,7 +284,7 @@ _gal_a11y_e_cell_get_action_info (GalA11yECell *cell, static void _gal_a11y_e_cell_destroy_action_info (gpointer action_info, - gpointer user_data) + gpointer user_data) { ActionInfo *info = (ActionInfo *) action_info; @@ -294,11 +296,11 @@ _gal_a11y_e_cell_destroy_action_info (gpointer action_info, } gboolean -gal_a11y_e_cell_add_action ( GalA11yECell * cell, - const gchar *action_name, - const gchar *action_description, - const gchar *action_keybinding, - ACTION_FUNC action_func) +gal_a11y_e_cell_add_action (GalA11yECell *cell, + const gchar *action_name, + const gchar *action_description, + const gchar *action_keybinding, + ACTION_FUNC action_func) { ActionInfo *info; g_return_val_if_fail (GAL_A11Y_IS_E_CELL (cell), FALSE); @@ -325,7 +327,7 @@ gal_a11y_e_cell_add_action ( GalA11yECell * cell, gboolean gal_a11y_e_cell_remove_action (GalA11yECell *cell, - gint action_index) + gint action_index) { GList *list_node; @@ -342,7 +344,7 @@ gal_a11y_e_cell_remove_action (GalA11yECell *cell, gboolean gal_a11y_e_cell_remove_action_by_name (GalA11yECell *cell, - const gchar *action_name) + const gchar *action_name) { GList *list_node; gboolean action_found= FALSE; @@ -377,7 +379,7 @@ gal_a11y_e_cell_action_get_n_actions (AtkAction *action) static const gchar * gal_a11y_e_cell_action_get_name (AtkAction *action, - gint index) + gint index) { GalA11yECell *cell = GAL_A11Y_E_CELL (action); ActionInfo *info = _gal_a11y_e_cell_get_action_info (cell, index); @@ -389,7 +391,7 @@ gal_a11y_e_cell_action_get_name (AtkAction *action, static const gchar * gal_a11y_e_cell_action_get_description (AtkAction *action, - gint index) + gint index) { GalA11yECell *cell = GAL_A11Y_E_CELL (action); ActionInfo *info = _gal_a11y_e_cell_get_action_info (cell, index); @@ -400,9 +402,9 @@ gal_a11y_e_cell_action_get_description (AtkAction *action, } static gboolean -gal_a11y_e_cell_action_set_description (AtkAction *action, - gint index, - const gchar *desc) +gal_a11y_e_cell_action_set_description (AtkAction *action, + gint index, + const gchar *desc) { GalA11yECell *cell = GAL_A11Y_E_CELL (action); ActionInfo *info = _gal_a11y_e_cell_get_action_info (cell, index); @@ -416,7 +418,7 @@ gal_a11y_e_cell_action_set_description (AtkAction *action, static const gchar * gal_a11y_e_cell_action_get_keybinding (AtkAction *action, - gint index) + gint index) { GalA11yECell *cell = GAL_A11Y_E_CELL (action); ActionInfo *info = _gal_a11y_e_cell_get_action_info (cell, index); @@ -445,7 +447,7 @@ idle_do_action (gpointer data) static gboolean gal_a11y_e_cell_action_do_action (AtkAction *action, - gint index) + gint index) { GalA11yECell *cell = GAL_A11Y_E_CELL (action); ActionInfo *info = _gal_a11y_e_cell_get_action_info (cell, index); @@ -493,9 +495,9 @@ gal_a11y_e_cell_type_add_action_interface (GType type) } gboolean -gal_a11y_e_cell_add_state (GalA11yECell *cell, - AtkStateType state_type, - gboolean emit_signal) +gal_a11y_e_cell_add_state (GalA11yECell *cell, + AtkStateType state_type, + gboolean emit_signal) { if (!atk_state_set_contains_state (cell->state_set, state_type)) { gboolean rc; @@ -510,7 +512,7 @@ gal_a11y_e_cell_add_state (GalA11yECell *cell, if (emit_signal) { atk_object_notify_state_change (ATK_OBJECT (cell), state_type, TRUE); /* If state_type is ATK_STATE_VISIBLE, additional - notification */ + * notification */ if (state_type == ATK_STATE_VISIBLE) g_signal_emit_by_name (cell, "visible_data_changed"); } @@ -522,9 +524,9 @@ gal_a11y_e_cell_add_state (GalA11yECell *cell, } gboolean -gal_a11y_e_cell_remove_state (GalA11yECell *cell, - AtkStateType state_type, - gboolean emit_signal) +gal_a11y_e_cell_remove_state (GalA11yECell *cell, + AtkStateType state_type, + gboolean emit_signal) { if (atk_state_set_contains_state (cell->state_set, state_type)) { gboolean rc; @@ -592,11 +594,11 @@ gal_a11y_e_cell_get_type (void) AtkObject * gal_a11y_e_cell_new (ETableItem *item, - ECellView *cell_view, - AtkObject *parent, - gint model_col, - gint view_col, - gint row) + ECellView *cell_view, + AtkObject *parent, + gint model_col, + gint view_col, + gint row) { AtkObject *a11y; @@ -613,13 +615,13 @@ gal_a11y_e_cell_new (ETableItem *item, } void -gal_a11y_e_cell_construct (AtkObject *object, - ETableItem *item, - ECellView *cell_view, - AtkObject *parent, - gint model_col, - gint view_col, - gint row) +gal_a11y_e_cell_construct (AtkObject *object, + ETableItem *item, + ECellView *cell_view, + AtkObject *parent, + gint model_col, + gint view_col, + gint row) { GalA11yECell *a11y = GAL_A11Y_E_CELL (object); a11y->item = item; diff --git a/widgets/table/gal-a11y-e-table-click-to-add-factory.c b/widgets/table/gal-a11y-e-table-click-to-add-factory.c index c71199cebb..1a4b418adf 100644 --- a/widgets/table/gal-a11y-e-table-click-to-add-factory.c +++ b/widgets/table/gal-a11y-e-table-click-to-add-factory.c @@ -45,7 +45,7 @@ gal_a11y_e_table_click_to_add_factory_get_accessible_type (void) return GAL_A11Y_TYPE_E_TABLE_CLICK_TO_ADD; } -static AtkObject* +static AtkObject * gal_a11y_e_table_click_to_add_factory_create_accessible (GObject *obj) { AtkObject * atk_object; diff --git a/widgets/table/gal-a11y-e-table-click-to-add.c b/widgets/table/gal-a11y-e-table-click-to-add.c index a947415c15..e4b5255e4c 100644 --- a/widgets/table/gal-a11y-e-table-click-to-add.c +++ b/widgets/table/gal-a11y-e-table-click-to-add.c @@ -56,7 +56,7 @@ etcta_get_n_actions (AtkAction *action) static const gchar * etcta_get_description (AtkAction *action, - gint i) + gint i) { if (i == 0) return _("click to add"); @@ -65,7 +65,8 @@ etcta_get_description (AtkAction *action, } static const gchar * -etcta_action_get_name (AtkAction *action, gint i) +etcta_action_get_name (AtkAction *action, + gint i) { if (i == 0) return _("click"); @@ -105,7 +106,8 @@ idle_do_action (gpointer data) } static gboolean -etcta_do_action (AtkAction * action, gint i) +etcta_do_action (AtkAction *action, + gint i) { g_return_val_if_fail (i == 0, FALSE); @@ -252,7 +254,9 @@ gal_a11y_e_table_click_to_add_get_type (void) } static gboolean -etcta_event (GnomeCanvasItem *item, GdkEvent *e, gpointer data) +etcta_event (GnomeCanvasItem *item, + GdkEvent *e, + gpointer data) { ETableClickToAdd *etcta = E_TABLE_CLICK_TO_ADD (item); GalA11yETableClickToAdd *a11y; @@ -285,8 +289,10 @@ etcta_event (GnomeCanvasItem *item, GdkEvent *e, gpointer data) } static void -etcta_selection_cursor_changed (ESelectionModel *esm, gint row, gint col, - GalA11yETableClickToAdd *a11y) +etcta_selection_cursor_changed (ESelectionModel *esm, + gint row, + gint col, + GalA11yETableClickToAdd *a11y) { ETableClickToAdd *etcta; AtkObject *row_a11y; diff --git a/widgets/table/gal-a11y-e-table-column-header.c b/widgets/table/gal-a11y-e-table-column-header.c index ccbfffadc9..8e13fd6865 100644 --- a/widgets/table/gal-a11y-e-table-column-header.c +++ b/widgets/table/gal-a11y-e-table-column-header.c @@ -67,7 +67,8 @@ gal_a11y_e_table_column_header_ref_state_set (AtkObject *accessible) } static void -gal_a11y_e_table_column_header_real_initialize (AtkObject *obj, gpointer data) +gal_a11y_e_table_column_header_real_initialize (AtkObject *obj, + gpointer data) { ATK_OBJECT_CLASS (parent_class)->initialize (obj, data); } @@ -110,7 +111,7 @@ etch_a11y_get_gobject (AtkGObjectAccessible *accessible) static gboolean gal_a11y_e_table_column_header_do_action (AtkAction *action, - gint i) + gint i) { gboolean return_value = TRUE; GtkWidget *widget; @@ -148,7 +149,7 @@ gal_a11y_e_table_column_header_get_n_actions (AtkAction *action) static const gchar * gal_a11y_e_table_column_header_action_get_name (AtkAction *action, - gint i) + gint i) { const gchar *return_value; @@ -209,7 +210,8 @@ gal_a11y_e_table_column_header_get_type (void) } AtkObject * -gal_a11y_e_table_column_header_new (ETableCol *ecol, ETableItem *item) +gal_a11y_e_table_column_header_new (ETableCol *ecol, + ETableItem *item) { GalA11yETableColumnHeader *a11y; AtkObject *accessible; diff --git a/widgets/table/gal-a11y-e-table-factory.c b/widgets/table/gal-a11y-e-table-factory.c index e89bb799bb..2270cbaa5b 100644 --- a/widgets/table/gal-a11y-e-table-factory.c +++ b/widgets/table/gal-a11y-e-table-factory.c @@ -39,7 +39,7 @@ gal_a11y_e_table_factory_get_accessible_type (void) return GAL_A11Y_TYPE_E_TABLE; } -static AtkObject* +static AtkObject * gal_a11y_e_table_factory_create_accessible (GObject *obj) { AtkObject *accessible; diff --git a/widgets/table/gal-a11y-e-table-item-factory.c b/widgets/table/gal-a11y-e-table-item-factory.c index 3aeab505f3..a38269bd81 100644 --- a/widgets/table/gal-a11y-e-table-item-factory.c +++ b/widgets/table/gal-a11y-e-table-item-factory.c @@ -45,7 +45,7 @@ gal_a11y_e_table_item_factory_get_accessible_type (void) return GAL_A11Y_TYPE_E_TABLE_ITEM; } -static AtkObject* +static AtkObject * gal_a11y_e_table_item_factory_create_accessible (GObject *obj) { AtkObject *accessible; diff --git a/widgets/table/gal-a11y-e-table-item.c b/widgets/table/gal-a11y-e-table-item.c index e296882e65..5b0e565714 100644 --- a/widgets/table/gal-a11y-e-table-item.c +++ b/widgets/table/gal-a11y-e-table-item.c @@ -68,10 +68,11 @@ static gboolean gal_a11y_e_table_item_ref_selection (GalA11yETableItem *a11y, ESelectionModel *selection); static gboolean gal_a11y_e_table_item_unref_selection (GalA11yETableItem *a11y); -static AtkObject* eti_ref_at (AtkTable *table, gint row, gint column); +static AtkObject * eti_ref_at (AtkTable *table, gint row, gint column); static void -item_finalized (gpointer user_data, GObject *gone_item) +item_finalized (gpointer user_data, + GObject *gone_item) { GalA11yETableItem *a11y; GalA11yETableItemPrivate *priv; @@ -103,7 +104,8 @@ eti_ref_state_set (AtkObject *accessible) } inline static gint -view_to_model_row (ETableItem *eti, gint row) +view_to_model_row (ETableItem *eti, + gint row) { if (eti->uses_source_model) { ETableSubset *etss = E_TABLE_SUBSET (eti->table_model); @@ -117,14 +119,16 @@ view_to_model_row (ETableItem *eti, gint row) } inline static gint -view_to_model_col (ETableItem *eti, gint col) +view_to_model_col (ETableItem *eti, + gint col) { ETableCol *ecol = e_table_header_get_column (eti->header, col); return ecol ? ecol->col_idx : -1; } inline static gint -model_to_view_row (ETableItem *eti, gint row) +model_to_view_row (ETableItem *eti, + gint row) { gint i; if (row == -1) @@ -146,7 +150,8 @@ model_to_view_row (ETableItem *eti, gint row) } inline static gint -model_to_view_col (ETableItem *eti, gint col) +model_to_view_col (ETableItem *eti, + gint col) { gint i; if (col == -1) @@ -235,8 +240,9 @@ eti_get_n_children (AtkObject *accessible) (atk_table_get_n_rows (ATK_TABLE (accessible)) + 1); } -static AtkObject* -eti_ref_child (AtkObject *accessible, gint index) +static AtkObject * +eti_ref_child (AtkObject *accessible, + gint index) { ETableItem *item; gint col, row; @@ -264,11 +270,11 @@ eti_ref_child (AtkObject *accessible, gint index) static void eti_get_extents (AtkComponent *component, - gint *x, - gint *y, - gint *width, - gint *height, - AtkCoordType coord_type) + gint *x, + gint *y, + gint *width, + gint *height, + AtkCoordType coord_type) { ETableItem *item; AtkObject *parent; @@ -294,11 +300,11 @@ eti_get_extents (AtkComponent *component, } } -static AtkObject* +static AtkObject * eti_ref_accessible_at_point (AtkComponent *component, - gint x, - gint y, - AtkCoordType coord_type) + gint x, + gint y, + AtkCoordType coord_type) { gint row = -1; gint col = -1; @@ -349,11 +355,13 @@ cell_destroyed (gpointer data) } /* atk table */ -static AtkObject* -eti_ref_at (AtkTable *table, gint row, gint column) +static AtkObject * +eti_ref_at (AtkTable *table, + gint row, + gint column) { ETableItem *item; - AtkObject* ret; + AtkObject * ret; GalA11yETableItemPrivate *priv = GET_PRIVATE (table); if (atk_state_set_contains_state (priv->state_set, ATK_STATE_DEFUNCT)) @@ -399,7 +407,9 @@ eti_ref_at (AtkTable *table, gint row, gint column) } static gint -eti_get_index_at (AtkTable *table, gint row, gint column) +eti_get_index_at (AtkTable *table, + gint row, + gint column) { ETableItem *item; @@ -411,7 +421,8 @@ eti_get_index_at (AtkTable *table, gint row, gint column) } static gint -eti_get_column_at_index (AtkTable *table, gint index) +eti_get_column_at_index (AtkTable *table, + gint index) { ETableItem *item; @@ -423,7 +434,8 @@ eti_get_column_at_index (AtkTable *table, gint index) } static gint -eti_get_row_at_index (AtkTable *table, gint index) +eti_get_row_at_index (AtkTable *table, + gint index) { ETableItem *item; @@ -460,8 +472,8 @@ eti_get_n_rows (AtkTable *table) static gint eti_get_column_extent_at (AtkTable *table, - gint row, - gint column) + gint row, + gint column) { ETableItem *item; gint width; @@ -483,8 +495,8 @@ eti_get_column_extent_at (AtkTable *table, static gint eti_get_row_extent_at (AtkTable *table, - gint row, - gint column) + gint row, + gint column) { ETableItem *item; gint height; @@ -513,7 +525,7 @@ eti_get_caption (AtkTable *table) static const gchar * eti_get_column_description (AtkTable *table, - gint column) + gint column) { ETableItem *item; ETableCol *ecol; @@ -528,7 +540,8 @@ eti_get_column_description (AtkTable *table, } static AtkObject * -eti_get_column_header (AtkTable *table, gint column) +eti_get_column_header (AtkTable *table, + gint column) { ETableItem *item; ETableCol *ecol; @@ -548,7 +561,7 @@ eti_get_column_header (AtkTable *table, gint column) static const gchar * eti_get_row_description (AtkTable *table, - gint row) + gint row) { /* Unimplemented */ return NULL; @@ -556,7 +569,7 @@ eti_get_row_description (AtkTable *table, static AtkObject * eti_get_row_header (AtkTable *table, - gint row) + gint row) { /* Unimplemented */ return NULL; @@ -570,7 +583,8 @@ eti_get_summary (AtkTable *table) } static gboolean -table_is_row_selected (AtkTable *table, gint row) +table_is_row_selected (AtkTable *table, + gint row) { ETableItem *item; GalA11yETableItemPrivate *priv = GET_PRIVATE (table); @@ -590,13 +604,16 @@ table_is_row_selected (AtkTable *table, gint row) } static gboolean -table_is_selected (AtkTable *table, gint row, gint column) +table_is_selected (AtkTable *table, + gint row, + gint column) { return table_is_row_selected (table, row); } static gint -table_get_selected_rows (AtkTable *table, gint **rows_selected) +table_get_selected_rows (AtkTable *table, + gint **rows_selected) { ETableItem *item; gint n_selected, row, index_selected; @@ -625,7 +642,8 @@ table_get_selected_rows (AtkTable *table, gint **rows_selected) } static gboolean -table_add_row_selection (AtkTable *table, gint row) +table_add_row_selection (AtkTable *table, + gint row) { ETableItem *item; @@ -642,7 +660,8 @@ table_add_row_selection (AtkTable *table, gint row) } static gboolean -table_remove_row_selection (AtkTable *table, gint row) +table_remove_row_selection (AtkTable *table, + gint row) { ETableItem *item; GalA11yETableItemPrivate *priv = GET_PRIVATE (table); @@ -698,8 +717,10 @@ eti_atk_component_iface_init (AtkComponentIface *iface) } static void -eti_rows_inserted (ETableModel * model, gint row, gint count, - AtkObject * table_item) +eti_rows_inserted (ETableModel *model, + gint row, + gint count, + AtkObject *table_item) { gint n_cols,n_rows,i,j; GalA11yETableItem * item_a11y; @@ -725,7 +746,7 @@ eti_rows_inserted (ETableModel * model, gint row, gint count, for (j = 0; j < n_cols; j++) { g_signal_emit_by_name (table_item, "children_changed::add", - ( ((i + 1)*n_cols) + j), NULL, NULL); + ( ((i + 1) * n_cols) + j), NULL, NULL); } } @@ -733,8 +754,10 @@ eti_rows_inserted (ETableModel * model, gint row, gint count, } static void -eti_rows_deleted (ETableModel * model, gint row, gint count, - AtkObject * table_item) +eti_rows_deleted (ETableModel *model, + gint row, + gint count, + AtkObject *table_item) { gint i,j, n_rows, n_cols, old_nrows; ETableItem *item = E_TABLE_ITEM ( @@ -746,7 +769,7 @@ eti_rows_deleted (ETableModel * model, gint row, gint count, old_nrows = GET_PRIVATE (table_item)->rows; - g_return_if_fail ( row+count <= old_nrows); + g_return_if_fail ( row + count <= old_nrows); g_return_if_fail (old_nrows == n_rows + count); GET_PRIVATE (table_item)->rows = n_rows; @@ -757,7 +780,7 @@ eti_rows_deleted (ETableModel * model, gint row, gint count, for (j = 0; j < n_cols; j++) { g_signal_emit_by_name (table_item, "children_changed::remove", - ( ((i + 1)*n_cols) + j), NULL, NULL); + ( ((i + 1) * n_cols) + j), NULL, NULL); } } g_signal_emit_by_name (table_item, "visible-data-changed"); @@ -765,7 +788,9 @@ eti_rows_deleted (ETableModel * model, gint row, gint count, } static void -eti_tree_model_node_changed_cb (ETreeModel *model, ETreePath node, ETableItem *eti) +eti_tree_model_node_changed_cb (ETreeModel *model, + ETreePath node, + ETableItem *eti) { AtkObject *atk_obj; GalA11yETableItem *a11y; @@ -793,10 +818,11 @@ enum { * 3. Emit signals */ static void -eti_header_structure_changed (ETableHeader *eth, AtkObject *a11y) +eti_header_structure_changed (ETableHeader *eth, + AtkObject *a11y) { - gboolean reorder_found=FALSE, added_found=FALSE, removed_found=FALSE; + gboolean reorder_found = FALSE, added_found = FALSE, removed_found = FALSE; GalA11yETableItem * a11y_item; ETableCol ** cols, **prev_cols; GalA11yETableItemPrivate *priv; @@ -876,7 +902,7 @@ eti_header_structure_changed (ETableHeader *eth, AtkObject *a11y) g_signal_emit_by_name ( G_OBJECT (a11y_item), "children_changed::remove", - ((j+1)*prev_n_cols+i), + ((j + 1) * prev_n_cols + i), NULL, NULL); } } @@ -892,7 +918,7 @@ eti_header_structure_changed (ETableHeader *eth, AtkObject *a11y) g_signal_emit_by_name ( G_OBJECT (a11y_item), "children_changed::add", - ((j+1)*n_cols+i), + ((j + 1) * n_cols + i), NULL, NULL); } } @@ -910,7 +936,7 @@ eti_header_structure_changed (ETableHeader *eth, AtkObject *a11y) static void eti_real_initialize (AtkObject *obj, - gpointer data) + gpointer data) { ETableItem * eti; ETableModel * model; @@ -920,14 +946,15 @@ eti_real_initialize (AtkObject *obj, model = eti->table_model; - g_signal_connect (model, "model-rows-inserted", - G_CALLBACK (eti_rows_inserted), - obj); - g_signal_connect (model, "model-rows-deleted", - G_CALLBACK (eti_rows_deleted), - obj); - g_signal_connect (G_OBJECT (eti->header), "structure_change", - G_CALLBACK (eti_header_structure_changed), obj); + g_signal_connect ( + model, "model-rows-inserted", + G_CALLBACK (eti_rows_inserted), obj); + g_signal_connect ( + model, "model-rows-deleted", + G_CALLBACK (eti_rows_deleted), obj); + g_signal_connect ( + eti->header, "structure_change", + G_CALLBACK (eti_header_structure_changed), obj); } @@ -1084,10 +1111,12 @@ gal_a11y_e_table_item_new (ETableItem *item) return NULL; if (item) { - g_signal_connect (G_OBJECT(item), "selection_model_removed", - G_CALLBACK (eti_a11y_selection_model_removed_cb), NULL); - g_signal_connect (G_OBJECT(item), "selection_model_added", - G_CALLBACK (eti_a11y_selection_model_added_cb), NULL); + g_signal_connect ( + item, "selection_model_removed", + G_CALLBACK (eti_a11y_selection_model_removed_cb), NULL); + g_signal_connect ( + item, "selection_model_added", + G_CALLBACK (eti_a11y_selection_model_added_cb), NULL); if (item->selection) gal_a11y_e_table_item_ref_selection (a11y, item->selection); @@ -1104,8 +1133,9 @@ gal_a11y_e_table_item_new (ETableItem *item) if (E_IS_TREE (GET_PRIVATE (a11y)->widget)) { ETreeModel *model; model = e_tree_get_model (E_TREE (GET_PRIVATE (a11y)->widget)); - g_signal_connect (G_OBJECT(model), "node_changed", - G_CALLBACK (eti_tree_model_node_changed_cb), item); + g_signal_connect ( + model, "node_changed", + G_CALLBACK (eti_tree_model_node_changed_cb), item); accessible->role = ATK_ROLE_TREE_TABLE; } else if (E_IS_TABLE (GET_PRIVATE (a11y)->widget)) { accessible->role = ATK_ROLE_TABLE; @@ -1126,7 +1156,7 @@ gal_a11y_e_table_item_new (ETableItem *item) static gboolean gal_a11y_e_table_item_ref_selection (GalA11yETableItem *a11y, - ESelectionModel *selection) + ESelectionModel *selection) { GalA11yETableItemPrivate *priv; @@ -1174,8 +1204,9 @@ gal_a11y_e_table_item_unref_selection (GalA11yETableItem *a11y) /* callbacks */ static void -eti_a11y_selection_model_removed_cb (ETableItem *eti, ESelectionModel *selection, - gpointer data) +eti_a11y_selection_model_removed_cb (ETableItem *eti, + ESelectionModel *selection, + gpointer data) { AtkObject *atk_obj; GalA11yETableItem *a11y; @@ -1191,8 +1222,9 @@ eti_a11y_selection_model_removed_cb (ETableItem *eti, ESelectionModel *selection } static void -eti_a11y_selection_model_added_cb (ETableItem *eti, ESelectionModel *selection, - gpointer data) +eti_a11y_selection_model_added_cb (ETableItem *eti, + ESelectionModel *selection, + gpointer data) { AtkObject *atk_obj; GalA11yETableItem *a11y; @@ -1209,7 +1241,8 @@ eti_a11y_selection_model_added_cb (ETableItem *eti, ESelectionModel *selection, } static void -eti_a11y_selection_changed_cb (ESelectionModel *selection, GalA11yETableItem *a11y) +eti_a11y_selection_changed_cb (ESelectionModel *selection, + GalA11yETableItem *a11y) { GalA11yETableItemPrivate *priv = GET_PRIVATE (a11y); @@ -1223,7 +1256,9 @@ eti_a11y_selection_changed_cb (ESelectionModel *selection, GalA11yETableItem *a1 static void eti_a11y_cursor_changed_cb (ESelectionModel *selection, - gint row, gint col, GalA11yETableItem *a11y) + gint row, + gint col, + GalA11yETableItem *a11y) { ETableItem *item; GalA11yETableItemPrivate *priv = GET_PRIVATE (a11y); @@ -1255,7 +1290,8 @@ static void atk_selection_interface_init (AtkSelectionIface *iface) } static gboolean -selection_add_selection (AtkSelection *selection, gint index) +selection_add_selection (AtkSelection *selection, + gint index) { AtkTable *table; gint row, col, cursor_row, cursor_col, model_row, model_col; @@ -1315,7 +1351,8 @@ selection_clear_selection (AtkSelection *selection) } static AtkObject * -selection_ref_selection (AtkSelection *selection, gint index) +selection_ref_selection (AtkSelection *selection, + gint index) { AtkTable *table; gint row, col; @@ -1343,7 +1380,8 @@ selection_get_selection_count (AtkSelection *selection) } static gboolean -selection_is_child_selected (AtkSelection *selection, gint i) +selection_is_child_selected (AtkSelection *selection, + gint i) { gint row; diff --git a/widgets/table/gal-a11y-e-table.c b/widgets/table/gal-a11y-e-table.c index 436de1ec0f..6ba51303ed 100644 --- a/widgets/table/gal-a11y-e-table.c +++ b/widgets/table/gal-a11y-e-table.c @@ -70,8 +70,9 @@ find_first_table_item (ETableGroup *group) return NULL; } -static AtkObject* -eti_get_accessible (ETableItem *eti, AtkObject *parent) +static AtkObject * +eti_get_accessible (ETableItem *eti, + AtkObject *parent) { AtkObject *a11y = NULL; @@ -110,11 +111,11 @@ init_child_item (GalA11yETable *a11y) return FALSE; } -static AtkObject* -et_ref_accessible_at_point (AtkComponent *component, - gint x, - gint y, - AtkCoordType coord_type) +static AtkObject * +et_ref_accessible_at_point (AtkComponent *component, + gint x, + gint y, + AtkCoordType coord_type) { GalA11yETable *a11y = GAL_A11Y_E_TABLE (component); if (GET_PRIVATE (a11y)->child_item) @@ -146,9 +147,9 @@ et_get_n_children (AtkObject *accessible) return n; } -static AtkObject* +static AtkObject * et_ref_child (AtkObject *accessible, - gint i) + gint i) { GalA11yETable *a11y = GAL_A11Y_E_TABLE (accessible); ETable * et; diff --git a/widgets/table/gal-a11y-e-tree-factory.c b/widgets/table/gal-a11y-e-tree-factory.c index 4e22c1ca70..00ce55c8c0 100644 --- a/widgets/table/gal-a11y-e-tree-factory.c +++ b/widgets/table/gal-a11y-e-tree-factory.c @@ -38,7 +38,7 @@ gal_a11y_e_tree_factory_get_accessible_type (void) return GAL_A11Y_TYPE_E_TREE; } -static AtkObject* +static AtkObject * gal_a11y_e_tree_factory_create_accessible (GObject *obj) { AtkObject *accessible; diff --git a/widgets/table/gal-a11y-e-tree.c b/widgets/table/gal-a11y-e-tree.c index f26c525550..12697f4535 100644 --- a/widgets/table/gal-a11y-e-tree.c +++ b/widgets/table/gal-a11y-e-tree.c @@ -61,11 +61,11 @@ init_child_item (GalA11yETree *a11y) } } -static AtkObject* -et_ref_accessible_at_point (AtkComponent *component, - gint x, - gint y, - AtkCoordType coord_type) +static AtkObject * +et_ref_accessible_at_point (AtkComponent *component, + gint x, + gint y, + AtkCoordType coord_type) { GalA11yETree *a11y = GAL_A11Y_E_TREE (component); init_child_item (a11y); @@ -78,9 +78,9 @@ et_get_n_children (AtkObject *accessible) return 1; } -static AtkObject* +static AtkObject * et_ref_child (AtkObject *accessible, - gint i) + gint i) { GalA11yETree *a11y = GAL_A11Y_E_TREE (accessible); if (i != 0) diff --git a/widgets/text/e-reflow-model.c b/widgets/text/e-reflow-model.c index f96d512f1e..05457d0145 100644 --- a/widgets/text/e-reflow-model.c +++ b/widgets/text/e-reflow-model.c @@ -52,7 +52,8 @@ static guint e_reflow_model_signals[LAST_SIGNAL] = { 0, }; * @width: The new value for the width of each item. */ void -e_reflow_model_set_width (EReflowModel *e_reflow_model, gint width) +e_reflow_model_set_width (EReflowModel *e_reflow_model, + gint width) { g_return_if_fail (e_reflow_model != NULL); g_return_if_fail (E_IS_REFLOW_MODEL (e_reflow_model)); @@ -84,7 +85,9 @@ e_reflow_model_count (EReflowModel *e_reflow_model) * Returns: the height of the nth item. */ gint -e_reflow_model_height (EReflowModel *e_reflow_model, gint n, GnomeCanvasGroup *parent) +e_reflow_model_height (EReflowModel *e_reflow_model, + gint n, + GnomeCanvasGroup *parent) { g_return_val_if_fail (e_reflow_model != NULL, 0); g_return_val_if_fail (E_IS_REFLOW_MODEL (e_reflow_model), 0); @@ -103,7 +106,9 @@ e_reflow_model_height (EReflowModel *e_reflow_model, gint n, GnomeCanvasGroup *p * Returns: the new GnomeCanvasItem. */ GnomeCanvasItem * -e_reflow_model_incarnate (EReflowModel *e_reflow_model, gint n, GnomeCanvasGroup *parent) +e_reflow_model_incarnate (EReflowModel *e_reflow_model, + gint n, + GnomeCanvasGroup *parent) { g_return_val_if_fail (e_reflow_model != NULL, NULL); g_return_val_if_fail (E_IS_REFLOW_MODEL (e_reflow_model), NULL); @@ -148,7 +153,10 @@ e_reflow_model_create_cmp_cache (EReflowModel *e_reflow_model) * Returns: strcmp like semantics for the comparison value. */ gint -e_reflow_model_compare (EReflowModel *e_reflow_model, gint n1, gint n2, GHashTable *cmp_cache) +e_reflow_model_compare (EReflowModel *e_reflow_model, + gint n1, + gint n2, + GHashTable *cmp_cache) { #if 0 g_return_val_if_fail (e_reflow_model != NULL, 0); @@ -167,7 +175,9 @@ e_reflow_model_compare (EReflowModel *e_reflow_model, gint n1, gint n2, GHashTab * Update item to represent the nth piece of data. */ void -e_reflow_model_reincarnate (EReflowModel *e_reflow_model, gint n, GnomeCanvasItem *item) +e_reflow_model_reincarnate (EReflowModel *e_reflow_model, + gint n, + GnomeCanvasItem *item) { g_return_if_fail (e_reflow_model != NULL); g_return_if_fail (E_IS_REFLOW_MODEL (e_reflow_model)); @@ -312,7 +322,9 @@ e_reflow_model_comparison_changed (EReflowModel *e_reflow_model) * Use this function to notify any views of the reflow model that a number of items have been inserted. **/ void -e_reflow_model_items_inserted (EReflowModel *e_reflow_model, gint position, gint count) +e_reflow_model_items_inserted (EReflowModel *e_reflow_model, + gint position, + gint count) { g_return_if_fail (e_reflow_model != NULL); g_return_if_fail (E_IS_REFLOW_MODEL (e_reflow_model)); @@ -335,8 +347,8 @@ e_reflow_model_items_inserted (EReflowModel *e_reflow_model, gint position, gint * item has been removed. **/ void -e_reflow_model_item_removed (EReflowModel *e_reflow_model, - gint n) +e_reflow_model_item_removed (EReflowModel *e_reflow_model, + gint n) { g_return_if_fail (e_reflow_model != NULL); g_return_if_fail (E_IS_REFLOW_MODEL (e_reflow_model)); @@ -362,7 +374,8 @@ e_reflow_model_item_removed (EReflowModel *e_reflow_model, * object */ void -e_reflow_model_item_changed (EReflowModel *e_reflow_model, gint n) +e_reflow_model_item_changed (EReflowModel *e_reflow_model, + gint n) { g_return_if_fail (e_reflow_model != NULL); g_return_if_fail (E_IS_REFLOW_MODEL (e_reflow_model)); diff --git a/widgets/text/e-reflow.c b/widgets/text/e-reflow.c index 1b99d6aec7..02535d7b34 100644 --- a/widgets/text/e-reflow.c +++ b/widgets/text/e-reflow.c @@ -85,14 +85,18 @@ er_create_cmp_cache (gpointer user_data) } static gint -er_compare (gint i1, gint i2, GHashTable *cmp_cache, gpointer user_data) +er_compare (gint i1, + gint i2, + GHashTable *cmp_cache, + gpointer user_data) { EReflow *reflow = user_data; return e_reflow_model_compare (reflow->model, i1, i2, cmp_cache); } static gint -e_reflow_pick_line (EReflow *reflow, gdouble x) +e_reflow_pick_line (EReflow *reflow, + gdouble x) { x += E_REFLOW_BORDER_WIDTH + E_REFLOW_DIVIDER_WIDTH; x /= reflow->column_width + E_REFLOW_FULL_GUTTER; @@ -100,7 +104,8 @@ e_reflow_pick_line (EReflow *reflow, gdouble x) } static gint -er_find_item (EReflow *reflow, GnomeCanvasItem *item) +er_find_item (EReflow *reflow, + GnomeCanvasItem *item) { gint i; for (i = 0; i < reflow->count; i++) { @@ -129,7 +134,8 @@ e_reflow_resize_children (GnomeCanvasItem *item) } static inline void -e_reflow_update_selection_row (EReflow *reflow, gint row) +e_reflow_update_selection_row (EReflow *reflow, + gint row) { if (reflow->items[row]) { g_object_set (reflow->items[row], @@ -157,13 +163,16 @@ e_reflow_update_selection (EReflow *reflow) } static void -selection_changed (ESelectionModel *selection, EReflow *reflow) +selection_changed (ESelectionModel *selection, + EReflow *reflow) { e_reflow_update_selection (reflow); } static void -selection_row_changed (ESelectionModel *selection, gint row, EReflow *reflow) +selection_row_changed (ESelectionModel *selection, + gint row, + EReflow *reflow) { e_reflow_update_selection_row (reflow, row); } @@ -208,7 +217,10 @@ do_adjustment (gpointer user_data) } static void -cursor_changed (ESelectionModel *selection, gint row, gint col, EReflow *reflow) +cursor_changed (ESelectionModel *selection, + gint row, + gint col, + EReflow *reflow) { gint count = reflow->count; gint old_cursor = reflow->cursor_row; @@ -329,8 +341,8 @@ reflow_columns (EReflow *reflow) } else { /* we start one column before the earliest new entry, - so we can handle the case where the new entry is - inserted at the start of the column */ + * so we can handle the case where the new entry is + * inserted at the start of the column */ column_start = reflow->reflow_from_column - 1; start = reflow->columns[column_start]; column_count = column_start + 1; @@ -371,7 +383,9 @@ reflow_columns (EReflow *reflow) } static void -item_changed (EReflowModel *model, gint i, EReflow *reflow) +item_changed (EReflowModel *model, + gint i, + EReflow *reflow) { if (i < 0 || i >= reflow->count) return; @@ -386,7 +400,9 @@ item_changed (EReflowModel *model, gint i, EReflow *reflow) } static void -item_removed (EReflowModel *model, gint i, EReflow *reflow) +item_removed (EReflowModel *model, + gint i, + EReflow *reflow) { gint c; gint sorted; @@ -428,7 +444,10 @@ item_removed (EReflowModel *model, gint i, EReflow *reflow) } static void -items_inserted (EReflowModel *model, gint position, gint count, EReflow *reflow) +items_inserted (EReflowModel *model, + gint position, + gint count, + EReflow *reflow) { gint i, oldcount; @@ -481,7 +500,8 @@ items_inserted (EReflowModel *model, gint position, gint count, EReflow *reflow) } static void -model_changed (EReflowModel *model, EReflow *reflow) +model_changed (EReflowModel *model, + EReflow *reflow) { gint i; gint count; @@ -518,7 +538,8 @@ model_changed (EReflowModel *model, EReflow *reflow) } static void -comparison_changed (EReflowModel *model, EReflow *reflow) +comparison_changed (EReflowModel *model, + EReflow *reflow) { e_sorter_array_clean (reflow->sorter); reflow->reflow_from_column = -1; @@ -615,7 +636,8 @@ disconnect_selection (EReflow *reflow) } static void -connect_model (EReflow *reflow, EReflowModel *model) +connect_model (EReflow *reflow, + EReflowModel *model) { if (reflow->model != NULL) disconnect_model (reflow); @@ -644,7 +666,8 @@ connect_model (EReflow *reflow, EReflowModel *model) } static void -adjustment_changed (GtkAdjustment *adjustment, EReflow *reflow) +adjustment_changed (GtkAdjustment *adjustment, + EReflow *reflow) { queue_incarnate (reflow); } @@ -668,7 +691,8 @@ disconnect_adjustment (EReflow *reflow) } static void -connect_adjustment (EReflow *reflow, GtkAdjustment *adjustment) +connect_adjustment (EReflow *reflow, + GtkAdjustment *adjustment) { if (reflow->adjustment != NULL) disconnect_adjustment (reflow); @@ -688,7 +712,10 @@ connect_adjustment (EReflow *reflow, GtkAdjustment *adjustment) #if 0 static void -set_scroll_adjustments (GtkLayout *layout, GtkAdjustment *hadj, GtkAdjustment *vadj, EReflow *reflow) +set_scroll_adjustments (GtkLayout *layout, + GtkAdjustment *hadj, + GtkAdjustment *vadj, + EReflow *reflow) { connect_adjustment (reflow, hadj); } @@ -723,7 +750,10 @@ column_width_changed (EReflow *reflow) /* Virtual functions */ static void -e_reflow_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) +e_reflow_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) { GnomeCanvasItem *item; EReflow *reflow; @@ -731,7 +761,7 @@ e_reflow_set_property (GObject *object, guint prop_id, const GValue *value, GPar item = GNOME_CANVAS_ITEM (object); reflow = E_REFLOW (object); - switch (prop_id) { + switch (property_id) { case PROP_HEIGHT: reflow->height = g_value_get_double (value); reflow->need_reflow_columns = TRUE; @@ -785,13 +815,16 @@ e_reflow_set_property (GObject *object, guint prop_id, const GValue *value, GPar } static void -e_reflow_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) +e_reflow_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) { EReflow *reflow; reflow = E_REFLOW (object); - switch (prop_id) { + switch (property_id) { case PROP_MINIMUM_WIDTH: g_value_set_double (value, reflow->minimum_width); break; @@ -811,7 +844,7 @@ e_reflow_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec g_value_set_double (value, reflow->column_width); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } @@ -922,7 +955,8 @@ e_reflow_unrealize (GnomeCanvasItem *item) } static gboolean -e_reflow_event (GnomeCanvasItem *item, GdkEvent *event) +e_reflow_event (GnomeCanvasItem *item, + GdkEvent *event) { EReflow *reflow; gint return_val = FALSE; @@ -1054,7 +1088,7 @@ e_reflow_event (GnomeCanvasItem *item, GdkEvent *event) value = gtk_adjustment_get_value (adjustment); reflow->temp_column_width = reflow->column_width + - (button->x - reflow->start_x)/(reflow->which_column_dragged - e_reflow_pick_line (reflow, value)); + (button->x - reflow->start_x) / (reflow->which_column_dragged - e_reflow_pick_line (reflow, value)); if (reflow->temp_column_width < 50) reflow->temp_column_width = 50; reflow->column_drag = FALSE; @@ -1094,7 +1128,7 @@ e_reflow_event (GnomeCanvasItem *item, GdkEvent *event) value = gtk_adjustment_get_value (adjustment); reflow->temp_column_width = reflow->column_width + - (motion->x - reflow->start_x)/(reflow->which_column_dragged - e_reflow_pick_line (reflow, value)); + (motion->x - reflow->start_x) / (reflow->which_column_dragged - e_reflow_pick_line (reflow, value)); if (reflow->temp_column_width < 50) reflow->temp_column_width = 50; if (old_width != reflow->temp_column_width) { @@ -1268,7 +1302,9 @@ e_reflow_draw (GnomeCanvasItem *item, } static void -e_reflow_update (GnomeCanvasItem *item, const cairo_matrix_t *i2c, gint flags) +e_reflow_update (GnomeCanvasItem *item, + const cairo_matrix_t *i2c, + gint flags) { EReflow *reflow; gdouble x0, x1, y0, y1; @@ -1359,7 +1395,10 @@ e_reflow_update (GnomeCanvasItem *item, const cairo_matrix_t *i2c, gint flags) static GnomeCanvasItem * e_reflow_point (GnomeCanvasItem *item, - gdouble x, gdouble y, gint cx, gint cy) + gdouble x, + gdouble y, + gint cx, + gint cy) { GnomeCanvasItem *child; @@ -1383,7 +1422,8 @@ e_reflow_point (GnomeCanvasItem *item, } static void -e_reflow_reflow ( GnomeCanvasItem *item, gint flags ) +e_reflow_reflow (GnomeCanvasItem *item, + gint flags) { EReflow *reflow = E_REFLOW (item); gdouble old_width; @@ -1429,7 +1469,9 @@ e_reflow_reflow ( GnomeCanvasItem *item, gint flags ) } static gint -e_reflow_selection_event_real (EReflow *reflow, GnomeCanvasItem *item, GdkEvent *event) +e_reflow_selection_event_real (EReflow *reflow, + GnomeCanvasItem *item, + GdkEvent *event) { gint row; gint return_val = TRUE; @@ -1484,7 +1526,7 @@ e_reflow_class_init (EReflowClass *klass) GObjectClass *object_class; GnomeCanvasItemClass *item_class; - object_class = (GObjectClass*) klass; + object_class = (GObjectClass *) klass; item_class = (GnomeCanvasItemClass *) klass; object_class->set_property = e_reflow_set_property; @@ -1612,13 +1654,13 @@ e_reflow_init (EReflow *reflow) NULL); reflow->selection_changed_id = - g_signal_connect(reflow->selection, "selection_changed", + g_signal_connect (reflow->selection, "selection_changed", G_CALLBACK (selection_changed), reflow); reflow->selection_row_changed_id = - g_signal_connect(reflow->selection, "selection_row_changed", + g_signal_connect (reflow->selection, "selection_row_changed", G_CALLBACK (selection_row_changed), reflow); reflow->cursor_changed_id = - g_signal_connect(reflow->selection, "cursor_changed", + g_signal_connect (reflow->selection, "cursor_changed", G_CALLBACK (cursor_changed), reflow); e_canvas_item_set_reflow_callback (GNOME_CANVAS_ITEM (reflow), e_reflow_reflow); diff --git a/widgets/text/e-text-model-repos.c b/widgets/text/e-text-model-repos.c index 0b7a3433fd..b56a213215 100644 --- a/widgets/text/e-text-model-repos.c +++ b/widgets/text/e-text-model-repos.c @@ -30,7 +30,8 @@ #define MODEL_CLAMP(model, pos) (CLAMP((pos), 0, strlen((model)->text))) gint -e_repos_absolute (gint pos, gpointer data) +e_repos_absolute (gint pos, + gpointer data) { EReposAbsolute *info = (EReposAbsolute *) data; g_return_val_if_fail (data, -1); @@ -45,7 +46,8 @@ e_repos_absolute (gint pos, gpointer data) } gint -e_repos_insert_shift (gint pos, gpointer data) +e_repos_insert_shift (gint pos, + gpointer data) { EReposInsertShift *info = (EReposInsertShift *) data; g_return_val_if_fail (data, -1); @@ -57,7 +59,8 @@ e_repos_insert_shift (gint pos, gpointer data) } gint -e_repos_delete_shift (gint pos, gpointer data) +e_repos_delete_shift (gint pos, + gpointer data) { EReposDeleteShift *info = (EReposDeleteShift *) data; g_return_val_if_fail (data, -1); diff --git a/widgets/text/e-text-model.c b/widgets/text/e-text-model.c index f079346b72..a2c34a7a84 100644 --- a/widgets/text/e-text-model.c +++ b/widgets/text/e-text-model.c @@ -171,7 +171,8 @@ e_text_model_dispose (GObject *object) } static gint -e_text_model_real_validate_position (ETextModel *model, gint pos) +e_text_model_real_validate_position (ETextModel *model, + gint pos) { gint len = e_text_model_get_text_length (model); @@ -199,7 +200,8 @@ e_text_model_real_get_text_length (ETextModel *model) } static void -e_text_model_real_set_text (ETextModel *model, const gchar *text) +e_text_model_real_set_text (ETextModel *model, + const gchar *text) { EReposAbsolute repos; gboolean changed = FALSE; @@ -226,7 +228,9 @@ e_text_model_real_set_text (ETextModel *model, const gchar *text) } static void -e_text_model_real_insert (ETextModel *model, gint position, const gchar *text) +e_text_model_real_insert (ETextModel *model, + gint position, + const gchar *text) { e_text_model_insert_length (model, position, text, strlen (text)); } @@ -268,7 +272,9 @@ e_text_model_real_insert_length (ETextModel *model, } static void -e_text_model_real_delete (ETextModel *model, gint position, gint length) +e_text_model_real_delete (ETextModel *model, + gint position, + gint length) { EReposDeleteShift repos; gint byte_position, byte_length; @@ -322,7 +328,9 @@ e_text_model_cancel_completion (ETextModel *model) } void -e_text_model_reposition (ETextModel *model, ETextModelReposFn fn, gpointer repos_data) +e_text_model_reposition (ETextModel *model, + ETextModelReposFn fn, + gpointer repos_data) { g_return_if_fail (E_IS_TEXT_MODEL (model)); g_return_if_fail (fn != NULL); @@ -333,7 +341,8 @@ e_text_model_reposition (ETextModel *model, ETextModelReposFn fn, gpointer repos } gint -e_text_model_validate_position (ETextModel *model, gint pos) +e_text_model_validate_position (ETextModel *model, + gint pos) { g_return_val_if_fail (E_IS_TEXT_MODEL (model), 0); @@ -380,7 +389,8 @@ e_text_model_get_text_length (ETextModel *model) } void -e_text_model_set_text (ETextModel *model, const gchar *text) +e_text_model_set_text (ETextModel *model, + const gchar *text) { g_return_if_fail (E_IS_TEXT_MODEL (model)); @@ -389,7 +399,9 @@ e_text_model_set_text (ETextModel *model, const gchar *text) } void -e_text_model_insert (ETextModel *model, gint position, const gchar *text) +e_text_model_insert (ETextModel *model, + gint position, + const gchar *text) { g_return_if_fail (E_IS_TEXT_MODEL (model)); @@ -417,7 +429,8 @@ e_text_model_insert_length (ETextModel *model, } void -e_text_model_prepend (ETextModel *model, const gchar *text) +e_text_model_prepend (ETextModel *model, + const gchar *text) { g_return_if_fail (E_IS_TEXT_MODEL (model)); @@ -428,7 +441,8 @@ e_text_model_prepend (ETextModel *model, const gchar *text) } void -e_text_model_append (ETextModel *model, const gchar *text) +e_text_model_append (ETextModel *model, + const gchar *text) { g_return_if_fail (E_IS_TEXT_MODEL (model)); @@ -439,7 +453,9 @@ e_text_model_append (ETextModel *model, const gchar *text) } void -e_text_model_delete (ETextModel *model, gint position, gint length) +e_text_model_delete (ETextModel *model, + gint position, + gint length) { gint txt_len; @@ -469,7 +485,9 @@ e_text_model_object_count (ETextModel *model) } const gchar * -e_text_model_get_nth_object (ETextModel *model, gint n, gint *len) +e_text_model_get_nth_object (ETextModel *model, + gint n, + gint *len) { g_return_val_if_fail (E_IS_TEXT_MODEL (model), NULL); @@ -483,7 +501,8 @@ e_text_model_get_nth_object (ETextModel *model, gint n, gint *len) } gchar * -e_text_model_strdup_nth_object (ETextModel *model, gint n) +e_text_model_strdup_nth_object (ETextModel *model, + gint n) { const gchar *obj; gint len = 0; @@ -503,7 +522,10 @@ e_text_model_strdup_nth_object (ETextModel *model, gint n) } void -e_text_model_get_nth_object_bounds (ETextModel *model, gint n, gint *start, gint *end) +e_text_model_get_nth_object_bounds (ETextModel *model, + gint n, + gint *start, + gint *end) { const gchar *txt = NULL, *obj = NULL; gint len = 0; @@ -522,7 +544,8 @@ e_text_model_get_nth_object_bounds (ETextModel *model, gint n, gint *start, gint } gint -e_text_model_get_object_at_offset (ETextModel *model, gint offset) +e_text_model_get_object_at_offset (ETextModel *model, + gint offset) { g_return_val_if_fail (E_IS_TEXT_MODEL (model), -1); @@ -553,7 +576,8 @@ e_text_model_get_object_at_offset (ETextModel *model, gint offset) } gint -e_text_model_get_object_at_pointer (ETextModel *model, const gchar *s) +e_text_model_get_object_at_pointer (ETextModel *model, + const gchar *s) { g_return_val_if_fail (E_IS_TEXT_MODEL (model), -1); g_return_val_if_fail (s != NULL, -1); @@ -563,7 +587,8 @@ e_text_model_get_object_at_pointer (ETextModel *model, const gchar *s) } void -e_text_model_activate_nth_object (ETextModel *model, gint n) +e_text_model_activate_nth_object (ETextModel *model, + gint n) { g_return_if_fail (model != NULL); g_return_if_fail (E_IS_TEXT_MODEL (model)); diff --git a/widgets/text/e-text.c b/widgets/text/e-text.c index fefc0a3317..b57cec835d 100644 --- a/widgets/text/e-text.c +++ b/widgets/text/e-text.c @@ -191,7 +191,8 @@ disconnect_im_context (EText *text) #if 0 static void -e_text_style_set (EText *text, GtkStyle *previous_style) +e_text_style_set (EText *text, + GtkStyle *previous_style) { if (text->line_wrap) { text->needs_split_into_lines = 1; @@ -463,7 +464,8 @@ reset_layout (EText *text) } static void -e_text_text_model_changed (ETextModel *model, EText *text) +e_text_text_model_changed (ETextModel *model, + EText *text) { gint model_len = e_text_model_get_text_length (model); text->text = e_text_model_get_text (model); @@ -494,7 +496,7 @@ e_text_text_model_reposition (ETextModel *model, text->selection_end = fn (text->selection_end, repos_data); /* Our repos function should make sure we don't overrun the buffer, but it never - hurts to be paranoid. */ + * hurts to be paranoid. */ text->selection_start = CLAMP (text->selection_start, 0, model_len); text->selection_end = CLAMP (text->selection_end, 0, model_len); @@ -506,7 +508,11 @@ e_text_text_model_reposition (ETextModel *model, } static void -get_bounds (EText *text, gdouble *px1, gdouble *py1, gdouble *px2, gdouble *py2) +get_bounds (EText *text, + gdouble *px1, + gdouble *py1, + gdouble *px2, + gdouble *py2) { GnomeCanvasItem *item; gdouble wx, wy, clip_width, clip_height; @@ -608,7 +614,7 @@ split_into_lines (EText *text) /* Set_arg handler for the text item */ static void e_text_set_property (GObject *object, - guint prop_id, + guint property_id, const GValue *value, GParamSpec *pspec) { @@ -623,7 +629,7 @@ e_text_set_property (GObject *object, item = GNOME_CANVAS_ITEM (object); text = E_TEXT (object); - switch (prop_id) { + switch (property_id) { case PROP_MODEL: if (text->model_changed_signal_id) @@ -726,9 +732,9 @@ e_text_set_property (GObject *object, text->clip_height = fabs (g_value_get_double (value)); text->needs_recalc_bounds = 1; /* toshok: kind of a hack - set needs_reset_layout - here so when something about the style/them - changes, we redraw the text at the proper size/with - the proper font. */ + * here so when something about the style/them + * changes, we redraw the text at the proper size/with + * the proper font. */ text->needs_reset_layout = 1; needs_reflow = 1; break; @@ -936,7 +942,7 @@ e_text_set_property (GObject *object, /* Get_arg handler for the text item */ static void e_text_get_property (GObject *object, - guint prop_id, + guint property_id, GValue *value, GParamSpec *pspec) { @@ -944,7 +950,7 @@ e_text_get_property (GObject *object, text = E_TEXT (object); - switch (prop_id) { + switch (property_id) { case PROP_MODEL: g_value_set_object (value, text->model); break; @@ -1070,14 +1076,15 @@ e_text_get_property (GObject *object, break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } /* Update handler for the text item */ static void -e_text_reflow (GnomeCanvasItem *item, gint flags) +e_text_reflow (GnomeCanvasItem *item, + gint flags) { EText *text; @@ -1106,7 +1113,9 @@ e_text_reflow (GnomeCanvasItem *item, gint flags) /* Update handler for the text item */ static void -e_text_update (GnomeCanvasItem *item, const cairo_matrix_t *i2c, gint flags) +e_text_update (GnomeCanvasItem *item, + const cairo_matrix_t *i2c, + gint flags) { EText *text; gdouble x1, y1, x2, y2; @@ -1213,7 +1222,8 @@ draw_pango_rectangle (cairo_t *cr, } static gboolean -show_pango_rectangle (EText *text, PangoRectangle rect) +show_pango_rectangle (EText *text, + PangoRectangle rect) { gint x1 = rect.x / PANGO_SCALE; gint x2 = (rect.x + rect.width) / PANGO_SCALE; @@ -1278,8 +1288,12 @@ show_pango_rectangle (EText *text, PangoRectangle rect) /* Draw handler for the text item */ static void -e_text_draw (GnomeCanvasItem *item, cairo_t *cr, - gint x, gint y, gint width, gint height) +e_text_draw (GnomeCanvasItem *item, + cairo_t *cr, + gint x, + gint y, + gint width, + gint height) { EText *text; gint xpos, ypos; @@ -1536,8 +1550,11 @@ e_text_draw (GnomeCanvasItem *item, cairo_t *cr, /* Point handler for the text item */ static GnomeCanvasItem * -e_text_point (GnomeCanvasItem *item, gdouble x, gdouble y, - gint cx, gint cy) +e_text_point (GnomeCanvasItem *item, + gdouble x, + gdouble y, + gint cx, + gint cy) { EText *text; gdouble clip_width; @@ -1609,7 +1626,9 @@ e_text_bounds (GnomeCanvasItem *item, } static gint -get_position_from_xy (EText *text, gint x, gint y) +get_position_from_xy (EText *text, + gint x, + gint y) { gint index; gint trailing; @@ -1801,7 +1820,8 @@ _click (gpointer data) } static gint -e_text_event (GnomeCanvasItem *item, GdkEvent *event) +e_text_event (GnomeCanvasItem *item, + GdkEvent *event) { EText *text = E_TEXT (item); ETextEventProcessorEvent e_tep_event; @@ -1896,7 +1916,7 @@ e_text_event (GnomeCanvasItem *item, GdkEvent *event) if (text->im_context && gtk_im_context_filter_keypress ( text->im_context, - (GdkEventKey*) event)) { + (GdkEventKey *) event)) { text->need_im_reset = TRUE; return 1; } @@ -1982,7 +2002,7 @@ e_text_event (GnomeCanvasItem *item, GdkEvent *event) } /* Create our own double and triple click events, - as gnome-canvas doesn't forward them to us */ + * as gnome-canvas doesn't forward them to us */ if (event->type == GDK_BUTTON_PRESS) { if (text->dbl_timeout == 0 && text->tpl_timeout == 0) { @@ -2135,10 +2155,10 @@ e_text_select_all (EText *text) } static void -primary_get_cb (GtkClipboard *clipboard, - GtkSelectionData *selection_data, - guint info, - gpointer data) +primary_get_cb (GtkClipboard *clipboard, + GtkSelectionData *selection_data, + guint info, + gpointer data) { EText *text = E_TEXT (data); gint sel_start, sel_end; @@ -2159,7 +2179,7 @@ primary_get_cb (GtkClipboard *clipboard, static void primary_clear_cb (GtkClipboard *clipboard, - gpointer data) + gpointer data) { #ifdef notyet /* XXX */ @@ -2197,8 +2217,8 @@ e_text_update_primary_selection (EText *text) static void paste_received (GtkClipboard *clipboard, - const gchar *text, - gpointer data) + const gchar *text, + gpointer data) { EText *etext = E_TEXT (data); @@ -2213,7 +2233,8 @@ paste_received (GtkClipboard *clipboard, } static void -e_text_paste (EText *text, GdkAtom selection) +e_text_paste (EText *text, + GdkAtom selection) { g_object_ref (text); gtk_clipboard_request_text ( @@ -2230,7 +2251,7 @@ typedef struct { static void popup_menu_detach (GtkWidget *attach_widget, - GtkMenu *menu) + GtkMenu *menu) { } @@ -2258,9 +2279,9 @@ popup_menu_placement_cb (GtkMenu *menu, } static void -popup_targets_received (GtkClipboard *clipboard, - GtkSelectionData *data, - gpointer user_data) +popup_targets_received (GtkClipboard *clipboard, + GtkSelectionData *data, + gpointer user_data) { PopupClosure *closure = user_data; EText *text = closure->text; @@ -2348,7 +2369,9 @@ popup_targets_received (GtkClipboard *clipboard, } static void -e_text_do_popup (EText *text, GdkEventButton *button, gint position) +e_text_do_popup (EText *text, + GdkEventButton *button, + gint position) { PopupClosure *closure = g_new (PopupClosure, 1); @@ -2377,7 +2400,8 @@ e_text_reset_im_context (EText *text) /* fixme: */ static gint -next_word (EText *text, gint start) +next_word (EText *text, + gint start) { gchar *p = g_utf8_offset_to_pointer (text->text, start); gint length; @@ -2406,7 +2430,9 @@ next_word (EText *text, gint start) } static gint -find_offset_into_line (EText *text, gint offset_into_text, gchar **start_of_line) +find_offset_into_line (EText *text, + gint offset_into_text, + gchar **start_of_line) { gchar *p; @@ -2436,10 +2462,11 @@ find_offset_into_line (EText *text, gint offset_into_text, gchar **start_of_line } /* direction = TRUE (move forward), FALSE (move backward) - Any error shall return length (text->text) or 0 or - text->selection_end (as deemed fit) */ + * Any error shall return length (text->text) or 0 or + * text->selection_end (as deemed fit) */ static gint -_get_updated_position (EText *text, gboolean direction) +_get_updated_position (EText *text, + gboolean direction) { PangoLogAttr *log_attrs = NULL; gint n_attrs; @@ -2469,7 +2496,7 @@ _get_updated_position (EText *text, gboolean direction) pango_layout_get_log_attrs (text->layout, &log_attrs, &n_attrs); /* Fetch the current gchar index in the line & keep moving - forward until we can display cursor */ + * forward until we can display cursor */ p = g_utf8_offset_to_pointer (text->text, text->selection_end); new_pos = text->selection_end; @@ -2489,7 +2516,7 @@ _get_updated_position (EText *text, gboolean direction) new_pos = g_utf8_pointer_to_offset (text->text, p); /* if is_cursor_position is set, cursor can appear in front of character. - i.e. this is a grapheme boundary AND make some sanity checks */ + * i.e. this is a grapheme boundary AND make some sanity checks */ if ((new_pos >=0) && (new_pos < n_attrs) && (log_attrs[new_pos].is_cursor_position)) break; @@ -2507,7 +2534,8 @@ _get_updated_position (EText *text, gboolean direction) } static gint -_get_position (EText *text, ETextEventProcessorCommand *command) +_get_position (EText *text, + ETextEventProcessorCommand *command) { gint length, obj_num; gunichar unival; @@ -2636,7 +2664,7 @@ _get_position (EText *text, ETextEventProcessorCommand *command) return text->selection_end; /* now we search forward til we hit a \n, and then - offset_into_line more characters */ + * offset_into_line more characters */ p = g_utf8_offset_to_pointer (text->text, text->selection_end); while (p && *p) { if (*p == '\n') @@ -2645,7 +2673,7 @@ _get_position (EText *text, ETextEventProcessorCommand *command) } if (p && *p == '\n') { /* now we loop forward offset_into_line - characters, or until we hit \n or \0 */ + * characters, or until we hit \n or \0 */ p = g_utf8_next_char (p); while (offset_into_line > 0 && p && *p != '\n' && *p != '\0') { @@ -2655,7 +2683,7 @@ _get_position (EText *text, ETextEventProcessorCommand *command) } /* at this point, p points to the new location, - convert it to an offset and we're done */ + * convert it to an offset and we're done */ new_pos = g_utf8_pointer_to_offset (text->text, p); break; } @@ -2666,8 +2694,8 @@ _get_position (EText *text, ETextEventProcessorCommand *command) return text->selection_end; /* p points to the first character on our line. if we - have a \n before it, skip it and scan til we hit - the next one */ + * have a \n before it, skip it and scan til we hit + * the next one */ if (p != text->text) { p = g_utf8_find_prev_char (text->text, p); if (*p == '\n') { @@ -2683,8 +2711,8 @@ _get_position (EText *text, ETextEventProcessorCommand *command) } /* at this point 'p' points to the start of the - previous line, move forward 'offset_into_line' - times. */ + * previous line, move forward 'offset_into_line' + * times. */ while (offset_into_line > 0 && p && *p != '\n' && *p != '\0') { p = g_utf8_next_char (p); @@ -2692,14 +2720,14 @@ _get_position (EText *text, ETextEventProcessorCommand *command) } /* at this point, p points to the new location, - convert it to an offset and we're done */ + * convert it to an offset and we're done */ new_pos = g_utf8_pointer_to_offset (text->text, p); break; } case E_TEP_SELECT_WORD: /* This is a silly hack to cause double-clicking on an object - to activate that object. - (Normally, double click == select word, which is why this is here.) */ + * to activate that object. + * (Normally, double click == select word, which is why this is here.) */ obj_num = e_text_model_get_object_at_offset ( text->model, text->selection_start); @@ -2781,7 +2809,8 @@ _get_position (EText *text, ETextEventProcessorCommand *command) } static void -e_text_insert (EText *text, const gchar *string) +e_text_insert (EText *text, + const gchar *string) { gint len = strlen (string); @@ -2820,7 +2849,10 @@ e_text_insert (EText *text, const gchar *string) } static void -capitalize (EText *text, gint start, gint end, ETextEventProcessorCaps type) +capitalize (EText *text, + gint start, + gint end, + ETextEventProcessorCaps type) { gboolean first = TRUE; const gchar *p = g_utf8_offset_to_pointer (text->text, start); @@ -2992,17 +3024,17 @@ e_text_command (ETextEventProcessor *tep, e_text_reset_im_context (text); /* it's possible to get here without ever having been realized - by our canvas (if the e-text started completely obscured.) - so let's create our layout object if we don't already have - one. */ + * by our canvas (if the e-text started completely obscured.) + * so let's create our layout object if we don't already have + * one. */ if (!text->layout) create_layout (text); /* We move cursor only if scroll is TRUE */ if (scroll && !text->button_down) { /* XXX do we really need the @trailing logic here? if - we don't we can scrap the loop and just use - pango_layout_index_to_pos */ + * we don't we can scrap the loop and just use + * pango_layout_index_to_pos */ PangoLayoutLine *cur_line = NULL; gint selection_index; PangoLayoutIter *iter = pango_layout_get_iter (text->layout); @@ -3477,8 +3509,8 @@ e_text_init (EText *text) /* IM Context Callbacks */ static void e_text_commit_cb (GtkIMContext *context, - const gchar *str, - EText *text) + const gchar *str, + EText *text) { if (g_utf8_validate (str, strlen (str), NULL)) { if (text->selection_end != text->selection_start) @@ -3490,7 +3522,7 @@ e_text_commit_cb (GtkIMContext *context, static void e_text_preedit_changed_cb (GtkIMContext *context, - EText *etext) + EText *etext) { gchar *preedit_string = NULL; gint cursor_pos; @@ -3509,7 +3541,7 @@ e_text_preedit_changed_cb (GtkIMContext *context, static gboolean e_text_retrieve_surrounding_cb (GtkIMContext *context, - EText *text) + EText *text) { gtk_im_context_set_surrounding ( context, text->text, strlen (text->text), @@ -3520,10 +3552,10 @@ e_text_retrieve_surrounding_cb (GtkIMContext *context, } static gboolean -e_text_delete_surrounding_cb (GtkIMContext *context, - gint offset, - gint n_chars, - EText *text) +e_text_delete_surrounding_cb (GtkIMContext *context, + gint offset, + gint n_chars, + EText *text) { e_text_model_delete (text->model, MIN (text->selection_start, text->selection_end) + offset, diff --git a/widgets/text/gal-a11y-e-text-factory.c b/widgets/text/gal-a11y-e-text-factory.c index a1ffaa0d90..8da12ee294 100644 --- a/widgets/text/gal-a11y-e-text-factory.c +++ b/widgets/text/gal-a11y-e-text-factory.c @@ -39,7 +39,7 @@ gal_a11y_e_text_factory_get_accessible_type (void) return GAL_A11Y_TYPE_E_TEXT; } -static AtkObject* +static AtkObject * gal_a11y_e_text_factory_create_accessible (GObject *obj) { AtkObject *atk_object; diff --git a/widgets/text/gal-a11y-e-text.c b/widgets/text/gal-a11y-e-text.c index a657543305..609b23a900 100644 --- a/widgets/text/gal-a11y-e-text.c +++ b/widgets/text/gal-a11y-e-text.c @@ -57,11 +57,11 @@ et_dispose (GObject *object) static void et_get_extents (AtkComponent *component, - gint *x, - gint *y, - gint *width, - gint *height, - AtkCoordType coord_type) + gint *x, + gint *y, + gint *width, + gint *height, + AtkCoordType coord_type) { EText *item = E_TEXT (atk_gobject_accessible_get_object ( ATK_GOBJECT_ACCESSIBLE (component))); @@ -107,7 +107,7 @@ et_get_full_text (AtkText *text) static void et_set_full_text (AtkEditableText *text, - const gchar *full_text) + const gchar *full_text) { EText *etext = E_TEXT (atk_gobject_accessible_get_object ( ATK_GOBJECT_ACCESSIBLE (text))); @@ -120,8 +120,8 @@ et_set_full_text (AtkEditableText *text, static gchar * et_get_text (AtkText *text, - gint start_offset, - gint end_offset) + gint start_offset, + gint end_offset) { gint start, end, real_start, real_end, len; const gchar *full_text = et_get_full_text (text); @@ -153,8 +153,8 @@ is_a_seperator (gunichar c) static gint find_word_start (const gchar *text, - gint begin_offset, - gint step) + gint begin_offset, + gint step) { gint offset; gchar *at_offset; @@ -167,7 +167,7 @@ find_word_start (const gchar *text, while (offset > 0 && offset < len) { at_offset = g_utf8_offset_to_pointer (text, offset); current = g_utf8_get_char_validated (at_offset, -1); - at_offset = g_utf8_offset_to_pointer (text, offset-1); + at_offset = g_utf8_offset_to_pointer (text, offset - 1); previous = g_utf8_get_char_validated (at_offset, -1); if ((!is_a_seperator (current)) && is_a_seperator (previous)) break; @@ -179,8 +179,8 @@ find_word_start (const gchar *text, static gint find_word_end (const gchar *text, - gint begin_offset, - gint step) + gint begin_offset, + gint step) { gint offset; gchar *at_offset; @@ -193,7 +193,7 @@ find_word_end (const gchar *text, while (offset > 0 && offset < len) { at_offset = g_utf8_offset_to_pointer (text, offset); current = g_utf8_get_char_validated (at_offset, -1); - at_offset = g_utf8_offset_to_pointer (text, offset-1); + at_offset = g_utf8_offset_to_pointer (text, offset - 1); previous = g_utf8_get_char_validated (at_offset, -1); if (is_a_seperator (current) && (!is_a_seperator (previous))) break; @@ -205,8 +205,8 @@ find_word_end (const gchar *text, static gint find_sentence_start (const gchar *text, - gint begin_offset, - gint step) + gint begin_offset, + gint step) { gint offset, last_word_end, len; gchar *at_offset; @@ -216,7 +216,7 @@ find_sentence_start (const gchar *text, offset = find_word_start (text, begin_offset, step); len = g_utf8_strlen (text, -1); - while (offset>0 && offset 0 && offset