aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2011-12-01 10:53:20 +0800
committerMatthew Barnes <mbarnes@redhat.com>2012-02-20 23:04:25 +0800
commit23f5773903d64a554d977ae7d0ebbaca73528f1f (patch)
tree104e1a59da8bf96b004bce204b79f47bbe0a6d13
parent49bc4c2d765ee1780c23fdc9f42152850dabb220 (diff)
downloadgsoc2013-evolution-23f5773903d64a554d977ae7d0ebbaca73528f1f.tar
gsoc2013-evolution-23f5773903d64a554d977ae7d0ebbaca73528f1f.tar.gz
gsoc2013-evolution-23f5773903d64a554d977ae7d0ebbaca73528f1f.tar.bz2
gsoc2013-evolution-23f5773903d64a554d977ae7d0ebbaca73528f1f.tar.lz
gsoc2013-evolution-23f5773903d64a554d977ae7d0ebbaca73528f1f.tar.xz
gsoc2013-evolution-23f5773903d64a554d977ae7d0ebbaca73528f1f.tar.zst
gsoc2013-evolution-23f5773903d64a554d977ae7d0ebbaca73528f1f.zip
Coding style and whitespace cleanup.
-rw-r--r--addressbook/gui/contact-editor/e-contact-editor.c41
-rw-r--r--addressbook/gui/contact-editor/e-contact-quick-add.c8
-rw-r--r--addressbook/gui/contact-editor/eab-editor.c38
-rw-r--r--addressbook/gui/contact-list-editor/e-contact-list-editor.c38
-rw-r--r--addressbook/gui/contact-list-editor/e-contact-list-model.c6
-rw-r--r--addressbook/gui/merging/eab-contact-merging.c13
-rw-r--r--addressbook/gui/widgets/e-addressbook-model.c42
-rw-r--r--addressbook/gui/widgets/e-addressbook-reflow-adapter.c155
-rw-r--r--addressbook/gui/widgets/e-addressbook-selector.c48
-rw-r--r--addressbook/gui/widgets/e-addressbook-table-adapter.c97
-rw-r--r--addressbook/gui/widgets/e-addressbook-table-adapter.h41
-rw-r--r--addressbook/gui/widgets/e-addressbook-view.c70
-rw-r--r--addressbook/gui/widgets/e-minicard-label.c39
-rw-r--r--addressbook/gui/widgets/e-minicard-view-widget.c31
-rw-r--r--addressbook/gui/widgets/e-minicard-view.c55
-rw-r--r--addressbook/gui/widgets/e-minicard.c26
-rw-r--r--addressbook/gui/widgets/eab-config.c44
-rw-r--r--addressbook/gui/widgets/eab-contact-display.c60
-rw-r--r--addressbook/gui/widgets/eab-gui-util.c13
-rw-r--r--addressbook/gui/widgets/gal-view-minicard.c31
-rw-r--r--addressbook/printing/e-contact-print.c4
-rw-r--r--calendar/alarm-notify/alarm-notify-dialog.c16
-rw-r--r--calendar/alarm-notify/alarm-notify.c34
-rw-r--r--calendar/alarm-notify/alarm-queue.c16
-rw-r--r--calendar/alarm-notify/config-data.c11
-rw-r--r--calendar/gui/calendar-config.c36
-rw-r--r--calendar/gui/calendar-view-factory.c46
-rw-r--r--calendar/gui/calendar-view.c29
-rw-r--r--calendar/gui/dialogs/alarm-dialog.c10
-rw-r--r--calendar/gui/dialogs/calendar-setup.c12
-rw-r--r--calendar/gui/dialogs/comp-editor-page.c39
-rw-r--r--calendar/gui/dialogs/comp-editor.c15
-rw-r--r--calendar/gui/dialogs/delete-comp.c4
-rw-r--r--calendar/gui/dialogs/e-delegate-dialog.c78
-rw-r--r--calendar/gui/dialogs/event-editor.c31
-rw-r--r--calendar/gui/dialogs/event-page.c51
-rw-r--r--calendar/gui/dialogs/memo-editor.c13
-rw-r--r--calendar/gui/dialogs/memo-page.c16
-rw-r--r--calendar/gui/dialogs/recurrence-page.c54
-rw-r--r--calendar/gui/dialogs/schedule-page.c13
-rw-r--r--calendar/gui/dialogs/task-details-page.c9
-rw-r--r--calendar/gui/dialogs/task-editor.c12
-rw-r--r--calendar/gui/dialogs/task-page.c48
-rw-r--r--calendar/gui/e-alarm-list.c50
-rw-r--r--calendar/gui/e-cal-component-preview.c49
-rw-r--r--calendar/gui/e-cal-config.c49
-rw-r--r--calendar/gui/e-cal-config.h4
-rw-r--r--calendar/gui/e-cal-event.c44
-rw-r--r--calendar/gui/e-cal-model-calendar.c37
-rw-r--r--calendar/gui/e-cal-model-memos.c38
-rw-r--r--calendar/gui/e-cal-model-tasks.c9
-rw-r--r--calendar/gui/e-cal-model.c75
-rw-r--r--calendar/gui/e-cal-model.h8
-rw-r--r--calendar/gui/e-calendar-selector.c7
-rw-r--r--calendar/gui/e-calendar-view.c24
-rw-r--r--calendar/gui/e-cell-date-edit-text.c43
-rw-r--r--calendar/gui/e-day-view-main-item.c51
-rw-r--r--calendar/gui/e-day-view-time-item.c121
-rw-r--r--calendar/gui/e-day-view-top-item.c71
-rw-r--r--calendar/gui/e-day-view.c139
-rw-r--r--calendar/gui/e-meeting-attendee.c136
-rw-r--r--calendar/gui/e-meeting-list-view.c98
-rw-r--r--calendar/gui/e-meeting-store.c23
-rw-r--r--calendar/gui/e-meeting-time-sel.c120
-rw-r--r--calendar/gui/e-memo-list-selector.c7
-rw-r--r--calendar/gui/e-memo-table.c62
-rw-r--r--calendar/gui/e-month-view.c40
-rw-r--r--calendar/gui/e-select-names-editable.c71
-rw-r--r--calendar/gui/e-select-names-renderer.c101
-rw-r--r--calendar/gui/e-select-names-renderer.h60
-rw-r--r--calendar/gui/e-task-list-selector.c7
-rw-r--r--calendar/gui/e-task-table.c62
-rw-r--r--calendar/gui/e-timezone-entry.c11
-rw-r--r--calendar/gui/e-week-view-event-item.c51
-rw-r--r--calendar/gui/e-week-view-layout.c7
-rw-r--r--calendar/gui/e-week-view-main-item.c52
-rw-r--r--calendar/gui/e-week-view-titles-item.c52
-rw-r--r--calendar/gui/e-week-view.c37
-rw-r--r--calendar/gui/ea-cal-view-event.c3
-rw-r--r--calendar/gui/ea-cal-view.c19
-rw-r--r--calendar/gui/ea-calendar.c3
-rw-r--r--calendar/gui/ea-day-view-cell.c2
-rw-r--r--calendar/gui/ea-day-view-main-item.c7
-rw-r--r--calendar/gui/ea-day-view.c3
-rw-r--r--calendar/gui/ea-gnome-calendar.c6
-rw-r--r--calendar/gui/ea-jump-button.c47
-rw-r--r--calendar/gui/ea-week-view-main-item.c7
-rw-r--r--calendar/gui/ea-week-view.c7
-rw-r--r--calendar/gui/gnome-cal.c60
-rw-r--r--calendar/gui/tag-calendar.c82
-rw-r--r--calendar/gui/weekday-picker.c82
-rw-r--r--calendar/importers/icalendar-importer.c16
-rw-r--r--capplet/anjal-settings-main.c2
-rw-r--r--capplet/anjal-settings-main.c.orig229
-rw-r--r--capplet/anjal-settings-main.c.rej11
-rw-r--r--capplet/settings/Makefile.am.orig65
-rw-r--r--capplet/settings/anjal-mail-view.c44
-rw-r--r--capplet/settings/mail-account-view.c49
-rw-r--r--capplet/settings/mail-account-view.c.orig1104
-rw-r--r--capplet/settings/mail-capplet-shell.c28
-rw-r--r--capplet/settings/mail-capplet-shell.c.orig395
-rw-r--r--capplet/settings/mail-settings-view.c22
-rw-r--r--capplet/settings/mail-view.c97
-rw-r--r--composer/e-composer-header-table.c4
-rw-r--r--composer/e-composer-header.c4
-rw-r--r--composer/e-msg-composer.c9
-rw-r--r--e-util/e-alert-dialog.c9
-rw-r--r--e-util/e-alert.c19
-rw-r--r--e-util/e-bit-array.c4
-rw-r--r--e-util/e-config.c11
-rw-r--r--e-util/e-datetime-format.c4
-rw-r--r--e-util/e-dialog-widgets.c1
-rw-r--r--e-util/e-event.c7
-rw-r--r--e-util/e-plugin-ui.c11
-rw-r--r--e-util/e-sorter-array.c6
-rw-r--r--e-util/e-sorter.c12
-rw-r--r--e-util/e-text-event-processor-emacs-like.c100
-rw-r--r--e-util/e-text-event-processor.c8
-rw-r--r--e-util/e-ui-manager.c7
-rw-r--r--e-util/e-util.c28
-rw-r--r--em-format/em-format-quote.c4
-rw-r--r--em-format/em-format.c38
-rw-r--r--filter/e-filter-datespec.c29
-rw-r--r--filter/e-filter-option.c12
-rw-r--r--filter/e-filter-rule.c34
-rw-r--r--filter/e-rule-context.c11
-rw-r--r--filter/e-rule-editor.c23
-rw-r--r--libemail-engine/e-mail-folder-utils.c10
-rw-r--r--libemail-engine/e-mail-session-utils.c9
-rw-r--r--libemail-engine/e-mail-utils.c19
-rw-r--r--libemail-engine/mail-config.c24
-rw-r--r--libemail-engine/mail-folder-cache.c13
-rw-r--r--libemail-engine/mail-ops.c42
-rw-r--r--libemail-utils/e-signature-list.c7
-rw-r--r--libemail-utils/e-signature.c7
-rw-r--r--libemail-utils/mail-mt.c22
-rw-r--r--libemail-utils/mail-mt.h4
-rw-r--r--libgnomecanvas/gailcanvas.c28
-rw-r--r--libgnomecanvas/gailcanvasitem.c12
-rw-r--r--libgnomecanvas/gnome-canvas-pixbuf.c7
-rw-r--r--libgnomecanvas/gnome-canvas-rect.c7
-rw-r--r--libgnomecanvas/gnome-canvas-rich-text.c70
-rw-r--r--libgnomecanvas/gnome-canvas-text.c40
-rw-r--r--libgnomecanvas/gnome-canvas-util.c8
-rw-r--r--libgnomecanvas/gnome-canvas-widget.c32
-rw-r--r--libgnomecanvas/gnome-canvas.c141
-rw-r--r--mail/e-mail-attachment-bar.c5
-rw-r--r--mail/e-mail-backend.c25
-rw-r--r--mail/e-mail-browser.c7
-rw-r--r--mail/e-mail-label-list-store.c53
-rw-r--r--mail/e-mail-migrate.c13
-rw-r--r--mail/e-mail-notebook-view.c47
-rw-r--r--mail/e-mail-pane.c71
-rw-r--r--mail/e-mail-pane.h65
-rw-r--r--mail/e-mail-paned-view.c13
-rw-r--r--mail/e-mail-reader-utils.c4
-rw-r--r--mail/e-mail-reader.c29
-rw-r--r--mail/e-mail-tab-picker.c3
-rw-r--r--mail/e-mail-tab.c12
-rw-r--r--mail/e-mail-ui-session.c13
-rw-r--r--mail/em-account-editor.c86
-rw-r--r--mail/em-composer-utils.c33
-rw-r--r--mail/em-filter-editor.c4
-rw-r--r--mail/em-filter-rule.c16
-rw-r--r--mail/em-folder-properties.c11
-rw-r--r--mail/em-folder-tree-model.c7
-rw-r--r--mail/em-folder-tree.c16
-rw-r--r--mail/em-format-hook.c3
-rw-r--r--mail/em-format-html-display.c21
-rw-r--r--mail/em-format-html-print.c5
-rw-r--r--mail/em-format-html.c20
-rw-r--r--mail/em-subscription-editor.c34
-rw-r--r--mail/em-vfolder-rule.c25
-rw-r--r--mail/importers/elm-importer.c8
-rw-r--r--mail/importers/evolution-mbox-importer.c4
-rw-r--r--mail/importers/pine-importer.c8
-rw-r--r--mail/mail-autofilter.c3
-rw-r--r--mail/mail-send-recv.c4
-rw-r--r--mail/mail-vfolder.c55
-rw-r--r--mail/message-list.c12
-rw-r--r--modules/addressbook/addressbook-config.c70
-rw-r--r--modules/calendar/e-cal-attachment-handler.c8
-rw-r--r--modules/calendar/e-cal-shell-backend.c4
-rw-r--r--modules/calendar/e-cal-shell-settings.c3
-rw-r--r--modules/calendar/e-calendar-preferences.c12
-rw-r--r--modules/calendar/e-memo-shell-backend.c4
-rw-r--r--modules/calendar/e-memo-shell-migrate.c4
-rw-r--r--modules/calendar/e-task-shell-view-private.c18
-rw-r--r--modules/mail/e-mail-attachment-handler.c20
-rw-r--r--modules/mail/e-mail-config-web-view.c7
-rw-r--r--modules/mail/e-mail-shell-backend.c10
-rw-r--r--modules/mail/e-mail-shell-view-actions.c2
-rw-r--r--modules/mail/e-mail-shell-view-private.c2
-rw-r--r--modules/mail/em-account-prefs.c10
-rw-r--r--modules/mail/em-mailer-prefs.c45
-rw-r--r--modules/mail/em-network-prefs.c87
-rw-r--r--modules/plugin-lib/e-plugin-lib.c4
-rw-r--r--modules/plugin-mono/e-plugin-mono.c7
-rw-r--r--modules/plugin-python/e-plugin-python.c7
-rw-r--r--modules/startup-wizard/evolution-startup-wizard.c2
-rw-r--r--plugins/attachment-reminder/attachment-reminder.c48
-rw-r--r--plugins/backup-restore/backup-restore.c4
-rw-r--r--plugins/backup-restore/backup.c45
-rw-r--r--plugins/bbdb/bbdb.c28
-rw-r--r--plugins/bbdb/gaimbuddies.c4
-rw-r--r--plugins/caldav/caldav-browse-server.c16
-rw-r--r--plugins/calendar-file/calendar-file.c16
-rw-r--r--plugins/calendar-http/calendar-http.c19
-rw-r--r--plugins/dbx-import/dbx-importer.c11
-rw-r--r--plugins/email-custom-header/email-custom-header.c144
-rw-r--r--plugins/email-custom-header/email-custom-header.h34
-rw-r--r--plugins/external-editor/external-editor.c6
-rw-r--r--plugins/face/face.c12
-rw-r--r--plugins/google-account-setup/google-contacts-source.c18
-rw-r--r--plugins/google-account-setup/google-source.c12
-rw-r--r--plugins/imap-features/imap-headers.c20
-rw-r--r--plugins/itip-formatter/itip-formatter.c20
-rw-r--r--plugins/itip-formatter/itip-view.c301
-rw-r--r--plugins/mail-notification/mail-notification.c24
-rw-r--r--plugins/mail-to-task/mail-to-task.c16
-rw-r--r--plugins/mark-all-read/mark-all-read.c13
-rw-r--r--plugins/prefer-plain/prefer-plain.c8
-rw-r--r--plugins/pst-import/pst-importer.c16
-rw-r--r--plugins/publish-calendar/publish-calendar.c16
-rw-r--r--plugins/publish-calendar/publish-format-fb.c8
-rw-r--r--plugins/publish-calendar/publish-format-ical.c4
-rw-r--r--plugins/publish-calendar/url-editor-dialog.c35
-rw-r--r--plugins/save-calendar/ical-format.c4
-rw-r--r--plugins/save-calendar/rdf-format.c4
-rw-r--r--plugins/templates/templates.c8
-rw-r--r--plugins/webdav-account-setup/webdav-contacts-source.c27
-rw-r--r--shell/e-shell-backend.c2
-rw-r--r--shell/e-shell-migrate.c4
-rw-r--r--shell/e-shell-settings.c4
-rw-r--r--shell/e-shell-switcher.c4
-rw-r--r--shell/e-shell-window.c29
-rw-r--r--shell/es-event.c77
-rw-r--r--smclient/eggsmclient-win32.c8
-rw-r--r--smclient/eggsmclient.c15
-rw-r--r--smime/gui/ca-trust-dialog.c4
-rw-r--r--smime/gui/cert-trust-dialog.c4
-rw-r--r--smime/gui/certificate-manager.c39
-rw-r--r--smime/gui/certificate-manager.h2
-rw-r--r--smime/gui/certificate-viewer.c8
-rw-r--r--smime/gui/component.c18
-rw-r--r--smime/gui/e-cert-selector.c64
-rw-r--r--smime/gui/e-cert-selector.h41
-rw-r--r--smime/lib/e-asn1-object.c63
-rw-r--r--smime/lib/e-cert-db.c57
-rw-r--r--smime/lib/e-cert-trust.c28
-rw-r--r--smime/lib/e-cert.c156
-rw-r--r--smime/lib/e-pkcs12.c62
-rw-r--r--widgets/e-timezone-dialog/e-timezone-dialog.c105
-rw-r--r--widgets/menus/gal-define-views-dialog.c17
-rw-r--r--widgets/menus/gal-define-views-model.c12
-rw-r--r--widgets/menus/gal-view-collection.c38
-rw-r--r--widgets/menus/gal-view-etable.c23
-rw-r--r--widgets/menus/gal-view-factory-etable.c12
-rw-r--r--widgets/menus/gal-view-instance-save-as-dialog.c16
-rw-r--r--widgets/menus/gal-view-instance.c25
-rw-r--r--widgets/menus/gal-view-new-dialog.c224
-rw-r--r--widgets/misc/e-account-combo-box.c13
-rw-r--r--widgets/misc/e-action-combo-box.c11
-rw-r--r--widgets/misc/e-alert-bar.c4
-rw-r--r--widgets/misc/e-attachment-button.c9
-rw-r--r--widgets/misc/e-attachment-dialog.c11
-rw-r--r--widgets/misc/e-attachment-handler-image.c8
-rw-r--r--widgets/misc/e-attachment-handler.c7
-rw-r--r--widgets/misc/e-attachment-icon-view.c10
-rw-r--r--widgets/misc/e-attachment-paned.c37
-rw-r--r--widgets/misc/e-attachment-store.c9
-rw-r--r--widgets/misc/e-attachment-tree-view.c10
-rw-r--r--widgets/misc/e-attachment.c14
-rw-r--r--widgets/misc/e-buffer-tagger.c32
-rw-r--r--widgets/misc/e-calendar-item.c409
-rw-r--r--widgets/misc/e-canvas-background.c23
-rw-r--r--widgets/misc/e-canvas-vbox.c10
-rw-r--r--widgets/misc/e-canvas.c12
-rw-r--r--widgets/misc/e-charset-combo-box.c13
-rw-r--r--widgets/misc/e-contact-map-window.c36
-rw-r--r--widgets/misc/e-contact-map.c5
-rw-r--r--widgets/misc/e-contact-marker.c9
-rw-r--r--widgets/misc/e-dateedit.c70
-rw-r--r--widgets/misc/e-focus-tracker.c9
-rw-r--r--widgets/misc/e-image-chooser.c11
-rw-r--r--widgets/misc/e-import-assistant.c110
-rw-r--r--widgets/misc/e-map.c24
-rw-r--r--widgets/misc/e-menu-tool-button.c26
-rw-r--r--widgets/misc/e-online-button.c9
-rw-r--r--widgets/misc/e-paned.c9
-rw-r--r--widgets/misc/e-picture-gallery.c12
-rw-r--r--widgets/misc/e-popup-action.c9
-rw-r--r--widgets/misc/e-preferences-window.c31
-rw-r--r--widgets/misc/e-preview-pane.c11
-rw-r--r--widgets/misc/e-printable.c16
-rw-r--r--widgets/misc/e-search-bar.c13
-rw-r--r--widgets/misc/e-searching-tokenizer.c18
-rw-r--r--widgets/misc/e-selection-model-array.c8
-rw-r--r--widgets/misc/e-send-options.c147
-rw-r--r--widgets/misc/e-send-options.h14
-rw-r--r--widgets/misc/e-signature-combo-box.c14
-rw-r--r--widgets/misc/e-signature-editor.c11
-rw-r--r--widgets/misc/e-signature-manager.c9
-rw-r--r--widgets/misc/e-signature-preview.c9
-rw-r--r--widgets/misc/e-signature-script-dialog.c10
-rw-r--r--widgets/misc/e-signature-tree-view.c14
-rw-r--r--widgets/misc/e-url-entry.c59
-rw-r--r--widgets/misc/e-web-view-preview.c9
-rw-r--r--widgets/misc/ea-calendar-item.c14
-rw-r--r--widgets/misc/test-calendar.c15
-rw-r--r--widgets/misc/test-dateedit.c70
-rw-r--r--widgets/table/e-cell-combo.c53
-rw-r--r--widgets/table/e-cell-date-edit.c59
-rw-r--r--widgets/table/e-cell-text.c27
-rw-r--r--widgets/table/e-cell-toggle.c23
-rw-r--r--widgets/table/e-cell.c176
-rw-r--r--widgets/table/e-popup-menu.c7
-rw-r--r--widgets/table/e-table-click-to-add.c15
-rw-r--r--widgets/table/e-table-config.c15
-rw-r--r--widgets/table/e-table-extras.c9
-rw-r--r--widgets/table/e-table-field-chooser-dialog.c216
-rw-r--r--widgets/table/e-table-field-chooser-item.c6
-rw-r--r--widgets/table/e-table-field-chooser.c18
-rw-r--r--widgets/table/e-table-group-container.c82
-rw-r--r--widgets/table/e-table-group-leaf.c260
-rw-r--r--widgets/table/e-table-header-item.c119
-rw-r--r--widgets/table/e-table-header-utils.c8
-rw-r--r--widgets/table/e-table-header.c3
-rw-r--r--widgets/table/e-table-item.c46
-rw-r--r--widgets/table/e-table-memory-store.c9
-rw-r--r--widgets/table/e-table-memory.c9
-rw-r--r--widgets/table/e-table-model.c318
-rw-r--r--widgets/table/e-table-search.c9
-rw-r--r--widgets/table/e-table-sorter.c51
-rw-r--r--widgets/table/e-table-subset.c33
-rw-r--r--widgets/table/e-table-utils.c10
-rw-r--r--widgets/table/e-table-without.c15
-rw-r--r--widgets/table/e-table.c901
-rw-r--r--widgets/table/e-tree-memory.c9
-rw-r--r--widgets/table/e-tree-model.c118
-rw-r--r--widgets/table/e-tree-selection-model.c240
-rw-r--r--widgets/table/e-tree-sorted.c11
-rw-r--r--widgets/table/e-tree-table-adapter.c11
-rw-r--r--widgets/table/e-tree.c169
-rw-r--r--widgets/table/gal-a11y-e-cell-registry.c11
-rw-r--r--widgets/table/gal-a11y-e-cell-toggle.c7
-rw-r--r--widgets/table/gal-a11y-e-cell-tree.c7
-rw-r--r--widgets/table/gal-a11y-e-table-click-to-add.c18
-rw-r--r--widgets/table/gal-a11y-e-table-column-header.c9
-rw-r--r--widgets/table/gal-a11y-e-table-factory.c3
-rw-r--r--widgets/text/e-reflow-model.c209
-rw-r--r--widgets/text/e-reflow-model.h37
-rw-r--r--widgets/text/e-reflow.c95
-rw-r--r--widgets/text/e-reflow.h52
-rw-r--r--widgets/text/e-text-model.c195
-rw-r--r--widgets/text/e-text.c171
-rw-r--r--widgets/text/gal-a11y-e-text-factory.c4
-rw-r--r--widgets/text/gal-a11y-e-text.c12
358 files changed, 6813 insertions, 8304 deletions
diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c
index f926eea764..3189632d53 100644
--- a/addressbook/gui/contact-editor/e-contact-editor.c
+++ b/addressbook/gui/contact-editor/e-contact-editor.c
@@ -73,8 +73,6 @@ enum {
NUM_IM_COLUMNS
};
-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 property_id,
const GValue *value,
@@ -205,6 +203,8 @@ static const gint email_default[] = { 0, 1, 2, 2 };
#define STRING_IS_EMPTY(x) (!(x) || !(*(x)))
#define STRING_MAKE_NON_NULL(x) ((x) ? (x) : "")
+G_DEFINE_TYPE (EContactEditor, e_contact_editor, EAB_TYPE_EDITOR)
+
static void
e_contact_editor_contact_added (EABEditor *editor,
const GError *error,
@@ -256,37 +256,11 @@ e_contact_editor_closed (EABEditor *editor)
g_object_unref (editor);
}
-GType
-e_contact_editor_get_type (void)
-{
- static GType contact_editor_type = 0;
-
- if (!contact_editor_type) {
- static const GTypeInfo contact_editor_info = {
- sizeof (EContactEditorClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) e_contact_editor_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (EContactEditor),
- 0, /* n_preallocs */
- (GInstanceInitFunc) e_contact_editor_init,
- };
-
- contact_editor_type = g_type_register_static (
- EAB_TYPE_EDITOR, "EContactEditor",
- &contact_editor_info, 0);
- }
-
- return contact_editor_type;
-}
-
static void
-e_contact_editor_class_init (EContactEditorClass *klass)
+e_contact_editor_class_init (EContactEditorClass *class)
{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
- EABEditorClass *editor_class = EAB_EDITOR_CLASS (klass);
+ GObjectClass *object_class = G_OBJECT_CLASS (class);
+ EABEditorClass *editor_class = EAB_EDITOR_CLASS (class);
parent_class = g_type_class_ref (EAB_TYPE_EDITOR);
@@ -3286,8 +3260,9 @@ categories_clicked (GtkWidget *button,
return;
}
- g_signal_connect (dialog, "response",
- G_CALLBACK (categories_response), editor);
+ g_signal_connect (
+ dialog, "response",
+ G_CALLBACK (categories_response), editor);
/* Close the category dialog if the editor is closed*/
g_signal_connect_swapped (
diff --git a/addressbook/gui/contact-editor/e-contact-quick-add.c b/addressbook/gui/contact-editor/e-contact-quick-add.c
index 3595437f28..3ec9430040 100644
--- a/addressbook/gui/contact-editor/e-contact-quick-add.c
+++ b/addressbook/gui/contact-editor/e-contact-quick-add.c
@@ -450,7 +450,9 @@ build_quick_add_dialog (QuickAdd *qa)
container = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
gtk_container_set_border_width (GTK_CONTAINER (container), 0);
- g_signal_connect (dialog, "response", G_CALLBACK (clicked_cb), qa);
+ g_signal_connect (
+ dialog, "response",
+ G_CALLBACK (clicked_cb), qa);
qa->dialog = dialog;
@@ -607,7 +609,9 @@ e_contact_quick_add_free_form (const gchar *text,
/* walk backwards to whitespace or a < or a quote... */
while (last_at >= text && !bad_char
- && !(isspace ((gint) *last_at) || *last_at == '<' || *last_at == '"')) {
+ && !(isspace ((gint) *last_at) ||
+ *last_at == '<' ||
+ *last_at == '"')) {
/* Check for some stuff that can't appear in a legal e-mail address. */
if (*last_at == '['
|| *last_at == ']'
diff --git a/addressbook/gui/contact-editor/eab-editor.c b/addressbook/gui/contact-editor/eab-editor.c
index 241bc477a4..d6e8322ad8 100644
--- a/addressbook/gui/contact-editor/eab-editor.c
+++ b/addressbook/gui/contact-editor/eab-editor.c
@@ -31,6 +31,10 @@
#include "e-util/e-util.h"
#include "addressbook/gui/widgets/eab-gui-util.h"
+#define EAB_EDITOR_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), EAB_TYPE_EDITOR, EABEditorPrivate))
+
struct _EABEditorPrivate {
EShell *shell;
};
@@ -52,6 +56,8 @@ static GSList *all_editors;
static gpointer parent_class;
static guint signals[LAST_SIGNAL];
+G_DEFINE_ABSTRACT_TYPE (EABEditor, eab_editor, G_TYPE_OBJECT)
+
static void
eab_editor_quit_requested_cb (EShell *shell,
EShellQuitReason reason,
@@ -123,7 +129,7 @@ eab_editor_dispose (GObject *object)
{
EABEditorPrivate *priv;
- priv = EAB_EDITOR (object)->priv;
+ priv = EAB_EDITOR_GET_PRIVATE (object);
if (priv->shell != NULL) {
g_signal_handlers_disconnect_matched (
@@ -214,39 +220,11 @@ eab_editor_class_init (EABEditorClass *class)
static void
eab_editor_init (EABEditor *editor)
{
- editor->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- editor, EAB_TYPE_EDITOR, EABEditorPrivate);
+ editor->priv = EAB_EDITOR_GET_PRIVATE (editor);
all_editors = g_slist_prepend (all_editors, editor);
}
-GType
-eab_editor_get_type (void)
-{
- static GType type = 0;
-
- if (G_UNLIKELY (type == 0)) {
- static const GTypeInfo type_info = {
- sizeof (EABEditorClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) eab_editor_class_init,
- (GClassFinalizeFunc) NULL,
- NULL, /* class_data */
- sizeof (EABEditor),
- 0, /* n_preallocs */
- (GInstanceInitFunc) eab_editor_init,
- NULL /* value_table */
- };
-
- type = g_type_register_static (
- G_TYPE_OBJECT, "EABEditor", &type_info,
- G_TYPE_FLAG_ABSTRACT);
- }
-
- return type;
-}
-
EShell *
eab_editor_get_shell (EABEditor *editor)
{
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 e95d87e3e9..42099d1e05 100644
--- a/addressbook/gui/contact-list-editor/e-contact-list-editor.c
+++ b/addressbook/gui/contact-list-editor/e-contact-list-editor.c
@@ -53,9 +53,13 @@
(G_TYPE_INSTANCE_GET_PRIVATE \
((obj), E_TYPE_CONTACT_LIST_EDITOR, EContactListEditorPrivate))
+#define E_CONTACT_LIST_EDITOR_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_CONTACT_LIST_EDITOR, EContactListEditorPrivate))
+
#define CONTACT_LIST_EDITOR_WIDGET(editor, name) \
(e_builder_get_widget \
- (E_CONTACT_LIST_EDITOR (editor)->priv->builder, name))
+ (E_CONTACT_LIST_EDITOR_GET_PRIVATE (editor)->builder, name))
/* More macros, less typos. */
#define CONTACT_LIST_EDITOR_WIDGET_ADD_BUTTON(editor) \
@@ -65,7 +69,7 @@
#define CONTACT_LIST_EDITOR_WIDGET_DIALOG(editor) \
CONTACT_LIST_EDITOR_WIDGET ((editor), "dialog")
#define CONTACT_LIST_EDITOR_WIDGET_EMAIL_ENTRY(editor) \
- editor->priv->email_entry
+ E_CONTACT_LIST_EDITOR_GET_PRIVATE (editor)->email_entry
#define CONTACT_LIST_EDITOR_WIDGET_LIST_NAME_ENTRY(editor) \
CONTACT_LIST_EDITOR_WIDGET ((editor), "list-name-entry")
#define CONTACT_LIST_EDITOR_WIDGET_MEMBERS_VBOX(editor) \
@@ -137,6 +141,8 @@ struct _EContactListEditorPrivate {
static gpointer parent_class;
+G_DEFINE_TYPE (EContactListEditor, e_contact_list_editor, EAB_TYPE_EDITOR)
+
static EContactListEditor *
contact_list_editor_extract (GtkWidget *widget)
{
@@ -1174,7 +1180,7 @@ setup_custom_widgets (EContactListEditor *editor)
g_return_if_fail (editor != NULL);
- priv = editor->priv;
+ priv = E_CONTACT_LIST_EDITOR_GET_PRIVATE (editor);
combo_box = WIDGET (SOURCE_MENU);
if (!e_book_client_get_sources (&source_list, &error))
@@ -1378,7 +1384,8 @@ contact_list_editor_constructed (GObject *object)
selection = gtk_tree_view_get_selection (view);
gtk_tree_selection_set_mode (selection, GTK_SELECTION_MULTIPLE);
- g_signal_connect (selection, "changed",
+ g_signal_connect (
+ selection, "changed",
G_CALLBACK (contact_list_editor_selection_changed_cb), editor);
gtk_tree_view_enable_model_drag_dest (view, NULL, 0, GDK_ACTION_LINK);
@@ -1492,7 +1499,7 @@ contact_list_editor_is_valid (EABEditor *editor)
static gboolean
contact_list_editor_is_changed (EABEditor *editor)
{
- return E_CONTACT_LIST_EDITOR (editor)->priv->changed;
+ return E_CONTACT_LIST_EDITOR_GET_PRIVATE (editor)->changed;
}
static GtkWindow *
@@ -1555,7 +1562,7 @@ contact_list_editor_closed (EABEditor *editor)
/****************************** GType Callbacks ******************************/
static void
-contact_list_editor_class_init (EContactListEditorClass *class)
+e_contact_list_editor_class_init (EContactListEditorClass *class)
{
GObjectClass *object_class;
EABEditorClass *editor_class;
@@ -1624,30 +1631,13 @@ contact_list_editor_class_init (EContactListEditorClass *class)
}
static void
-contact_list_editor_init (EContactListEditor *editor)
+e_contact_list_editor_init (EContactListEditor *editor)
{
editor->priv = E_CONTACT_LIST_EDITOR_GET_PRIVATE (editor);
}
/***************************** Public Interface ******************************/
-GType
-e_contact_list_editor_get_type (void)
-{
- static GType type = 0;
-
- if (G_UNLIKELY (type == 0))
- type = g_type_register_static_simple (
- EAB_TYPE_EDITOR,
- "EContactListEditor",
- sizeof (EContactListEditorClass),
- (GClassInitFunc) contact_list_editor_class_init,
- sizeof (EContactListEditor),
- (GInstanceInitFunc) contact_list_editor_init, 0);
-
- return type;
-}
-
EABEditor *
e_contact_list_editor_new (EShell *shell,
EBookClient *book_client,
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 8236bafea4..c81beeecbe 100644
--- a/addressbook/gui/contact-list-editor/e-contact-list-model.c
+++ b/addressbook/gui/contact-list-editor/e-contact-list-model.c
@@ -29,6 +29,10 @@
#include "e-util/e-alert-dialog.h"
#include "shell/e-shell.h"
+#define E_CONTACT_LIST_MODEL_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_CONTACT_LIST_MODEL, EContactListModelPrivate))
+
static gpointer parent_class;
G_DEFINE_TYPE (EContactListModel, e_contact_list_model, GTK_TYPE_TREE_STORE);
@@ -111,7 +115,7 @@ e_contact_list_model_class_init (EContactListModelClass *class)
static void
e_contact_list_model_init (EContactListModel *model)
{
- model->priv = G_TYPE_INSTANCE_GET_PRIVATE (model, E_TYPE_CONTACT_LIST_MODEL, EContactListModelPrivate);
+ model->priv = E_CONTACT_LIST_MODEL_GET_PRIVATE (model);
model->priv->uids_table = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
model->priv->emails_table = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
diff --git a/addressbook/gui/merging/eab-contact-merging.c b/addressbook/gui/merging/eab-contact-merging.c
index 4309354007..2302761812 100644
--- a/addressbook/gui/merging/eab-contact-merging.c
+++ b/addressbook/gui/merging/eab-contact-merging.c
@@ -405,7 +405,9 @@ mergeit (EContactMergingLookup *lookup)
data->field = use_field;
data->match = lookup->match;
e_contact_set (lookup->match, use_field, string);
- g_signal_connect (dropdown, "changed", G_CALLBACK(dropdown_changed), data);
+ 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);
@@ -451,7 +453,10 @@ mergeit (EContactMergingLookup *lookup)
if (field == E_CONTACT_NICKNAME || field == E_CONTACT_GIVEN_NAME)
gtk_widget_set_sensitive ((GtkWidget *) dropdown, FALSE);
- g_signal_connect (dropdown, "changed", G_CALLBACK(dropdown_changed), data);
+ 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_table_attach_defaults (table, (GtkWidget *) hbox, 1, 2, row, row + 1);
@@ -464,7 +469,9 @@ mergeit (EContactMergingLookup *lookup)
gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (scrolled_window), GTK_WIDGET (table));
gtk_box_pack_start (GTK_BOX (content_area), GTK_WIDGET (scrolled_window), TRUE, TRUE, 0);
gtk_widget_show (scrolled_window);
- g_signal_connect (dialog, "map-event", G_CALLBACK (dialog_map), table);
+ g_signal_connect (
+ dialog, "map-event",
+ G_CALLBACK (dialog_map), table);
gtk_widget_show_all ((GtkWidget *) table);
result = gtk_dialog_run (GTK_DIALOG (dialog));
diff --git a/addressbook/gui/widgets/e-addressbook-model.c b/addressbook/gui/widgets/e-addressbook-model.c
index fa61c4e5e2..bb8f2b59e3 100644
--- a/addressbook/gui/widgets/e-addressbook-model.c
+++ b/addressbook/gui/widgets/e-addressbook-model.c
@@ -31,6 +31,10 @@
#include <e-util/e-util.h>
#include "eab-gui-util.h"
+#define E_ADDRESSBOOK_MODEL_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_ADDRESSBOOK_MODEL, EAddressbookModelPrivate))
+
struct _EAddressbookModelPrivate {
EBookClient *book_client;
gchar *query_str;
@@ -80,6 +84,8 @@ enum {
static gpointer parent_class;
static guint signals[LAST_SIGNAL];
+G_DEFINE_TYPE (EAddressbookModel, e_addressbook_model, G_TYPE_OBJECT)
+
static void
free_data (EAddressbookModel *model)
{
@@ -546,7 +552,7 @@ addressbook_model_finalize (GObject *object)
{
EAddressbookModelPrivate *priv;
- priv = E_ADDRESSBOOK_MODEL (object)->priv;
+ priv = E_ADDRESSBOOK_MODEL_GET_PRIVATE (object);
g_ptr_array_free (priv->contacts, TRUE);
@@ -555,7 +561,7 @@ addressbook_model_finalize (GObject *object)
}
static void
-addressbook_model_class_init (EAddressbookModelClass *class)
+e_addressbook_model_class_init (EAddressbookModelClass *class)
{
GObjectClass *object_class;
@@ -705,41 +711,13 @@ addressbook_model_class_init (EAddressbookModelClass *class)
}
static void
-addressbook_model_init (EAddressbookModel *model)
+e_addressbook_model_init (EAddressbookModel *model)
{
- model->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- model, E_TYPE_ADDRESSBOOK_MODEL, EAddressbookModelPrivate);
-
+ model->priv = E_ADDRESSBOOK_MODEL_GET_PRIVATE (model);
model->priv->contacts = g_ptr_array_new ();
model->priv->first_get_view = TRUE;
}
-GType
-e_addressbook_model_get_type (void)
-{
- static GType type = 0;
-
- if (G_UNLIKELY (type == 0)) {
- static const GTypeInfo type_info = {
- sizeof (EAddressbookModelClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) addressbook_model_class_init,
- (GClassFinalizeFunc) NULL,
- NULL, /* class_data */
- sizeof (EAddressbookModel),
- 0, /* n_preallocs */
- (GInstanceInitFunc) addressbook_model_init,
- NULL /* value_table */
- };
-
- type = g_type_register_static (
- G_TYPE_OBJECT, "EAddressbookModel", &type_info, 0);
- }
-
- return type;
-}
-
EAddressbookModel *
e_addressbook_model_new (void)
{
diff --git a/addressbook/gui/widgets/e-addressbook-reflow-adapter.c b/addressbook/gui/widgets/e-addressbook-reflow-adapter.c
index 71e63867d6..00a86ce73f 100644
--- a/addressbook/gui/widgets/e-addressbook-reflow-adapter.c
+++ b/addressbook/gui/widgets/e-addressbook-reflow-adapter.c
@@ -31,6 +31,10 @@
#include <e-util/e-util.h>
#include "addressbook/printing/e-contact-print.h"
+#define E_ADDRESSBOOK_REFLOW_ADAPTER_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_ADDRESSBOOK_REFLOW_ADAPTER, EAddressbookReflowAdapterPrivate))
+
struct _EAddressbookReflowAdapterPrivate {
EAddressbookModel *model;
@@ -40,9 +44,6 @@ struct _EAddressbookReflowAdapterPrivate {
gint search_started_id, search_result_id;
};
-#define PARENT_TYPE e_reflow_model_get_type()
-static EReflowModel *parent_class;
-
#define d(x)
enum {
@@ -61,6 +62,11 @@ enum {
static guint signals[LAST_SIGNAL] = {0, };
+G_DEFINE_TYPE (
+ EAddressbookReflowAdapter,
+ e_addressbook_reflow_adapter,
+ E_TYPE_REFLOW_MODEL)
+
static void
unlink_model (EAddressbookReflowAdapter *adapter)
{
@@ -307,22 +313,19 @@ addressbook_incarnate (EReflowModel *erm,
EAddressbookReflowAdapterPrivate *priv = adapter->priv;
GnomeCanvasItem *item;
- item = gnome_canvas_item_new (parent,
- e_minicard_get_type (),
- "contact", e_addressbook_model_contact_at (priv->model, i),
- "editable", e_addressbook_model_get_editable (priv->model),
- NULL);
+ item = gnome_canvas_item_new (
+ parent, e_minicard_get_type (),
+ "contact", e_addressbook_model_contact_at (priv->model, i),
+ "editable", e_addressbook_model_get_editable (priv->model),
+ NULL);
-#if 0
- g_signal_connect (item, "selected",
- G_CALLBACK (card_selected), 0, emvm);
-#endif
+ g_signal_connect (
+ item, "drag_begin",
+ G_CALLBACK (adapter_drag_begin), adapter);
- g_signal_connect (item, "drag_begin",
- G_CALLBACK (adapter_drag_begin), adapter);
-
- g_signal_connect (item, "open-contact",
- G_CALLBACK (adapter_open_contact), adapter);
+ g_signal_connect (
+ item, "open-contact",
+ G_CALLBACK (adapter_open_contact), adapter);
return item;
}
@@ -470,16 +473,28 @@ addressbook_get_property (GObject *object,
}
static void
-e_addressbook_reflow_adapter_class_init (GObjectClass *object_class)
+e_addressbook_reflow_adapter_class_init (EAddressbookReflowAdapterClass *class)
{
- EReflowModelClass *model_class = (EReflowModelClass *) object_class;
+ GObjectClass *object_class;
+ EReflowModelClass *reflow_model_class;
- parent_class = g_type_class_peek_parent (object_class);
+ g_type_class_add_private (
+ class, sizeof (EAddressbookReflowAdapterPrivate));
+ object_class = G_OBJECT_CLASS (class);
object_class->set_property = addressbook_set_property;
object_class->get_property = addressbook_get_property;
object_class->dispose = addressbook_dispose;
+ reflow_model_class = E_REFLOW_MODEL_CLASS (class);
+ reflow_model_class->set_width = addressbook_set_width;
+ reflow_model_class->count = addressbook_count;
+ reflow_model_class->height = addressbook_height;
+ reflow_model_class->create_cmp_cache = addressbook_create_cmp_cache;
+ reflow_model_class->compare = addressbook_compare;
+ reflow_model_class->incarnate = addressbook_incarnate;
+ reflow_model_class->reincarnate = addressbook_reincarnate;
+
g_object_class_install_property (object_class, PROP_CLIENT,
g_param_spec_object ("client",
"EBookClient",
@@ -526,56 +541,12 @@ e_addressbook_reflow_adapter_class_init (GObjectClass *object_class)
g_cclosure_marshal_VOID__OBJECT,
G_TYPE_NONE, 1,
E_TYPE_CONTACT);
-
- model_class->set_width = addressbook_set_width;
- model_class->count = addressbook_count;
- model_class->height = addressbook_height;
- model_class->create_cmp_cache = addressbook_create_cmp_cache;
- model_class->compare = addressbook_compare;
- model_class->incarnate = addressbook_incarnate;
- model_class->reincarnate = addressbook_reincarnate;
}
static void
-e_addressbook_reflow_adapter_init (GObject *object)
-{
- EAddressbookReflowAdapter *adapter = E_ADDRESSBOOK_REFLOW_ADAPTER (object);
- EAddressbookReflowAdapterPrivate *priv;
-
- priv = adapter->priv = g_new0 (EAddressbookReflowAdapterPrivate, 1);
-
- priv->loading = FALSE;
- priv->create_contact_id = 0;
- priv->remove_contact_id = 0;
- priv->modify_contact_id = 0;
- priv->model_changed_id = 0;
- priv->search_started_id = 0;
- priv->search_result_id = 0;
-}
-
-GType
-e_addressbook_reflow_adapter_get_type (void)
+e_addressbook_reflow_adapter_init (EAddressbookReflowAdapter *adapter)
{
- static GType type = 0;
-
- if (!type) {
- static const GTypeInfo info = {
- sizeof (EAddressbookReflowAdapterClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) e_addressbook_reflow_adapter_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (EAddressbookReflowAdapter),
- 0, /* n_preallocs */
- (GInstanceInitFunc) e_addressbook_reflow_adapter_init,
- };
-
- type = g_type_register_static (
- PARENT_TYPE, "EAddressbookReflowAdapter", &info, 0);
- }
-
- return type;
+ adapter->priv = E_ADDRESSBOOK_REFLOW_ADAPTER_GET_PRIVATE (adapter);
}
void
@@ -584,33 +555,31 @@ e_addressbook_reflow_adapter_construct (EAddressbookReflowAdapter *adapter,
{
EAddressbookReflowAdapterPrivate *priv = adapter->priv;
- priv->model = model;
- g_object_ref (priv->model);
-
- priv->create_contact_id = g_signal_connect (priv->model,
- "contact_added",
- G_CALLBACK (create_contact),
- adapter);
- priv->remove_contact_id = g_signal_connect (priv->model,
- "contacts_removed",
- G_CALLBACK (remove_contacts),
- adapter);
- priv->modify_contact_id = g_signal_connect (priv->model,
- "contact_changed",
- G_CALLBACK (modify_contact),
- adapter);
- priv->model_changed_id = g_signal_connect (priv->model,
- "model_changed",
- G_CALLBACK (model_changed),
- adapter);
- priv->search_started_id = g_signal_connect (priv->model,
- "search_started",
- G_CALLBACK (search_started),
- adapter);
- priv->search_result_id = g_signal_connect (priv->model,
- "search_result",
- G_CALLBACK (search_result),
- adapter);
+ priv->model = g_object_ref (model);
+
+ priv->create_contact_id = g_signal_connect (
+ priv->model, "contact_added",
+ G_CALLBACK (create_contact), adapter);
+
+ priv->remove_contact_id = g_signal_connect (
+ priv->model, "contacts_removed",
+ G_CALLBACK (remove_contacts), adapter);
+
+ priv->modify_contact_id = g_signal_connect (
+ priv->model, "contact_changed",
+ G_CALLBACK (modify_contact), adapter);
+
+ priv->model_changed_id = g_signal_connect (
+ priv->model, "model_changed",
+ G_CALLBACK (model_changed), adapter);
+
+ priv->search_started_id = g_signal_connect (
+ priv->model, "search_started",
+ G_CALLBACK (search_started), adapter);
+
+ priv->search_result_id = g_signal_connect (
+ priv->model, "search_result",
+ G_CALLBACK (search_result), adapter);
}
EReflowModel *
diff --git a/addressbook/gui/widgets/e-addressbook-selector.c b/addressbook/gui/widgets/e-addressbook-selector.c
index 30bb8899f5..6fc1df3ebf 100644
--- a/addressbook/gui/widgets/e-addressbook-selector.c
+++ b/addressbook/gui/widgets/e-addressbook-selector.c
@@ -30,6 +30,10 @@
#include <eab-book-util.h>
#include <eab-contact-merging.h>
+#define E_ADDRESSBOOK_SELECTOR_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_ADDRESSBOOK_SELECTOR, EAddressbookSelectorPrivate))
+
typedef struct _MergeContext MergeContext;
struct _EAddressbookSelectorPrivate {
@@ -60,6 +64,11 @@ static GtkTargetEntry drag_types[] = {
static gpointer parent_class;
+G_DEFINE_TYPE (
+ EAddressbookSelector,
+ e_addressbook_selector,
+ E_TYPE_SOURCE_SELECTOR)
+
static void
merge_context_next (MergeContext *merge_context)
{
@@ -233,7 +242,7 @@ addressbook_selector_dispose (GObject *object)
{
EAddressbookSelectorPrivate *priv;
- priv = E_ADDRESSBOOK_SELECTOR (object)->priv;
+ priv = E_ADDRESSBOOK_SELECTOR_GET_PRIVATE (object);
if (priv->current_view != NULL) {
g_object_unref (priv->current_view);
@@ -313,7 +322,7 @@ addressbook_selector_data_dropped (ESourceSelector *selector,
const gchar *string;
gboolean remove_from_source;
- priv = E_ADDRESSBOOK_SELECTOR (selector)->priv;
+ priv = E_ADDRESSBOOK_SELECTOR_GET_PRIVATE (selector);
g_return_val_if_fail (priv->current_view != NULL, FALSE);
string = (const gchar *) gtk_selection_data_get_data (selection_data);
@@ -345,7 +354,7 @@ addressbook_selector_data_dropped (ESourceSelector *selector,
}
static void
-addressbook_selector_class_init (EAddressbookSelectorClass *class)
+e_addressbook_selector_class_init (EAddressbookSelectorClass *class)
{
GObjectClass *object_class;
ESourceSelectorClass *selector_class;
@@ -374,11 +383,9 @@ addressbook_selector_class_init (EAddressbookSelectorClass *class)
}
static void
-addressbook_selector_init (EAddressbookSelector *selector)
+e_addressbook_selector_init (EAddressbookSelector *selector)
{
- selector->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- selector, E_TYPE_ADDRESSBOOK_SELECTOR,
- EAddressbookSelectorPrivate);
+ selector->priv = E_ADDRESSBOOK_SELECTOR_GET_PRIVATE (selector);
gtk_drag_dest_set (
GTK_WIDGET (selector), GTK_DEST_DEFAULT_ALL,
@@ -388,33 +395,6 @@ addressbook_selector_init (EAddressbookSelector *selector)
e_drag_dest_add_directory_targets (GTK_WIDGET (selector));
}
-GType
-e_addressbook_selector_get_type (void)
-{
- static GType type = 0;
-
- if (G_UNLIKELY (type == 0)) {
- const GTypeInfo type_info = {
- sizeof (EAddressbookSelectorClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) addressbook_selector_class_init,
- (GClassFinalizeFunc) NULL,
- NULL, /* class_data */
- sizeof (EAddressbookSelector),
- 0, /* n_preallocs */
- (GInstanceInitFunc) addressbook_selector_init,
- NULL /* value_table */
- };
-
- type = g_type_register_static (
- E_TYPE_SOURCE_SELECTOR, "EAddressbookSelector",
- &type_info, 0);
- }
-
- return type;
-}
-
GtkWidget *
e_addressbook_selector_new (ESourceList *source_list)
{
diff --git a/addressbook/gui/widgets/e-addressbook-table-adapter.c b/addressbook/gui/widgets/e-addressbook-table-adapter.c
index 463bdc7a3d..5a2a9b473f 100644
--- a/addressbook/gui/widgets/e-addressbook-table-adapter.c
+++ b/addressbook/gui/widgets/e-addressbook-table-adapter.c
@@ -36,6 +36,10 @@
#include <libxml/parser.h>
#include <libxml/xmlmemory.h>
+#define E_ADDRESSBOOK_TABLE_ADAPTER_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_ADDRESSBOOK_TABLE_ADAPTER, EAddressbookTableAdapterPrivate))
+
struct _EAddressbookTableAdapterPrivate {
EAddressbookModel *model;
@@ -44,11 +48,13 @@ struct _EAddressbookTableAdapterPrivate {
GHashTable *emails;
};
-#define PARENT_TYPE e_table_model_get_type()
-static ETableModelClass *parent_class;
-
#define COLS (E_CONTACT_FIELD_LAST)
+G_DEFINE_TYPE (
+ EAddressbookTableAdapter,
+ e_addressbook_table_adapter,
+ E_TYPE_TABLE_MODEL)
+
static void
unlink_model (EAddressbookTableAdapter *adapter)
{
@@ -70,22 +76,18 @@ unlink_model (EAddressbookTableAdapter *adapter)
}
static void
-addressbook_dispose (GObject *object)
+addressbook_finalize (GObject *object)
{
- EAddressbookTableAdapter *adapter = EAB_TABLE_ADAPTER (object);
+ EAddressbookTableAdapter *adapter;
- if (adapter->priv) {
- unlink_model (adapter);
+ adapter = E_ADDRESSBOOK_TABLE_ADAPTER (object);
- g_hash_table_remove_all (adapter->priv->emails);
- g_hash_table_destroy (adapter->priv->emails);
+ unlink_model (adapter);
- g_free (adapter->priv);
- adapter->priv = NULL;
- }
+ g_hash_table_destroy (adapter->priv->emails);
- /* Chain up to parent's dispose() method. */
- G_OBJECT_CLASS (parent_class)->dispose (object);
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (e_addressbook_table_adapter_parent_class)->finalize (object);
}
/* This function returns the number of columns in our ETableModel. */
@@ -99,7 +101,7 @@ addressbook_col_count (ETableModel *etc)
static gint
addressbook_row_count (ETableModel *etc)
{
- EAddressbookTableAdapter *adapter = EAB_TABLE_ADAPTER (etc);
+ EAddressbookTableAdapter *adapter = E_ADDRESSBOOK_TABLE_ADAPTER (etc);
EAddressbookTableAdapterPrivate *priv = adapter->priv;
return e_addressbook_model_contact_count (priv->model);
@@ -111,7 +113,7 @@ addressbook_value_at (ETableModel *etc,
gint col,
gint row)
{
- EAddressbookTableAdapter *adapter = EAB_TABLE_ADAPTER (etc);
+ EAddressbookTableAdapter *adapter = E_ADDRESSBOOK_TABLE_ADAPTER (etc);
EAddressbookTableAdapterPrivate *priv = adapter->priv;
EContact *contact;
const gchar *value;
@@ -164,7 +166,7 @@ addressbook_set_value_at (ETableModel *etc,
gint row,
gconstpointer val)
{
- EAddressbookTableAdapter *adapter = EAB_TABLE_ADAPTER (etc);
+ EAddressbookTableAdapter *adapter = E_ADDRESSBOOK_TABLE_ADAPTER (etc);
EAddressbookTableAdapterPrivate *priv = adapter->priv;
if (e_addressbook_model_get_editable (priv->model)) {
@@ -219,7 +221,7 @@ addressbook_append_row (ETableModel *etm,
ETableModel *source,
gint row)
{
- EAddressbookTableAdapter *adapter = EAB_TABLE_ADAPTER (etm);
+ EAddressbookTableAdapter *adapter = E_ADDRESSBOOK_TABLE_ADAPTER (etm);
EAddressbookTableAdapterPrivate *priv = adapter->priv;
EBookClient *book_client;
EContact *contact;
@@ -280,14 +282,18 @@ addressbook_value_to_string (ETableModel *etc,
}
static void
-eab_table_adapter_class_init (GObjectClass *object_class)
+e_addressbook_table_adapter_class_init (EAddressbookTableAdapterClass *class)
{
- ETableModelClass *model_class = (ETableModelClass *) object_class;
+ GObjectClass *object_class;
+ ETableModelClass *model_class;
- parent_class = g_type_class_peek_parent (object_class);
+ g_type_class_add_private (
+ class, sizeof (EAddressbookTableAdapterPrivate));
- object_class->dispose = addressbook_dispose;
+ object_class = G_OBJECT_CLASS (class);
+ object_class->finalize = addressbook_finalize;
+ model_class = E_TABLE_MODEL_CLASS (class);
model_class->column_count = addressbook_col_count;
model_class->row_count = addressbook_row_count;
model_class->value_at = addressbook_value_at;
@@ -302,17 +308,9 @@ eab_table_adapter_class_init (GObjectClass *object_class)
}
static void
-eab_table_adapter_init (GObject *object)
+e_addressbook_table_adapter_init (EAddressbookTableAdapter *adapter)
{
- EAddressbookTableAdapter *adapter = EAB_TABLE_ADAPTER (object);
- EAddressbookTableAdapterPrivate *priv;
-
- priv = adapter->priv = g_new0 (EAddressbookTableAdapterPrivate, 1);
-
- priv->create_contact_id = 0;
- priv->remove_contact_id = 0;
- priv->modify_contact_id = 0;
- priv->model_changed_id = 0;
+ adapter->priv = E_ADDRESSBOOK_TABLE_ADAPTER_GET_PRIVATE (adapter);
}
static void
@@ -368,34 +366,9 @@ model_changed (EAddressbookModel *model,
e_table_model_changed (E_TABLE_MODEL (adapter));
}
-GType
-eab_table_adapter_get_type (void)
-{
- static GType type = 0;
-
- if (!type) {
- static const GTypeInfo info = {
- sizeof (EAddressbookTableAdapterClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) eab_table_adapter_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (EAddressbookTableAdapter),
- 0, /* n_preallocs */
- (GInstanceInitFunc) eab_table_adapter_init,
- };
-
- type = g_type_register_static (
- PARENT_TYPE, "EAddressbookTableAdapter", &info, 0);
- }
-
- return type;
-}
-
void
-eab_table_adapter_construct (EAddressbookTableAdapter *adapter,
- EAddressbookModel *model)
+e_addressbook_table_adapter_construct (EAddressbookTableAdapter *adapter,
+ EAddressbookModel *model)
{
EAddressbookTableAdapterPrivate *priv = adapter->priv;
@@ -425,13 +398,13 @@ eab_table_adapter_construct (EAddressbookTableAdapter *adapter,
}
ETableModel *
-eab_table_adapter_new (EAddressbookModel *model)
+e_addressbook_table_adapter_new (EAddressbookModel *model)
{
EAddressbookTableAdapter *et;
- et = g_object_new (E_TYPE_AB_TABLE_ADAPTER, NULL);
+ et = g_object_new (E_TYPE_ADDRESSBOOK_TABLE_ADAPTER, NULL);
- eab_table_adapter_construct (et, model);
+ e_addressbook_table_adapter_construct (et, model);
return E_TABLE_MODEL (et);
}
diff --git a/addressbook/gui/widgets/e-addressbook-table-adapter.h b/addressbook/gui/widgets/e-addressbook-table-adapter.h
index 17cf4cfadb..51c9436ff2 100644
--- a/addressbook/gui/widgets/e-addressbook-table-adapter.h
+++ b/addressbook/gui/widgets/e-addressbook-table-adapter.h
@@ -23,19 +23,33 @@
#include <table/e-table-model.h>
-#define E_TYPE_AB_TABLE_ADAPTER (eab_table_adapter_get_type ())
-#define EAB_TABLE_ADAPTER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TYPE_AB_TABLE_ADAPTER, EAddressbookTableAdapter))
-#define EAB_TABLE_ADAPTER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TYPE_AB_TABLE_ADAPTER, EAddressbookTableAdapterClass))
-#define E_IS_ADDRESSBOOK_TABLE_ADAPTER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TYPE_AB_TABLE_ADAPTER))
-#define E_IS_ADDRESSBOOK_TABLE_ADAPTER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TYPE_AB_TABLE_ADAPTER))
+/* Standard GObject macros */
+#define E_TYPE_ADDRESSBOOK_TABLE_ADAPTER \
+ (e_addressbook_table_adapter_get_type ())
+#define E_ADDRESSBOOK_TABLE_ADAPTER(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), E_TYPE_ADDRESSBOOK_TABLE_ADAPTER, EAddressbookTableAdapter))
+#define E_ADDRESSBOOK_TABLE_ADAPTER_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), E_TYPE_ADDRESSBOOK_TABLE_ADAPTER, EAddressbookTableAdapterClass))
+#define E_IS_ADDRESSBOOK_TABLE_ADAPTER(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), E_TYPE_ADDRESSBOOK_TABLE_ADAPTER))
+#define E_IS_ADDRESSBOOK_TABLE_ADAPTER_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), E_TYPE_ADDRESSBOOK_TABLE_ADAPTER))
+#define E_ADDRESSBOOK_TABLE_ADAPTER_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), E_TYPE_ADDRESSBOOK_TABLE_ADAPTER, EAddressbookTableAdapterClass))
+
+G_BEGIN_DECLS
typedef struct _EAddressbookTableAdapter EAddressbookTableAdapter;
-typedef struct _EAddressbookTableAdapterPrivate EAddressbookTableAdapterPrivate;
typedef struct _EAddressbookTableAdapterClass EAddressbookTableAdapterClass;
+typedef struct _EAddressbookTableAdapterPrivate EAddressbookTableAdapterPrivate;
struct _EAddressbookTableAdapter {
ETableModel parent;
-
EAddressbookTableAdapterPrivate *priv;
};
@@ -43,9 +57,14 @@ struct _EAddressbookTableAdapterClass {
ETableModelClass parent_class;
};
-GType eab_table_adapter_get_type (void);
-void eab_table_adapter_construct (EAddressbookTableAdapter *adapter,
- EAddressbookModel *model);
-ETableModel *eab_table_adapter_new (EAddressbookModel *model);
+GType e_addressbook_table_adapter_get_type
+ (void) G_GNUC_CONST;
+void e_addressbook_table_adapter_construct
+ (EAddressbookTableAdapter *adapter,
+ EAddressbookModel *model);
+ETableModel * e_addressbook_table_adapter_new
+ (EAddressbookModel *model);
+
+G_END_DECLS
#endif /* _EAB_TABLE_ADAPTER_H_ */
diff --git a/addressbook/gui/widgets/e-addressbook-view.c b/addressbook/gui/widgets/e-addressbook-view.c
index 9bda90a280..1212cc60bd 100644
--- a/addressbook/gui/widgets/e-addressbook-view.c
+++ b/addressbook/gui/widgets/e-addressbook-view.c
@@ -61,6 +61,10 @@
#include <ctype.h>
#include <string.h>
+#define E_ADDRESSBOOK_VIEW_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_ADDRESSBOOK_VIEW, EAddressbookViewPrivate))
+
#define d(x)
static void status_message (EAddressbookView *view,
@@ -126,6 +130,18 @@ static GtkTargetEntry drag_types[] = {
static gpointer parent_class;
static guint signals[LAST_SIGNAL];
+/* Forward Declarations */
+static void e_addressbook_view_selectable_init
+ (ESelectableInterface *interface);
+
+G_DEFINE_TYPE_WITH_CODE (
+ EAddressbookView,
+ e_addressbook_view,
+ GTK_TYPE_SCROLLED_WINDOW,
+ G_IMPLEMENT_INTERFACE (
+ E_TYPE_SELECTABLE,
+ e_addressbook_view_selectable_init))
+
static void
addressbook_view_emit_open_contact (EAddressbookView *view,
EContact *contact,
@@ -289,7 +305,7 @@ addressbook_view_create_table_view (EAddressbookView *view,
GtkWidget *widget;
gchar *etspecfile;
- adapter = eab_table_adapter_new (view->priv->model);
+ adapter = e_addressbook_table_adapter_new (view->priv->model);
extras = e_table_extras_new ();
@@ -494,7 +510,7 @@ addressbook_view_dispose (GObject *object)
{
EAddressbookViewPrivate *priv;
- priv = E_ADDRESSBOOK_VIEW (object)->priv;
+ priv = E_ADDRESSBOOK_VIEW_GET_PRIVATE (object);
if (priv->shell_view != NULL) {
g_object_remove_weak_pointer (
@@ -737,7 +753,7 @@ addressbook_view_select_all (ESelectable *selectable)
}
static void
-addressbook_view_class_init (EAddressbookViewClass *class)
+e_addressbook_view_class_init (EAddressbookViewClass *class)
{
GObjectClass *object_class;
@@ -838,12 +854,11 @@ addressbook_view_class_init (EAddressbookViewClass *class)
}
static void
-addressbook_view_init (EAddressbookView *view)
+e_addressbook_view_init (EAddressbookView *view)
{
GtkTargetList *target_list;
- view->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- view, E_TYPE_ADDRESSBOOK_VIEW, EAddressbookViewPrivate);
+ view->priv = E_ADDRESSBOOK_VIEW_GET_PRIVATE (view);
view->priv->model = e_addressbook_model_new ();
@@ -863,7 +878,7 @@ addressbook_view_init (EAddressbookView *view)
}
static void
-addressbook_view_selectable_init (ESelectableInterface *interface)
+e_addressbook_view_selectable_init (ESelectableInterface *interface)
{
interface->update_actions = addressbook_view_update_actions;
interface->cut_clipboard = addressbook_view_cut_clipboard;
@@ -873,42 +888,6 @@ addressbook_view_selectable_init (ESelectableInterface *interface)
interface->select_all = addressbook_view_select_all;
}
-GType
-e_addressbook_view_get_type (void)
-{
- static GType type = 0;
-
- if (G_UNLIKELY (type == 0)) {
- static const GTypeInfo type_info = {
- sizeof (EAddressbookViewClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) addressbook_view_class_init,
- (GClassFinalizeFunc) NULL,
- NULL, /* class_data */
- sizeof (EAddressbookView),
- 0, /* n_preallocs */
- (GInstanceInitFunc) addressbook_view_init,
- NULL /* value_table */
- };
-
- static const GInterfaceInfo selectable_info = {
- (GInterfaceInitFunc) addressbook_view_selectable_init,
- (GInterfaceFinalizeFunc) NULL,
- NULL /* interface_data */
- };
-
- type = g_type_register_static (
- GTK_TYPE_SCROLLED_WINDOW, "EAddressbookView",
- &type_info, 0);
-
- g_type_add_interface_static (
- type, E_TYPE_SELECTABLE, &selectable_info);
- }
-
- return type;
-}
-
GtkWidget *
e_addressbook_view_new (EShellView *shell_view,
ESource *source)
@@ -933,8 +912,9 @@ e_addressbook_view_new (EShellView *shell_view,
g_signal_connect_swapped (
view->priv->model, "folder_bar_message",
G_CALLBACK (folder_bar_message), view);
- g_signal_connect (view->priv->model, "stop_state_changed",
- G_CALLBACK (stop_state_changed), view);
+ g_signal_connect (
+ view->priv->model, "stop_state_changed",
+ G_CALLBACK (stop_state_changed), view);
g_signal_connect_swapped (
view->priv->model, "writable-status",
G_CALLBACK (command_state_change), view);
diff --git a/addressbook/gui/widgets/e-minicard-label.c b/addressbook/gui/widgets/e-minicard-label.c
index c22ffe58a5..88d9458c39 100644
--- a/addressbook/gui/widgets/e-minicard-label.c
+++ b/addressbook/gui/widgets/e-minicard-label.c
@@ -35,8 +35,6 @@
#include <misc/e-canvas-utils.h>
#include <gdk/gdkkeysyms.h>
-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 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);
@@ -71,42 +69,23 @@ enum {
static guint e_minicard_label_signals[LAST_SIGNAL] = {0, };
-GType
-e_minicard_label_get_type (void)
-{
- static GType type = 0;
-
- if (!type) {
- static const GTypeInfo info = {
- sizeof (EMinicardLabelClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) e_minicard_label_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (EMinicardLabel),
- 0, /* n_preallocs */
- (GInstanceInitFunc) e_minicard_label_init,
- };
-
- type = g_type_register_static (gnome_canvas_group_get_type (), "EMinicardLabel", &info, 0);
- }
-
- return type;
-}
+G_DEFINE_TYPE (
+ EMinicardLabel,
+ e_minicard_label,
+ GNOME_TYPE_CANVAS_GROUP)
static void
-e_minicard_label_class_init (EMinicardLabelClass *klass)
+e_minicard_label_class_init (EMinicardLabelClass *class)
{
GObjectClass *object_class;
GnomeCanvasItemClass *item_class;
- object_class = G_OBJECT_CLASS (klass);
- item_class = (GnomeCanvasItemClass *) klass;
+ object_class = G_OBJECT_CLASS (class);
+ item_class = (GnomeCanvasItemClass *) class;
- klass->style_set = e_minicard_label_style_set;
+ class->style_set = e_minicard_label_style_set;
- parent_class = g_type_class_peek_parent (klass);
+ parent_class = g_type_class_peek_parent (class);
object_class->set_property = e_minicard_label_set_property;
object_class->get_property = e_minicard_label_get_property;
diff --git a/addressbook/gui/widgets/e-minicard-view-widget.c b/addressbook/gui/widgets/e-minicard-view-widget.c
index 0a0b19df94..b06e92dbf9 100644
--- a/addressbook/gui/widgets/e-minicard-view-widget.c
+++ b/addressbook/gui/widgets/e-minicard-view-widget.c
@@ -32,9 +32,6 @@
#include "e-util/e-util.h"
#include "e-minicard-view-widget.h"
-static void e_minicard_view_widget_init (EMinicardViewWidget *widget);
-static void e_minicard_view_widget_class_init
- (EMinicardViewWidgetClass *class);
static void e_minicard_view_widget_set_property
(GObject *object,
guint property_id,
@@ -80,30 +77,10 @@ enum {
static guint signals[LAST_SIGNAL] = {0, };
-GType
-e_minicard_view_widget_get_type (void)
-{
- static GType type = 0;
-
- if (!type) {
- static const GTypeInfo info = {
- sizeof (EMinicardViewWidgetClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) e_minicard_view_widget_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (EMinicardViewWidget),
- 0, /* n_preallocs */
- (GInstanceInitFunc) e_minicard_view_widget_init,
- };
-
- type = g_type_register_static (
- E_TYPE_CANVAS, "EMinicardViewWidget", &info, 0);
- }
-
- return type;
-}
+G_DEFINE_TYPE (
+ EMinicardViewWidget,
+ e_minicard_view_widget,
+ E_TYPE_CANVAS)
static void
e_minicard_view_widget_class_init (EMinicardViewWidgetClass *class)
diff --git a/addressbook/gui/widgets/e-minicard-view.c b/addressbook/gui/widgets/e-minicard-view.c
index ba52e7a0a8..a07c5d90bf 100644
--- a/addressbook/gui/widgets/e-minicard-view.c
+++ b/addressbook/gui/widgets/e-minicard-view.c
@@ -48,7 +48,6 @@ static void e_minicard_view_drag_data_get (GtkWidget *widget,
EMinicardView *view);
static EReflowClass *parent_class = NULL;
-#define PARENT_TYPE (E_REFLOW_TYPE)
/* The arguments we take */
enum {
@@ -79,6 +78,8 @@ static GtkTargetEntry drag_types[] = {
{ (gchar *) VCARD_LIST_TYPE, 0, DND_TARGET_TYPE_VCARD_LIST }
};
+G_DEFINE_TYPE (EMinicardView, e_minicard_view, E_TYPE_REFLOW)
+
static void
e_minicard_view_drag_data_get (GtkWidget *widget,
GdkDragContext *context,
@@ -229,8 +230,9 @@ adapter_changed (EMinicardView *view)
{
set_empty_message (view);
- g_signal_connect (view->adapter, "drag_begin",
- G_CALLBACK (e_minicard_view_drag_begin), view);
+ g_signal_connect (
+ view->adapter, "drag_begin",
+ G_CALLBACK (e_minicard_view_drag_begin), view);
}
static void
@@ -275,12 +277,12 @@ e_minicard_view_set_property (GObject *object,
"model", &model,
NULL);
if (model) {
- view->writable_status_id =
- g_signal_connect (model, "writable_status",
- G_CALLBACK (writable_status_change), view);
- view->stop_state_id =
- g_signal_connect (model, "stop_state_changed",
- G_CALLBACK (stop_state_changed), view);
+ view->writable_status_id = g_signal_connect (
+ model, "writable_status",
+ G_CALLBACK (writable_status_change), view);
+ view->stop_state_id = g_signal_connect (
+ model, "stop_state_changed",
+ G_CALLBACK (stop_state_changed), view);
}
}
@@ -466,17 +468,17 @@ e_minicard_view_selection_event (EReflow *reflow,
}
static void
-e_minicard_view_class_init (EMinicardViewClass *klass)
+e_minicard_view_class_init (EMinicardViewClass *class)
{
GObjectClass *object_class;
GnomeCanvasItemClass *item_class;
EReflowClass *reflow_class;
- object_class = G_OBJECT_CLASS (klass);
- item_class = (GnomeCanvasItemClass *) klass;
- reflow_class = (EReflowClass *) klass;
+ object_class = G_OBJECT_CLASS (class);
+ item_class = (GnomeCanvasItemClass *) class;
+ reflow_class = (EReflowClass *) class;
- parent_class = g_type_class_peek_parent (klass);
+ parent_class = g_type_class_peek_parent (class);
object_class->set_property = e_minicard_view_set_property;
object_class->get_property = e_minicard_view_get_property;
@@ -556,31 +558,6 @@ e_minicard_view_init (EMinicardView *view)
set_empty_message (view);
}
-GType
-e_minicard_view_get_type (void)
-{
- static GType reflow_type = 0;
-
- if (!reflow_type) {
- static const GTypeInfo reflow_info = {
- sizeof (EMinicardViewClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) e_minicard_view_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (EMinicardView),
- 0, /* n_preallocs */
- (GInstanceInitFunc) e_minicard_view_init,
- };
-
- reflow_type = g_type_register_static (
- PARENT_TYPE, "EMinicardView", &reflow_info, 0);
- }
-
- return reflow_type;
-}
-
void
e_minicard_view_jump_to_letter (EMinicardView *view,
gunichar letter)
diff --git a/addressbook/gui/widgets/e-minicard.c b/addressbook/gui/widgets/e-minicard.c
index 3c13a0cd71..86a17eca87 100644
--- a/addressbook/gui/widgets/e-minicard.c
+++ b/addressbook/gui/widgets/e-minicard.c
@@ -41,8 +41,6 @@
#include <libebook/e-destination.h>
#include "ea-addressbook.h"
-static void e_minicard_init (EMinicard *card);
-static void e_minicard_class_init (EMinicardClass *class);
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);
@@ -104,29 +102,7 @@ common_location[] =
static guint signals[LAST_SIGNAL] = {0, };
-GType
-e_minicard_get_type (void)
-{
- static GType type = 0;
-
- if (!type) {
- static const GTypeInfo info = {
- sizeof (EMinicardClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) e_minicard_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (EMinicard),
- 0, /* n_preallocs */
- (GInstanceInitFunc) e_minicard_init,
- };
-
- type = g_type_register_static (gnome_canvas_group_get_type (), "EMinicard", &info, 0);
- }
-
- return type;
-}
+G_DEFINE_TYPE (EMinicard, e_minicard, GNOME_TYPE_CANVAS_GROUP)
static void
e_minicard_class_init (EMinicardClass *class)
diff --git a/addressbook/gui/widgets/eab-config.c b/addressbook/gui/widgets/eab-config.c
index 6974df22d1..df91f12802 100644
--- a/addressbook/gui/widgets/eab-config.c
+++ b/addressbook/gui/widgets/eab-config.c
@@ -26,17 +26,22 @@
#include "eab-config.h"
+#define EAB_CONFIG_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), EAB_TYPE_CONFIG, EABConfigPrivate))
+
static GObjectClass *ecp_parent_class;
struct _EABConfigPrivate {
guint source_changed_id;
};
+G_DEFINE_TYPE (EABConfig, eab_config, E_TYPE_CONFIG)
+
static void
-ecp_init (EABConfig *cfg)
+eab_config_init (EABConfig *cfg)
{
- cfg->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- cfg, EAB_TYPE_CONFIG, EABConfigPrivate);
+ cfg->priv = EAB_CONFIG_GET_PRIVATE (cfg);
}
static void
@@ -89,7 +94,7 @@ static void
ecp_set_target (EConfig *ec,
EConfigTarget *t)
{
- struct _EABConfigPrivate *p = EAB_CONFIG (ec)->priv;
+ struct _EABConfigPrivate *p = EAB_CONFIG_GET_PRIVATE (ec);
((EConfigClass *) ecp_parent_class)->set_target (ec, t);
@@ -109,34 +114,15 @@ ecp_set_target (EConfig *ec,
}
static void
-ecp_class_init (GObjectClass *klass)
+eab_config_class_init (EABConfigClass *class)
{
- ((EConfigClass *) klass)->set_target = ecp_set_target;
- ((EConfigClass *) klass)->target_free = ecp_target_free;
+ EConfigClass *config_class;
- g_type_class_add_private (klass, sizeof (struct _EABConfigPrivate));
-}
-
-GType
-eab_config_get_type (void)
-{
- static GType type = 0;
-
- if (!type) {
- static const GTypeInfo info = {
- sizeof (EABConfigClass),
- NULL, NULL,
- (GClassInitFunc) ecp_class_init,
- NULL, NULL,
- sizeof (EABConfig), 0,
- (GInstanceInitFunc) ecp_init
- };
-
- ecp_parent_class = g_type_class_ref (e_config_get_type ());
- type = g_type_register_static (e_config_get_type (), "EABConfig", &info, 0);
- }
+ g_type_class_add_private (class, sizeof (struct _EABConfigPrivate));
- return type;
+ config_class = E_CONFIG_CLASS (class);
+ config_class->set_target = ecp_set_target;
+ config_class->target_free = ecp_target_free;
}
EABConfig *
diff --git a/addressbook/gui/widgets/eab-contact-display.c b/addressbook/gui/widgets/eab-contact-display.c
index 44935c4ca9..8ade5c5026 100644
--- a/addressbook/gui/widgets/eab-contact-display.c
+++ b/addressbook/gui/widgets/eab-contact-display.c
@@ -43,6 +43,10 @@
#include <gtkhtml/gtkhtml-stream.h>
#include <gtkhtml/gtkhtml-embedded.h>
+#define EAB_CONTACT_DISPLAY_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), EAB_TYPE_CONTACT_DISPLAY, EABContactDisplayPrivate))
+
#define TEXT_IS_RIGHT_TO_LEFT \
(gtk_widget_get_default_direction () == GTK_TEXT_DIR_RTL)
@@ -112,6 +116,11 @@ static const gchar *ui =
static gpointer parent_class;
static guint signals[LAST_SIGNAL];
+G_DEFINE_TYPE (
+ EABContactDisplay,
+ eab_contact_display,
+ E_TYPE_WEB_VIEW)
+
static void
contact_display_emit_send_message (EABContactDisplay *display,
gint email_num)
@@ -1163,7 +1172,7 @@ contact_display_dispose (GObject *object)
{
EABContactDisplayPrivate *priv;
- priv = EAB_CONTACT_DISPLAY (object)->priv;
+ priv = EAB_CONTACT_DISPLAY_GET_PRIVATE (object);
if (priv->contact != NULL) {
g_object_unref (priv->contact);
@@ -1355,15 +1364,20 @@ contact_display_object_requested (GtkHTML *html,
GtkWidget *map = e_contact_map_new ();
gtk_container_add (GTK_CONTAINER (eb), map);
gtk_widget_set_size_request (map, 250, 250);
- g_signal_connect (E_CONTACT_MAP (map), "contact-added",
+ g_signal_connect (
+ E_CONTACT_MAP (map), "contact-added",
G_CALLBACK (e_contact_map_zoom_on_marker), NULL);
- g_signal_connect_swapped (E_CONTACT_MAP (map), "contact-added",
+ g_signal_connect_swapped (
+ E_CONTACT_MAP (map), "contact-added",
G_CALLBACK (gtk_widget_show_all), map);
- g_signal_connect (GTK_CHAMPLAIN_EMBED (map), "scroll-event",
+ g_signal_connect (
+ GTK_CHAMPLAIN_EMBED (map), "scroll-event",
G_CALLBACK (handle_map_scroll_event), NULL);
- /* No need to display photo in contact preview ------------------v */
- e_contact_map_add_marker (E_CONTACT_MAP (map), full_name, contact_uid, address, NULL);
+ /* No need to display photo in contact preview. */
+ e_contact_map_add_marker (
+ E_CONTACT_MAP (map), full_name,
+ contact_uid, address, NULL);
}
g_free (full_name);
@@ -1489,8 +1503,7 @@ eab_contact_display_init (EABContactDisplay *display)
const gchar *domain = GETTEXT_PACKAGE;
GError *error = NULL;
- display->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- display, EAB_TYPE_CONTACT_DISPLAY, EABContactDisplayPrivate);
+ display->priv = EAB_CONTACT_DISPLAY_GET_PRIVATE (display);
display->priv->mode = EAB_CONTACT_DISPLAY_RENDER_NORMAL;
display->priv->orientation = GTK_ORIENTATION_HORIZONTAL;
display->priv->show_maps = FALSE;
@@ -1501,8 +1514,9 @@ eab_contact_display_init (EABContactDisplay *display)
ui_manager = e_web_view_get_ui_manager (web_view);
#ifdef WITH_CONTACT_MAPS
- g_signal_connect (web_view, "object-requested",
- G_CALLBACK (contact_display_object_requested), display);
+ g_signal_connect (
+ web_view, "object-requested",
+ G_CALLBACK (contact_display_object_requested), display);
#endif
action_group = gtk_action_group_new ("internal-mailto");
@@ -1522,32 +1536,6 @@ eab_contact_display_init (EABContactDisplay *display)
g_error ("%s", error->message);
}
-GType
-eab_contact_display_get_type (void)
-{
- static GType type = 0;
-
- if (G_UNLIKELY (type == 0)) {
- static const GTypeInfo type_info = {
- sizeof (EABContactDisplayClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) eab_contact_display_class_init,
- (GClassFinalizeFunc) NULL,
- NULL, /* class_data */
- sizeof (EABContactDisplay),
- 0, /* n_preallocs */
- (GInstanceInitFunc) eab_contact_display_init,
- NULL /* value_table */
- };
-
- type = g_type_register_static (
- E_TYPE_WEB_VIEW, "EABContactDisplay", &type_info, 0);
- }
-
- return type;
-}
-
GtkWidget *
eab_contact_display_new (void)
{
diff --git a/addressbook/gui/widgets/eab-gui-util.c b/addressbook/gui/widgets/eab-gui-util.c
index e3b8537caa..12c08d0b22 100644
--- a/addressbook/gui/widgets/eab-gui-util.c
+++ b/addressbook/gui/widgets/eab-gui-util.c
@@ -181,12 +181,19 @@ eab_load_error_dialog (GtkWidget *parent,
}
if (alert_sink) {
- e_alert_submit (alert_sink, "addressbook:load-error", label_string, NULL);
+ e_alert_submit (
+ alert_sink, "addressbook:load-error",
+ label_string, NULL);
} else {
GtkWidget *dialog;
- dialog = e_alert_dialog_new_for_args ((GtkWindow *) parent, "addressbook:load-error", label_string, NULL);
- g_signal_connect (dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL);
+ dialog = e_alert_dialog_new_for_args (
+ (GtkWindow *) parent,
+ "addressbook:load-error",
+ label_string, NULL);
+ g_signal_connect (
+ dialog, "response",
+ G_CALLBACK (gtk_widget_destroy), NULL);
gtk_widget_show (dialog);
}
diff --git a/addressbook/gui/widgets/gal-view-minicard.c b/addressbook/gui/widgets/gal-view-minicard.c
index 280ae7583f..277866a20c 100644
--- a/addressbook/gui/widgets/gal-view-minicard.c
+++ b/addressbook/gui/widgets/gal-view-minicard.c
@@ -35,6 +35,11 @@
static gpointer parent_class;
+G_DEFINE_TYPE (
+ GalViewMinicard,
+ gal_view_minicard,
+ GAL_TYPE_VIEW)
+
static void
view_minicard_column_width_changed (EAddressbookView *address_view,
gdouble width)
@@ -183,32 +188,6 @@ gal_view_minicard_init (GalViewMinicard *gvm)
gvm->emvw_column_width_changed_id = 0;
}
-GType
-gal_view_minicard_get_type (void)
-{
- static GType type = 0;
-
- if (G_UNLIKELY (type == 0)) {
- static const GTypeInfo type_info = {
- sizeof (GalViewMinicardClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) gal_view_minicard_class_init,
- (GClassFinalizeFunc) NULL,
- NULL, /* class_data */
- sizeof (GalViewMinicard),
- 0, /* n_preallocs */
- (GInstanceInitFunc) gal_view_minicard_init,
- NULL /* value_table */
- };
-
- type = g_type_register_static (
- GAL_TYPE_VIEW, "GalViewMinicard", &type_info, 0);
- }
-
- return type;
-}
-
/**
* gal_view_minicard_new
* @title: The name of the new view.
diff --git a/addressbook/printing/e-contact-print.c b/addressbook/printing/e-contact-print.c
index 519f3bc336..0746a431c5 100644
--- a/addressbook/printing/e-contact-print.c
+++ b/addressbook/printing/e-contact-print.c
@@ -380,7 +380,9 @@ contact_compare (EContact *contact1,
field1 = e_contact_get_const (contact1, E_CONTACT_UID);
field2 = e_contact_get_const (contact2, E_CONTACT_UID);
- g_return_val_if_fail (field1 != NULL && field2 != NULL, (field1 != NULL) ? -1 : 1);
+ g_return_val_if_fail (
+ field1 != NULL && field2 != NULL,
+ (field1 != NULL) ? -1 : 1);
return strcmp (field1, field2);
}
diff --git a/calendar/alarm-notify/alarm-notify-dialog.c b/calendar/alarm-notify/alarm-notify-dialog.c
index c9a264d880..eec926cf94 100644
--- a/calendar/alarm-notify/alarm-notify-dialog.c
+++ b/calendar/alarm-notify/alarm-notify-dialog.c
@@ -355,10 +355,18 @@ notified_alarms_dialog_new (void)
gtk_image_set_from_icon_name (
GTK_IMAGE (image), "stock_alarm", GTK_ICON_SIZE_DIALOG);
- g_signal_connect (an->edit_btn, "clicked", G_CALLBACK (edit_pressed_cb), an);
- g_signal_connect (an->print_btn, "clicked", G_CALLBACK (print_pressed_cb), an);
- g_signal_connect (an->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 (
+ an->edit_btn, "clicked",
+ G_CALLBACK (edit_pressed_cb), an);
+ g_signal_connect (
+ an->print_btn, "clicked",
+ G_CALLBACK (print_pressed_cb), an);
+ g_signal_connect (
+ an->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 (
an->dialog, "response",
G_CALLBACK (dialog_response_cb), an);
diff --git a/calendar/alarm-notify/alarm-notify.c b/calendar/alarm-notify/alarm-notify.c
index eeca88e1b6..2c14196a68 100644
--- a/calendar/alarm-notify/alarm-notify.c
+++ b/calendar/alarm-notify/alarm-notify.c
@@ -153,15 +153,20 @@ alarm_notify_list_changed_cb (ESourceList *source_list,
for (q = sources; q != NULL; q = q->next) {
ESource *source = E_SOURCE (q->data);
gchar *uri;
- const gchar *alarm = e_source_get_property (source, "alarm");
+ const gchar *alarm;
+
+ alarm = e_source_get_property (source, "alarm");
if (alarm && (!g_ascii_strcasecmp (alarm, "false") ||
!g_ascii_strcasecmp (alarm, "never")))
continue;
uri = e_source_get_uri (source);
- if (!g_hash_table_lookup (an->priv->uri_client_hash[source_type], uri) &&
- !g_slist_find_custom (an->priv->offline_sources, uri, find_slist_source_uri_cb)) {
+ if (!g_hash_table_lookup (
+ an->priv->uri_client_hash[source_type], uri) &&
+ !g_slist_find_custom (
+ an->priv->offline_sources, uri,
+ find_slist_source_uri_cb)) {
debug (("Adding Calendar %s", uri));
alarm_notify_add_calendar (an, source_type, source);
}
@@ -209,9 +214,13 @@ alarm_notify_load_calendars (AlarmNotify *an,
for (q = sources; q != NULL; q = q->next) {
ESource *source = E_SOURCE (q->data);
gchar *uri;
- const gchar *alarm = e_source_get_property (source, "alarm");
+ const gchar *alarm;
+
+ alarm = e_source_get_property (source, "alarm");
- if (alarm && (!g_ascii_strcasecmp (alarm, "false") || !g_ascii_strcasecmp (alarm, "never")))
+ if (alarm && (
+ !g_ascii_strcasecmp (alarm, "false") ||
+ !g_ascii_strcasecmp (alarm, "never")))
continue;
uri = e_source_get_uri (source);
@@ -421,8 +430,12 @@ client_opened_cb (GObject *source_object,
if (g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_REPOSITORY_OFFLINE)) {
if (an->priv->offline_timeout_id)
g_source_remove (an->priv->offline_timeout_id);
- an->priv->offline_sources = g_slist_append (an->priv->offline_sources, g_object_ref (source));
- an->priv->offline_timeout_id = g_timeout_add_seconds (5 * 60, try_open_offline_timeout_cb, an);
+ an->priv->offline_sources = g_slist_append (
+ an->priv->offline_sources,
+ g_object_ref (source));
+ an->priv->offline_timeout_id =
+ g_timeout_add_seconds (
+ 5 * 60, try_open_offline_timeout_cb, an);
}
g_clear_error (&error);
@@ -520,7 +533,9 @@ alarm_notify_add_calendar (AlarmNotify *an,
client_source_type = E_CLIENT_SOURCE_TYPE_LAST;
}
- g_object_set_data (G_OBJECT (source), "source-type", GUINT_TO_POINTER (source_type));
+ g_object_set_data (
+ G_OBJECT (source), "source-type",
+ GUINT_TO_POINTER (source_type));
e_client_utils_open_new (
source, client_source_type, TRUE, NULL,
@@ -551,7 +566,8 @@ alarm_notify_remove_calendar (AlarmNotify *an,
g_hash_table_remove (priv->uri_client_hash[source_type], str_uri);
}
- in_offline = g_slist_find_custom (priv->offline_sources, str_uri, find_slist_source_uri_cb);
+ in_offline = g_slist_find_custom (
+ priv->offline_sources, str_uri, find_slist_source_uri_cb);
if (in_offline) {
ESource *source = in_offline->data;
diff --git a/calendar/alarm-notify/alarm-queue.c b/calendar/alarm-notify/alarm-queue.c
index f30ce00af7..8cd052952a 100644
--- a/calendar/alarm-notify/alarm-queue.c
+++ b/calendar/alarm-notify/alarm-queue.c
@@ -1140,10 +1140,12 @@ on_dialog_objs_removed_async (struct _query_msg *msg)
if (!id)
continue;
- if (g_strcmp0 (id->uid, our_id->uid) == 0&& g_strcmp0 (id->rid, our_id->rid) == 0) {
+ if (g_strcmp0 (id->uid, our_id->uid) == 0 &&
+ g_strcmp0 (id->rid, our_id->rid) == 0) {
tray_data->cqa = NULL;
tray_data->alarm_id = NULL;
- tray_icons_list = g_list_remove (tray_icons_list, tray_data);
+ tray_icons_list = g_list_remove (
+ tray_icons_list, tray_data);
tray_data = NULL;
}
@@ -2073,16 +2075,18 @@ free_client_alarms_cb (gpointer key,
if (ca->cal_client) {
debug (("Disconnecting Client"));
- g_signal_handlers_disconnect_matched (ca->cal_client, G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL, ca);
+ g_signal_handlers_disconnect_matched (
+ ca->cal_client, G_SIGNAL_MATCH_DATA,
+ 0, 0, NULL, NULL, ca);
g_object_unref (ca->cal_client);
}
if (ca->view) {
debug (("Disconnecting Query"));
- g_signal_handlers_disconnect_matched (ca->view, G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL, ca);
+ g_signal_handlers_disconnect_matched (
+ ca->view, G_SIGNAL_MATCH_DATA,
+ 0, 0, NULL, NULL, ca);
g_object_unref (ca->view);
}
diff --git a/calendar/alarm-notify/config-data.c b/calendar/alarm-notify/config-data.c
index c8348f89fc..3fcbe598a5 100644
--- a/calendar/alarm-notify/config-data.c
+++ b/calendar/alarm-notify/config-data.c
@@ -267,9 +267,11 @@ config_data_set_last_notification_time (ECalClient *cal,
as_text = g_time_val_to_iso8601 (&tmval);
if (as_text) {
- e_source_set_property (source, "last-notified", as_text);
+ e_source_set_property (
+ source, "last-notified", as_text);
g_free (as_text);
- /* pass through, thus the global last notification time is also changed */
+ /* pass through, thus the global last
+ * notification time is also changed */
}
}
}
@@ -342,7 +344,10 @@ config_data_save_blessed_program (const gchar *program)
g_ptr_array_add (array, (gpointer) program);
g_ptr_array_add (array, NULL);
- g_settings_set_strv (calendar_settings, "notify-programs", (const gchar *const *) array->pdata);
+
+ g_settings_set_strv (
+ calendar_settings, "notify-programs",
+ (const gchar *const *) array->pdata);
g_strfreev (list);
g_ptr_array_free (array, TRUE);
diff --git a/calendar/gui/calendar-config.c b/calendar/gui/calendar-config.c
index e293a6e41b..6b7f5b11e2 100644
--- a/calendar/gui/calendar-config.c
+++ b/calendar/gui/calendar-config.c
@@ -162,8 +162,9 @@ calendar_config_add_notification_month_scroll_by_week (CalendarConfigChangedFunc
{
calendar_config_init ();
- g_signal_connect (G_OBJECT (config), "changed::month-scroll-by-week",
- G_CALLBACK (func), data);
+ g_signal_connect (
+ config, "changed::month-scroll-by-week",
+ G_CALLBACK (func), data);
}
/***************************************/
@@ -266,9 +267,13 @@ calendar_config_get_hide_completed_tasks_sexp (gboolean get_completed)
* the query sub-expression. */
isodate = isodate_from_time_t (t);
if (!get_completed)
- sexp = g_strdup_printf ("(not (completed-before? (make-time \"%s\")))", isodate);
+ sexp = g_strdup_printf (
+ "(not (completed-before? "
+ "(make-time \"%s\")))", isodate);
else
- sexp = g_strdup_printf ("(completed-before? (make-time \"%s\"))", isodate);
+ sexp = g_strdup_printf (
+ "(completed-before? "
+ "(make-time \"%s\"))", isodate);
g_free (isodate);
}
}
@@ -296,8 +301,8 @@ calendar_config_get_dir_path (void)
return path;
}
-/* contains list of strings, locations, recently used as the second timezone in a day view.
- * Free with calendar_config_free_day_second_zones. */
+/* contains list of strings, locations, recently used as the second timezone
+ * in a day view. Free with calendar_config_free_day_second_zones. */
GSList *
calendar_config_get_day_second_zones (void)
{
@@ -328,7 +333,8 @@ calendar_config_free_day_second_zones (GSList *zones)
}
}
-/* keeps max 'day_second_zones_max' zones, if 'location' is already in a list, then it'll became first there */
+/* keeps max 'day_second_zones_max' zones, if 'location'
+ * is already in a list, then it'll became first there */
void
calendar_config_set_day_second_zone (const gchar *location)
{
@@ -370,13 +376,17 @@ calendar_config_set_day_second_zone (const gchar *location)
g_ptr_array_add (array, l->data);
g_ptr_array_add (array, NULL);
- g_settings_set_strv (config, "day-second-zones", (const gchar * const *) array->pdata);
+ g_settings_set_strv (
+ config, "day-second-zones",
+ (const gchar * const *) array->pdata);
calendar_config_free_day_second_zones (lst);
g_ptr_array_free (array, FALSE);
}
- g_settings_set_string (config, "day-second-zone", location ? location : "");
+ g_settings_set_string (
+ config, "day-second-zone",
+ (location != NULL) ? location : "");
}
/* location of the second time zone user has selected. Free with g_free. */
@@ -431,8 +441,9 @@ calendar_config_add_notification_day_second_zone (CalendarConfigChangedFunc func
{
calendar_config_init ();
- g_signal_connect (G_OBJECT (config), "changed::day-second-zone",
- G_CALLBACK (func), data);
+ g_signal_connect (
+ config, "changed::day-second-zone",
+ G_CALLBACK (func), data);
}
gboolean
@@ -446,7 +457,8 @@ calendar_config_get_prefer_meeting (void)
shell = e_shell_get_default ();
shell_settings = e_shell_get_shell_settings (shell);
- prefer_new_item = e_shell_settings_get_string (shell_settings, "cal-prefer-new-item");
+ prefer_new_item = e_shell_settings_get_string (
+ shell_settings, "cal-prefer-new-item");
prefer_meeting = g_strcmp0 (prefer_new_item, "event-meeting-new") == 0;
g_free (prefer_new_item);
diff --git a/calendar/gui/calendar-view-factory.c b/calendar/gui/calendar-view-factory.c
index 8342475620..0d1908e79b 100644
--- a/calendar/gui/calendar-view-factory.c
+++ b/calendar/gui/calendar-view-factory.c
@@ -30,13 +30,15 @@
#include "calendar-view-factory.h"
#include "calendar-view.h"
-/* Private part of the CalendarViewFactory structure */
+#define CALENDAR_VIEW_FACTORY_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), TYPE_CALENDAR_VIEW_FACTORY, CalendarViewFactoryPrivate))
+
struct _CalendarViewFactoryPrivate {
/* Type of views created by this factory */
GnomeCalendarViewType view_type;
};
-static void calendar_view_factory_finalize (GObject *object);
static const gchar *
calendar_view_factory_get_title (GalViewFactory *factory);
static const gchar *
@@ -46,53 +48,29 @@ static GalView *
calendar_view_factory_new_view (GalViewFactory *factory,
const gchar *name);
-G_DEFINE_TYPE (CalendarViewFactory, calendar_view_factory, GAL_TYPE_VIEW_FACTORY)
+G_DEFINE_TYPE (
+ CalendarViewFactory,
+ calendar_view_factory,
+ GAL_TYPE_VIEW_FACTORY)
-/* Class initialization function for the calendar view factory */
static void
calendar_view_factory_class_init (CalendarViewFactoryClass *class)
{
GalViewFactoryClass *gal_view_factory_class;
- GObjectClass *gobject_class;
- gal_view_factory_class = (GalViewFactoryClass *) class;
- gobject_class = (GObjectClass *) class;
+ g_type_class_add_private (class, sizeof (CalendarViewFactoryPrivate));
+ gal_view_factory_class = GAL_VIEW_FACTORY_CLASS (class);
gal_view_factory_class->get_title = calendar_view_factory_get_title;
gal_view_factory_class->get_type_code = calendar_view_factory_get_type_code;
gal_view_factory_class->new_view = calendar_view_factory_new_view;
-
- gobject_class->finalize = calendar_view_factory_finalize;
}
-/* Object initialization class for the calendar view factory */
static void
calendar_view_factory_init (CalendarViewFactory *cal_view_factory)
{
- CalendarViewFactoryPrivate *priv;
-
- priv = g_new0 (CalendarViewFactoryPrivate, 1);
- cal_view_factory->priv = priv;
-}
-
-/* Finalize method for the calendar view factory */
-static void
-calendar_view_factory_finalize (GObject *object)
-{
- CalendarViewFactory *cal_view_factory;
- CalendarViewFactoryPrivate *priv;
-
- g_return_if_fail (object != NULL);
- g_return_if_fail (IS_CALENDAR_VIEW_FACTORY (object));
-
- cal_view_factory = CALENDAR_VIEW_FACTORY (object);
- priv = cal_view_factory->priv;
-
- g_free (priv);
- cal_view_factory->priv = NULL;
-
- /* Chain up to parent's finalize() method. */
- G_OBJECT_CLASS (calendar_view_factory_parent_class)->finalize (object);
+ cal_view_factory->priv =
+ CALENDAR_VIEW_FACTORY_GET_PRIVATE (cal_view_factory);
}
/* get_title method for the calendar view factory */
diff --git a/calendar/gui/calendar-view.c b/calendar/gui/calendar-view.c
index 6f9f2951f3..344f4c3856 100644
--- a/calendar/gui/calendar-view.c
+++ b/calendar/gui/calendar-view.c
@@ -28,7 +28,10 @@
#include "calendar-view.h"
-/* Private part of the CalendarView structure */
+#define CALENDAR_VIEW_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), TYPE_CALENDAR_VIEW, CalendarViewPrivate))
+
struct _CalendarViewPrivate {
/* Type of the view */
GnomeCalendarViewType view_type;
@@ -55,6 +58,8 @@ calendar_view_class_init (CalendarViewClass *class)
GalViewClass *gal_view_class;
GObjectClass *object_class;
+ g_type_class_add_private (class, sizeof (CalendarViewPrivate));
+
gal_view_class = (GalViewClass *) class;
object_class = (GObjectClass *) class;
@@ -73,34 +78,18 @@ calendar_view_class_init (CalendarViewClass *class)
static void
calendar_view_init (CalendarView *cal_view)
{
- CalendarViewPrivate *priv;
-
- priv = g_new0 (CalendarViewPrivate, 1);
- cal_view->priv = priv;
-
- priv->title = NULL;
+ cal_view->priv = CALENDAR_VIEW_GET_PRIVATE (cal_view);
}
/* Destroy method for the calendar view */
static void
calendar_view_finalize (GObject *object)
{
- CalendarView *cal_view;
CalendarViewPrivate *priv;
- g_return_if_fail (object != NULL);
- g_return_if_fail (IS_CALENDAR_VIEW (object));
-
- cal_view = CALENDAR_VIEW (object);
- priv = cal_view->priv;
-
- if (priv->title) {
- g_free (priv->title);
- priv->title = NULL;
- }
+ priv = CALENDAR_VIEW_GET_PRIVATE (object);
- g_free (priv);
- cal_view->priv = NULL;
+ g_free (priv->title);
/* Chain up to parent's finalize() method. */
G_OBJECT_CLASS (calendar_view_parent_class)->finalize (object);
diff --git a/calendar/gui/dialogs/alarm-dialog.c b/calendar/gui/dialogs/alarm-dialog.c
index d18594e826..065d11b9b5 100644
--- a/calendar/gui/dialogs/alarm-dialog.c
+++ b/calendar/gui/dialogs/alarm-dialog.c
@@ -927,8 +927,9 @@ setup_select_names (Dialog *dialog)
G_CALLBACK (addressbook_clicked_cb), dialog);
name_selector_dialog = e_name_selector_peek_dialog (dialog->name_selector);
- g_signal_connect (name_selector_dialog, "response",
- G_CALLBACK (addressbook_response_cb), dialog);
+ g_signal_connect (
+ name_selector_dialog, "response",
+ G_CALLBACK (addressbook_response_cb), dialog);
return TRUE;
}
@@ -1208,8 +1209,9 @@ init_widgets (Dialog *dialog)
text_buffer, "changed",
G_CALLBACK (malarm_description_changed_cb), dialog);
- g_signal_connect (dialog->malarm_addresses, "changed",
- G_CALLBACK (malarm_addresses_changed_cb), dialog);
+ g_signal_connect (
+ dialog->malarm_addresses, "changed",
+ G_CALLBACK (malarm_addresses_changed_cb), dialog);
}
gboolean
diff --git a/calendar/gui/dialogs/calendar-setup.c b/calendar/gui/dialogs/calendar-setup.c
index 8aa82c29e5..377fd5ca7e 100644
--- a/calendar/gui/dialogs/calendar-setup.c
+++ b/calendar/gui/dialogs/calendar-setup.c
@@ -206,7 +206,9 @@ eccp_get_source_type (EConfig *ec,
gtk_cell_layout_set_attributes ((GtkCellLayout *) type, cell, "text", 0, NULL);
gtk_combo_box_set_model ((GtkComboBox *) type, (GtkTreeModel *) store);
gtk_combo_box_set_active ((GtkComboBox *) type, active);
- g_signal_connect (type, "changed", G_CALLBACK (eccp_type_changed), sdialog);
+ 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_label_set_mnemonic_widget (GTK_LABEL (label), type);
@@ -318,7 +320,9 @@ eccp_general_offline (EConfig *ec,
offline_setting = gtk_check_button_new_with_mnemonic (_("Cop_y memo list contents locally for offline operation"));
gtk_widget_show (offline_setting);
- g_signal_connect (offline_setting, "toggled", G_CALLBACK (offline_status_changed_cb), sdialog);
+ 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);
}
@@ -365,7 +369,9 @@ 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);
+ 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);
return reminder_setting;
diff --git a/calendar/gui/dialogs/comp-editor-page.c b/calendar/gui/dialogs/comp-editor-page.c
index 3d8af28153..2f4e942bf1 100644
--- a/calendar/gui/dialogs/comp-editor-page.c
+++ b/calendar/gui/dialogs/comp-editor-page.c
@@ -31,6 +31,10 @@
#include "comp-editor.h"
#include "comp-editor-page.h"
+#define COMP_EDITOR_PAGE_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), TYPE_COMP_EDITOR_PAGE, CompEditorPagePrivate))
+
struct _CompEditorPagePrivate {
CompEditor *editor; /* not referenced */
gboolean updating;
@@ -50,6 +54,8 @@ enum {
static gpointer parent_class;
static guint comp_editor_page_signals[LAST_SIGNAL];
+G_DEFINE_TYPE (CompEditorPage, comp_editor_page, G_TYPE_OBJECT)
+
static void
comp_editor_page_set_property (GObject *object,
guint property_id,
@@ -58,7 +64,7 @@ comp_editor_page_set_property (GObject *object,
{
CompEditorPagePrivate *priv;
- priv = COMP_EDITOR_PAGE (object)->priv;
+ priv = COMP_EDITOR_PAGE_GET_PRIVATE (object);
switch (property_id) {
case PROP_EDITOR:
@@ -163,36 +169,7 @@ comp_editor_page_class_init (CompEditorPageClass *class)
static void
comp_editor_page_init (CompEditorPage *page)
{
- page->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- page, TYPE_COMP_EDITOR_PAGE, CompEditorPagePrivate);
-
- page->accel_group = NULL;
-}
-
-GType
-comp_editor_page_get_type (void)
-{
- static GType type = 0;
-
- if (G_UNLIKELY (type == 0)) {
- static const GTypeInfo type_info = {
- sizeof (CompEditorPageClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) comp_editor_page_class_init,
- (GClassFinalizeFunc) NULL,
- NULL, /* class_data */
- sizeof (CompEditorPage),
- 0, /* n_preallocs */
- (GInstanceInitFunc) comp_editor_page_init,
- NULL /* value_table */
- };
-
- type = g_type_register_static (
- G_TYPE_OBJECT, "CompEditorPage", &type_info, 0);
- }
-
- return type;
+ page->priv = COMP_EDITOR_PAGE_GET_PRIVATE (page);
}
/**
diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c
index e3676e60c2..f148f1e15e 100644
--- a/calendar/gui/dialogs/comp-editor.c
+++ b/calendar/gui/dialogs/comp-editor.c
@@ -64,6 +64,10 @@
#include "e-util/e-alert-dialog.h"
#include "e-util/e-ui-manager.h"
+#define COMP_EDITOR_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), TYPE_COMP_EDITOR, CompEditorPrivate))
+
#define d(x)
/* Private part of the CompEditor structure */
@@ -1522,7 +1526,7 @@ comp_editor_dispose (GObject *object)
{
CompEditorPrivate *priv;
- priv = COMP_EDITOR (object)->priv;
+ priv = COMP_EDITOR_GET_PRIVATE (object);
if (priv->shell != NULL) {
g_object_remove_weak_pointer (
@@ -1602,7 +1606,7 @@ comp_editor_finalize (GObject *object)
{
CompEditorPrivate *priv;
- priv = COMP_EDITOR (object)->priv;
+ priv = COMP_EDITOR_GET_PRIVATE (object);
g_object_unref (priv->calendar_settings);
g_free (priv->summary);
@@ -1700,7 +1704,7 @@ comp_editor_drag_motion (GtkWidget *widget,
CompEditorPrivate *priv;
EAttachmentView *view;
- priv = COMP_EDITOR (widget)->priv;
+ priv = COMP_EDITOR_GET_PRIVATE (widget);
view = E_ATTACHMENT_VIEW (priv->attachment_view);
return e_attachment_view_drag_motion (view, context, x, y, time);
@@ -1718,7 +1722,7 @@ comp_editor_drag_data_received (GtkWidget *widget,
CompEditorPrivate *priv;
EAttachmentView *view;
- priv = COMP_EDITOR (widget)->priv;
+ priv = COMP_EDITOR_GET_PRIVATE (widget);
view = E_ATTACHMENT_VIEW (priv->attachment_view);
/* Forward the data to the attachment view. Note that calling
@@ -1936,8 +1940,7 @@ comp_editor_init (CompEditor *editor)
express_mode = e_shell_get_express_mode (shell);
meego_mode = e_shell_get_meego_mode (shell);
- editor->priv = priv = G_TYPE_INSTANCE_GET_PRIVATE (
- editor, TYPE_COMP_EDITOR, CompEditorPrivate);
+ editor->priv = priv = COMP_EDITOR_GET_PRIVATE (editor);
g_object_weak_ref (
G_OBJECT (editor), (GWeakNotify)
diff --git a/calendar/gui/dialogs/delete-comp.c b/calendar/gui/dialogs/delete-comp.c
index 87330ed0dd..4ad1bf7451 100644
--- a/calendar/gui/dialogs/delete-comp.c
+++ b/calendar/gui/dialogs/delete-comp.c
@@ -228,7 +228,9 @@ prompt_retract_dialog (ECalComponent *comp,
gtk_label_set_mnemonic_widget ((GtkLabel *) label, entry);
gtk_container_add (GTK_CONTAINER (frame), sw);
- g_signal_connect ((GtkToggleButton *)cb, "toggled", G_CALLBACK (cb_toggled_cb), entry);
+ g_signal_connect (
+ cb, "toggled",
+ G_CALLBACK (cb_toggled_cb), entry);
gtk_widget_show_all ((GtkWidget *) dialog);
diff --git a/calendar/gui/dialogs/e-delegate-dialog.c b/calendar/gui/dialogs/e-delegate-dialog.c
index fc7ae7d121..9b9d7b4bbd 100644
--- a/calendar/gui/dialogs/e-delegate-dialog.c
+++ b/calendar/gui/dialogs/e-delegate-dialog.c
@@ -34,6 +34,10 @@
#include "e-util/e-util-private.h"
#include "e-delegate-dialog.h"
+#define E_DELEGATE_DIALOG_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_DELEGATE_DIALOG, EDelegateDialogPrivate))
+
struct _EDelegateDialogPrivate {
gchar *name;
gchar *address;
@@ -51,68 +55,50 @@ struct _EDelegateDialogPrivate {
static const gchar *section_name = "Delegate To";
-static void e_delegate_dialog_finalize (GObject *object);
-
static gboolean get_widgets (EDelegateDialog *edd);
static void addressbook_clicked_cb (GtkWidget *widget, gpointer data);
static void addressbook_response_cb (GtkWidget *widget, gint response, gpointer data);
G_DEFINE_TYPE (EDelegateDialog, e_delegate_dialog, G_TYPE_OBJECT)
-/* Class initialization function for the event editor */
-static void
-e_delegate_dialog_class_init (EDelegateDialogClass *class)
-{
- GObjectClass *gobject_class;
-
- gobject_class = (GObjectClass *) class;
-
- gobject_class->finalize = e_delegate_dialog_finalize;
-}
-
-/* Object initialization function for the event editor */
-static void
-e_delegate_dialog_init (EDelegateDialog *edd)
-{
- EDelegateDialogPrivate *priv;
-
- priv = g_new0 (EDelegateDialogPrivate, 1);
- edd->priv = priv;
-
- priv->address = NULL;
-}
-
-/* Destroy handler for the event editor */
static void
e_delegate_dialog_finalize (GObject *object)
{
- EDelegateDialog *edd;
EDelegateDialogPrivate *priv;
GtkWidget *dialog;
- g_return_if_fail (object != NULL);
- g_return_if_fail (E_IS_DELEGATE_DIALOG (object));
-
- edd = E_DELEGATE_DIALOG (object);
- priv = edd->priv;
+ priv = E_DELEGATE_DIALOG_GET_PRIVATE (object);
e_name_selector_cancel_loading (priv->name_selector);
g_object_unref (priv->name_selector);
/* Destroy the actual dialog. */
- dialog = e_delegate_dialog_get_toplevel (edd);
+ dialog = e_delegate_dialog_get_toplevel (E_DELEGATE_DIALOG (object));
gtk_widget_destroy (dialog);
g_free (priv->address);
- priv->address = NULL;
-
- g_free (priv);
- edd->priv = NULL;
/* Chain up to parent's finalize() method. */
G_OBJECT_CLASS (e_delegate_dialog_parent_class)->finalize (object);
}
+static void
+e_delegate_dialog_class_init (EDelegateDialogClass *class)
+{
+ GObjectClass *object_class;
+
+ g_type_class_add_private (class, sizeof (EDelegateDialogPrivate));
+
+ object_class = G_OBJECT_CLASS (class);
+ object_class->finalize = e_delegate_dialog_finalize;
+}
+
+static void
+e_delegate_dialog_init (EDelegateDialog *edd)
+{
+ edd->priv = E_DELEGATE_DIALOG_GET_PRIVATE (edd);
+}
+
EDelegateDialog *
e_delegate_dialog_construct (EDelegateDialog *edd,
const gchar *name,
@@ -158,11 +144,14 @@ e_delegate_dialog_construct (EDelegateDialog *edd,
e_destination_store_append_destination (destination_store, dest);
g_object_unref (dest);
- g_signal_connect ((priv->addressbook), "clicked",
- G_CALLBACK (addressbook_clicked_cb), edd);
+ g_signal_connect (
+ priv->addressbook, "clicked",
+ G_CALLBACK (addressbook_clicked_cb), edd);
name_selector_dialog = e_name_selector_peek_dialog (priv->name_selector);
- g_signal_connect (name_selector_dialog, "response", G_CALLBACK (addressbook_response_cb), edd);
+ g_signal_connect (
+ name_selector_dialog, "response",
+ G_CALLBACK (addressbook_response_cb), edd);
return edd;
@@ -242,7 +231,6 @@ e_delegate_dialog_get_delegate (EDelegateDialog *edd)
GList *destinations;
EDestination *destination;
- g_return_val_if_fail (edd != NULL, NULL);
g_return_val_if_fail (E_IS_DELEGATE_DIALOG (edd), NULL);
priv = edd->priv;
@@ -273,7 +261,6 @@ e_delegate_dialog_get_delegate_name (EDelegateDialog *edd)
GList *destinations;
EDestination *destination;
- g_return_val_if_fail (edd != NULL, NULL);
g_return_val_if_fail (E_IS_DELEGATE_DIALOG (edd), NULL);
priv = edd->priv;
@@ -298,13 +285,8 @@ e_delegate_dialog_get_delegate_name (EDelegateDialog *edd)
GtkWidget *
e_delegate_dialog_get_toplevel (EDelegateDialog *edd)
{
- EDelegateDialogPrivate *priv;
-
- g_return_val_if_fail (edd != NULL, NULL);
g_return_val_if_fail (E_IS_DELEGATE_DIALOG (edd), NULL);
- priv = edd->priv;
-
- return priv->app;
+ return edd->priv->app;
}
diff --git a/calendar/gui/dialogs/event-editor.c b/calendar/gui/dialogs/event-editor.c
index 79e951244e..7d679e6bbf 100644
--- a/calendar/gui/dialogs/event-editor.c
+++ b/calendar/gui/dialogs/event-editor.c
@@ -43,6 +43,10 @@
#include "cancel-comp.h"
#include "event-editor.h"
+#define EVENT_EDITOR_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), TYPE_EVENT_EDITOR, EventEditorPrivate))
+
struct _EventEditorPrivate {
EventPage *event_page;
RecurrencePage *recur_page;
@@ -117,7 +121,7 @@ create_schedule_page (CompEditor *editor)
CompEditorPage *page;
GtkWidget *content_area;
- priv = EVENT_EDITOR (editor)->priv;
+ priv = EVENT_EDITOR_GET_PRIVATE (editor);
priv->sched_window = gtk_dialog_new_with_buttons (
_("Free/Busy"), GTK_WINDOW (editor), GTK_DIALOG_DESTROY_WITH_PARENT,
@@ -296,7 +300,7 @@ event_editor_constructor (GType type,
type, n_construct_properties, construct_properties);
editor = COMP_EDITOR (object);
- priv = EVENT_EDITOR (object)->priv;
+ priv = EVENT_EDITOR_GET_PRIVATE (object);
shell = comp_editor_get_shell (editor);
@@ -394,7 +398,7 @@ event_editor_dispose (GObject *object)
{
EventEditorPrivate *priv;
- priv = EVENT_EDITOR (object)->priv;
+ priv = EVENT_EDITOR_GET_PRIVATE (object);
if (priv->event_page) {
g_object_unref (priv->event_page);
@@ -427,7 +431,7 @@ event_editor_constructed (GObject *object)
{
EventEditorPrivate *priv;
- priv = EVENT_EDITOR (object)->priv;
+ priv = EVENT_EDITOR_GET_PRIVATE (object);
g_object_bind_property (
object, "client",
@@ -444,7 +448,7 @@ event_editor_show_categories (CompEditor *editor,
{
EventEditorPrivate *priv;
- priv = EVENT_EDITOR (editor)->priv;
+ priv = EVENT_EDITOR_GET_PRIVATE (editor);
event_page_set_show_categories (priv->event_page, visible);
}
@@ -455,7 +459,7 @@ event_editor_show_role (CompEditor *editor,
{
EventEditorPrivate *priv;
- priv = EVENT_EDITOR (editor)->priv;
+ priv = EVENT_EDITOR_GET_PRIVATE (editor);
event_page_set_view_role (priv->event_page, visible);
}
@@ -466,7 +470,7 @@ event_editor_show_rsvp (CompEditor *editor,
{
EventEditorPrivate *priv;
- priv = EVENT_EDITOR (editor)->priv;
+ priv = EVENT_EDITOR_GET_PRIVATE (editor);
event_page_set_view_rsvp (priv->event_page, visible);
}
@@ -477,7 +481,7 @@ event_editor_show_status (CompEditor *editor,
{
EventEditorPrivate *priv;
- priv = EVENT_EDITOR (editor)->priv;
+ priv = EVENT_EDITOR_GET_PRIVATE (editor);
event_page_set_view_status (priv->event_page, visible);
}
@@ -488,7 +492,7 @@ event_editor_show_time_zone (CompEditor *editor,
{
EventEditorPrivate *priv;
- priv = EVENT_EDITOR (editor)->priv;
+ priv = EVENT_EDITOR_GET_PRIVATE (editor);
event_page_set_show_timezone (priv->event_page, visible);
}
@@ -499,7 +503,7 @@ event_editor_show_type (CompEditor *editor,
{
EventEditorPrivate *priv;
- priv = EVENT_EDITOR (editor)->priv;
+ priv = EVENT_EDITOR_GET_PRIVATE (editor);
event_page_set_view_type (priv->event_page, visible);
}
@@ -539,8 +543,7 @@ event_editor_init (EventEditor *ee)
const gchar *id;
GError *error = NULL;
- ee->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- ee, TYPE_EVENT_EDITOR, EventEditorPrivate);
+ ee->priv = EVENT_EDITOR_GET_PRIVATE (ee);
ee->priv->model = E_MEETING_STORE (e_meeting_store_new ());
ee->priv->meeting_shown = TRUE;
ee->priv->updating = FALSE;
@@ -607,7 +610,7 @@ event_editor_edit_comp (CompEditor *editor,
ECalClient *client;
GSList *attendees = NULL;
- priv = EVENT_EDITOR (editor)->priv;
+ priv = EVENT_EDITOR_GET_PRIVATE (editor);
priv->updating = TRUE;
delegate = (comp_editor_get_flags (COMP_EDITOR (editor)) & COMP_EDITOR_DELEGATE);
@@ -717,7 +720,7 @@ event_editor_send_comp (CompEditor *editor,
EventEditorPrivate *priv;
ECalComponent *comp = NULL;
- priv = EVENT_EDITOR (editor)->priv;
+ priv = EVENT_EDITOR_GET_PRIVATE (editor);
/* Don't cancel more than once or when just publishing */
if (method == E_CAL_COMPONENT_METHOD_PUBLISH ||
diff --git a/calendar/gui/dialogs/event-page.c b/calendar/gui/dialogs/event-page.c
index a5c0ac6355..086f3ef494 100644
--- a/calendar/gui/dialogs/event-page.c
+++ b/calendar/gui/dialogs/event-page.c
@@ -68,6 +68,10 @@
(G_TYPE_INSTANCE_GET_PRIVATE \
((obj), TYPE_EVENT_PAGE, EventPagePrivate))
+#define EVENT_PAGE_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), TYPE_EVENT_PAGE, EventPagePrivate))
+
enum {
ALARM_NONE,
ALARM_15_MINUTES,
@@ -3195,8 +3199,9 @@ init_widgets (EventPage *epage)
gtk_widget_hide (priv->info_hbox);
/* Summary */
- g_signal_connect ((priv->summary), "changed",
- G_CALLBACK (summary_changed_cb), epage);
+ g_signal_connect (
+ priv->summary, "changed",
+ G_CALLBACK (summary_changed_cb), epage);
/* Description */
text_buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (priv->description));
@@ -3206,18 +3211,23 @@ init_widgets (EventPage *epage)
e_buffer_tagger_connect (GTK_TEXT_VIEW (priv->description));
/* Start and end times */
- g_signal_connect (priv->start_time, "changed",
- G_CALLBACK (start_date_changed_cb), epage);
- g_signal_connect (priv->end_time, "changed",
- G_CALLBACK (end_date_changed_cb), epage);
+ g_signal_connect (
+ priv->start_time, "changed",
+ G_CALLBACK (start_date_changed_cb), epage);
+ g_signal_connect (
+ priv->end_time, "changed",
+ G_CALLBACK (end_date_changed_cb), epage);
/* Categories */
- g_signal_connect ((priv->categories_btn), "clicked",
- G_CALLBACK (categories_clicked_cb), epage);
+ g_signal_connect (
+ priv->categories_btn, "clicked",
+ G_CALLBACK (categories_clicked_cb), epage);
/* Source selector */
- g_signal_connect ((priv->source_selector), "changed",
- G_CALLBACK (source_changed_cb), epage);
+ g_signal_connect (
+ priv->source_selector, "changed",
+ G_CALLBACK (source_changed_cb), epage);
+
/* Alarms */
priv->alarm_list_store = e_alarm_list_new ();
g_signal_connect_swapped (
@@ -3231,8 +3241,9 @@ init_widgets (EventPage *epage)
G_CALLBACK (comp_editor_page_changed), epage);
/* Timezone changed */
- g_signal_connect ((priv->start_timezone), "changed",
- G_CALLBACK (start_timezone_changed_cb), epage);
+ g_signal_connect (
+ priv->start_timezone, "changed",
+ G_CALLBACK (start_timezone_changed_cb), epage);
e_meeting_list_view_column_set_visible (
priv->list_view, E_MEETING_STORE_ATTENDEE_COL, TRUE);
@@ -3301,7 +3312,9 @@ init_widgets (EventPage *epage)
gtk_window_set_modal (GTK_WINDOW (priv->alarm_dialog), TRUE);
/* Meeting List View */
- g_signal_connect (priv->list_view, "attendee_added", G_CALLBACK (attendee_added_cb), epage);
+ g_signal_connect (
+ priv->list_view, "attendee_added",
+ G_CALLBACK (attendee_added_cb), epage);
gtk_widget_show (GTK_WIDGET (priv->list_view));
@@ -3319,13 +3332,19 @@ init_widgets (EventPage *epage)
gtk_combo_box_set_active (GTK_COMBO_BOX (priv->end_time_combo), 1);
gtk_widget_hide (priv->time_hour);
gtk_widget_show (priv->end_time);
- g_signal_connect (priv->end_time_combo, "changed", G_CALLBACK (time_sel_changed), epage);
+ g_signal_connect (
+ priv->end_time_combo, "changed",
+ G_CALLBACK (time_sel_changed), epage);
update_end_time_combo ( epage);
/* Hour and Minute selector */
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);
+ 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);
/* Add the user defined time if necessary */
priv->alarm_units =
diff --git a/calendar/gui/dialogs/memo-editor.c b/calendar/gui/dialogs/memo-editor.c
index e7dd1e7f93..ae0d351618 100644
--- a/calendar/gui/dialogs/memo-editor.c
+++ b/calendar/gui/dialogs/memo-editor.c
@@ -38,6 +38,10 @@
#include "cancel-comp.h"
#include "memo-editor.h"
+#define MEMO_EDITOR_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), TYPE_MEMO_EDITOR, MemoEditorPrivate))
+
struct _MemoEditorPrivate {
MemoPage *memo_page;
@@ -69,7 +73,7 @@ memo_editor_show_categories (CompEditor *editor,
{
MemoEditorPrivate *priv;
- priv = MEMO_EDITOR (editor)->priv;
+ priv = MEMO_EDITOR_GET_PRIVATE (editor);
memo_page_set_show_categories (priv->memo_page, visible);
}
@@ -79,7 +83,7 @@ memo_editor_dispose (GObject *object)
{
MemoEditorPrivate *priv;
- priv = MEMO_EDITOR (object)->priv;
+ priv = MEMO_EDITOR_GET_PRIVATE (object);
if (priv->memo_page) {
g_object_unref (priv->memo_page);
@@ -96,7 +100,7 @@ memo_editor_constructed (GObject *object)
MemoEditorPrivate *priv;
CompEditor *editor;
- priv = MEMO_EDITOR (object)->priv;
+ priv = MEMO_EDITOR_GET_PRIVATE (object);
editor = COMP_EDITOR (object);
priv->memo_page = memo_page_new (editor);
@@ -136,8 +140,7 @@ memo_editor_init (MemoEditor *me)
const gchar *id;
GError *error = NULL;
- me->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- me, TYPE_MEMO_EDITOR, MemoEditorPrivate);
+ me->priv = MEMO_EDITOR_GET_PRIVATE (me);
me->priv->updating = FALSE;
ui_manager = comp_editor_get_ui_manager (editor);
diff --git a/calendar/gui/dialogs/memo-page.c b/calendar/gui/dialogs/memo-page.c
index bf60445001..5348a19328 100644
--- a/calendar/gui/dialogs/memo-page.c
+++ b/calendar/gui/dialogs/memo-page.c
@@ -57,6 +57,10 @@
#include "e-send-options-utils.h"
#include "memo-page.h"
+#define MEMO_PAGE_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), TYPE_MEMO_PAGE, MemoPagePrivate))
+
/* Private part of the MemoPage structure */
struct _MemoPagePrivate {
GtkBuilder *builder;
@@ -190,7 +194,7 @@ memo_page_dispose (GObject *object)
{
MemoPagePrivate *priv;
- priv = MEMO_PAGE (object)->priv;
+ priv = MEMO_PAGE_GET_PRIVATE (object);
if (priv->open_cancellable) {
g_cancellable_cancel (priv->open_cancellable);
@@ -213,7 +217,7 @@ memo_page_finalize (GObject *object)
{
MemoPagePrivate *priv;
- priv = MEMO_PAGE (object)->priv;
+ priv = MEMO_PAGE_GET_PRIVATE (object);
if (priv->name_selector) {
e_name_selector_cancel_loading (priv->name_selector);
@@ -240,7 +244,7 @@ memo_page_finalize (GObject *object)
static GtkWidget *
memo_page_get_widget (CompEditorPage *page)
{
- MemoPagePrivate *priv = MEMO_PAGE (page)->priv;
+ MemoPagePrivate *priv = MEMO_PAGE_GET_PRIVATE (page);
return priv->main;
}
@@ -248,7 +252,7 @@ memo_page_get_widget (CompEditorPage *page)
static void
memo_page_focus_main_widget (CompEditorPage *page)
{
- MemoPagePrivate *priv = MEMO_PAGE (page)->priv;
+ MemoPagePrivate *priv = MEMO_PAGE_GET_PRIVATE (page);
gtk_widget_grab_focus (priv->summary_entry);
}
@@ -398,9 +402,7 @@ memo_page_class_init (MemoPageClass *class)
static void
memo_page_init (MemoPage *mpage)
{
- mpage->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- mpage, TYPE_MEMO_PAGE, MemoPagePrivate);
- mpage->priv->open_cancellable = NULL;
+ mpage->priv = MEMO_PAGE_GET_PRIVATE (mpage);
}
/* returns whether changed info text */
diff --git a/calendar/gui/dialogs/recurrence-page.c b/calendar/gui/dialogs/recurrence-page.c
index 54dee77f44..5658cd0fb3 100644
--- a/calendar/gui/dialogs/recurrence-page.c
+++ b/calendar/gui/dialogs/recurrence-page.c
@@ -46,6 +46,10 @@
#include "e-util/e-dialog-widgets.h"
#include "e-util/e-util-private.h"
+#define RECURRENCE_PAGE_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), TYPE_RECURRENCE_PAGE, RecurrencePagePrivate))
+
enum month_num_options {
MONTH_NUM_FIRST,
MONTH_NUM_SECOND,
@@ -297,7 +301,7 @@ recurrence_page_dispose (GObject *object)
{
RecurrencePagePrivate *priv;
- priv = RECURRENCE_PAGE (object)->priv;
+ priv = RECURRENCE_PAGE_GET_PRIVATE (object);
if (priv->main != NULL) {
g_object_unref (priv->main);
@@ -339,7 +343,7 @@ recurrence_page_finalize (GObject *object)
{
RecurrencePagePrivate *priv;
- priv = RECURRENCE_PAGE (object)->priv;
+ priv = RECURRENCE_PAGE_GET_PRIVATE (object);
g_signal_handlers_disconnect_matched (
E_CALENDAR (priv->preview_calendar)->calitem,
@@ -383,8 +387,7 @@ recurrence_page_class_init (RecurrencePageClass *class)
static void
recurrence_page_init (RecurrencePage *rpage)
{
- rpage->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- rpage, TYPE_RECURRENCE_PAGE, RecurrencePagePrivate);
+ rpage->priv = RECURRENCE_PAGE_GET_PRIVATE (rpage);
rpage->priv->cancellable = g_cancellable_new ();
}
@@ -395,7 +398,7 @@ recurrence_page_get_widget (CompEditorPage *page)
{
RecurrencePagePrivate *priv;
- priv = RECURRENCE_PAGE (page)->priv;
+ priv = RECURRENCE_PAGE_GET_PRIVATE (page);
return priv->main;
}
@@ -406,7 +409,7 @@ recurrence_page_focus_main_widget (CompEditorPage *page)
{
RecurrencePagePrivate *priv;
- priv = RECURRENCE_PAGE (page)->priv;
+ priv = RECURRENCE_PAGE_GET_PRIVATE (page);
gtk_widget_grab_focus (priv->recurs);
}
@@ -1343,8 +1346,12 @@ make_monthly_special (RecurrencePage *rpage)
adj, "value-changed",
G_CALLBACK (comp_editor_page_changed), rpage);
- g_signal_connect (priv->month_num_combo, "changed", G_CALLBACK (month_num_combo_changed_cb), rpage);
- g_signal_connect (priv->month_day_combo, "changed", G_CALLBACK (month_day_combo_changed_cb), rpage);
+ g_signal_connect (
+ priv->month_num_combo, "changed",
+ G_CALLBACK (month_num_combo_changed_cb), rpage);
+ g_signal_connect (
+ priv->month_day_combo, "changed",
+ G_CALLBACK (month_day_combo_changed_cb), rpage);
}
/* Changes the recurrence-special widget to match the interval units.
@@ -2363,9 +2370,9 @@ 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_CALLBACK (preview_date_range_changed_cb),
- rpage);
+ 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);
gtk_container_add (GTK_CONTAINER (priv->preview_bin),
priv->preview_calendar);
@@ -2379,7 +2386,9 @@ 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 */
@@ -2408,12 +2417,15 @@ init_widgets (RecurrencePage *rpage)
/* Exception buttons */
- g_signal_connect ((priv->exception_add), "clicked",
- G_CALLBACK (exception_add_cb), rpage);
- g_signal_connect ((priv->exception_modify), "clicked",
- G_CALLBACK (exception_modify_cb), rpage);
- g_signal_connect ((priv->exception_delete), "clicked",
- G_CALLBACK (exception_delete_cb), rpage);
+ g_signal_connect (
+ priv->exception_add, "clicked",
+ G_CALLBACK (exception_add_cb), rpage);
+ g_signal_connect (
+ priv->exception_modify, "clicked",
+ G_CALLBACK (exception_modify_cb), rpage);
+ g_signal_connect (
+ priv->exception_delete, "clicked",
+ G_CALLBACK (exception_delete_cb), rpage);
gtk_widget_set_sensitive (priv->exception_modify, FALSE);
gtk_widget_set_sensitive (priv->exception_delete, FALSE);
@@ -2438,8 +2450,10 @@ init_widgets (RecurrencePage *rpage)
gtk_tree_view_column_add_attribute (column, cell_renderer, "text", E_DATE_TIME_LIST_COLUMN_DESCRIPTION);
gtk_tree_view_append_column (GTK_TREE_VIEW (priv->exception_list), column);
- g_signal_connect (gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->exception_list)), "changed",
- G_CALLBACK (exception_selection_changed_cb), rpage);
+ g_signal_connect (
+ gtk_tree_view_get_selection (
+ GTK_TREE_VIEW (priv->exception_list)), "changed",
+ G_CALLBACK (exception_selection_changed_cb), rpage);
}
/**
diff --git a/calendar/gui/dialogs/schedule-page.c b/calendar/gui/dialogs/schedule-page.c
index b164f87648..3fcf1749cc 100644
--- a/calendar/gui/dialogs/schedule-page.c
+++ b/calendar/gui/dialogs/schedule-page.c
@@ -39,6 +39,10 @@
#include "e-delegate-dialog.h"
#include "schedule-page.h"
+#define SCHEDULE_PAGE_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), TYPE_SCHEDULE_PAGE, SchedulePagePrivate))
+
/* Private part of the SchedulePage structure */
struct _SchedulePagePrivate {
GtkBuilder *builder;
@@ -168,7 +172,7 @@ schedule_page_dispose (GObject *object)
{
SchedulePagePrivate *priv;
- priv = SCHEDULE_PAGE (object)->priv;
+ priv = SCHEDULE_PAGE_GET_PRIVATE (object);
if (priv->main != NULL) {
g_object_unref (priv->main);
@@ -283,8 +287,7 @@ schedule_page_class_init (SchedulePageClass *class)
static void
schedule_page_init (SchedulePage *spage)
{
- spage->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- spage, TYPE_SCHEDULE_PAGE, SchedulePagePrivate);
+ spage->priv = SCHEDULE_PAGE_GET_PRIVATE (spage);
}
/* Gets the widgets from the XML file and returns if they are all available. */
@@ -328,7 +331,9 @@ init_widgets (SchedulePage *spage)
priv = spage->priv;
- g_signal_connect (priv->sel, "changed", G_CALLBACK (times_changed_cb), spage);
+ g_signal_connect (
+ priv->sel, "changed",
+ G_CALLBACK (times_changed_cb), spage);
return TRUE;
}
diff --git a/calendar/gui/dialogs/task-details-page.c b/calendar/gui/dialogs/task-details-page.c
index 919a9c0550..c31fef6e23 100644
--- a/calendar/gui/dialogs/task-details-page.c
+++ b/calendar/gui/dialogs/task-details-page.c
@@ -41,6 +41,10 @@
#include "e-util/e-dialog-widgets.h"
#include "e-util/e-util-private.h"
+#define TASK_DETAILS_PAGE_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), TYPE_TASK_DETAILS_PAGE, TaskDetailsPagePrivate))
+
struct _TaskDetailsPagePrivate {
GtkBuilder *builder;
@@ -172,7 +176,7 @@ task_details_page_dispose (GObject *object)
{
TaskDetailsPagePrivate *priv;
- priv = TASK_DETAILS_PAGE (object)->priv;
+ priv = TASK_DETAILS_PAGE_GET_PRIVATE (object);
if (priv->main != NULL) {
g_object_unref (priv->main);
@@ -436,8 +440,7 @@ task_details_page_class_init (TaskDetailsPageClass *class)
static void
task_details_page_init (TaskDetailsPage *tdpage)
{
- tdpage->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- tdpage, TYPE_TASK_DETAILS_PAGE, TaskDetailsPagePrivate);
+ tdpage->priv = TASK_DETAILS_PAGE_GET_PRIVATE (tdpage);
}
/* Gets the widgets from the XML file and returns if they are all available. */
diff --git a/calendar/gui/dialogs/task-editor.c b/calendar/gui/dialogs/task-editor.c
index e1d90f4d5a..927913c898 100644
--- a/calendar/gui/dialogs/task-editor.c
+++ b/calendar/gui/dialogs/task-editor.c
@@ -335,8 +335,10 @@ task_editor_init (TaskEditor *te)
GTK_DIALOG (te->priv->task_details_window));
gtk_container_add (
GTK_CONTAINER (content_area),
- comp_editor_page_get_widget ((CompEditorPage *) te->priv->task_details_page));
- gtk_widget_show_all (gtk_bin_get_child (GTK_BIN (te->priv->task_details_window)));
+ comp_editor_page_get_widget (
+ (CompEditorPage *) te->priv->task_details_page));
+ gtk_widget_show_all (
+ gtk_bin_get_child (GTK_BIN (te->priv->task_details_window)));
comp_editor_append_page (
editor, COMP_EDITOR_PAGE (te->priv->task_details_page), NULL, FALSE);
@@ -430,13 +432,15 @@ task_editor_edit_comp (CompEditor *editor,
ia = e_meeting_store_find_self (priv->model, &row);
if (ia != NULL)
- e_meeting_attendee_set_edit_level (ia, E_MEETING_ATTENDEE_EDIT_STATUS);
+ e_meeting_attendee_set_edit_level (
+ ia, E_MEETING_ATTENDEE_EDIT_STATUS);
} else if (e_cal_client_check_organizer_must_attend (client)) {
EMeetingAttendee *ia;
ia = e_meeting_store_find_attendee (priv->model, organizer.value, &row);
if (ia != NULL)
- e_meeting_attendee_set_edit_level (ia, E_MEETING_ATTENDEE_EDIT_NONE);
+ e_meeting_attendee_set_edit_level (
+ ia, E_MEETING_ATTENDEE_EDIT_NONE);
}
comp_editor_set_group_item (editor, TRUE);
diff --git a/calendar/gui/dialogs/task-page.c b/calendar/gui/dialogs/task-page.c
index 2033a46ff2..71a494541a 100644
--- a/calendar/gui/dialogs/task-page.c
+++ b/calendar/gui/dialogs/task-page.c
@@ -1925,8 +1925,9 @@ init_widgets (TaskPage *tpage)
gtk_widget_hide (priv->info_hbox);
/* Summary */
- g_signal_connect ((priv->summary), "changed",
- G_CALLBACK (summary_changed_cb), tpage);
+ g_signal_connect (
+ priv->summary, "changed",
+ G_CALLBACK (summary_changed_cb), tpage);
/* Description */
text_buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (priv->description));
@@ -1936,20 +1937,27 @@ init_widgets (TaskPage *tpage)
e_buffer_tagger_connect (GTK_TEXT_VIEW (priv->description));
/* Dates */
- g_signal_connect ((priv->start_date), "changed",
- G_CALLBACK (date_changed_cb), tpage);
- g_signal_connect ((priv->due_date), "changed",
- G_CALLBACK (date_changed_cb), tpage);
+ g_signal_connect (
+ priv->start_date, "changed",
+ G_CALLBACK (date_changed_cb), tpage);
+ 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);
+ g_signal_connect (
+ priv->timezone, "changed",
+ G_CALLBACK (timezone_changed_cb), tpage);
/* Categories button */
- g_signal_connect ((priv->categories_btn), "clicked",
- G_CALLBACK (categories_clicked_cb), tpage);
+ 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);
+ 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. */
@@ -1988,19 +1996,29 @@ init_widgets (TaskPage *tpage)
G_CALLBACK (list_key_press), tpage);
/* Add attendee button */
- g_signal_connect (priv->add, "clicked", G_CALLBACK (add_clicked_cb), tpage);
+ g_signal_connect (
+ priv->add, "clicked",
+ G_CALLBACK (add_clicked_cb), tpage);
/* Edit attendee button */
- g_signal_connect (priv->edit, "clicked", G_CALLBACK (edit_clicked_cb), tpage);
+ g_signal_connect (
+ priv->edit, "clicked",
+ G_CALLBACK (edit_clicked_cb), tpage);
/* Remove attendee button */
- g_signal_connect (priv->remove, "clicked", G_CALLBACK (remove_clicked_cb), 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);
+ g_signal_connect (
+ priv->list_view, "attendee_added",
+ G_CALLBACK (attendee_added_cb), tpage);
/* Set the default timezone, so the timezone entry may be hidden. */
zone = comp_editor_get_timezone (editor);
diff --git a/calendar/gui/e-alarm-list.c b/calendar/gui/e-alarm-list.c
index 35c3484c13..67511165cf 100644
--- a/calendar/gui/e-alarm-list.c
+++ b/calendar/gui/e-alarm-list.c
@@ -40,8 +40,6 @@
static GType column_types[E_ALARM_LIST_NUM_COLUMNS];
-static void e_alarm_list_init (EAlarmList *file_list);
-static void e_alarm_list_class_init (EAlarmListClass *class);
static void e_alarm_list_tree_model_init (GtkTreeModelIface *iface);
static GtkTreeModelFlags e_alarm_list_get_flags (GtkTreeModel *tree_model);
static gint e_alarm_list_get_n_columns (GtkTreeModel *tree_model);
@@ -73,50 +71,18 @@ static gboolean e_alarm_list_iter_parent (GtkTreeModel *tree_model
GtkTreeIter *iter,
GtkTreeIter *child);
-static GObjectClass *parent_class = NULL;
-
-GType
-e_alarm_list_get_type (void)
-{
- static GType alarm_list_type = 0;
-
- if (!alarm_list_type) {
- static const GTypeInfo alarm_list_info =
- {
- sizeof (EAlarmListClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) e_alarm_list_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (EAlarmList),
- 0,
- (GInstanceInitFunc) e_alarm_list_init,
- };
-
- static const GInterfaceInfo tree_model_info =
- {
- (GInterfaceInitFunc) e_alarm_list_tree_model_init,
- NULL,
- NULL
- };
-
- column_types[E_ALARM_LIST_COLUMN_DESCRIPTION] = G_TYPE_STRING;
-
- alarm_list_type = g_type_register_static (G_TYPE_OBJECT, "EAlarmList",
- &alarm_list_info, 0);
- g_type_add_interface_static (alarm_list_type,
- GTK_TYPE_TREE_MODEL,
- &tree_model_info);
- }
-
- return alarm_list_type;
-}
+G_DEFINE_TYPE_WITH_CODE (
+ EAlarmList,
+ e_alarm_list,
+ G_TYPE_OBJECT,
+ G_IMPLEMENT_INTERFACE (
+ GTK_TYPE_TREE_MODEL,
+ e_alarm_list_tree_model_init))
static void
e_alarm_list_class_init (EAlarmListClass *class)
{
- parent_class = g_type_class_peek_parent (class);
+ column_types[E_ALARM_LIST_COLUMN_DESCRIPTION] = G_TYPE_STRING;
}
static void
diff --git a/calendar/gui/e-cal-component-preview.c b/calendar/gui/e-cal-component-preview.c
index ec4f817042..ce8cdeee2d 100644
--- a/calendar/gui/e-cal-component-preview.c
+++ b/calendar/gui/e-cal-component-preview.c
@@ -38,6 +38,15 @@
#include <e-util/e-util.h>
#include <e-util/e-categories-config.h>
+#define E_CAL_COMPONENT_PREVIEW_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_CAL_COMPONENT_PREVIEW, ECalComponentPreviewPrivate))
+
+G_DEFINE_TYPE (
+ ECalComponentPreview,
+ e_cal_component_preview,
+ E_TYPE_WEB_VIEW)
+
struct _ECalComponentPreviewPrivate {
/* information about currently showing component in a preview;
* if it didn't change then the preview is not updated */
@@ -47,8 +56,6 @@ struct _ECalComponentPreviewPrivate {
gint comp_sequence;
};
-static gpointer parent_class;
-
static void
clear_comp_info (ECalComponentPreview *preview)
{
@@ -388,15 +395,14 @@ cal_component_preview_finalize (GObject *object)
clear_comp_info (E_CAL_COMPONENT_PREVIEW (object));
/* Chain up to parent's finalize() method. */
- G_OBJECT_CLASS (parent_class)->finalize (object);
+ G_OBJECT_CLASS (e_cal_component_preview_parent_class)->finalize (object);
}
static void
-cal_component_preview_class_init (ECalComponentPreviewClass *class)
+e_cal_component_preview_class_init (ECalComponentPreviewClass *class)
{
GObjectClass *object_class;
- parent_class = g_type_class_peek_parent (class);
g_type_class_add_private (class, sizeof (ECalComponentPreviewPrivate));
object_class = G_OBJECT_CLASS (class);
@@ -404,38 +410,9 @@ cal_component_preview_class_init (ECalComponentPreviewClass *class)
}
static void
-cal_component_preview_init (ECalComponentPreview *preview)
-{
- preview->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- preview, E_TYPE_CAL_COMPONENT_PREVIEW,
- ECalComponentPreviewPrivate);
-}
-
-GType
-e_cal_component_preview_get_type (void)
+e_cal_component_preview_init (ECalComponentPreview *preview)
{
- static GType type = 0;
-
- if (G_UNLIKELY (type == 0)) {
- static const GTypeInfo type_info = {
- sizeof (ECalComponentPreviewClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) cal_component_preview_class_init,
- (GClassFinalizeFunc) NULL,
- NULL, /* class_data */
- sizeof (ECalComponentPreview),
- 0, /* n_preallocs */
- (GInstanceInitFunc) cal_component_preview_init,
- NULL /* value_table */
- };
-
- type = g_type_register_static (
- E_TYPE_WEB_VIEW, "ECalComponentPreview",
- &type_info, 0);
- }
-
- return type;
+ preview->priv = E_CAL_COMPONENT_PREVIEW_GET_PRIVATE (preview);
}
GtkWidget *
diff --git a/calendar/gui/e-cal-config.c b/calendar/gui/e-cal-config.c
index 99a2487f98..08f0aedd89 100644
--- a/calendar/gui/e-cal-config.c
+++ b/calendar/gui/e-cal-config.c
@@ -27,24 +27,23 @@
#include <gtk/gtk.h>
#include "e-cal-config.h"
+#define E_CAL_CONFIG_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_CAL_CONFIG, ECalConfigPrivate))
+
static GObjectClass *ecp_parent_class;
struct _ECalConfigPrivate {
guint source_changed_id;
};
-static void
-ecp_init (ECalConfig *cfg)
-{
- cfg->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- cfg, E_TYPE_CAL_CONFIG, ECalConfigPrivate);
-}
+G_DEFINE_TYPE (ECalConfig, e_cal_config, E_TYPE_CONFIG)
static void
ecp_target_free (EConfig *ec,
EConfigTarget *t)
{
- struct _ECalConfigPrivate *p = E_CAL_CONFIG (ec)->priv;
+ ECalConfigPrivate *p = E_CAL_CONFIG (ec)->priv;
if (ec->target == t) {
switch (t->type) {
@@ -89,7 +88,7 @@ static void
ecp_set_target (EConfig *ec,
EConfigTarget *t)
{
- struct _ECalConfigPrivate *p = E_CAL_CONFIG (ec)->priv;
+ ECalConfigPrivate *p = E_CAL_CONFIG_GET_PRIVATE (ec);
((EConfigClass *) ecp_parent_class)->set_target (ec, t);
@@ -110,35 +109,21 @@ ecp_set_target (EConfig *ec,
}
static void
-ecp_class_init (GObjectClass *klass)
+e_cal_config_class_init (ECalConfigClass *class)
{
- ((EConfigClass *) klass)->set_target = ecp_set_target;
- ((EConfigClass *) klass)->target_free = ecp_target_free;
+ EConfigClass *config_class;
- g_type_class_add_private (klass, sizeof (struct _ECalConfigPrivate));
+ g_type_class_add_private (class, sizeof (ECalConfigPrivate));
+
+ config_class = E_CONFIG_CLASS (class);
+ config_class->set_target = ecp_set_target;
+ config_class->target_free = ecp_target_free;
}
-GType
-e_cal_config_get_type (void)
+static void
+e_cal_config_init (ECalConfig *cfg)
{
- static GType type = 0;
-
- if (!type) {
- static const GTypeInfo info = {
- sizeof (ECalConfigClass),
- NULL, NULL,
- (GClassInitFunc) ecp_class_init,
- NULL, NULL,
- sizeof (ECalConfig), 0,
- (GInstanceInitFunc) ecp_init
- };
-
- ecp_parent_class = g_type_class_ref (e_config_get_type ());
- type = g_type_register_static (
- e_config_get_type (), "ECalConfig", &info, 0);
- }
-
- return type;
+ cfg->priv = E_CAL_CONFIG_GET_PRIVATE (cfg);
}
ECalConfig *
diff --git a/calendar/gui/e-cal-config.h b/calendar/gui/e-cal-config.h
index 28109ab394..f03220ffb8 100644
--- a/calendar/gui/e-cal-config.h
+++ b/calendar/gui/e-cal-config.h
@@ -21,8 +21,8 @@
*
*/
-#ifndef __E_CAL_CONFIG_H__
-#define __E_CAL_CONFIG_H__
+#ifndef E_CAL_CONFIG_H
+#define E_CAL_CONFIG_H
#include <libecal/e-cal-client.h>
#include "e-util/e-config.h"
diff --git a/calendar/gui/e-cal-event.c b/calendar/gui/e-cal-event.c
index 176e2923b3..9683ddefe1 100644
--- a/calendar/gui/e-cal-event.c
+++ b/calendar/gui/e-cal-event.c
@@ -26,18 +26,7 @@
#include "e-cal-event.h"
-static GObjectClass *ece_parent;
-
-static void
-ece_init (GObject *o)
-{
-}
-
-static void
-ece_finalize (GObject *o)
-{
- ((GObjectClass *) ece_parent)->finalize (o);
-}
+G_DEFINE_TYPE (ECalEvent, e_cal_event, E_TYPE_EVENT)
static void
ece_target_free (EEvent *ev,
@@ -53,36 +42,21 @@ ece_target_free (EEvent *ev,
break; }
}
- ((EEventClass *) ece_parent)->target_free (ev, t);
+ E_EVENT_CLASS (e_cal_event_parent_class)->target_free (ev, t);
}
static void
-ece_class_init (GObjectClass *klass)
+e_cal_event_class_init (ECalEventClass *class)
{
- klass->finalize = ece_finalize;
- ((EEventClass *) klass)->target_free = ece_target_free;
+ EEventClass *event_class;
+
+ event_class = E_EVENT_CLASS (class);
+ event_class->target_free = ece_target_free;
}
-GType
-e_cal_event_get_type (void)
+static void
+e_cal_event_init (ECalEvent *event)
{
- static GType type = 0;
-
- if (!type) {
- static const GTypeInfo info = {
- sizeof (ECalEventClass),
- NULL, NULL,
- (GClassInitFunc) ece_class_init,
- NULL, NULL,
- sizeof (ECalEvent), 0,
- (GInstanceInitFunc) ece_init
- };
- ece_parent = g_type_class_ref (e_event_get_type ());
- type = g_type_register_static (
- e_event_get_type (), "ECalEvent", &info, 0);
- }
-
- return type;
}
ECalEvent *
diff --git a/calendar/gui/e-cal-model-calendar.c b/calendar/gui/e-cal-model-calendar.c
index 6a1493f01a..0c59a1212e 100644
--- a/calendar/gui/e-cal-model-calendar.c
+++ b/calendar/gui/e-cal-model-calendar.c
@@ -35,11 +35,6 @@
#include "dialogs/recur-comp.h"
#include "dialogs/send-comp.h"
-struct _ECalModelCalendarPrivate {
- guint reserved;
-};
-
-static void e_cal_model_calendar_finalize (GObject *object);
static gint ecmc_column_count (ETableModel *etm);
static gpointer ecmc_value_at (ETableModel *etm, gint col, gint row);
static void ecmc_set_value_at (ETableModel *etm, gint col, gint row, gconstpointer value);
@@ -56,13 +51,10 @@ static void ecmc_fill_component_from_model (ECalModel *model, ECalModelComponent
G_DEFINE_TYPE (ECalModelCalendar, e_cal_model_calendar, E_TYPE_CAL_MODEL)
static void
-e_cal_model_calendar_class_init (ECalModelCalendarClass *klass)
+e_cal_model_calendar_class_init (ECalModelCalendarClass *class)
{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
- ETableModelClass *etm_class = E_TABLE_MODEL_CLASS (klass);
- ECalModelClass *model_class = E_CAL_MODEL_CLASS (klass);
-
- object_class->finalize = e_cal_model_calendar_finalize;
+ ETableModelClass *etm_class = E_TABLE_MODEL_CLASS (class);
+ ECalModelClass *model_class = E_CAL_MODEL_CLASS (class);
etm_class->column_count = ecmc_column_count;
etm_class->value_at = ecmc_value_at;
@@ -80,32 +72,9 @@ e_cal_model_calendar_class_init (ECalModelCalendarClass *klass)
static void
e_cal_model_calendar_init (ECalModelCalendar *model)
{
- ECalModelCalendarPrivate *priv;
-
- priv = g_new0 (ECalModelCalendarPrivate, 1);
- model->priv = priv;
-
e_cal_model_set_component_kind (E_CAL_MODEL (model), ICAL_VEVENT_COMPONENT);
}
-static void
-e_cal_model_calendar_finalize (GObject *object)
-{
- ECalModelCalendarPrivate *priv;
- ECalModelCalendar *model = (ECalModelCalendar *) object;
-
- g_return_if_fail (E_IS_CAL_MODEL_CALENDAR (model));
-
- priv = model->priv;
- if (priv) {
- g_free (priv);
- model->priv = NULL;
- }
-
- /* Chain up to parent's finalize() method. */
- G_OBJECT_CLASS (e_cal_model_calendar_parent_class)->finalize (object);
-}
-
/* ETableModel methods */
static gint
ecmc_column_count (ETableModel *etm)
diff --git a/calendar/gui/e-cal-model-memos.c b/calendar/gui/e-cal-model-memos.c
index 261cdda058..e95cd15ed4 100644
--- a/calendar/gui/e-cal-model-memos.c
+++ b/calendar/gui/e-cal-model-memos.c
@@ -35,12 +35,6 @@
#define d(x) (x)
-struct _ECalModelMemosPrivate {
- gint dummy;
-};
-
-static void e_cal_model_memos_finalize (GObject *object);
-
static gint ecmm_column_count (ETableModel *etm);
static gpointer ecmm_value_at (ETableModel *etm, gint col, gint row);
static void ecmm_set_value_at (ETableModel *etm, gint col, gint row, gconstpointer value);
@@ -57,13 +51,10 @@ static void ecmm_fill_component_from_model (ECalModel *model, ECalModelComponent
G_DEFINE_TYPE (ECalModelMemos, e_cal_model_memos, E_TYPE_CAL_MODEL)
static void
-e_cal_model_memos_class_init (ECalModelMemosClass *klass)
+e_cal_model_memos_class_init (ECalModelMemosClass *class)
{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
- ETableModelClass *etm_class = E_TABLE_MODEL_CLASS (klass);
- ECalModelClass *model_class = E_CAL_MODEL_CLASS (klass);
-
- object_class->finalize = e_cal_model_memos_finalize;
+ ETableModelClass *etm_class = E_TABLE_MODEL_CLASS (class);
+ ECalModelClass *model_class = E_CAL_MODEL_CLASS (class);
etm_class->column_count = ecmm_column_count;
etm_class->value_at = ecmm_value_at;
@@ -81,32 +72,9 @@ e_cal_model_memos_class_init (ECalModelMemosClass *klass)
static void
e_cal_model_memos_init (ECalModelMemos *model)
{
- ECalModelMemosPrivate *priv;
-
- priv = g_new0 (ECalModelMemosPrivate, 1);
- model->priv = priv;
-
e_cal_model_set_component_kind (E_CAL_MODEL (model), ICAL_VJOURNAL_COMPONENT);
}
-static void
-e_cal_model_memos_finalize (GObject *object)
-{
- ECalModelMemosPrivate *priv;
- ECalModelMemos *model = (ECalModelMemos *) object;
-
- g_return_if_fail (E_IS_CAL_MODEL_MEMOS (model));
-
- priv = model->priv;
- if (priv) {
- g_free (priv);
- model->priv = NULL;
- }
-
- /* Chain up to parent's finalize() method. */
- G_OBJECT_CLASS (e_cal_model_memos_parent_class)->finalize (object);
-}
-
/* ETableModel methods */
static gint
ecmm_column_count (ETableModel *etm)
diff --git a/calendar/gui/e-cal-model-tasks.c b/calendar/gui/e-cal-model-tasks.c
index f4f41cf81e..feacc6d422 100644
--- a/calendar/gui/e-cal-model-tasks.c
+++ b/calendar/gui/e-cal-model-tasks.c
@@ -37,6 +37,10 @@
#include "e-cell-date-edit-text.h"
#include "misc.h"
+#define E_CAL_MODEL_TASKS_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_CAL_MODEL_TASKS, ECalModelTasksPrivate))
+
struct _ECalModelTasksPrivate {
gboolean highlight_due_today;
gchar *color_due_today;
@@ -148,7 +152,7 @@ cal_model_tasks_finalize (GObject *object)
{
ECalModelTasksPrivate *priv;
- priv = E_CAL_MODEL_TASKS (object)->priv;
+ priv = E_CAL_MODEL_TASKS_GET_PRIVATE (object);
g_free (priv->color_due_today);
g_free (priv->color_overdue);
@@ -230,8 +234,7 @@ e_cal_model_tasks_class_init (ECalModelTasksClass *class)
static void
e_cal_model_tasks_init (ECalModelTasks *model)
{
- model->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- model, E_TYPE_CAL_MODEL_TASKS, ECalModelTasksPrivate);
+ model->priv = E_CAL_MODEL_TASKS_GET_PRIVATE (model);
model->priv->highlight_due_today = TRUE;
model->priv->highlight_overdue = TRUE;
diff --git a/calendar/gui/e-cal-model.c b/calendar/gui/e-cal-model.c
index 2255ec4b35..20dee7f714 100644
--- a/calendar/gui/e-cal-model.c
+++ b/calendar/gui/e-cal-model.c
@@ -49,6 +49,14 @@ struct _ECalModelComponentPrivate {
GString *categories_str;
};
+#define E_CAL_MODEL_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_CAL_MODEL, ECalModelPrivate))
+
+#define E_CAL_MODEL_COMPONENT_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_CAL_MODEL_COMPONENT, ECalModelComponentPrivate))
+
typedef struct {
ECalClient *client;
ECalClientView *view;
@@ -182,6 +190,11 @@ G_DEFINE_TYPE_WITH_CODE (
ECalModel, e_cal_model, E_TYPE_TABLE_MODEL,
G_IMPLEMENT_INTERFACE (E_TYPE_EXTENSIBLE, NULL))
+G_DEFINE_TYPE (
+ ECalModelComponent,
+ e_cal_model_component,
+ G_TYPE_OBJECT)
+
static void
cal_model_set_property (GObject *object,
guint property_id,
@@ -387,7 +400,7 @@ cal_model_dispose (GObject *object)
{
ECalModelPrivate *priv;
- priv = E_CAL_MODEL (object)->priv;
+ priv = E_CAL_MODEL_GET_PRIVATE (object);
if (priv->loading_clients) {
g_cancellable_cancel (priv->loading_clients);
@@ -431,7 +444,7 @@ cal_model_finalize (GObject *object)
ECalModelPrivate *priv;
gint ii;
- priv = E_CAL_MODEL (object)->priv;
+ priv = E_CAL_MODEL_GET_PRIVATE (object);
g_free (priv->search_sexp);
g_free (priv->full_sexp);
@@ -703,8 +716,7 @@ e_cal_model_class_init (ECalModelClass *class)
static void
e_cal_model_init (ECalModel *model)
{
- model->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- model, E_TYPE_CAL_MODEL, ECalModelPrivate);
+ model->priv = E_CAL_MODEL_GET_PRIVATE (model);
/* match none by default */
model->priv->start = -1;
@@ -2732,11 +2744,21 @@ get_view_cb (GObject *source_object,
} else {
gvd->client_data->view = view;
- g_signal_connect (gvd->client_data->view, "objects-added", G_CALLBACK (client_view_objects_added_cb), gvd->model);
- g_signal_connect (gvd->client_data->view, "objects-modified", G_CALLBACK (client_view_objects_modified_cb), gvd->model);
- g_signal_connect (gvd->client_data->view, "objects-removed", G_CALLBACK (client_view_objects_removed_cb), gvd->model);
- g_signal_connect (gvd->client_data->view, "progress", G_CALLBACK (client_view_progress_cb), gvd->model);
- g_signal_connect (gvd->client_data->view, "complete", G_CALLBACK (client_view_complete_cb), gvd->model);
+ g_signal_connect (
+ gvd->client_data->view, "objects-added",
+ G_CALLBACK (client_view_objects_added_cb), gvd->model);
+ g_signal_connect (
+ gvd->client_data->view, "objects-modified",
+ G_CALLBACK (client_view_objects_modified_cb), gvd->model);
+ g_signal_connect (
+ gvd->client_data->view, "objects-removed",
+ G_CALLBACK (client_view_objects_removed_cb), gvd->model);
+ g_signal_connect (
+ gvd->client_data->view, "progress",
+ G_CALLBACK (client_view_progress_cb), gvd->model);
+ g_signal_connect (
+ gvd->client_data->view, "complete",
+ G_CALLBACK (client_view_complete_cb), gvd->model);
e_cal_client_view_start (gvd->client_data->view, &error);
@@ -3713,43 +3735,10 @@ e_cal_model_component_finalize (GObject *object)
G_OBJECT_CLASS (component_parent_class)->finalize (object);
}
-/* Object initialization function for the calendar component object */
static void
e_cal_model_component_init (ECalModelComponent *comp)
{
- comp->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- comp, E_TYPE_CAL_MODEL_COMPONENT, ECalModelComponentPrivate);
-
- comp->dtstart = NULL;
- comp->dtend = NULL;
- comp->due = NULL;
- comp->completed = NULL;
- comp->created = NULL;
- comp->lastmodified = NULL;
- comp->color = NULL;
- comp->priv->categories_str = NULL;
-}
-
-GType
-e_cal_model_component_get_type (void)
-{
- static GType e_cal_model_component_type = 0;
-
- if (!e_cal_model_component_type) {
- static GTypeInfo info = {
- sizeof (ECalModelComponentClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) e_cal_model_component_class_init,
- NULL, NULL,
- sizeof (ECalModelComponent),
- 0,
- (GInstanceInitFunc) e_cal_model_component_init
- };
- e_cal_model_component_type = g_type_register_static (G_TYPE_OBJECT, "ECalModelComponent", &info, 0);
- }
-
- return e_cal_model_component_type;
+ comp->priv = E_CAL_MODEL_COMPONENT_GET_PRIVATE (comp);
}
/**
diff --git a/calendar/gui/e-cal-model.h b/calendar/gui/e-cal-model.h
index 6dd04675ed..3b4089bb25 100644
--- a/calendar/gui/e-cal-model.h
+++ b/calendar/gui/e-cal-model.h
@@ -310,10 +310,12 @@ 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));
+ void (*set_func) (icalproperty *prop,
+ struct icaltimetype v),
+ icalproperty * (*new_func) (struct icaltimetype v));
-void e_cal_model_update_status_message (ECalModel *model,
+void e_cal_model_update_status_message
+ (ECalModel *model,
const gchar *message,
gdouble percent);
diff --git a/calendar/gui/e-calendar-selector.c b/calendar/gui/e-calendar-selector.c
index 989391625b..4add4a3e97 100644
--- a/calendar/gui/e-calendar-selector.c
+++ b/calendar/gui/e-calendar-selector.c
@@ -29,6 +29,10 @@
#include "e-util/e-selection.h"
+#define E_CALENDAR_SELECTOR_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_CALENDAR_SELECTOR, ECalendarSelectorPrivate))
+
struct _ECalendarSelectorPrivate {
gint dummy_value;
};
@@ -205,8 +209,7 @@ e_calendar_selector_class_init (ECalendarSelectorClass *class)
static void
e_calendar_selector_init (ECalendarSelector *selector)
{
- selector->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- selector, E_TYPE_CALENDAR_SELECTOR, ECalendarSelectorPrivate);
+ selector->priv = E_CALENDAR_SELECTOR_GET_PRIVATE (selector);
gtk_drag_dest_set (
GTK_WIDGET (selector), GTK_DEST_DEFAULT_ALL,
diff --git a/calendar/gui/e-calendar-view.c b/calendar/gui/e-calendar-view.c
index ebaede4257..1788e96017 100644
--- a/calendar/gui/e-calendar-view.c
+++ b/calendar/gui/e-calendar-view.c
@@ -61,6 +61,10 @@
#include "print.h"
#include "misc.h"
+#define E_CALENDAR_VIEW_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_CALENDAR_VIEW, ECalendarViewPrivate))
+
struct _ECalendarViewPrivate {
/* The GnomeCalendar we are associated to */
GnomeCalendar *calendar;
@@ -321,7 +325,7 @@ calendar_view_dispose (GObject *object)
{
ECalendarViewPrivate *priv;
- priv = E_CALENDAR_VIEW (object)->priv;
+ priv = E_CALENDAR_VIEW_GET_PRIVATE (object);
if (priv->model != NULL) {
g_signal_handlers_disconnect_matched (
@@ -350,7 +354,7 @@ calendar_view_finalize (GObject *object)
{
ECalendarViewPrivate *priv;
- priv = E_CALENDAR_VIEW (object)->priv;
+ priv = E_CALENDAR_VIEW_GET_PRIVATE (object);
g_free (priv->default_category);
@@ -916,8 +920,7 @@ e_calendar_view_init (ECalendarView *calendar_view)
{
GtkTargetList *target_list;
- calendar_view->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- calendar_view, E_TYPE_CALENDAR_VIEW, ECalendarViewPrivate);
+ calendar_view->priv = E_CALENDAR_VIEW_GET_PRIVATE (calendar_view);
/* Set this early to avoid a divide-by-zero during init. */
calendar_view->priv->time_divisions = 30;
@@ -1462,8 +1465,9 @@ e_calendar_view_new_appointment_for (ECalendarView *cal_view,
e_source_peek_name (source),
NULL);
- g_signal_connect ((GtkDialog *)widget, "response", G_CALLBACK (gtk_widget_destroy),
- widget);
+ g_signal_connect (
+ widget, "response",
+ G_CALLBACK (gtk_widget_destroy), widget);
gtk_widget_show (widget);
return;
}
@@ -1632,7 +1636,9 @@ e_calendar_view_open_event_with_flags (ECalendarView *cal_view,
if (!ce) {
ce = event_editor_new (client, shell, flags);
- g_signal_connect (ce, "object_created", G_CALLBACK (object_created_cb), cal_view);
+ g_signal_connect (
+ ce, "object_created",
+ G_CALLBACK (object_created_cb), cal_view);
comp = e_cal_component_new ();
e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (icalcomp));
@@ -2013,7 +2019,9 @@ e_calendar_view_get_tooltips (const ECalendarViewEventData *data)
window = gtk_widget_get_window (pevent->tooltip);
gdk_keyboard_grab (window, FALSE, GDK_CURRENT_TIME);
- g_signal_connect (pevent->tooltip, "key-press-event", G_CALLBACK (tooltip_grab), data->cal_view);
+ g_signal_connect (
+ pevent->tooltip, "key-press-event",
+ G_CALLBACK (tooltip_grab), data->cal_view);
pevent->timeout = -1;
g_object_set_data (G_OBJECT (data->cal_view), "tooltip-window", pevent->tooltip);
diff --git a/calendar/gui/e-cell-date-edit-text.c b/calendar/gui/e-cell-date-edit-text.c
index 61f6d9a3fd..594bcf07c8 100644
--- a/calendar/gui/e-cell-date-edit-text.c
+++ b/calendar/gui/e-cell-date-edit-text.c
@@ -38,6 +38,10 @@
#include "e-cell-date-edit-text.h"
+#define E_CELL_DATE_EDIT_TEXT_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_CELL_DATE_EDIT_TEXT, ECellDateEditTextPrivate))
+
struct _ECellDateEditTextPrivate {
/* The timezone to display the date in. */
@@ -53,7 +57,10 @@ enum {
PROP_USE_24_HOUR_FORMAT
};
-static gpointer parent_class;
+G_DEFINE_TYPE (
+ ECellDateEditText,
+ e_cell_date_edit_text,
+ E_TYPE_CELL_TEXT)
static void
cell_date_edit_text_set_property (GObject *object,
@@ -226,12 +233,11 @@ cell_date_edit_text_set_value (ECellText *cell,
}
static void
-cell_date_edit_text_class_init (ECellDateEditTextClass *class)
+e_cell_date_edit_text_class_init (ECellDateEditTextClass *class)
{
GObjectClass *object_class;
ECellTextClass *cell_text_class;
- parent_class = g_type_class_peek_parent (class);
g_type_class_add_private (class, sizeof (ECellDateEditTextPrivate));
object_class = G_OBJECT_CLASS (class);
@@ -264,41 +270,14 @@ cell_date_edit_text_class_init (ECellDateEditTextClass *class)
}
static void
-cell_date_edit_text_init (ECellDateEditText *ecd)
+e_cell_date_edit_text_init (ECellDateEditText *ecd)
{
- ecd->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- ecd, E_TYPE_CELL_DATE_EDIT_TEXT, ECellDateEditTextPrivate);
+ ecd->priv = E_CELL_DATE_EDIT_TEXT_GET_PRIVATE (ecd);
ecd->priv->timezone = icaltimezone_get_utc_timezone ();
ecd->priv->use_24_hour_format = TRUE;
}
-GType
-e_cell_date_edit_text_get_type (void)
-{
- static GType type = 0;
-
- if (G_UNLIKELY (type == 0)) {
- const GTypeInfo type_info = {
- sizeof (ECellDateEditTextClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) cell_date_edit_text_class_init,
- (GClassFinalizeFunc) NULL,
- NULL, /* class_data */
- sizeof (ECellDateEditText),
- 0, /* n_preallocs */
- (GInstanceInitFunc) cell_date_edit_text_init,
- NULL /* value_table */
- };
-
- type = g_type_register_static (
- E_TYPE_CELL_TEXT, "ECellDateEditText", &type_info, 0);
- }
-
- return type;
-}
-
/**
* e_cell_date_edit_text_new:
*
diff --git a/calendar/gui/e-day-view-main-item.c b/calendar/gui/e-day-view-main-item.c
index b6cdc967e7..4a7fb88bb6 100644
--- a/calendar/gui/e-day-view-main-item.c
+++ b/calendar/gui/e-day-view-main-item.c
@@ -40,6 +40,10 @@
#include "e-calendar-view.h"
#include "comp-util.h"
+#define E_DAY_VIEW_MAIN_ITEM_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_DAY_VIEW_MAIN_ITEM, EDayViewMainItemPrivate))
+
struct _EDayViewMainItemPrivate {
EDayView *day_view;
};
@@ -49,7 +53,10 @@ enum {
PROP_DAY_VIEW
};
-static gpointer parent_class;
+G_DEFINE_TYPE (
+ EDayViewMainItem,
+ e_day_view_main_item,
+ GNOME_TYPE_CANVAS_ITEM)
static gboolean
can_draw_in_region (cairo_region_t *draw_region,
@@ -927,7 +934,7 @@ day_view_main_item_dispose (GObject *object)
{
EDayViewMainItemPrivate *priv;
- priv = E_DAY_VIEW_MAIN_ITEM (object)->priv;
+ priv = E_DAY_VIEW_MAIN_ITEM_GET_PRIVATE (object);
if (priv->day_view != NULL) {
g_object_unref (priv->day_view);
@@ -935,7 +942,7 @@ day_view_main_item_dispose (GObject *object)
}
/* Chain up to parent's dispose() method. */
- G_OBJECT_CLASS (parent_class)->dispose (object);
+ G_OBJECT_CLASS (e_day_view_main_item_parent_class)->dispose (object);
}
static void
@@ -946,7 +953,8 @@ day_view_main_item_update (GnomeCanvasItem *item,
GnomeCanvasItemClass *canvas_item_class;
/* Chain up to parent's update() method. */
- canvas_item_class = GNOME_CANVAS_ITEM_CLASS (parent_class);
+ canvas_item_class =
+ GNOME_CANVAS_ITEM_CLASS (e_day_view_main_item_parent_class);
canvas_item_class->update (item, i2c, flags);
/* The item covers the entire canvas area. */
@@ -1218,12 +1226,11 @@ day_view_main_item_point (GnomeCanvasItem *item,
}
static void
-day_view_main_item_class_init (EDayViewMainItemClass *class)
+e_day_view_main_item_class_init (EDayViewMainItemClass *class)
{
GObjectClass *object_class;
GnomeCanvasItemClass *item_class;
- parent_class = g_type_class_peek_parent (class);
g_type_class_add_private (class, sizeof (EDayViewMainItemPrivate));
object_class = G_OBJECT_CLASS (class);
@@ -1251,37 +1258,9 @@ day_view_main_item_class_init (EDayViewMainItemClass *class)
}
static void
-day_view_main_item_init (EDayViewMainItem *main_item)
-{
- main_item->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- main_item, E_TYPE_DAY_VIEW_MAIN_ITEM, EDayViewMainItemPrivate);
-}
-
-GType
-e_day_view_main_item_get_type (void)
+e_day_view_main_item_init (EDayViewMainItem *main_item)
{
- static GType type = 0;
-
- if (G_UNLIKELY (type == 0)) {
- const GTypeInfo type_info = {
- sizeof (EDayViewMainItemClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) day_view_main_item_class_init,
- (GClassFinalizeFunc) NULL,
- NULL, /* class_data */
- sizeof (EDayViewMainItem),
- 0, /* n_preallocs */
- (GInstanceInitFunc) day_view_main_item_init,
- NULL /* value_table */
- };
-
- type = g_type_register_static (
- GNOME_TYPE_CANVAS_ITEM, "EDayViewMainItem",
- &type_info, 0);
- }
-
- return type;
+ main_item->priv = E_DAY_VIEW_MAIN_ITEM_GET_PRIVATE (main_item);
}
EDayView *
diff --git a/calendar/gui/e-day-view-time-item.c b/calendar/gui/e-day-view-time-item.c
index 9b61f11649..f270fcca63 100644
--- a/calendar/gui/e-day-view-time-item.c
+++ b/calendar/gui/e-day-view-time-item.c
@@ -54,6 +54,10 @@
#define E_DVTMI_LARGE_HOUR_Y_PAD 1
#define E_DVTMI_SMALL_FONT_Y_PAD 1
+#define E_DAY_VIEW_TIME_ITEM_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_DAY_VIEW_TIME_ITEM, EDayViewTimeItemPrivate))
+
struct _EDayViewTimeItemPrivate {
/* The parent EDayView widget. */
EDayView *day_view;
@@ -117,7 +121,10 @@ enum {
PROP_DAY_VIEW
};
-static gpointer parent_class;
+G_DEFINE_TYPE (
+ EDayViewTimeItem,
+ e_day_view_time_item,
+ GNOME_TYPE_CANVAS_ITEM)
static void
day_view_time_item_set_property (GObject *object,
@@ -158,7 +165,7 @@ day_view_time_item_dispose (GObject *object)
{
EDayViewTimeItemPrivate *priv;
- priv = E_DAY_VIEW_TIME_ITEM (object)->priv;
+ priv = E_DAY_VIEW_TIME_ITEM_GET_PRIVATE (object);
if (priv->day_view != NULL) {
g_object_unref (priv->day_view);
@@ -166,7 +173,7 @@ day_view_time_item_dispose (GObject *object)
}
/* Chain up to parent's dispose() method. */
- G_OBJECT_CLASS (parent_class)->dispose (object);
+ G_OBJECT_CLASS (e_day_view_time_item_parent_class)->dispose (object);
}
static void
@@ -176,19 +183,20 @@ day_view_time_item_finalize (GObject *object)
time_item = E_DAY_VIEW_TIME_ITEM (object);
- calendar_config_remove_notification ((CalendarConfigChangedFunc) edvti_second_zone_changed_cb, time_item);
+ calendar_config_remove_notification (
+ (CalendarConfigChangedFunc)
+ edvti_second_zone_changed_cb, time_item);
/* Chain up to parent's dispose() method. */
- G_OBJECT_CLASS (parent_class)->finalize (object);
+ G_OBJECT_CLASS (e_day_view_time_item_parent_class)->finalize (object);
}
static void
-day_view_time_item_class_init (EDayViewTimeItemClass *class)
+e_day_view_time_item_class_init (EDayViewTimeItemClass *class)
{
GObjectClass *object_class;
GnomeCanvasItemClass *item_class;
- parent_class = g_type_class_peek_parent (class);
g_type_class_add_private (class, sizeof (EDayViewTimeItemPrivate));
object_class = G_OBJECT_CLASS (class);
@@ -215,15 +223,11 @@ day_view_time_item_class_init (EDayViewTimeItemClass *class)
}
static void
-day_view_time_item_init (EDayViewTimeItem *time_item)
+e_day_view_time_item_init (EDayViewTimeItem *time_item)
{
gchar *last;
- time_item->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- time_item, E_TYPE_DAY_VIEW_TIME_ITEM, EDayViewTimeItemPrivate);
-
- time_item->priv->dragging_selection = FALSE;
- time_item->priv->second_zone = NULL;
+ time_item->priv = E_DAY_VIEW_TIME_ITEM_GET_PRIVATE (time_item);
last = calendar_config_get_day_second_zone ();
@@ -239,40 +243,13 @@ day_view_time_item_init (EDayViewTimeItem *time_item)
time_item);
}
-GType
-e_day_view_time_item_get_type (void)
-{
- static GType type = 0;
-
- if (G_UNLIKELY (type == 0)) {
- const GTypeInfo type_info = {
- sizeof (EDayViewTimeItemClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) day_view_time_item_class_init,
- (GClassFinalizeFunc) NULL,
- NULL, /* class_data */
- sizeof (EDayViewTimeItem),
- 0, /* n_preallocs */
- (GInstanceInitFunc) day_view_time_item_init,
- NULL /* value_table */
- };
-
- type = g_type_register_static (
- GNOME_TYPE_CANVAS_ITEM, "EDayViewTimeItem",
- &type_info, 0);
- }
-
- return type;
-}
-
static void
e_day_view_time_item_update (GnomeCanvasItem *item,
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);
+ if (GNOME_CANVAS_ITEM_CLASS (e_day_view_time_item_parent_class)->update)
+ (* GNOME_CANVAS_ITEM_CLASS (e_day_view_time_item_parent_class)->update) (item, i2c, flags);
/* The item covers the entire canvas area. */
item->x1 = 0;
@@ -327,16 +304,19 @@ edvti_draw_zone (GnomeCanvasItem *canvas_item,
small_font_desc = style->font_desc;
context = gtk_widget_get_pango_context (GTK_WIDGET (day_view));
- large_font_metrics = pango_context_get_metrics (context, day_view->large_font_desc,
- pango_context_get_language (context));
- small_font_metrics = pango_context_get_metrics (context, small_font_desc,
- pango_context_get_language (context));
+ large_font_metrics = pango_context_get_metrics (
+ context, day_view->large_font_desc,
+ pango_context_get_language (context));
+ small_font_metrics = pango_context_get_metrics (
+ context, small_font_desc,
+ pango_context_get_language (context));
fg = style->fg[GTK_STATE_NORMAL];
dark = style->dark[GTK_STATE_NORMAL];
/* The start and end of the long horizontal line between hours. */
- long_line_x1 = (use_zone ? 0 : E_DVTMI_TIME_GRID_X_PAD) - x + x_offset;
+ long_line_x1 =
+ (use_zone ? 0 : E_DVTMI_TIME_GRID_X_PAD) - x + x_offset;
long_line_x2 =
time_item->priv->column_width -
E_DVTMI_TIME_GRID_X_PAD - x -
@@ -575,8 +555,10 @@ edvti_draw_zone (GnomeCanvasItem *canvas_item,
gdk_cairo_set_source_color (cr, &fg);
layout = pango_cairo_create_layout (cr);
pango_layout_set_text (layout, buffer, -1);
- pango_layout_set_font_description (layout, day_view->large_font_desc);
- pango_layout_get_pixel_size (layout, &hour_width, NULL);
+ pango_layout_set_font_description (
+ layout, day_view->large_font_desc);
+ pango_layout_get_pixel_size (
+ layout, &hour_width, NULL);
cairo_translate (
cr, large_hour_x2 - hour_width,
row_y + large_hour_y_offset);
@@ -620,8 +602,10 @@ edvti_draw_zone (GnomeCanvasItem *canvas_item,
gdk_cairo_set_source_color (cr, &fg);
layout = pango_cairo_create_layout (cr);
pango_layout_set_text (layout, buffer, -1);
- pango_layout_set_font_description (layout, day_view->small_font_desc);
- pango_layout_get_pixel_size (layout, &minute_width, NULL);
+ pango_layout_set_font_description (
+ layout, day_view->small_font_desc);
+ pango_layout_get_pixel_size (
+ layout, &minute_width, NULL);
cairo_translate (
cr, minute_x2 - minute_width,
row_y + small_font_y_offset);
@@ -796,11 +780,14 @@ e_day_view_time_item_show_popup_menu (EDayViewTimeItem *time_item,
G_CALLBACK (gtk_widget_destroy), NULL);
for (i = 0; i < G_N_ELEMENTS (divisions); i++) {
- g_snprintf (buffer, sizeof (buffer),
- /* TO TRANSLATORS: %02i is the number of minutes; this is a context menu entry
- * to change the length of the time division in the calendar day view, e.g.
- * a day is displayed in 24 "60 minute divisions" or 48 "30 minute divisions"
- */
+ g_snprintf (
+ buffer, sizeof (buffer),
+ /* Translators: %02i is the number of minutes;
+ * this is a context menu entry to change the
+ * length of the time division in the calendar
+ * day view, e.g. a day is displayed in
+ * 24 "60 minute divisions" or
+ * 48 "30 minute divisions". */
_("%02i minute divisions"), divisions[i]);
item = gtk_radio_menu_item_new_with_label (group, buffer);
group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (item));
@@ -808,13 +795,17 @@ e_day_view_time_item_show_popup_menu (EDayViewTimeItem *time_item,
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
if (current_divisions == divisions[i])
- gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), TRUE);
+ gtk_check_menu_item_set_active (
+ GTK_CHECK_MENU_ITEM (item), TRUE);
- g_object_set_data (G_OBJECT (item), "divisions",
- GINT_TO_POINTER (divisions[i]));
+ g_object_set_data (
+ G_OBJECT (item), "divisions",
+ GINT_TO_POINTER (divisions[i]));
- g_signal_connect (item, "toggled",
- G_CALLBACK (e_day_view_time_item_on_set_divisions), time_item);
+ g_signal_connect (
+ item, "toggled",
+ G_CALLBACK (e_day_view_time_item_on_set_divisions),
+ time_item);
}
item = gtk_separator_menu_item_new ();
@@ -844,7 +835,9 @@ e_day_view_time_item_show_popup_menu (EDayViewTimeItem *time_item,
if (!time_item->priv->second_zone)
gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), TRUE);
gtk_menu_shell_append (GTK_MENU_SHELL (submenu), item);
- g_signal_connect (item, "toggled", G_CALLBACK (edvti_on_set_zone), time_item);
+ g_signal_connect (
+ item, "toggled",
+ G_CALLBACK (edvti_on_set_zone), time_item);
recent_zones = calendar_config_get_day_second_zones ();
for (s = recent_zones; s != NULL; s = s->next) {
@@ -872,7 +865,9 @@ e_day_view_time_item_show_popup_menu (EDayViewTimeItem *time_item,
gtk_menu_shell_append (GTK_MENU_SHELL (submenu), item);
item = gtk_menu_item_new_with_label (_("Select..."));
- g_signal_connect (item, "activate", G_CALLBACK (edvti_on_select_zone), time_item);
+ g_signal_connect (
+ item, "activate",
+ G_CALLBACK (edvti_on_select_zone), time_item);
gtk_menu_shell_append (GTK_MENU_SHELL (submenu), item);
gtk_widget_show_all (submenu);
diff --git a/calendar/gui/e-day-view-top-item.c b/calendar/gui/e-day-view-top-item.c
index 9b22fbe339..17a08a06ef 100644
--- a/calendar/gui/e-day-view-top-item.c
+++ b/calendar/gui/e-day-view-top-item.c
@@ -36,6 +36,10 @@
#include "e-calendar-view.h"
#include "e-day-view-top-item.h"
+#define E_DAY_VIEW_TOP_ITEM_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_DAY_VIEW_TOP_ITEM, EDayViewTopItemPrivate))
+
struct _EDayViewTopItemPrivate {
/* The parent EDayView widget. */
EDayView *day_view;
@@ -50,7 +54,10 @@ enum {
PROP_SHOW_DATES
};
-static gpointer parent_class;
+G_DEFINE_TYPE (
+ EDayViewTopItem,
+ e_day_view_top_item,
+ GNOME_TYPE_CANVAS_ITEM)
/* This draws a little triangle to indicate that an event extends past
* the days visible on screen. */
@@ -518,7 +525,7 @@ day_view_top_item_dispose (GObject *object)
{
EDayViewTopItemPrivate *priv;
- priv = E_DAY_VIEW_TOP_ITEM (object)->priv;
+ priv = E_DAY_VIEW_TOP_ITEM_GET_PRIVATE (object);
if (priv->day_view != NULL) {
g_object_unref (priv->day_view);
@@ -526,7 +533,7 @@ day_view_top_item_dispose (GObject *object)
}
/* Chain up to parent's dispose() method. */
- G_OBJECT_CLASS (parent_class)->dispose (object);
+ G_OBJECT_CLASS (e_day_view_top_item_parent_class)->dispose (object);
}
static void
@@ -537,7 +544,8 @@ day_view_top_item_update (GnomeCanvasItem *item,
GnomeCanvasItemClass *canvas_item_class;
/* Chain up to parent's update() method. */
- canvas_item_class = GNOME_CANVAS_ITEM_CLASS (parent_class);
+ canvas_item_class =
+ GNOME_CANVAS_ITEM_CLASS (e_day_view_top_item_parent_class);
canvas_item_class->update (item, i2c, flags);
/* The item covers the entire canvas area. */
@@ -657,16 +665,19 @@ 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. */
+ /* Draw the date. Set a clipping rectangle
+ * so we don't draw over the 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));
+ e_day_view_top_item_get_day_label (
+ day_view, day, buffer, sizeof (buffer));
clip_rect.x = day_view->day_offsets[day] - x;
clip_rect.y = 2 - y;
if (day_view->days_shown == 1) {
gtk_widget_get_allocation (
day_view->top_canvas, &allocation);
- clip_rect.width = allocation.width - day_view->day_offsets[day];
+ clip_rect.width =
+ allocation.width -
+ day_view->day_offsets[day];
} else
clip_rect.width = day_view->day_widths[day];
clip_rect.height = item_height - 2;
@@ -676,11 +687,14 @@ day_view_top_item_draw (GnomeCanvasItem *canvas_item,
gdk_cairo_rectangle (cr, &clip_rect);
cairo_clip (cr);
- layout = gtk_widget_create_pango_layout (GTK_WIDGET (day_view), buffer);
+ layout = gtk_widget_create_pango_layout (
+ GTK_WIDGET (day_view), buffer);
pango_layout_get_pixel_size (layout, &date_width, NULL);
- date_x = day_view->day_offsets[day] + (clip_rect.width - date_width) / 2;
+ date_x = day_view->day_offsets[day] +
+ (clip_rect.width - date_width) / 2;
- gdk_cairo_set_source_color (cr, &style->fg[GTK_STATE_NORMAL]);
+ gdk_cairo_set_source_color (
+ cr, &style->fg[GTK_STATE_NORMAL]);
cairo_move_to (cr, date_x - x, 3 - y);
pango_cairo_show_layout (cr, layout);
@@ -742,12 +756,11 @@ day_view_top_item_point (GnomeCanvasItem *item,
}
static void
-day_view_top_item_class_init (EDayViewTopItemClass *class)
+e_day_view_top_item_class_init (EDayViewTopItemClass *class)
{
GObjectClass *object_class;
GnomeCanvasItemClass *item_class;
- parent_class = g_type_class_peek_parent (class);
g_type_class_add_private (class, sizeof (EDayViewTopItemPrivate));
object_class = G_OBJECT_CLASS (class);
@@ -782,37 +795,9 @@ day_view_top_item_class_init (EDayViewTopItemClass *class)
}
static void
-day_view_top_item_init (EDayViewTopItem *top_item)
+e_day_view_top_item_init (EDayViewTopItem *top_item)
{
- top_item->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- top_item, E_TYPE_DAY_VIEW_TOP_ITEM, EDayViewTopItemPrivate);
-}
-
-GType
-e_day_view_top_item_get_type (void)
-{
- static GType type = 0;
-
- if (G_UNLIKELY (type == 0)) {
- const GTypeInfo type_info = {
- sizeof (EDayViewTopItemClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) day_view_top_item_class_init,
- (GClassFinalizeFunc) NULL,
- NULL, /* class_data */
- sizeof (EDayViewTopItem),
- 0, /* n_preallocs */
- (GInstanceInitFunc) day_view_top_item_init,
- NULL /* value_table */
- };
-
- type = g_type_register_static (
- GNOME_TYPE_CANVAS_ITEM, "EDayViewTopItem",
- &type_info, 0);
- }
-
- return type;
+ top_item->priv = E_DAY_VIEW_TOP_ITEM_GET_PRIVATE (top_item);
}
void
diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c
index cb19db0fe0..89694506f1 100644
--- a/calendar/gui/e-day-view.c
+++ b/calendar/gui/e-day-view.c
@@ -1045,27 +1045,37 @@ e_day_view_init (EDayView *day_view)
1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
gtk_widget_show_all (w);
- g_signal_connect_after (day_view->top_canvas, "button_press_event",
- G_CALLBACK (e_day_view_on_top_canvas_button_press), day_view);
- g_signal_connect (day_view->top_canvas, "button_release_event",
- G_CALLBACK (e_day_view_on_top_canvas_button_release), day_view);
- g_signal_connect (day_view->top_canvas, "scroll_event",
- G_CALLBACK (e_day_view_on_top_canvas_scroll), day_view);
- g_signal_connect (day_view->top_canvas, "motion_notify_event",
- G_CALLBACK (e_day_view_on_top_canvas_motion), day_view);
- g_signal_connect (day_view->top_canvas, "drag_motion",
- G_CALLBACK (e_day_view_on_top_canvas_drag_motion), day_view);
- g_signal_connect (day_view->top_canvas, "drag_leave",
- G_CALLBACK (e_day_view_on_top_canvas_drag_leave), day_view);
-
- g_signal_connect (day_view->top_canvas, "drag_begin",
- G_CALLBACK (e_day_view_on_drag_begin), day_view);
- g_signal_connect (day_view->top_canvas, "drag_end",
- G_CALLBACK (e_day_view_on_drag_end), day_view);
- g_signal_connect (day_view->top_canvas, "drag_data_get",
- G_CALLBACK (e_day_view_on_drag_data_get), day_view);
- g_signal_connect (day_view->top_canvas, "drag_data_received",
- G_CALLBACK (e_day_view_on_top_canvas_drag_data_received), day_view);
+ g_signal_connect_after (
+ day_view->top_canvas, "button_press_event",
+ G_CALLBACK (e_day_view_on_top_canvas_button_press), day_view);
+ g_signal_connect (
+ day_view->top_canvas, "button_release_event",
+ G_CALLBACK (e_day_view_on_top_canvas_button_release), day_view);
+ g_signal_connect (
+ day_view->top_canvas, "scroll_event",
+ G_CALLBACK (e_day_view_on_top_canvas_scroll), day_view);
+ g_signal_connect (
+ day_view->top_canvas, "motion_notify_event",
+ G_CALLBACK (e_day_view_on_top_canvas_motion), day_view);
+ g_signal_connect (
+ day_view->top_canvas, "drag_motion",
+ G_CALLBACK (e_day_view_on_top_canvas_drag_motion), day_view);
+ g_signal_connect (
+ day_view->top_canvas, "drag_leave",
+ G_CALLBACK (e_day_view_on_top_canvas_drag_leave), day_view);
+
+ g_signal_connect (
+ day_view->top_canvas, "drag_begin",
+ G_CALLBACK (e_day_view_on_drag_begin), day_view);
+ g_signal_connect (
+ day_view->top_canvas, "drag_end",
+ G_CALLBACK (e_day_view_on_drag_end), day_view);
+ g_signal_connect (
+ day_view->top_canvas, "drag_data_get",
+ G_CALLBACK (e_day_view_on_drag_data_get), day_view);
+ g_signal_connect (
+ day_view->top_canvas, "drag_data_received",
+ G_CALLBACK (e_day_view_on_top_canvas_drag_data_received), day_view);
canvas_group = GNOME_CANVAS_GROUP (GNOME_CANVAS (day_view->top_dates_canvas)->root);
@@ -1113,42 +1123,42 @@ e_day_view_init (EDayView *day_view)
1, 2, 1, 2,
GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
gtk_widget_show (day_view->main_canvas);
- g_signal_connect (day_view->main_canvas, "realize",
- G_CALLBACK (e_day_view_on_canvas_realized), day_view);
-
- g_signal_connect (day_view->main_canvas,
- "button_press_event",
- G_CALLBACK (e_day_view_on_main_canvas_button_press),
- day_view);
- g_signal_connect (day_view->main_canvas,
- "button_release_event",
- G_CALLBACK (e_day_view_on_main_canvas_button_release),
- day_view);
- g_signal_connect (day_view->main_canvas,
- "scroll_event",
- G_CALLBACK (e_day_view_on_main_canvas_scroll),
- day_view);
- g_signal_connect (day_view->main_canvas,
- "motion_notify_event",
- G_CALLBACK (e_day_view_on_main_canvas_motion),
- day_view);
- g_signal_connect (day_view->main_canvas,
- "drag_motion",
- G_CALLBACK (e_day_view_on_main_canvas_drag_motion),
- day_view);
- g_signal_connect (day_view->main_canvas,
- "drag_leave",
- G_CALLBACK (e_day_view_on_main_canvas_drag_leave),
- day_view);
-
- g_signal_connect (day_view->main_canvas, "drag_begin",
- G_CALLBACK (e_day_view_on_drag_begin), day_view);
- g_signal_connect (day_view->main_canvas, "drag_end",
- G_CALLBACK (e_day_view_on_drag_end), day_view);
- g_signal_connect (day_view->main_canvas, "drag_data_get",
- G_CALLBACK (e_day_view_on_drag_data_get), day_view);
- g_signal_connect (day_view->main_canvas, "drag_data_received",
- G_CALLBACK (e_day_view_on_main_canvas_drag_data_received), day_view);
+ g_signal_connect (
+ day_view->main_canvas, "realize",
+ G_CALLBACK (e_day_view_on_canvas_realized), day_view);
+
+ g_signal_connect (
+ day_view->main_canvas, "button_press_event",
+ G_CALLBACK (e_day_view_on_main_canvas_button_press), day_view);
+ g_signal_connect (
+ day_view->main_canvas, "button_release_event",
+ G_CALLBACK (e_day_view_on_main_canvas_button_release),
+ day_view);
+ g_signal_connect (
+ day_view->main_canvas, "scroll_event",
+ G_CALLBACK (e_day_view_on_main_canvas_scroll), day_view);
+ g_signal_connect (
+ day_view->main_canvas, "motion_notify_event",
+ G_CALLBACK (e_day_view_on_main_canvas_motion), day_view);
+ g_signal_connect (
+ day_view->main_canvas, "drag_motion",
+ G_CALLBACK (e_day_view_on_main_canvas_drag_motion), day_view);
+ g_signal_connect (
+ day_view->main_canvas, "drag_leave",
+ G_CALLBACK (e_day_view_on_main_canvas_drag_leave), day_view);
+
+ g_signal_connect (
+ day_view->main_canvas, "drag_begin",
+ G_CALLBACK (e_day_view_on_drag_begin), day_view);
+ g_signal_connect (
+ day_view->main_canvas, "drag_end",
+ G_CALLBACK (e_day_view_on_drag_end), day_view);
+ g_signal_connect (
+ day_view->main_canvas, "drag_data_get",
+ G_CALLBACK (e_day_view_on_drag_data_get), day_view);
+ g_signal_connect (
+ day_view->main_canvas, "drag_data_received",
+ G_CALLBACK (e_day_view_on_main_canvas_drag_data_received), day_view);
canvas_group = GNOME_CANVAS_GROUP (GNOME_CANVAS (day_view->main_canvas)->root);
@@ -1195,8 +1205,9 @@ e_day_view_init (EDayView *day_view)
0, 1, 1, 2,
GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
gtk_widget_show (day_view->time_canvas);
- g_signal_connect_after (day_view->time_canvas, "scroll_event",
- G_CALLBACK (e_day_view_on_time_canvas_scroll), day_view);
+ g_signal_connect_after (
+ day_view->time_canvas, "scroll_event",
+ G_CALLBACK (e_day_view_on_time_canvas_scroll), day_view);
canvas_group = GNOME_CANVAS_GROUP (GNOME_CANVAS (day_view->time_canvas)->root);
@@ -4806,8 +4817,9 @@ e_day_view_reshape_long_event (EDayView *day_view,
NULL);
g_object_set_data (G_OBJECT (event->canvas_item), "event-num", GINT_TO_POINTER (event_num));
g_object_set_data (G_OBJECT (event->canvas_item), "event-day", GINT_TO_POINTER (E_DAY_VIEW_LONG_EVENT));
- g_signal_connect (event->canvas_item, "event",
- G_CALLBACK (e_day_view_on_text_item_event), day_view);
+ g_signal_connect (
+ event->canvas_item, "event",
+ G_CALLBACK (e_day_view_on_text_item_event), day_view);
g_signal_emit_by_name (G_OBJECT (day_view),
"event_added", event);
@@ -4992,8 +5004,9 @@ e_day_view_reshape_day_event (EDayView *day_view,
NULL);
g_object_set_data (G_OBJECT (event->canvas_item), "event-num", GINT_TO_POINTER (event_num));
g_object_set_data (G_OBJECT (event->canvas_item), "event-day", GINT_TO_POINTER (day));
- g_signal_connect (event->canvas_item, "event",
- G_CALLBACK (e_day_view_on_text_item_event), day_view);
+ g_signal_connect (
+ event->canvas_item, "event",
+ G_CALLBACK (e_day_view_on_text_item_event), day_view);
g_signal_emit_by_name (G_OBJECT (day_view),
"event_added", event);
diff --git a/calendar/gui/e-meeting-attendee.c b/calendar/gui/e-meeting-attendee.c
index 00e3f9d543..a7c4fff5d7 100644
--- a/calendar/gui/e-meeting-attendee.c
+++ b/calendar/gui/e-meeting-attendee.c
@@ -28,6 +28,10 @@
#include <gtk/gtk.h>
#include "e-meeting-attendee.h"
+#define E_MEETING_ATTENDEE_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_MEETING_ATTENDEE, EMeetingAttendeePrivate))
+
struct _EMeetingAttendeePrivate {
gchar *address;
gchar *member;
@@ -72,25 +76,6 @@ static void e_meeting_attendee_finalize (GObject *obj);
G_DEFINE_TYPE (EMeetingAttendee, e_meeting_attendee, G_TYPE_OBJECT)
-static void
-e_meeting_attendee_class_init (EMeetingAttendeeClass *klass)
-{
- GObjectClass *object_class;
-
- object_class = G_OBJECT_CLASS (klass);
-
- signals[CHANGED] =
- g_signal_new ("changed",
- G_TYPE_FROM_CLASS (klass),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (EMeetingAttendeeClass, changed),
- NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
- object_class->finalize = e_meeting_attendee_finalize;
-}
-
static gchar *
string_test (gchar *string)
{
@@ -113,76 +98,89 @@ notify_changed (EMeetingAttendee *ia)
}
static void
-e_meeting_attendee_init (EMeetingAttendee *ia)
+e_meeting_attendee_finalize (GObject *object)
{
EMeetingAttendeePrivate *priv;
- priv = g_new0 (EMeetingAttendeePrivate, 1);
+ priv = E_MEETING_ATTENDEE_GET_PRIVATE (object);
- ia->priv = priv;
+ g_free (priv->address);
+ g_free (priv->member);
+ g_free (priv->fburi);
- priv->address = string_test (NULL);
- priv->member = string_test (NULL);
+ g_free (priv->delto);
+ g_free (priv->delfrom);
- priv->cutype = ICAL_CUTYPE_NONE;
- priv->role = ICAL_ROLE_NONE;
+ g_free (priv->sentby);
+ g_free (priv->cn);
+ g_free (priv->language);
- priv->rsvp = FALSE;
+ g_array_free (priv->busy_periods, TRUE);
- priv->delto = string_test (NULL);
- priv->delfrom = string_test (NULL);
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (e_meeting_attendee_parent_class)->finalize (object);
+}
- priv->status = ICAL_PARTSTAT_NONE;
+static void
+e_meeting_attendee_class_init (EMeetingAttendeeClass *class)
+{
+ GObjectClass *object_class;
- priv->sentby = string_test (NULL);
- priv->cn = string_test (NULL);
- priv->language = string_test (NULL);
+ g_type_class_add_private (class, sizeof (EMeetingAttendeePrivate));
- priv->edit_level = E_MEETING_ATTENDEE_EDIT_FULL;
- priv->has_calendar_info = FALSE;
+ object_class = G_OBJECT_CLASS (class);
+ object_class->finalize = e_meeting_attendee_finalize;
- priv->busy_periods = g_array_new (FALSE, FALSE, sizeof (EMeetingFreeBusyPeriod));
- priv->busy_periods_sorted = FALSE;
+ signals[CHANGED] = g_signal_new (
+ "changed",
+ G_TYPE_FROM_CLASS (class),
+ G_SIGNAL_RUN_FIRST,
+ G_STRUCT_OFFSET (EMeetingAttendeeClass, changed),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+}
- g_date_clear (&priv->busy_periods_start.date, 1);
- priv->busy_periods_start.hour = 0;
- priv->busy_periods_start.minute = 0;
+static void
+e_meeting_attendee_init (EMeetingAttendee *ia)
+{
+ ia->priv = E_MEETING_ATTENDEE_GET_PRIVATE (ia);
- g_date_clear (&priv->busy_periods_end.date, 1);
- priv->busy_periods_end.hour = 0;
- priv->busy_periods_end.minute = 0;
+ ia->priv->address = string_test (NULL);
+ ia->priv->member = string_test (NULL);
- priv->start_busy_range_set = FALSE;
- priv->end_busy_range_set = FALSE;
+ ia->priv->cutype = ICAL_CUTYPE_NONE;
+ ia->priv->role = ICAL_ROLE_NONE;
- priv->longest_period_in_days = 0;
-}
+ ia->priv->rsvp = FALSE;
-static void
-e_meeting_attendee_finalize (GObject *obj)
-{
- EMeetingAttendee *ia = E_MEETING_ATTENDEE (obj);
- EMeetingAttendeePrivate *priv;
+ ia->priv->delto = string_test (NULL);
+ ia->priv->delfrom = string_test (NULL);
- priv = ia->priv;
+ ia->priv->status = ICAL_PARTSTAT_NONE;
- g_free (priv->address);
- g_free (priv->member);
- g_free (priv->fburi);
+ ia->priv->sentby = string_test (NULL);
+ ia->priv->cn = string_test (NULL);
+ ia->priv->language = string_test (NULL);
- g_free (priv->delto);
- g_free (priv->delfrom);
+ ia->priv->edit_level = E_MEETING_ATTENDEE_EDIT_FULL;
+ ia->priv->has_calendar_info = FALSE;
- g_free (priv->sentby);
- g_free (priv->cn);
- g_free (priv->language);
+ ia->priv->busy_periods = g_array_new (FALSE, FALSE, sizeof (EMeetingFreeBusyPeriod));
+ ia->priv->busy_periods_sorted = FALSE;
- g_array_free (priv->busy_periods, TRUE);
+ g_date_clear (&ia->priv->busy_periods_start.date, 1);
+ ia->priv->busy_periods_start.hour = 0;
+ ia->priv->busy_periods_start.minute = 0;
- g_free (priv);
+ g_date_clear (&ia->priv->busy_periods_end.date, 1);
+ ia->priv->busy_periods_end.hour = 0;
+ ia->priv->busy_periods_end.minute = 0;
- /* Chain up to parent's finalize() method. */
- G_OBJECT_CLASS (e_meeting_attendee_parent_class)->finalize (obj);
+ ia->priv->start_busy_range_set = FALSE;
+ ia->priv->end_busy_range_set = FALSE;
+
+ ia->priv->longest_period_in_days = 0;
}
GObject *
@@ -899,7 +897,13 @@ e_meeting_attendee_add_busy_period (EMeetingAttendee *ia,
priv->busy_periods_end.hour = period.end.hour;
priv->busy_periods_end.minute = period.end.minute;
} else {
- switch (g_date_compare (&period.end.date, &priv->busy_periods_end.date)) {
+ gint compare;
+
+ compare = g_date_compare (
+ &period.end.date,
+ &priv->busy_periods_end.date);
+
+ switch (compare) {
case 0:
if (period.end.hour > priv->busy_periods_end.hour
|| (period.end.hour == priv->busy_periods_end.hour
diff --git a/calendar/gui/e-meeting-list-view.c b/calendar/gui/e-meeting-list-view.c
index cd2e7fbcfd..08ff03f86f 100644
--- a/calendar/gui/e-meeting-list-view.c
+++ b/calendar/gui/e-meeting-list-view.c
@@ -40,6 +40,10 @@
#include <libebook/e-destination.h>
#include "e-select-names-renderer.h"
+#define E_MEETING_LIST_VIEW_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_MEETING_LIST_VIEW, EMeetingListViewPrivate))
+
struct _EMeetingListViewPrivate {
EMeetingStore *store;
@@ -75,10 +79,11 @@ static icalparameter_role roles[] = {ICAL_ROLE_CHAIR,
G_DEFINE_TYPE (EMeetingListView, e_meeting_list_view, GTK_TYPE_TREE_VIEW)
static void
-e_meeting_list_view_finalize (GObject *obj)
+e_meeting_list_view_finalize (GObject *object)
{
- EMeetingListView *view = E_MEETING_LIST_VIEW (obj);
- EMeetingListViewPrivate *priv = view->priv;
+ EMeetingListViewPrivate *priv;
+
+ priv = E_MEETING_LIST_VIEW_GET_PRIVATE (object);
if (priv->name_selector) {
e_name_selector_cancel_loading (priv->name_selector);
@@ -91,30 +96,29 @@ e_meeting_list_view_finalize (GObject *obj)
priv->renderers = NULL;
}
- g_free (priv);
-
/* Chain up to parent's finalize() method. */
- G_OBJECT_CLASS (e_meeting_list_view_parent_class)->finalize (obj);
+ G_OBJECT_CLASS (e_meeting_list_view_parent_class)->finalize (object);
}
static void
-e_meeting_list_view_class_init (EMeetingListViewClass *klass)
+e_meeting_list_view_class_init (EMeetingListViewClass *class)
{
GObjectClass *object_class;
- object_class = G_OBJECT_CLASS (klass);
+ g_type_class_add_private (class, sizeof (EMeetingListViewPrivate));
+ object_class = G_OBJECT_CLASS (class);
object_class->finalize = e_meeting_list_view_finalize;
- e_meeting_list_view_signals[ATTENDEE_ADDED] =
- g_signal_new ("attendee_added",
- G_TYPE_FROM_CLASS (klass),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EMeetingListViewClass, attendee_added),
- NULL, NULL,
- g_cclosure_marshal_VOID__POINTER,
- G_TYPE_NONE, 1,
- G_TYPE_POINTER);
+ e_meeting_list_view_signals[ATTENDEE_ADDED] = g_signal_new (
+ "attendee_added",
+ G_TYPE_FROM_CLASS (class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EMeetingListViewClass, attendee_added),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__POINTER,
+ G_TYPE_NONE, 1,
+ G_TYPE_POINTER);
}
static void
@@ -141,28 +145,29 @@ meeting_list_view_realize_cb (EMeetingListView *view)
static void
e_meeting_list_view_init (EMeetingListView *view)
{
- EMeetingListViewPrivate *priv;
ENameSelectorDialog *name_selector_dialog;
gint i;
- priv = g_new0 (EMeetingListViewPrivate, 1);
-
- view->priv = priv;
+ view->priv = E_MEETING_LIST_VIEW_GET_PRIVATE (view);
- priv->renderers = g_hash_table_new (g_direct_hash, g_int_equal);
+ view->priv->renderers = g_hash_table_new (g_direct_hash, g_int_equal);
- priv->name_selector = e_name_selector_new ();
+ view->priv->name_selector = e_name_selector_new ();
for (i = 0; sections[i]; i++)
- add_section (priv->name_selector, sections[i]);
+ add_section (view->priv->name_selector, sections[i]);
- name_selector_dialog = e_name_selector_peek_dialog (view->priv->name_selector);
+ name_selector_dialog =
+ e_name_selector_peek_dialog (view->priv->name_selector);
gtk_window_set_title (GTK_WINDOW (name_selector_dialog), _("Attendees"));
- g_signal_connect (name_selector_dialog, "response",
- G_CALLBACK (name_selector_dialog_close_cb), view);
+ g_signal_connect (
+ name_selector_dialog, "response",
+ G_CALLBACK (name_selector_dialog_close_cb), view);
/* postpone name_selector loading, do that only when really needed */
- g_signal_connect (view, "realize", G_CALLBACK (meeting_list_view_realize_cb), NULL);
+ g_signal_connect (
+ view, "realize",
+ G_CALLBACK (meeting_list_view_realize_cb), NULL);
}
static GList *
@@ -553,7 +558,9 @@ editing_started_cb (GtkCellRenderer *renderer,
gchar *path,
gpointer user_data)
{
- g_signal_connect (editable, "updated", G_CALLBACK(ense_update), NULL);
+ g_signal_connect (
+ editable, "updated",
+ G_CALLBACK (ense_update), NULL);
}
static GtkCellRenderer *
@@ -617,9 +624,15 @@ build_table (EMeetingListView *lview)
gtk_tree_view_column_set_expand (col, TRUE);
g_object_set (col, "min-width", 50, NULL);
g_object_set_data (G_OBJECT (col), "mtg-store-col", GINT_TO_POINTER (E_MEETING_STORE_ATTENDEE_COL));
- g_signal_connect (renderer, "cell_edited", G_CALLBACK (attendee_edited_cb), view);
- g_signal_connect (renderer, "editing-canceled", G_CALLBACK (attendee_editing_canceled_cb), view);
- g_signal_connect (renderer, "editing-started", G_CALLBACK (editing_started_cb), view);
+ g_signal_connect (
+ renderer, "cell_edited",
+ G_CALLBACK (attendee_edited_cb), view);
+ g_signal_connect (
+ renderer, "editing-canceled",
+ G_CALLBACK (attendee_editing_canceled_cb), view);
+ g_signal_connect (
+ renderer, "editing-started",
+ G_CALLBACK (editing_started_cb), view);
g_hash_table_insert (edit_table, GINT_TO_POINTER (E_MEETING_STORE_ATTENDEE_COL), renderer);
@@ -631,7 +644,9 @@ build_table (EMeetingListView *lview)
gtk_tree_view_column_set_resizable (col, TRUE);
gtk_tree_view_column_set_reorderable (col, TRUE);
g_object_set_data (G_OBJECT (col), "mtg-store-col", GINT_TO_POINTER (E_MEETING_STORE_TYPE_COL));
- g_signal_connect (renderer, "edited", G_CALLBACK (type_edited_cb), view);
+ g_signal_connect (
+ renderer, "edited",
+ G_CALLBACK (type_edited_cb), view);
g_hash_table_insert (edit_table, GINT_TO_POINTER (E_MEETING_STORE_TYPE_COL), renderer);
renderer = create_combo_cell_renderer (get_role_strings ());
@@ -642,7 +657,9 @@ build_table (EMeetingListView *lview)
gtk_tree_view_column_set_resizable (col, TRUE);
gtk_tree_view_column_set_reorderable (col, TRUE);
g_object_set_data (G_OBJECT (col), "mtg-store-col", GINT_TO_POINTER (E_MEETING_STORE_ROLE_COL));
- g_signal_connect (renderer, "edited", G_CALLBACK (role_edited_cb), view);
+ g_signal_connect (
+ renderer, "edited",
+ G_CALLBACK (role_edited_cb), view);
g_hash_table_insert (edit_table, GINT_TO_POINTER (E_MEETING_STORE_ROLE_COL), renderer);
renderer = create_combo_cell_renderer (get_rsvp_strings ());
@@ -654,7 +671,9 @@ build_table (EMeetingListView *lview)
gtk_tree_view_column_set_resizable (col, TRUE);
gtk_tree_view_column_set_reorderable (col, TRUE);
g_object_set_data (G_OBJECT (col), "mtg-store-col", GINT_TO_POINTER (E_MEETING_STORE_RSVP_COL));
- g_signal_connect (renderer, "edited", G_CALLBACK (rsvp_edited_cb), view);
+ g_signal_connect (
+ renderer, "edited",
+ G_CALLBACK (rsvp_edited_cb), view);
g_hash_table_insert (edit_table, GINT_TO_POINTER (E_MEETING_STORE_RSVP_COL), renderer);
renderer = create_combo_cell_renderer (get_status_strings ());
@@ -665,7 +684,9 @@ build_table (EMeetingListView *lview)
gtk_tree_view_column_set_resizable (col, TRUE);
gtk_tree_view_column_set_reorderable (col, TRUE);
g_object_set_data (G_OBJECT (col), "mtg-store-col", GINT_TO_POINTER (E_MEETING_STORE_STATUS_COL));
- g_signal_connect (renderer, "edited", G_CALLBACK (status_edited_cb), view);
+ g_signal_connect (
+ renderer, "edited",
+ G_CALLBACK (status_edited_cb), view);
g_hash_table_insert (edit_table, GINT_TO_POINTER (E_MEETING_STORE_STATUS_COL), renderer);
priv->renderers = edit_table;
@@ -776,7 +797,10 @@ e_meeting_list_view_new (EMeetingStore *store)
}
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (view));
- g_signal_connect (selection, "changed", G_CALLBACK (row_activated_cb), view);
+ g_signal_connect (
+ selection, "changed",
+ G_CALLBACK (row_activated_cb), view);
+
return view;
}
diff --git a/calendar/gui/e-meeting-store.c b/calendar/gui/e-meeting-store.c
index e11d90e7bb..0fbf327236 100644
--- a/calendar/gui/e-meeting-store.c
+++ b/calendar/gui/e-meeting-store.c
@@ -49,6 +49,10 @@
#define ROW_VALID(store, row) \
(row >= 0 && row < store->priv->attendees->len)
+#define E_MEETING_STORE_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_MEETING_STORE, EMeetingStorePrivate))
+
struct _EMeetingStorePrivate {
GPtrArray *attendees;
gint stamp;
@@ -739,7 +743,7 @@ meeting_store_finalize (GObject *object)
EMeetingStorePrivate *priv;
gint i;
- priv = E_MEETING_STORE (object)->priv;
+ priv = E_MEETING_STORE_GET_PRIVATE (object);
for (i = 0; i < priv->attendees->len; i++)
g_object_unref (g_ptr_array_index (priv->attendees, i));
@@ -846,8 +850,7 @@ e_meeting_store_class_init (EMeetingStoreClass *class)
static void
e_meeting_store_init (EMeetingStore *store)
{
- store->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- store, E_TYPE_MEETING_STORE, EMeetingStorePrivate);
+ store->priv = E_MEETING_STORE_GET_PRIVATE (store);
store->priv->attendees = g_ptr_array_new ();
store->priv->refresh_queue = g_ptr_array_new ();
@@ -1028,7 +1031,9 @@ e_meeting_store_add_attendee (EMeetingStore *store,
g_object_ref (attendee);
g_ptr_array_add (store->priv->attendees, attendee);
- g_signal_connect (attendee, "changed", G_CALLBACK (attendee_changed_cb), store);
+ g_signal_connect (
+ attendee, "changed",
+ G_CALLBACK (attendee_changed_cb), store);
path = gtk_tree_path_new ();
gtk_tree_path_append_index (path, store->priv->attendees->len - 1);
@@ -1797,10 +1802,10 @@ async_read (GObject *source_object,
read = g_input_stream_read_finish (istream, result, &error);
- if (error || read < 0) {
- g_warning ("Read finish failed: %s", error ? error->message : "Unknown error");
- if (error)
- g_error_free (error);
+ if (error != NULL) {
+ g_warning (
+ "Read finish failed: %s", error->message);
+ g_error_free (error);
g_input_stream_close (istream, NULL, NULL);
g_object_unref (istream);
@@ -1808,6 +1813,8 @@ async_read (GObject *source_object,
return;
}
+ g_return_if_fail (read >= 0);
+
if (read == 0) {
g_input_stream_close (istream, NULL, NULL);
g_object_unref (istream);
diff --git a/calendar/gui/e-meeting-time-sel.c b/calendar/gui/e-meeting-time-sel.c
index ca5bb2c15b..cfbff11d2b 100644
--- a/calendar/gui/e-meeting-time-sel.c
+++ b/calendar/gui/e-meeting-time-sel.c
@@ -47,6 +47,10 @@
#include "e-meeting-list-view.h"
#include "e-meeting-time-sel-item.h"
+#define E_MEETING_TIME_SELECTOR_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_MEETING_TIME_SELECTOR, EMeetingTimeSelectorPrivate))
+
struct _EMeetingTimeSelectorPrivate {
gint week_start_day;
guint show_week_numbers : 1;
@@ -362,9 +366,7 @@ e_meeting_time_selector_class_init (EMeetingTimeSelectorClass *class)
static void
e_meeting_time_selector_init (EMeetingTimeSelector *mts)
{
- mts->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- mts, E_TYPE_MEETING_TIME_SELECTOR,
- EMeetingTimeSelectorPrivate);
+ mts->priv = E_MEETING_TIME_SELECTOR_GET_PRIVATE (mts);
/* The shadow is drawn in the border so it must be >= 2 pixels. */
gtk_container_set_border_width (GTK_CONTAINER (mts), 2);
@@ -448,9 +450,15 @@ e_meeting_time_selector_construct (EMeetingTimeSelector *mts,
mts->model, "notify::free-busy-template",
G_CALLBACK (free_busy_template_changed_cb), mts);
- g_signal_connect (mts->model, "row_inserted", G_CALLBACK (row_inserted_cb), mts);
- g_signal_connect (mts->model, "row_changed", G_CALLBACK (row_changed_cb), mts);
- g_signal_connect (mts->model, "row_deleted", G_CALLBACK (row_deleted_cb), mts);
+ g_signal_connect (
+ mts->model, "row_inserted",
+ G_CALLBACK (row_inserted_cb), mts);
+ g_signal_connect (
+ mts->model, "row_changed",
+ G_CALLBACK (row_changed_cb), mts);
+ g_signal_connect (
+ mts->model, "row_deleted",
+ G_CALLBACK (row_deleted_cb), mts);
mts->list_view = e_meeting_list_view_new (mts->model);
e_meeting_list_view_column_set_visible (mts->list_view, E_MEETING_STORE_ROLE_COL, FALSE);
@@ -471,7 +479,9 @@ e_meeting_time_selector_construct (EMeetingTimeSelector *mts,
#if 0
/* FIXME: do we need sorting here */
- g_signal_connect (real_table->sort_info, "sort_info_changed", G_CALLBACK (sort_info_changed_cb), mts);
+ g_signal_connect (
+ real_table->sort_info, "sort_info_changed",
+ G_CALLBACK (sort_info_changed_cb), mts);
#endif
gtk_box_pack_start (GTK_BOX (mts->attendees_vbox), GTK_WIDGET (sw), TRUE, TRUE, 6);
@@ -487,8 +497,9 @@ e_meeting_time_selector_construct (EMeetingTimeSelector *mts,
gtk_table_attach (GTK_TABLE (mts), mts->display_top,
1, 4, 0, 1, GTK_EXPAND | GTK_FILL, 0, 0, 0);
gtk_widget_show (mts->display_top);
- g_signal_connect (mts->display_top, "realize",
- G_CALLBACK (e_meeting_time_selector_on_canvas_realized), mts);
+ g_signal_connect (
+ mts->display_top, "realize",
+ G_CALLBACK (e_meeting_time_selector_on_canvas_realized), mts);
mts->display_main = gnome_canvas_new ();
e_meeting_time_selector_update_main_canvas_scroll_region (mts);
@@ -497,12 +508,15 @@ e_meeting_time_selector_construct (EMeetingTimeSelector *mts,
1, 4, 1, 2,
GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
gtk_widget_show (mts->display_main);
- g_signal_connect (mts->display_main, "realize",
- G_CALLBACK (e_meeting_time_selector_on_canvas_realized), mts);
- g_signal_connect (mts->display_main, "size_allocate",
- G_CALLBACK (e_meeting_time_selector_on_canvas_size_allocate), mts);
- g_signal_connect (mts->display_main, "scroll-event",
- G_CALLBACK (e_meeting_time_selector_on_canvas_scroll_event), mts);
+ g_signal_connect (
+ mts->display_main, "realize",
+ G_CALLBACK (e_meeting_time_selector_on_canvas_realized), mts);
+ g_signal_connect (
+ mts->display_main, "size_allocate",
+ G_CALLBACK (e_meeting_time_selector_on_canvas_size_allocate), mts);
+ g_signal_connect (
+ mts->display_main, "scroll-event",
+ G_CALLBACK (e_meeting_time_selector_on_canvas_scroll_event), mts);
scrollable = GTK_SCROLLABLE (mts->display_main);
@@ -569,15 +583,17 @@ e_meeting_time_selector_construct (EMeetingTimeSelector *mts,
GTK_STOCK_JUMP_TO, GTK_ICON_SIZE_BUTTON));
gtk_box_pack_start (GTK_BOX (hbox), mts->add_attendees_button, TRUE, TRUE, 6);
gtk_widget_show (mts->add_attendees_button);
- g_signal_connect (mts->add_attendees_button, "clicked",
- G_CALLBACK (e_meeting_time_selector_on_invite_others_button_clicked), mts);
+ g_signal_connect (
+ mts->add_attendees_button, "clicked",
+ G_CALLBACK (e_meeting_time_selector_on_invite_others_button_clicked), mts);
mts->options_button = gtk_button_new ();
gtk_box_pack_start (GTK_BOX (hbox), mts->options_button, TRUE, TRUE, 6);
gtk_widget_show (mts->options_button);
- g_signal_connect (mts->options_button, "clicked",
- G_CALLBACK (e_meeting_time_selector_on_options_button_clicked), mts);
+ g_signal_connect (
+ mts->options_button, "clicked",
+ G_CALLBACK (e_meeting_time_selector_on_options_button_clicked), mts);
child_hbox = gtk_hbox_new (FALSE, 2);
gtk_container_add (GTK_CONTAINER (mts->options_button), child_hbox);
@@ -606,8 +622,9 @@ e_meeting_time_selector_construct (EMeetingTimeSelector *mts,
gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menuitem),
mts->working_hours_only);
- g_signal_connect (menuitem, "toggled",
- G_CALLBACK (e_meeting_time_selector_on_working_hours_toggled), mts);
+ g_signal_connect (
+ menuitem, "toggled",
+ G_CALLBACK (e_meeting_time_selector_on_working_hours_toggled), mts);
gtk_widget_show (menuitem);
menuitem = gtk_check_menu_item_new_with_label ("");
@@ -617,8 +634,9 @@ e_meeting_time_selector_construct (EMeetingTimeSelector *mts,
gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menuitem),
mts->zoomed_out);
- g_signal_connect (menuitem, "toggled",
- G_CALLBACK (e_meeting_time_selector_on_zoomed_out_toggled), mts);
+ g_signal_connect (
+ menuitem, "toggled",
+ G_CALLBACK (e_meeting_time_selector_on_zoomed_out_toggled), mts);
gtk_widget_show (menuitem);
menuitem = gtk_menu_item_new ();
@@ -631,8 +649,9 @@ e_meeting_time_selector_construct (EMeetingTimeSelector *mts,
gtk_label_set_text_with_mnemonic (GTK_LABEL (child), _("_Update free/busy"));
gtk_menu_shell_append (GTK_MENU_SHELL (mts->options_menu), menuitem);
- g_signal_connect (menuitem, "activate",
- G_CALLBACK (e_meeting_time_selector_on_update_free_busy), mts);
+ g_signal_connect (
+ menuitem, "activate",
+ G_CALLBACK (e_meeting_time_selector_on_update_free_busy), mts);
gtk_widget_show (menuitem);
/* Create the 3 AutoPick buttons on the left. */
@@ -649,8 +668,9 @@ e_meeting_time_selector_construct (EMeetingTimeSelector *mts,
accel_key, GDK_MOD1_MASK | GDK_SHIFT_MASK, 0);
gtk_box_pack_start (GTK_BOX (hbox), mts->autopick_down_button, TRUE, TRUE, 6);
gtk_widget_show (mts->autopick_down_button);
- g_signal_connect (mts->autopick_down_button, "clicked",
- G_CALLBACK (e_meeting_time_selector_on_prev_button_clicked), mts);
+ g_signal_connect (
+ mts->autopick_down_button, "clicked",
+ G_CALLBACK (e_meeting_time_selector_on_prev_button_clicked), mts);
mts->autopick_button = gtk_button_new ();
gtk_box_pack_start (GTK_BOX (hbox), mts->autopick_button, TRUE, TRUE, 6);
@@ -667,8 +687,9 @@ e_meeting_time_selector_construct (EMeetingTimeSelector *mts,
gtk_widget_show (label);
gtk_widget_add_accelerator (mts->autopick_button, "clicked", mts->accel_group,
accel_key, GDK_MOD1_MASK, 0);
- g_signal_connect (mts->autopick_button, "clicked",
- G_CALLBACK (e_meeting_time_selector_on_autopick_button_clicked), mts);
+ g_signal_connect (
+ mts->autopick_button, "clicked",
+ G_CALLBACK (e_meeting_time_selector_on_autopick_button_clicked), mts);
arrow = gtk_arrow_new (GTK_ARROW_DOWN, GTK_SHADOW_NONE);
gtk_box_pack_start (GTK_BOX (child_hbox), arrow, FALSE, FALSE, 6);
@@ -682,8 +703,9 @@ e_meeting_time_selector_construct (EMeetingTimeSelector *mts,
accel_key, GDK_MOD1_MASK | GDK_SHIFT_MASK, 0);
gtk_box_pack_start (GTK_BOX (hbox), mts->autopick_up_button, TRUE, TRUE, 6);
gtk_widget_show (mts->autopick_up_button);
- g_signal_connect (mts->autopick_up_button, "clicked",
- G_CALLBACK (e_meeting_time_selector_on_next_button_clicked), mts);
+ g_signal_connect (
+ mts->autopick_up_button, "clicked",
+ G_CALLBACK (e_meeting_time_selector_on_next_button_clicked), mts);
/* Create the Autopick menu. */
mts->autopick_menu = gtk_menu_new ();
@@ -696,8 +718,9 @@ e_meeting_time_selector_construct (EMeetingTimeSelector *mts,
group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (menuitem));
gtk_label_set_text_with_mnemonic (GTK_LABEL (child), _("_All people and resources"));
gtk_menu_shell_append (GTK_MENU_SHELL (mts->autopick_menu), menuitem);
- g_signal_connect (menuitem, "toggled",
- G_CALLBACK (e_meeting_time_selector_on_autopick_option_toggled), mts);
+ g_signal_connect (
+ menuitem, "toggled",
+ G_CALLBACK (e_meeting_time_selector_on_autopick_option_toggled), mts);
gtk_widget_show (menuitem);
menuitem = gtk_radio_menu_item_new_with_label (group, "");
@@ -706,8 +729,9 @@ e_meeting_time_selector_construct (EMeetingTimeSelector *mts,
group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (menuitem));
gtk_label_set_text_with_mnemonic (GTK_LABEL (child), _("All _people and one resource"));
gtk_menu_shell_append (GTK_MENU_SHELL (mts->autopick_menu), menuitem);
- g_signal_connect (menuitem, "toggled",
- G_CALLBACK (e_meeting_time_selector_on_autopick_option_toggled), mts);
+ g_signal_connect (
+ menuitem, "toggled",
+ G_CALLBACK (e_meeting_time_selector_on_autopick_option_toggled), mts);
gtk_widget_show (menuitem);
menuitem = gtk_radio_menu_item_new_with_label (group, "");
@@ -716,8 +740,9 @@ e_meeting_time_selector_construct (EMeetingTimeSelector *mts,
group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (menuitem));
gtk_label_set_text_with_mnemonic (GTK_LABEL (child), _("_Required people"));
gtk_menu_shell_append (GTK_MENU_SHELL (mts->autopick_menu), menuitem);
- g_signal_connect (menuitem, "activate",
- G_CALLBACK (e_meeting_time_selector_on_autopick_option_toggled), mts);
+ g_signal_connect (
+ menuitem, "activate",
+ G_CALLBACK (e_meeting_time_selector_on_autopick_option_toggled), mts);
gtk_widget_show (menuitem);
menuitem = gtk_radio_menu_item_new_with_label (group, "");
@@ -725,8 +750,9 @@ e_meeting_time_selector_construct (EMeetingTimeSelector *mts,
child = gtk_bin_get_child (GTK_BIN (menuitem));
gtk_label_set_text_with_mnemonic (GTK_LABEL (child), _("Required people and _one resource"));
gtk_menu_shell_append (GTK_MENU_SHELL (mts->autopick_menu), menuitem);
- g_signal_connect (menuitem, "activate",
- G_CALLBACK (e_meeting_time_selector_on_autopick_option_toggled), mts);
+ g_signal_connect (
+ menuitem, "activate",
+ G_CALLBACK (e_meeting_time_selector_on_autopick_option_toggled), mts);
gtk_widget_show (menuitem);
/* Create the date entry fields on the right. */
@@ -769,8 +795,9 @@ e_meeting_time_selector_construct (EMeetingTimeSelector *mts,
gtk_table_attach (GTK_TABLE (table), mts->start_date_edit,
1, 2, 0, 1, GTK_FILL, 0, 0, 0);
gtk_widget_show (mts->start_date_edit);
- g_signal_connect (mts->start_date_edit, "changed",
- G_CALLBACK (e_meeting_time_selector_on_start_time_changed), mts);
+ g_signal_connect (
+ mts->start_date_edit, "changed",
+ G_CALLBACK (e_meeting_time_selector_on_start_time_changed), mts);
label = gtk_label_new_with_mnemonic (_("_Start time:"));
gtk_label_set_mnemonic_widget (GTK_LABEL (label), (mts->start_date_edit));
@@ -809,8 +836,9 @@ e_meeting_time_selector_construct (EMeetingTimeSelector *mts,
gtk_table_attach (GTK_TABLE (table), mts->end_date_edit,
1, 2, 1, 2, GTK_FILL, 0, 0, 0);
gtk_widget_show (mts->end_date_edit);
- g_signal_connect (mts->end_date_edit, "changed",
- G_CALLBACK (e_meeting_time_selector_on_end_time_changed), mts);
+ g_signal_connect (
+ mts->end_date_edit, "changed",
+ G_CALLBACK (e_meeting_time_selector_on_end_time_changed), mts);
label = gtk_label_new_with_mnemonic (_("_End time:"));
gtk_label_set_mnemonic_widget (GTK_LABEL (label), (mts->end_date_edit));
@@ -885,9 +913,9 @@ e_meeting_time_selector_add_key_color (EMeetingTimeSelector *mts,
gtk_box_pack_start (GTK_BOX (child_hbox), label, TRUE, TRUE, 6);
gtk_widget_show (label);
- g_signal_connect (darea, "draw",
- G_CALLBACK (e_meeting_time_selector_draw_key_color),
- color);
+ g_signal_connect (
+ darea, "draw",
+ G_CALLBACK (e_meeting_time_selector_draw_key_color), color);
}
static gint
diff --git a/calendar/gui/e-memo-list-selector.c b/calendar/gui/e-memo-list-selector.c
index 4484f94298..51466da09e 100644
--- a/calendar/gui/e-memo-list-selector.c
+++ b/calendar/gui/e-memo-list-selector.c
@@ -30,6 +30,10 @@
#include "e-util/e-selection.h"
#include "calendar/gui/comp-util.h"
+#define E_MEMO_LIST_SELECTOR_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_MEMO_LIST_SELECTOR, EMemoListSelectorPrivate))
+
struct _EMemoListSelectorPrivate {
gint dummy_value;
};
@@ -318,8 +322,7 @@ e_memo_list_selector_class_init (EMemoListSelectorClass *class)
static void
e_memo_list_selector_init (EMemoListSelector *selector)
{
- selector->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- selector, E_TYPE_MEMO_LIST_SELECTOR, EMemoListSelectorPrivate);
+ selector->priv = E_MEMO_LIST_SELECTOR_GET_PRIVATE (selector);
gtk_drag_dest_set (
GTK_WIDGET (selector), GTK_DEST_DEFAULT_ALL,
diff --git a/calendar/gui/e-memo-table.c b/calendar/gui/e-memo-table.c
index 872408c8da..be2cd1a127 100644
--- a/calendar/gui/e-memo-table.c
+++ b/calendar/gui/e-memo-table.c
@@ -60,6 +60,10 @@
#include <e-util/e-icon-factory.h>
#include "misc.h"
+#define E_MEMO_TABLE_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_MEMO_TABLE, EMemoTablePrivate))
+
struct _EMemoTablePrivate {
gpointer shell_view; /* weak pointer */
ECalModel *model;
@@ -92,6 +96,18 @@ static const gchar *icon_names[] = {
"stock_insert-note"
};
+/* Forward Declarations */
+static void e_memo_table_selectable_init
+ (ESelectableInterface *interface);
+
+G_DEFINE_TYPE_WITH_CODE (
+ EMemoTable,
+ e_memo_table,
+ E_TYPE_TABLE,
+ G_IMPLEMENT_INTERFACE (
+ E_TYPE_SELECTABLE,
+ e_memo_table_selectable_init))
+
static void
memo_table_emit_open_component (EMemoTable *memo_table,
ECalModelComponent *comp_data)
@@ -294,7 +310,7 @@ memo_table_dispose (GObject *object)
{
EMemoTablePrivate *priv;
- priv = E_MEMO_TABLE (object)->priv;
+ priv = E_MEMO_TABLE_GET_PRIVATE (object);
if (priv->shell_view != NULL) {
g_object_remove_weak_pointer (
@@ -1059,7 +1075,7 @@ memo_table_select_all (ESelectable *selectable)
}
static void
-memo_table_class_init (EMemoTableClass *class)
+e_memo_table_class_init (EMemoTableClass *class)
{
GObjectClass *object_class;
GtkWidgetClass *widget_class;
@@ -1148,12 +1164,11 @@ memo_table_class_init (EMemoTableClass *class)
}
static void
-memo_table_init (EMemoTable *memo_table)
+e_memo_table_init (EMemoTable *memo_table)
{
GtkTargetList *target_list;
- memo_table->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- memo_table, E_TYPE_MEMO_TABLE, EMemoTablePrivate);
+ memo_table->priv = E_MEMO_TABLE_GET_PRIVATE (memo_table);
target_list = gtk_target_list_new (NULL, 0);
e_target_list_add_calendar_targets (target_list, 0);
@@ -1165,7 +1180,7 @@ memo_table_init (EMemoTable *memo_table)
}
static void
-memo_table_selectable_init (ESelectableInterface *interface)
+e_memo_table_selectable_init (ESelectableInterface *interface)
{
interface->update_actions = memo_table_update_actions;
interface->cut_clipboard = memo_table_cut_clipboard;
@@ -1175,41 +1190,6 @@ memo_table_selectable_init (ESelectableInterface *interface)
interface->select_all = memo_table_select_all;
}
-GType
-e_memo_table_get_type (void)
-{
- static GType type = 0;
-
- if (G_UNLIKELY (type == 0)) {
- static const GTypeInfo type_info = {
- sizeof (EMemoTableClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) memo_table_class_init,
- (GClassFinalizeFunc) NULL,
- NULL, /* class_data */
- sizeof (EMemoTable),
- 0, /* n_preallocs */
- (GInstanceInitFunc) memo_table_init,
- NULL /* value_table */
- };
-
- static const GInterfaceInfo selectable_info = {
- (GInterfaceInitFunc) memo_table_selectable_init,
- (GInterfaceFinalizeFunc) NULL,
- NULL /* interface_data */
- };
-
- type = g_type_register_static (
- E_TYPE_TABLE, "EMemoTable", &type_info, 0);
-
- g_type_add_interface_static (
- type, E_TYPE_SELECTABLE, &selectable_info);
- }
-
- return type;
-}
-
/**
* e_memo_table_new:
* @shell_view: an #EShellView
diff --git a/calendar/gui/e-month-view.c b/calendar/gui/e-month-view.c
index ca8fe3a1de..fe0bebaf8e 100644
--- a/calendar/gui/e-month-view.c
+++ b/calendar/gui/e-month-view.c
@@ -27,11 +27,15 @@
#include <libecal/e-cal-time-util.h>
+#define E_MONTH_VIEW_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_MONTH_VIEW, EMonthViewPrivate))
+
struct _EMonthViewPrivate {
gint placeholder;
};
-static gpointer parent_class;
+G_DEFINE_TYPE (EMonthView, e_month_view, E_TYPE_WEEK_VIEW)
static void
month_view_cursor_key_up (EWeekView *week_view)
@@ -158,11 +162,10 @@ month_view_cursor_key_right (EWeekView *week_view)
}
static void
-month_view_class_init (EMonthViewClass *class)
+e_month_view_class_init (EMonthViewClass *class)
{
EWeekViewClass *week_view_class;
- parent_class = g_type_class_peek_parent (class);
g_type_class_add_private (class, sizeof (EMonthViewPrivate));
week_view_class = E_WEEK_VIEW_CLASS (class);
@@ -173,36 +176,9 @@ month_view_class_init (EMonthViewClass *class)
}
static void
-month_view_init (EMonthView *month_view)
-{
- month_view->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- month_view, E_TYPE_MONTH_VIEW, EMonthViewPrivate);
-}
-
-GType
-e_month_view_get_type (void)
+e_month_view_init (EMonthView *month_view)
{
- static GType type = 0;
-
- if (G_UNLIKELY (type == 0)) {
- const GTypeInfo type_info = {
- sizeof (EMonthViewClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) month_view_class_init,
- (GClassFinalizeFunc) NULL,
- NULL, /* class_data */
- sizeof (EMonthView),
- 0, /* n_preallocs */
- (GInstanceInitFunc) month_view_init,
- NULL /* value_table */
- };
-
- type = g_type_register_static (
- E_TYPE_WEEK_VIEW, "EMonthView", &type_info, 0);
- }
-
- return type;
+ month_view->priv = E_MONTH_VIEW_GET_PRIVATE (month_view);
}
ECalendarView *
diff --git a/calendar/gui/e-select-names-editable.c b/calendar/gui/e-select-names-editable.c
index 040993595a..70e1de24e2 100644
--- a/calendar/gui/e-select-names-editable.c
+++ b/calendar/gui/e-select-names-editable.c
@@ -31,80 +31,27 @@
#include "e-select-names-editable.h"
-struct _ESelectNamesEditablePriv {
- gint dummy;
-};
-
-static ENameSelectorEntryClass *parent_class;
-
-static void
-esne_cell_editable_init (GtkCellEditableIface *iface)
-{
-}
-
-static void
-esne_finalize (GObject *object)
-{
- ESelectNamesEditable *esne = (ESelectNamesEditable *) object;
-
- g_free (esne->priv);
-
- /* Chain up to parent's finalize() method. */
- G_OBJECT_CLASS (parent_class)->finalize (object);
-}
+G_DEFINE_TYPE_WITH_CODE (
+ ESelectNamesEditable,
+ e_select_names_editable,
+ E_TYPE_NAME_SELECTOR_ENTRY,
+ G_IMPLEMENT_INTERFACE (
+ GTK_TYPE_CELL_EDITABLE, NULL))
static void
-esne_init (ESelectNamesEditable *esne)
+e_select_names_editable_class_init (ESelectNamesEditableClass *class)
{
- esne->priv = g_new0 (ESelectNamesEditablePriv, 1);
}
static void
-esne_class_init (GObjectClass *klass)
+e_select_names_editable_init (ESelectNamesEditable *esne)
{
- klass->finalize = esne_finalize;
-
- parent_class = E_NAME_SELECTOR_ENTRY_CLASS (g_type_class_peek_parent (klass));
-}
-
-GType
-e_select_names_editable_get_type (void)
-{
- static GType esne_type = 0;
-
- if (!esne_type) {
- static const GTypeInfo esne_info = {
- sizeof (ESelectNamesEditableClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) esne_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (ESelectNamesEditable),
- 0, /* n_preallocs */
- (GInstanceInitFunc) esne_init,
- };
-
- static const GInterfaceInfo cell_editable_info = {
- (GInterfaceInitFunc) esne_cell_editable_init,
- NULL,
- NULL
- };
-
- esne_type = g_type_register_static (E_TYPE_NAME_SELECTOR_ENTRY, "ESelectNamesEditable", &esne_info, 0);
-
- g_type_add_interface_static (esne_type, GTK_TYPE_CELL_EDITABLE, &cell_editable_info);
- }
-
- return esne_type;
}
ESelectNamesEditable *
e_select_names_editable_new (void)
{
- ESelectNamesEditable *esne = g_object_new (E_TYPE_SELECT_NAMES_EDITABLE, NULL);
-
- return esne;
+ return g_object_new (E_TYPE_SELECT_NAMES_EDITABLE, NULL);
}
gchar *
diff --git a/calendar/gui/e-select-names-renderer.c b/calendar/gui/e-select-names-renderer.c
index e5326c108f..b3a00d5d7e 100644
--- a/calendar/gui/e-select-names-renderer.c
+++ b/calendar/gui/e-select-names-renderer.c
@@ -29,7 +29,11 @@
#include "e-select-names-editable.h"
#include "e-select-names-renderer.h"
-struct _ESelectNamesRendererPriv {
+#define E_SELECT_NAMES_RENDERER_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_SELECT_NAMES_RENDERER, ESelectNamesRendererPrivate))
+
+struct _ESelectNamesRendererPrivate {
ESelectNamesEditable *editable;
gchar *path;
@@ -50,7 +54,10 @@ enum {
static gint signals[LAST_SIGNAL];
-G_DEFINE_TYPE (ESelectNamesRenderer, e_select_names_renderer, GTK_TYPE_CELL_RENDERER_TEXT)
+G_DEFINE_TYPE (
+ ESelectNamesRenderer,
+ e_select_names_renderer,
+ GTK_TYPE_CELL_RENDERER_TEXT)
static void
e_select_names_renderer_editing_done (GtkCellEditable *editable,
@@ -131,7 +138,9 @@ e_select_names_renderer_start_editing (GtkCellRenderer *cell,
e_select_names_editable_set_address (editable, sn_cell->priv->name, sn_cell->priv->email);
gtk_widget_show (GTK_WIDGET (editable));
- g_signal_connect (editable, "editing_done", G_CALLBACK (e_select_names_renderer_editing_done), sn_cell);
+ 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 */
@@ -187,58 +196,80 @@ e_select_names_renderer_set_property (GObject *object,
static void
e_select_names_renderer_finalize (GObject *object)
{
- ESelectNamesRenderer *cell = (ESelectNamesRenderer *) object;
+ ESelectNamesRendererPrivate *priv;
- if (cell->priv->editable)
- g_object_unref (cell->priv->editable);
- cell->priv->editable = NULL;
+ priv = E_SELECT_NAMES_RENDERER_GET_PRIVATE (object);
- g_free (cell->priv->path);
- g_free (cell->priv->name);
- g_free (cell->priv->email);
- g_free (cell->priv);
+ if (priv->editable != NULL) {
+ g_object_unref (priv->editable);
+ priv->editable = NULL;
+ }
+
+ g_free (priv->path);
+ g_free (priv->name);
+ g_free (priv->email);
/* Chain up to parent's finalize() method. */
G_OBJECT_CLASS (e_select_names_renderer_parent_class)->finalize (object);
}
static void
-e_select_names_renderer_init (ESelectNamesRenderer *cell)
-{
- cell->priv = g_new0 (ESelectNamesRendererPriv, 1);
-}
-
-static void
e_select_names_renderer_class_init (ESelectNamesRendererClass *class)
{
+ GObjectClass *object_class;
GtkCellRendererClass *cell_class = GTK_CELL_RENDERER_CLASS (class);
- GObjectClass *obj_class = G_OBJECT_CLASS (class);
- obj_class->finalize = e_select_names_renderer_finalize;
- obj_class->get_property = e_select_names_renderer_get_property;
- obj_class->set_property = e_select_names_renderer_set_property;
+ g_type_class_add_private (class, sizeof (ESelectNamesRendererPrivate));
- cell_class->start_editing = e_select_names_renderer_start_editing;
+ object_class = G_OBJECT_CLASS (class);
+ object_class->get_property = e_select_names_renderer_get_property;
+ object_class->set_property = e_select_names_renderer_set_property;
+ object_class->finalize = e_select_names_renderer_finalize;
- g_object_class_install_property (obj_class, PROP_NAME,
- g_param_spec_string ("name", "Name", "Email name.", NULL, G_PARAM_READWRITE));
+ cell_class->start_editing = e_select_names_renderer_start_editing;
- g_object_class_install_property (obj_class, PROP_EMAIL,
- g_param_spec_string ("email", "Email", "Email address.", NULL, G_PARAM_READWRITE));
+ g_object_class_install_property (
+ object_class,
+ PROP_NAME,
+ g_param_spec_string (
+ "name",
+ "Name",
+ "Email name.",
+ NULL,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_EMAIL,
+ g_param_spec_string (
+ "email",
+ "Email",
+ "Email address.",
+ NULL,
+ G_PARAM_READWRITE));
+
+ signals[CELL_EDITED] = g_signal_new (
+ "cell_edited",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ESelectNamesRendererClass, cell_edited),
+ NULL, NULL,
+ e_marshal_VOID__STRING_POINTER_POINTER,
+ G_TYPE_NONE, 3,
+ G_TYPE_STRING,
+ G_TYPE_POINTER,
+ G_TYPE_POINTER);
+}
- signals [CELL_EDITED] = g_signal_new ("cell_edited",
- G_OBJECT_CLASS_TYPE (obj_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ESelectNamesRendererClass, cell_edited),
- NULL, NULL,
- e_marshal_VOID__STRING_POINTER_POINTER,
- G_TYPE_NONE, 3,
- G_TYPE_STRING, G_TYPE_POINTER, G_TYPE_POINTER);
+static void
+e_select_names_renderer_init (ESelectNamesRenderer *cell)
+{
+ cell->priv = E_SELECT_NAMES_RENDERER_GET_PRIVATE (cell);
}
GtkCellRenderer *
e_select_names_renderer_new (void)
{
- return GTK_CELL_RENDERER (g_object_new (E_TYPE_SELECT_NAMES_RENDERER, NULL));
+ return g_object_new (E_TYPE_SELECT_NAMES_RENDERER, NULL);
}
diff --git a/calendar/gui/e-select-names-renderer.h b/calendar/gui/e-select-names-renderer.h
index 6a2c4be102..2517f76d63 100644
--- a/calendar/gui/e-select-names-renderer.h
+++ b/calendar/gui/e-select-names-renderer.h
@@ -21,44 +21,54 @@
*
*/
-#ifndef __E_SELECT_NAMES_RENDERER_H__
-#define __E_SELECT_NAMES_RENDERER_H__
+#ifndef E_SELECT_NAMES_RENDERER_H
+#define E_SELECT_NAMES_RENDERER_H
#include <gtk/gtk.h>
-G_BEGIN_DECLS
+/* Standard GObject macros */
+#define E_TYPE_SELECT_NAMES_RENDERER \
+ (e_select_names_renderer_get_type ())
+#define E_SELECT_NAMES_RENDERER(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), E_TYPE_SELECT_NAMES_RENDERER, ESelectNamesRenderer))
+#define E_SELECT_NAMES_RENDERER_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), E_TYPE_SELECT_NAMES_RENDERER, ESelectNamesRendererClass))
+#define E_IS_SELECT_NAMES_RENDERER(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), E_TYPE_SELECT_NAMES_RENDERER))
+#define E_IS_SELECT_NAMES_RENDERER_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), E_TYPE_SELECT_NAMES_RENDERER))
+#define E_SELECT_NAMES_RENDERER_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), E_TYPE_SELECT_NAMES_RENDERER, ESelectNamesRendererClass))
-#define E_TYPE_SELECT_NAMES_RENDERER (e_select_names_renderer_get_type ())
-#define E_SELECT_NAMES_RENDERER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TYPE_SELECT_NAMES_RENDERER, ESelectNamesRenderer))
-#define E_SELECT_NAMES_RENDERER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), E_TYPE_SELECT_NAMES_RENDERER, ESelectNamesRendererClass))
-#define E_IS_SELECT_NAMES_RENDERER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TYPE_SELECT_NAMES_RENDERER))
-#define E_IS_SELECT_NAMES_RENDERER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((o), E_TYPE_SELECT_NAMES_RENDERER))
-#define E_SELECT_NAMES_RENDERER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), E_TYPE_SELECT_NAMES_RENDERER, ESelectNamesRendererClass))
+G_BEGIN_DECLS
-typedef struct _ESelectNamesRenderer ESelectNamesRenderer;
+typedef struct _ESelectNamesRenderer ESelectNamesRenderer;
typedef struct _ESelectNamesRendererClass ESelectNamesRendererClass;
-typedef struct _ESelectNamesRendererPriv ESelectNamesRendererPriv;
-
-struct _ESelectNamesRenderer
-{
- GtkCellRendererText parent;
+typedef struct _ESelectNamesRendererPrivate ESelectNamesRendererPrivate;
- ESelectNamesRendererPriv *priv;
+struct _ESelectNamesRenderer {
+ GtkCellRendererText parent;
+ ESelectNamesRendererPrivate *priv;
};
-struct _ESelectNamesRendererClass
-{
+struct _ESelectNamesRendererClass {
GtkCellRendererTextClass parent_class;
- void (* cell_edited) (ESelectNamesRenderer *renderer,
- const gchar *path,
- GList *addresses,
- GList *names);
+ void (*cell_edited) (ESelectNamesRenderer *renderer,
+ const gchar *path,
+ GList *addresses,
+ GList *names);
};
-GType e_select_names_renderer_get_type (void);
-GtkCellRenderer *e_select_names_renderer_new (void);
+GType e_select_names_renderer_get_type (void) G_GNUC_CONST;
+GtkCellRenderer *
+ e_select_names_renderer_new (void);
G_END_DECLS
-#endif /* __E_SELECT_NAMES_RENDERER_H__ */
+#endif /* E_SELECT_NAMES_RENDERER_H */
diff --git a/calendar/gui/e-task-list-selector.c b/calendar/gui/e-task-list-selector.c
index ba210e8c05..fd6a7915f3 100644
--- a/calendar/gui/e-task-list-selector.c
+++ b/calendar/gui/e-task-list-selector.c
@@ -30,6 +30,10 @@
#include "e-util/e-selection.h"
#include "calendar/gui/comp-util.h"
+#define E_TASK_LIST_SELECTOR_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_TASK_LIST_SELECTOR, ETaskListSelectorPrivate))
+
struct _ETaskListSelectorPrivate {
gint dummy_value;
};
@@ -320,8 +324,7 @@ e_task_list_selector_class_init (ETaskListSelectorClass *class)
static void
e_task_list_selector_init (ETaskListSelector *selector)
{
- selector->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- selector, E_TYPE_TASK_LIST_SELECTOR, ETaskListSelectorPrivate);
+ selector->priv = E_TASK_LIST_SELECTOR_GET_PRIVATE (selector);
gtk_drag_dest_set (
GTK_WIDGET (selector), GTK_DEST_DEFAULT_ALL,
diff --git a/calendar/gui/e-task-table.c b/calendar/gui/e-task-table.c
index 4b6d671af3..b314766aff 100644
--- a/calendar/gui/e-task-table.c
+++ b/calendar/gui/e-task-table.c
@@ -63,6 +63,10 @@
#include <e-util/e-icon-factory.h>
#include "misc.h"
+#define E_TASK_TABLE_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_TASK_TABLE, ETaskTablePrivate))
+
struct _ETaskTablePrivate {
gpointer shell_view; /* weak pointer */
ECalModel *model;
@@ -100,6 +104,18 @@ static const gchar *icon_names[] = {
"stock_task-assigned-to"
};
+/* Forward Declarations */
+static void e_task_table_selectable_init
+ (ESelectableInterface *interface);
+
+G_DEFINE_TYPE_WITH_CODE (
+ ETaskTable,
+ e_task_table,
+ E_TYPE_TABLE,
+ G_IMPLEMENT_INTERFACE (
+ E_TYPE_SELECTABLE,
+ e_task_table_selectable_init))
+
static void
task_table_emit_open_component (ETaskTable *task_table,
ECalModelComponent *comp_data)
@@ -414,7 +430,7 @@ task_table_dispose (GObject *object)
{
ETaskTablePrivate *priv;
- priv = E_TASK_TABLE (object)->priv;
+ priv = E_TASK_TABLE_GET_PRIVATE (object);
if (priv->completed_cancellable) {
g_cancellable_cancel (priv->completed_cancellable);
@@ -1418,7 +1434,7 @@ task_table_select_all (ESelectable *selectable)
}
static void
-task_table_class_init (ETaskTableClass *class)
+e_task_table_class_init (ETaskTableClass *class)
{
GObjectClass *object_class;
GtkWidgetClass *widget_class;
@@ -1507,12 +1523,11 @@ task_table_class_init (ETaskTableClass *class)
}
static void
-task_table_init (ETaskTable *task_table)
+e_task_table_init (ETaskTable *task_table)
{
GtkTargetList *target_list;
- task_table->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- task_table, E_TYPE_TASK_TABLE, ETaskTablePrivate);
+ task_table->priv = E_TASK_TABLE_GET_PRIVATE (task_table);
task_table->priv->completed_cancellable = NULL;
@@ -1526,7 +1541,7 @@ task_table_init (ETaskTable *task_table)
}
static void
-task_table_selectable_init (ESelectableInterface *interface)
+e_task_table_selectable_init (ESelectableInterface *interface)
{
interface->update_actions = task_table_update_actions;
interface->cut_clipboard = task_table_cut_clipboard;
@@ -1536,41 +1551,6 @@ task_table_selectable_init (ESelectableInterface *interface)
interface->select_all = task_table_select_all;
}
-GType
-e_task_table_get_type (void)
-{
- static GType type = 0;
-
- if (G_UNLIKELY (type == 0)) {
- static const GTypeInfo type_info = {
- sizeof (ETaskTableClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) task_table_class_init,
- (GClassFinalizeFunc) NULL,
- NULL, /* class_data */
- sizeof (ETaskTable),
- 0, /* n_preallocs */
- (GInstanceInitFunc) task_table_init,
- NULL /* value_table */
- };
-
- static const GInterfaceInfo selectable_info = {
- (GInterfaceInitFunc) task_table_selectable_init,
- (GInterfaceFinalizeFunc) NULL,
- NULL /* interface_data */
- };
-
- type = g_type_register_static (
- E_TYPE_TABLE, "ETaskTable", &type_info, 0);
-
- g_type_add_interface_static (
- type, E_TYPE_SELECTABLE, &selectable_info);
- }
-
- return type;
-}
-
/**
* e_task_table_new:
* @shell_view: an #EShellView
diff --git a/calendar/gui/e-timezone-entry.c b/calendar/gui/e-timezone-entry.c
index a3288b1115..d8429b844d 100644
--- a/calendar/gui/e-timezone-entry.c
+++ b/calendar/gui/e-timezone-entry.c
@@ -36,6 +36,10 @@
#include <glib/gi18n.h>
#include "e-timezone-entry.h"
+#define E_TIMEZONE_ENTRY_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_TIMEZONE_ENTRY, ETimezoneEntryPrivate))
+
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
@@ -216,7 +220,7 @@ timezone_entry_mnemonic_activate (GtkWidget *widget,
{
ETimezoneEntryPrivate *priv;
- priv = E_TIMEZONE_ENTRY (widget)->priv;
+ priv = E_TIMEZONE_ENTRY_GET_PRIVATE (widget);
if (gtk_widget_get_can_focus (widget)) {
if (priv->button != NULL)
@@ -232,7 +236,7 @@ timezone_entry_focus (GtkWidget *widget,
{
ETimezoneEntryPrivate *priv;
- priv = E_TIMEZONE_ENTRY (widget)->priv;
+ priv = E_TIMEZONE_ENTRY_GET_PRIVATE (widget);
if (direction == GTK_DIR_TAB_FORWARD) {
if (gtk_widget_has_focus (priv->entry))
@@ -301,8 +305,7 @@ e_timezone_entry_init (ETimezoneEntry *timezone_entry)
AtkObject *a11y;
GtkWidget *widget;
- timezone_entry->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- timezone_entry, E_TYPE_TIMEZONE_ENTRY, ETimezoneEntryPrivate);
+ timezone_entry->priv = E_TIMEZONE_ENTRY_GET_PRIVATE (timezone_entry);
gtk_widget_set_can_focus (GTK_WIDGET (timezone_entry), TRUE);
diff --git a/calendar/gui/e-week-view-event-item.c b/calendar/gui/e-week-view-event-item.c
index 8aa50a99e2..c18ab8db57 100644
--- a/calendar/gui/e-week-view-event-item.c
+++ b/calendar/gui/e-week-view-event-item.c
@@ -39,6 +39,10 @@
#include <text/e-text.h>
+#define E_WEEK_VIEW_EVENT_ITEM_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_WEEK_VIEW_EVENT_ITEM, EWeekViewEventItemPrivate))
+
struct _EWeekViewEventItemPrivate {
/* The event index in the EWeekView events array. */
gint event_num;
@@ -53,7 +57,10 @@ enum {
PROP_SPAN_NUM
};
-static gpointer parent_class;
+G_DEFINE_TYPE (
+ EWeekViewEventItem,
+ e_week_view_event_item,
+ GNOME_TYPE_CANVAS_ITEM)
static gboolean
can_draw_in_region (cairo_region_t *draw_region,
@@ -424,7 +431,8 @@ week_view_event_item_draw_icons (EWeekViewEventItem *event_item,
num_icons++;
}
- if (e_cal_component_has_recurrences (comp) || e_cal_component_is_instance (comp)) {
+ if (e_cal_component_has_recurrences (comp) ||
+ e_cal_component_is_instance (comp)) {
draw_recurrence_icon = TRUE;
num_icons++;
}
@@ -654,7 +662,8 @@ week_view_event_item_update (GnomeCanvasItem *item,
week_view = E_WEEK_VIEW (parent);
/* Chain up to parent's update() method. */
- canvas_item_class = GNOME_CANVAS_ITEM_CLASS (parent_class);
+ canvas_item_class =
+ GNOME_CANVAS_ITEM_CLASS (e_week_view_event_item_parent_class);
canvas_item_class->update (item, i2c, flags);
item->x1 = 0;
@@ -1118,12 +1127,11 @@ week_view_event_item_event (GnomeCanvasItem *item,
}
static void
-week_view_event_item_class_init (EWeekViewEventItemClass *class)
+e_week_view_event_item_class_init (EWeekViewEventItemClass *class)
{
GObjectClass *object_class;
GnomeCanvasItemClass *item_class;
- parent_class = g_type_class_peek_parent (class);
g_type_class_add_private (class, sizeof (EWeekViewEventItemPrivate));
object_class = G_OBJECT_CLASS (class);
@@ -1162,43 +1170,14 @@ week_view_event_item_class_init (EWeekViewEventItemClass *class)
}
static void
-week_view_event_item_init (EWeekViewEventItem *event_item)
+e_week_view_event_item_init (EWeekViewEventItem *event_item)
{
- event_item->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- event_item, E_TYPE_WEEK_VIEW_EVENT_ITEM,
- EWeekViewEventItemPrivate);
+ event_item->priv = E_WEEK_VIEW_EVENT_ITEM_GET_PRIVATE (event_item);
event_item->priv->event_num = -1;
event_item->priv->span_num = -1;
}
-GType
-e_week_view_event_item_get_type (void)
-{
- static GType type = 0;
-
- if (G_UNLIKELY (type == 0)) {
- const GTypeInfo type_info = {
- sizeof (EWeekViewEventItemClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) week_view_event_item_class_init,
- (GClassFinalizeFunc) NULL,
- NULL, /* class_data */
- sizeof (EWeekViewEventItem),
- 0, /* n_preallocs */
- (GInstanceInitFunc) week_view_event_item_init,
- NULL /* value_table */
- };
-
- type = g_type_register_static (
- GNOME_TYPE_CANVAS_ITEM, "EWeekViewEventItem",
- &type_info, 0);
- }
-
- return type;
-}
-
gint
e_week_view_event_item_get_event_num (EWeekViewEventItem *event_item)
{
diff --git a/calendar/gui/e-week-view-layout.c b/calendar/gui/e-week-view-layout.c
index b2fc7ca158..1e7f6366b1 100644
--- a/calendar/gui/e-week-view-layout.c
+++ b/calendar/gui/e-week-view-layout.c
@@ -377,10 +377,13 @@ e_week_view_layout_get_day_position (gint day,
if (arr[i - m] > 1) {
any = TRUE;
- if (wd > 6) { /* too many rows, make last shorter */
+ /* too many rows, make last shorter */
+ if (wd > 6) {
arr[i - m] --;
wd--;
- } else if (wd < 6) { /* free rows left, enlarge those bigger */
+
+ /* free rows left, enlarge those bigger */
+ } else if (wd < 6) {
arr[i - m] ++;
wd++;
}
diff --git a/calendar/gui/e-week-view-main-item.c b/calendar/gui/e-week-view-main-item.c
index bca3343b67..06ebf68dbe 100644
--- a/calendar/gui/e-week-view-main-item.c
+++ b/calendar/gui/e-week-view-main-item.c
@@ -32,6 +32,10 @@
#include "ea-calendar.h"
#include "calendar-config.h"
+#define E_WEEK_VIEW_MAIN_ITEM_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_WEEK_VIEW_MAIN_ITEM, EWeekViewMainItemPrivate))
+
struct _EWeekViewMainItemPrivate {
EWeekView *week_view;
};
@@ -41,7 +45,10 @@ enum {
PROP_WEEK_VIEW
};
-static gpointer parent_class;
+G_DEFINE_TYPE (
+ EWeekViewMainItem,
+ e_week_view_main_item,
+ GNOME_TYPE_CANVAS_ITEM)
static gint
gdate_to_cal_weekdays (GDateWeekday wd)
@@ -337,7 +344,7 @@ week_view_main_item_dispose (GObject *object)
{
EWeekViewMainItemPrivate *priv;
- priv = E_WEEK_VIEW_MAIN_ITEM (object)->priv;
+ priv = E_WEEK_VIEW_MAIN_ITEM_GET_PRIVATE (object);
if (priv->week_view != NULL) {
g_object_unref (priv->week_view);
@@ -345,7 +352,7 @@ week_view_main_item_dispose (GObject *object)
}
/* Chain up to parent's dispose() method. */
- G_OBJECT_CLASS (parent_class)->dispose (object);
+ G_OBJECT_CLASS (e_week_view_main_item_parent_class)->dispose (object);
}
static void
@@ -356,7 +363,8 @@ week_view_main_item_update (GnomeCanvasItem *item,
GnomeCanvasItemClass *canvas_item_class;
/* Chain up to parent's update() method. */
- canvas_item_class = GNOME_CANVAS_ITEM_CLASS (parent_class);
+ canvas_item_class =
+ GNOME_CANVAS_ITEM_CLASS (e_week_view_main_item_parent_class);
canvas_item_class->update (item, i2c, flags);
/* The item covers the entire canvas area. */
@@ -417,12 +425,11 @@ week_view_main_item_point (GnomeCanvasItem *item,
}
static void
-week_view_main_item_class_init (EWeekViewMainItemClass *class)
+e_week_view_main_item_class_init (EWeekViewMainItemClass *class)
{
GObjectClass *object_class;
GnomeCanvasItemClass *item_class;
- parent_class = g_type_class_peek_parent (class);
g_type_class_add_private (class, sizeof (EWeekViewMainItemPrivate));
object_class = G_OBJECT_CLASS (class);
@@ -450,38 +457,9 @@ week_view_main_item_class_init (EWeekViewMainItemClass *class)
}
static void
-week_view_main_item_init (EWeekViewMainItem *main_item)
-{
- main_item->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- main_item, E_TYPE_WEEK_VIEW_MAIN_ITEM,
- EWeekViewMainItemPrivate);
-}
-
-GType
-e_week_view_main_item_get_type (void)
+e_week_view_main_item_init (EWeekViewMainItem *main_item)
{
- static GType type = 0;
-
- if (G_UNLIKELY (type == 0)) {
- const GTypeInfo type_info = {
- sizeof (EWeekViewMainItemClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) week_view_main_item_class_init,
- (GClassFinalizeFunc) NULL,
- NULL, /* class_data */
- sizeof (EWeekViewMainItem),
- 0, /* n_preallocs */
- (GInstanceInitFunc) week_view_main_item_init,
- NULL /* value_table */
- };
-
- type = g_type_register_static (
- GNOME_TYPE_CANVAS_ITEM, "EWeekViewMainItem",
- &type_info, 0);
- }
-
- return type;
+ main_item->priv = E_WEEK_VIEW_MAIN_ITEM_GET_PRIVATE (main_item);
}
EWeekView *
diff --git a/calendar/gui/e-week-view-titles-item.c b/calendar/gui/e-week-view-titles-item.c
index 66f9930534..40d7391679 100644
--- a/calendar/gui/e-week-view-titles-item.c
+++ b/calendar/gui/e-week-view-titles-item.c
@@ -29,6 +29,10 @@
#include <e-util/e-util.h>
#include "e-week-view-titles-item.h"
+#define E_WEEK_VIEW_TITLES_ITEM_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_WEEK_VIEW_TITLES_ITEM, EWeekViewTitlesItemPrivate))
+
struct _EWeekViewTitlesItemPrivate {
EWeekView *week_view;
};
@@ -38,7 +42,10 @@ enum {
PROP_WEEK_VIEW
};
-static gpointer parent_class;
+G_DEFINE_TYPE (
+ EWeekViewTitlesItem,
+ e_week_view_titles_item,
+ GNOME_TYPE_CANVAS_ITEM)
static void
week_view_titles_item_set_property (GObject *object,
@@ -80,7 +87,7 @@ week_view_titles_item_dispose (GObject *object)
{
EWeekViewTitlesItemPrivate *priv;
- priv = E_WEEK_VIEW_TITLES_ITEM (object)->priv;
+ priv = E_WEEK_VIEW_TITLES_ITEM_GET_PRIVATE (object);
if (priv->week_view != NULL) {
g_object_unref (priv->week_view);
@@ -88,7 +95,7 @@ week_view_titles_item_dispose (GObject *object)
}
/* Chain up to parent's dispose() method. */
- G_OBJECT_CLASS (parent_class)->dispose (object);
+ G_OBJECT_CLASS (e_week_view_titles_item_parent_class)->dispose (object);
}
static void
@@ -99,7 +106,8 @@ week_view_titles_item_update (GnomeCanvasItem *item,
GnomeCanvasItemClass *canvas_item_class;
/* Chain up to parent's update() method. */
- canvas_item_class = GNOME_CANVAS_ITEM_CLASS (parent_class);
+ canvas_item_class =
+ GNOME_CANVAS_ITEM_CLASS (e_week_view_titles_item_parent_class);
canvas_item_class->update (item, i2c, flags);
/* The item covers the entire canvas area. */
@@ -245,12 +253,11 @@ week_view_titles_item_point (GnomeCanvasItem *item,
}
static void
-week_view_titles_item_class_init (EWeekViewTitlesItemClass *class)
+e_week_view_titles_item_class_init (EWeekViewTitlesItemClass *class)
{
GObjectClass *object_class;
GnomeCanvasItemClass *item_class;
- parent_class = g_type_class_peek_parent (class);
g_type_class_add_private (class, sizeof (EWeekViewTitlesItemPrivate));
object_class = G_OBJECT_CLASS (class);
@@ -275,38 +282,9 @@ week_view_titles_item_class_init (EWeekViewTitlesItemClass *class)
}
static void
-week_view_titles_item_init (EWeekViewTitlesItem *titles_item)
-{
- titles_item->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- titles_item, E_TYPE_WEEK_VIEW_TITLES_ITEM,
- EWeekViewTitlesItemPrivate);
-}
-
-GType
-e_week_view_titles_item_get_type (void)
+e_week_view_titles_item_init (EWeekViewTitlesItem *titles_item)
{
- static GType type = 0;
-
- if (G_UNLIKELY (type == 0)) {
- const GTypeInfo type_info = {
- sizeof (EWeekViewTitlesItemClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) week_view_titles_item_class_init,
- (GClassFinalizeFunc) NULL,
- NULL, /* class_data */
- sizeof (EWeekViewTitlesItem),
- 0, /* n_preallocs */
- (GInstanceInitFunc) week_view_titles_item_init,
- NULL /* value_table */
- };
-
- type = g_type_register_static (
- GNOME_TYPE_CANVAS_ITEM, "EWeekViewTitlesItem",
- &type_info, 0);
- }
-
- return type;
+ titles_item->priv = E_WEEK_VIEW_TITLES_ITEM_GET_PRIVATE (titles_item);
}
EWeekView *
diff --git a/calendar/gui/e-week-view.c b/calendar/gui/e-week-view.c
index 45917c170c..3feacccfda 100644
--- a/calendar/gui/e-week-view.c
+++ b/calendar/gui/e-week-view.c
@@ -813,14 +813,18 @@ e_week_view_init (EWeekView *week_view)
"EWeekViewMainItem::week_view", week_view,
NULL);
- g_signal_connect_after (week_view->main_canvas, "button_press_event",
- G_CALLBACK (e_week_view_on_button_press), week_view);
- g_signal_connect (week_view->main_canvas, "button_release_event",
- G_CALLBACK (e_week_view_on_button_release), week_view);
- g_signal_connect (week_view->main_canvas, "scroll_event",
- G_CALLBACK (e_week_view_on_scroll), week_view);
- g_signal_connect (week_view->main_canvas, "motion_notify_event",
- G_CALLBACK (e_week_view_on_motion), week_view);
+ g_signal_connect_after (
+ week_view->main_canvas, "button_press_event",
+ G_CALLBACK (e_week_view_on_button_press), week_view);
+ g_signal_connect (
+ week_view->main_canvas, "button_release_event",
+ G_CALLBACK (e_week_view_on_button_release), week_view);
+ g_signal_connect (
+ week_view->main_canvas, "scroll_event",
+ G_CALLBACK (e_week_view_on_scroll), week_view);
+ g_signal_connect (
+ week_view->main_canvas, "motion_notify_event",
+ G_CALLBACK (e_week_view_on_motion), week_view);
/* Create the buttons to jump to each days. */
pixbuf = gdk_pixbuf_new_from_xpm_data ((const gchar **) jump_xpm);
@@ -832,8 +836,9 @@ e_week_view_init (EWeekView *week_view)
"GnomeCanvasPixbuf::pixbuf", pixbuf,
NULL);
- g_signal_connect (week_view->jump_buttons[i], "event",
- G_CALLBACK (e_week_view_on_jump_button_event), week_view);
+ g_signal_connect (
+ week_view->jump_buttons[i], "event",
+ G_CALLBACK (e_week_view_on_jump_button_event), week_view);
}
week_view->focused_jump_button = E_WEEK_VIEW_JUMP_BUTTON_NO_FOCUS;
@@ -3147,9 +3152,9 @@ e_week_view_reshape_event_span (EWeekView *week_view,
}
g_object_set_data ((GObject *)span->background_item, "event-num", GINT_TO_POINTER (event_num));
- g_signal_connect (span->background_item, "event",
- G_CALLBACK (tooltip_event_cb),
- week_view);
+ g_signal_connect (
+ span->background_item, "event",
+ G_CALLBACK (tooltip_event_cb), week_view);
gnome_canvas_item_set (span->background_item,
"event_num", event_num,
@@ -3188,9 +3193,9 @@ e_week_view_reshape_event_span (EWeekView *week_view,
set_text_as_bold (event, span);
}
g_object_set_data (G_OBJECT (span->text_item), "event-num", GINT_TO_POINTER (event_num));
- g_signal_connect (span->text_item, "event",
- G_CALLBACK (e_week_view_on_text_item_event),
- week_view);
+ g_signal_connect (
+ span->text_item, "event",
+ G_CALLBACK (e_week_view_on_text_item_event), week_view);
g_signal_emit_by_name (G_OBJECT (week_view),
"event_added", event);
diff --git a/calendar/gui/ea-cal-view-event.c b/calendar/gui/ea-cal-view-event.c
index 5111d6d27f..cd777949ab 100644
--- a/calendar/gui/ea-cal-view-event.c
+++ b/calendar/gui/ea-cal-view-event.c
@@ -210,7 +210,8 @@ ea_cal_view_event_new (GObject *obj)
EWeekViewEvent,
event_num);
- if (!is_array_index_in_bounds (week_view->spans, week_view_event->spans_index))
+ if (!is_array_index_in_bounds (
+ week_view->spans, week_view_event->spans_index))
return NULL;
/* get the first span */
diff --git a/calendar/gui/ea-cal-view.c b/calendar/gui/ea-cal-view.c
index e6c3d65b9b..415e72bb0d 100644
--- a/calendar/gui/ea-cal-view.c
+++ b/calendar/gui/ea-cal-view.c
@@ -174,9 +174,9 @@ ea_cal_view_real_initialize (AtkObject *accessible,
gcal = e_calendar_view_get_calendar (cal_view);
if (gcal)
- g_signal_connect (gcal, "dates_shown_changed",
- G_CALLBACK (ea_cal_view_dates_change_cb),
- accessible);
+ g_signal_connect (
+ gcal, "dates_shown_changed",
+ G_CALLBACK (ea_cal_view_dates_change_cb), accessible);
}
static AtkObject *
@@ -222,7 +222,9 @@ ea_cal_view_event_changed_cb (ECalendarView *cal_view,
span = &g_array_index (week_view->spans, EWeekViewEventSpan,
week_view_event->spans_index);
if (span && span->text_item)
- event_atk_obj = ea_calendar_helpers_get_accessible_for (span->text_item);
+ event_atk_obj =
+ ea_calendar_helpers_get_accessible_for (
+ span->text_item);
}
if (event_atk_obj) {
#ifdef ACC_DEBUG
@@ -258,10 +260,13 @@ ea_cal_view_event_added_cb (ECalendarView *cal_view,
EWeekViewEvent *week_view_event = (EWeekViewEvent *) event;
EWeekView *week_view = E_WEEK_VIEW (cal_view);
/* get the first span of the event */
- span = &g_array_index (week_view->spans, EWeekViewEventSpan,
- week_view_event->spans_index);
+ span = &g_array_index (
+ week_view->spans, EWeekViewEventSpan,
+ week_view_event->spans_index);
if (span && span->text_item)
- event_atk_obj = ea_calendar_helpers_get_accessible_for (span->text_item);
+ event_atk_obj =
+ ea_calendar_helpers_get_accessible_for (
+ span->text_item);
}
if (event_atk_obj) {
diff --git a/calendar/gui/ea-calendar.c b/calendar/gui/ea-calendar.c
index cbea6ded02..a81fb5e7a5 100644
--- a/calendar/gui/ea-calendar.c
+++ b/calendar/gui/ea-calendar.c
@@ -204,9 +204,6 @@ ea_calendar_focus_watcher (GSignalInvocationHint *ihint,
else
/* focus out */
ea_event = NULL;
-#ifdef ACC_DEBUG
- printf ("EvoAcc: focus notify on week main item %p\n", (gpointer)object);
-#endif
atk_focus_tracker_notify (ea_event);
}
}
diff --git a/calendar/gui/ea-day-view-cell.c b/calendar/gui/ea-day-view-cell.c
index 4fe1c5bedb..419e11426e 100644
--- a/calendar/gui/ea-day-view-cell.c
+++ b/calendar/gui/ea-day-view-cell.c
@@ -93,7 +93,7 @@ e_day_view_cell_new (EDayView *day_view,
/* EaDayViewCell */
-static void ea_day_view_cell_class_init (EaDayViewCellClass *klass);
+static void ea_day_view_cell_class_init (EaDayViewCellClass *class);
static const gchar * ea_day_view_cell_get_name (AtkObject *accessible);
static const gchar * ea_day_view_cell_get_description (AtkObject *accessible);
diff --git a/calendar/gui/ea-day-view-main-item.c b/calendar/gui/ea-day-view-main-item.c
index 1ced61b7ad..19c91384da 100644
--- a/calendar/gui/ea-day-view-main-item.c
+++ b/calendar/gui/ea-day-view-main-item.c
@@ -272,9 +272,10 @@ ea_day_view_main_item_new (GObject *obj)
/* listen for date changes of calendar */
gcal = e_calendar_view_get_calendar (E_CALENDAR_VIEW (day_view));
if (gcal)
- g_signal_connect (gcal, "dates_shown_changed",
- G_CALLBACK (ea_day_view_main_item_dates_change_cb),
- accessible);
+ g_signal_connect (
+ gcal, "dates_shown_changed",
+ G_CALLBACK (ea_day_view_main_item_dates_change_cb),
+ accessible);
return accessible;
}
diff --git a/calendar/gui/ea-day-view.c b/calendar/gui/ea-day-view.c
index 89e9c4b8a0..4c5ffb0199 100644
--- a/calendar/gui/ea-day-view.c
+++ b/calendar/gui/ea-day-view.c
@@ -283,7 +283,8 @@ ea_day_view_ref_child (AtkObject *accessible,
/* Not use atk_gobject_accessible_for_object here,
* we need to do special thing here
*/
- atk_object = ea_calendar_helpers_get_accessible_for (event->canvas_item);
+ atk_object = ea_calendar_helpers_get_accessible_for (
+ event->canvas_item);
g_object_ref (atk_object);
}
}
diff --git a/calendar/gui/ea-gnome-calendar.c b/calendar/gui/ea-gnome-calendar.c
index e1826355b5..b989506e9e 100644
--- a/calendar/gui/ea-gnome-calendar.c
+++ b/calendar/gui/ea-gnome-calendar.c
@@ -131,9 +131,9 @@ ea_gnome_calendar_new (GtkWidget *widget)
/* listen on view type change
*/
- g_signal_connect (widget, "dates_shown_changed",
- G_CALLBACK (ea_gcal_dates_change_cb),
- accessible);
+ g_signal_connect (
+ widget, "dates_shown_changed",
+ G_CALLBACK (ea_gcal_dates_change_cb), accessible);
#ifdef ACC_DEBUG
printf ("EvoAcc: ea-gnome-calendar created: %p\n", (gpointer)accessible);
diff --git a/calendar/gui/ea-jump-button.c b/calendar/gui/ea-jump-button.c
index 34a7b32ad0..11a36df54a 100644
--- a/calendar/gui/ea-jump-button.c
+++ b/calendar/gui/ea-jump-button.c
@@ -58,23 +58,22 @@ ea_jump_button_get_type (void)
if (!type) {
static GTypeInfo tinfo = {
sizeof (EaJumpButtonClass),
- (GBaseInitFunc) NULL, /* base init */
- (GBaseFinalizeFunc) NULL, /* base finalize */
- (GClassInitFunc) ea_jump_button_class_init, /* class init */
- (GClassFinalizeFunc) NULL, /* class finalize */
- NULL, /* class data */
- sizeof (EaJumpButton), /* instance size */
- 0, /* nb preallocs */
- (GInstanceInitFunc) NULL, /* instance init */
- NULL /* value table */
+ (GBaseInitFunc) NULL,
+ (GBaseFinalizeFunc) NULL,
+ (GClassInitFunc) ea_jump_button_class_init,
+ (GClassFinalizeFunc) NULL,
+ /* class_data */ NULL,
+ sizeof (EaJumpButton),
+ /* n_preallocs */ 0,
+ (GInstanceInitFunc) NULL,
+ /* value_table */ NULL
};
- static const GInterfaceInfo atk_action_info =
- {
- (GInterfaceInitFunc) atk_action_interface_init,
- (GInterfaceFinalizeFunc) NULL,
- NULL
- };
+ static const GInterfaceInfo atk_action_info = {
+ (GInterfaceInitFunc) atk_action_interface_init,
+ (GInterfaceFinalizeFunc) NULL,
+ NULL
+ };
/*
* Figure out the size of the class and instance
@@ -82,20 +81,22 @@ ea_jump_button_get_type (void)
* GNOME_TYPE_CANVAS_ITEM, in this case)
*/
- factory = atk_registry_get_factory (atk_get_default_registry (),
- GNOME_TYPE_CANVAS_ITEM);
- derived_atk_type = atk_object_factory_get_accessible_type (factory);
+ factory = atk_registry_get_factory (
+ atk_get_default_registry (), GNOME_TYPE_CANVAS_ITEM);
+ derived_atk_type =
+ atk_object_factory_get_accessible_type (factory);
g_type_query (derived_atk_type, &query);
tinfo.class_size = query.class_size;
tinfo.instance_size = query.instance_size;
- /* we inherit the component and other interfaces from GNOME_TYPE_CANVAS_ITEM */
- type = g_type_register_static (derived_atk_type,
- "EaJumpButton", &tinfo, 0);
+ /* we inherit the component and other
+ * interfaces from GNOME_TYPE_CANVAS_ITEM */
+ type = g_type_register_static (
+ derived_atk_type, "EaJumpButton", &tinfo, 0);
- g_type_add_interface_static (type, ATK_TYPE_ACTION,
- &atk_action_info);
+ g_type_add_interface_static (
+ type, ATK_TYPE_ACTION, &atk_action_info);
}
return type;
diff --git a/calendar/gui/ea-week-view-main-item.c b/calendar/gui/ea-week-view-main-item.c
index f7a5a2a7fe..e33d630f00 100644
--- a/calendar/gui/ea-week-view-main-item.c
+++ b/calendar/gui/ea-week-view-main-item.c
@@ -301,9 +301,10 @@ ea_week_view_main_item_new (GObject *obj)
/* listen for date changes of calendar */
gcal = e_calendar_view_get_calendar (E_CALENDAR_VIEW (week_view));
if (gcal)
- g_signal_connect (gcal, "dates_shown_changed",
- G_CALLBACK (ea_week_view_main_item_dates_change_cb),
- accessible);
+ g_signal_connect (
+ gcal, "dates_shown_changed",
+ G_CALLBACK (ea_week_view_main_item_dates_change_cb),
+ accessible);
return accessible;
}
diff --git a/calendar/gui/ea-week-view.c b/calendar/gui/ea-week-view.c
index 15fe1cb09f..679f201d95 100644
--- a/calendar/gui/ea-week-view.c
+++ b/calendar/gui/ea-week-view.c
@@ -319,13 +319,16 @@ ea_week_view_ref_child (AtkObject *accessible,
/* Not use atk_gobject_accessible_for_object for event
* text_item we need to do special thing here
*/
- atk_object = ea_calendar_helpers_get_accessible_for (span->text_item);
+ atk_object =
+ ea_calendar_helpers_get_accessible_for (
+ span->text_item);
}
else {
gint index;
index = (current_day != -1) ? current_day : 0;
- atk_object = ea_calendar_helpers_get_accessible_for (
+ atk_object =
+ ea_calendar_helpers_get_accessible_for (
week_view->jump_buttons[index]);
}
g_object_ref (atk_object);
diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c
index aa0aebf08a..ecfb116341 100644
--- a/calendar/gui/gnome-cal.c
+++ b/calendar/gui/gnome-cal.c
@@ -70,6 +70,10 @@
#define d(x)
+#define GNOME_CALENDAR_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), GNOME_TYPE_CALENDAR, GnomeCalendarPrivate))
+
/* Private part of the GnomeCalendar structure */
struct _GnomeCalendarPrivate {
ECalModel *model;
@@ -501,6 +505,8 @@ gnome_calendar_class_init (GnomeCalendarClass *class)
GObjectClass *object_class;
GtkBindingSet *binding_set;
+ g_type_class_add_private (class, sizeof (GnomeCalendarPrivate));
+
object_class = G_OBJECT_CLASS (class);
object_class->set_property = gnome_calendar_set_property;
object_class->get_property = gnome_calendar_get_property;
@@ -1451,50 +1457,42 @@ setup_widgets (GnomeCalendar *gcal)
static void
gnome_calendar_init (GnomeCalendar *gcal)
{
- GnomeCalendarPrivate *priv;
-
- priv = g_new0 (GnomeCalendarPrivate, 1);
- gcal->priv = priv;
+ gcal->priv = GNOME_CALENDAR_GET_PRIVATE (gcal);
- priv->todo_update_lock = g_mutex_new ();
- priv->dn_query_lock = g_mutex_new ();
+ gcal->priv->todo_update_lock = g_mutex_new ();
+ gcal->priv->dn_query_lock = g_mutex_new ();
- priv->current_view_type = GNOME_CAL_WORK_WEEK_VIEW;
- priv->range_selected = FALSE;
- priv->lview_select_daten_range = TRUE;
+ gcal->priv->current_view_type = GNOME_CAL_WORK_WEEK_VIEW;
+ gcal->priv->range_selected = FALSE;
+ gcal->priv->lview_select_daten_range = TRUE;
setup_widgets (gcal);
- priv->dn_queries = NULL;
- priv->sexp = g_strdup ("#t"); /* Match all */
- priv->todo_sexp = g_strdup ("#t");
- priv->memo_sexp = g_strdup ("#t");
+ gcal->priv->dn_queries = NULL;
+ gcal->priv->sexp = g_strdup ("#t"); /* Match all */
+ gcal->priv->todo_sexp = g_strdup ("#t");
+ gcal->priv->memo_sexp = g_strdup ("#t");
- priv->visible_start = -1;
- priv->visible_end = -1;
- priv->updating = FALSE;
+ gcal->priv->visible_start = -1;
+ gcal->priv->visible_end = -1;
+ gcal->priv->updating = FALSE;
- priv->cancellable = g_cancellable_new ();
+ gcal->priv->cancellable = g_cancellable_new ();
}
static void
gnome_calendar_do_dispose (GObject *object)
{
- GnomeCalendar *gcal;
GnomeCalendarPrivate *priv;
gint ii;
- g_return_if_fail (object != NULL);
- g_return_if_fail (GNOME_IS_CALENDAR (object));
-
- gcal = GNOME_CALENDAR (object);
- priv = gcal->priv;
+ priv = GNOME_CALENDAR_GET_PRIVATE (object);
if (priv->model != NULL) {
g_signal_handlers_disconnect_by_func (
- priv->model, view_progress_cb, gcal);
+ priv->model, view_progress_cb, object);
g_signal_handlers_disconnect_by_func (
- priv->model, view_complete_cb, gcal);
+ priv->model, view_complete_cb, object);
g_object_unref (priv->model);
priv->model = NULL;
}
@@ -1506,7 +1504,7 @@ gnome_calendar_do_dispose (GObject *object)
}
}
- free_dn_queries (gcal);
+ free_dn_queries (GNOME_CALENDAR (object));
if (priv->sexp) {
g_free (priv->sexp);
@@ -1529,21 +1527,21 @@ gnome_calendar_do_dispose (GObject *object)
priv->cancellable = NULL;
}
+ /* Chain up to parent's dispose() method. */
G_OBJECT_CLASS (gnome_calendar_parent_class)->dispose (object);
}
static void
gnome_calendar_finalize (GObject *object)
{
- GnomeCalendar *gcal = GNOME_CALENDAR (object);
- GnomeCalendarPrivate *priv = gcal->priv;
+ GnomeCalendarPrivate *priv;
+
+ priv = GNOME_CALENDAR_GET_PRIVATE (object);
g_mutex_free (priv->todo_update_lock);
g_mutex_free (priv->dn_query_lock);
- g_free (priv);
- gcal->priv = NULL;
-
+ /* Chain up to parent's finalize() method. */
G_OBJECT_CLASS (gnome_calendar_parent_class)->finalize (object);
}
diff --git a/calendar/gui/tag-calendar.c b/calendar/gui/tag-calendar.c
index 6a0fdcce1f..2e1e511340 100644
--- a/calendar/gui/tag-calendar.c
+++ b/calendar/gui/tag-calendar.c
@@ -49,7 +49,7 @@ struct calendar_tag_closure {
* the calendar has no dates shown. */
static gboolean
prepare_tag (ECalendar *ecal,
- struct calendar_tag_closure *c,
+ struct calendar_tag_closure *closure,
icaltimezone *zone,
gboolean clear_first)
{
@@ -77,15 +77,17 @@ prepare_tag (ECalendar *ecal,
icaltime_adjust (&end_tt, 1, 0, 0, 0);
- c->calitem = ecal->calitem;
+ closure->calitem = ecal->calitem;
- if (zone)
- c->zone = zone;
+ if (zone != NULL)
+ closure->zone = zone;
else
- c->zone = calendar_config_get_icaltimezone ();
+ closure->zone = calendar_config_get_icaltimezone ();
- c->start_time = icaltime_as_timet_with_zone (start_tt, c->zone);
- c->end_time = icaltime_as_timet_with_zone (end_tt, c->zone);
+ closure->start_time =
+ icaltime_as_timet_with_zone (start_tt, closure->zone);
+ closure->end_time =
+ icaltime_as_timet_with_zone (end_tt, closure->zone);
return TRUE;
}
@@ -96,9 +98,8 @@ static gboolean
tag_calendar_cb (ECalComponent *comp,
time_t istart,
time_t iend,
- gpointer data)
+ struct calendar_tag_closure *closure)
{
- struct calendar_tag_closure *c = data;
struct icaltimetype start_tt, end_tt;
ECalComponentTransparency transparency;
guint8 style = 0;
@@ -107,21 +108,21 @@ tag_calendar_cb (ECalComponent *comp,
* transparent. */
e_cal_component_get_transparency (comp, &transparency);
if (transparency == E_CAL_COMPONENT_TRANSP_TRANSPARENT) {
- if (c->skip_transparent_events)
+ if (closure->skip_transparent_events)
return TRUE;
style = E_CALENDAR_ITEM_MARK_ITALIC;
- } else if (c->recur_events_italic && e_cal_component_is_instance (comp)) {
+ } else if (closure->recur_events_italic && e_cal_component_is_instance (comp)) {
style = E_CALENDAR_ITEM_MARK_ITALIC;
} else {
style = E_CALENDAR_ITEM_MARK_BOLD;
}
- start_tt = icaltime_from_timet_with_zone (istart, FALSE, c->zone);
- end_tt = icaltime_from_timet_with_zone (iend - 1, FALSE, c->zone);
+ start_tt = icaltime_from_timet_with_zone (istart, FALSE, closure->zone);
+ end_tt = icaltime_from_timet_with_zone (iend - 1, FALSE, closure->zone);
e_calendar_item_mark_days (
- c->calitem,
+ closure->calitem,
start_tt.year, start_tt.month - 1, start_tt.day,
end_tt.year, end_tt.month - 1, end_tt.day,
style, TRUE);
@@ -138,7 +139,8 @@ get_recur_events_italic (void)
shell = e_shell_get_default ();
shell_settings = e_shell_get_shell_settings (shell);
- return e_shell_settings_get_boolean (shell_settings, "cal-recur-events-italic");
+ return e_shell_settings_get_boolean (
+ shell_settings, "cal-recur-events-italic");
}
/**
@@ -155,7 +157,7 @@ tag_calendar_by_client (ECalendar *ecal,
ECalClient *client,
GCancellable *cancellable)
{
- struct calendar_tag_closure *c;
+ struct calendar_tag_closure *closure;
g_return_if_fail (E_IS_CALENDAR (ecal));
g_return_if_fail (E_IS_CAL_CLIENT (client));
@@ -167,18 +169,20 @@ tag_calendar_by_client (ECalendar *ecal,
if (!e_client_is_opened (E_CLIENT (client)))
return;
- c = g_new0 (struct calendar_tag_closure, 1);
+ closure = g_new0 (struct calendar_tag_closure, 1);
- if (!prepare_tag (ecal, c, NULL, TRUE)) {
- g_free (c);
+ if (!prepare_tag (ecal, closure, NULL, TRUE)) {
+ g_free (closure);
return;
}
- c->skip_transparent_events = TRUE;
- c->recur_events_italic = get_recur_events_italic ();
+ closure->skip_transparent_events = TRUE;
+ closure->recur_events_italic = get_recur_events_italic ();
e_cal_client_generate_instances (
- client, c->start_time, c->end_time, cancellable, tag_calendar_cb, c, g_free);
+ client, closure->start_time, closure->end_time, cancellable,
+ (ECalRecurInstanceFn) tag_calendar_cb,
+ closure, (GDestroyNotify) g_free);
}
/* Resolves TZIDs for the recurrence generator, for when the comp is not on
@@ -186,15 +190,10 @@ tag_calendar_by_client (ECalendar *ecal,
* be added to the server yet. */
static icaltimezone *
resolve_tzid_cb (const gchar *tzid,
- gpointer data)
+ ECalClient *client)
{
- ECalClient *client;
icaltimezone *zone = NULL;
- g_return_val_if_fail (E_IS_CAL_CLIENT (data), NULL);
-
- client = E_CAL_CLIENT (data);
-
/* Try to find the builtin timezone first. */
zone = icaltimezone_get_builtin_timezone_from_tzid (tzid);
@@ -240,7 +239,7 @@ tag_calendar_by_comp (ECalendar *ecal,
gboolean can_recur_events_italic,
GCancellable *cancellable)
{
- struct calendar_tag_closure c;
+ struct calendar_tag_closure closure;
g_return_if_fail (E_IS_CALENDAR (ecal));
g_return_if_fail (E_IS_CAL_COMPONENT (comp));
@@ -249,23 +248,30 @@ tag_calendar_by_comp (ECalendar *ecal,
if (!gtk_widget_get_visible (GTK_WIDGET (ecal)))
return;
- if (!prepare_tag (ecal, &c, display_zone, clear_first))
+ if (!prepare_tag (ecal, &closure, display_zone, clear_first))
return;
- c.skip_transparent_events = FALSE;
- c.recur_events_italic = can_recur_events_italic && get_recur_events_italic ();
+ closure.skip_transparent_events = FALSE;
+ closure.recur_events_italic =
+ can_recur_events_italic && get_recur_events_italic ();
if (comp_is_on_server) {
- struct calendar_tag_closure *closure = g_new0 (struct calendar_tag_closure, 1);
+ struct calendar_tag_closure *alloced_closure;
+
+ alloced_closure = g_new0 (struct calendar_tag_closure, 1);
- *closure = c;
+ *alloced_closure = closure;
e_cal_client_generate_instances_for_object (
client, e_cal_component_get_icalcomponent (comp),
- c.start_time, c.end_time, cancellable, tag_calendar_cb, closure, g_free);
+ closure.start_time, closure.end_time, cancellable,
+ (ECalRecurInstanceFn) tag_calendar_cb,
+ alloced_closure, (GDestroyNotify) g_free);
} else
e_cal_recur_generate_instances (
- comp, c.start_time, c.end_time,
- tag_calendar_cb, &c, resolve_tzid_cb,
- client, c.zone);
+ comp, closure.start_time, closure.end_time,
+ (ECalRecurInstanceFn) tag_calendar_cb,
+ &closure,
+ (ECalRecurResolveTimezoneFn) resolve_tzid_cb,
+ client, closure.zone);
}
diff --git a/calendar/gui/weekday-picker.c b/calendar/gui/weekday-picker.c
index a06b249ee5..eaed5cc5ec 100644
--- a/calendar/gui/weekday-picker.c
+++ b/calendar/gui/weekday-picker.c
@@ -36,6 +36,10 @@
#define PADDING 2
+#define WEEKDAY_PICKER_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), TYPE_WEEKDAY_PICKER, WeekdayPickerPrivate))
+
/* Private part of the WeekdayPicker structure */
struct _WeekdayPickerPrivate {
/* Selected days; see weekday_picker_set_days() */
@@ -184,25 +188,6 @@ configure_items (WeekdayPicker *wp)
}
static void
-weekday_picker_dispose (GObject *object)
-{
- WeekdayPicker *wp;
- WeekdayPickerPrivate *priv;
-
- g_return_if_fail (object != NULL);
- g_return_if_fail (IS_WEEKDAY_PICKER (object));
-
- wp = WEEKDAY_PICKER (object);
- priv = wp->priv;
-
- g_free (priv);
- wp->priv = NULL;
-
- /* Chain up to parent's dispose() method. */
- G_OBJECT_CLASS (weekday_picker_parent_class)->dispose (object);
-}
-
-static void
weekday_picker_realize (GtkWidget *widget)
{
WeekdayPicker *wp;
@@ -351,11 +336,9 @@ weekday_picker_focus (GtkWidget *widget,
static void
weekday_picker_class_init (WeekdayPickerClass *class)
{
- GObjectClass *object_class;
GtkWidgetClass *widget_class;
- object_class = G_OBJECT_CLASS (class);
- object_class->dispose = weekday_picker_dispose;
+ g_type_class_add_private (class, sizeof (WeekdayPickerPrivate));
widget_class = GTK_WIDGET_CLASS (class);
widget_class->realize = weekday_picker_realize;
@@ -369,7 +352,7 @@ weekday_picker_class_init (WeekdayPickerClass *class)
wp_signals[CHANGED] = g_signal_new (
"changed",
- G_TYPE_FROM_CLASS (object_class),
+ G_TYPE_FROM_CLASS (class),
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (WeekdayPickerClass, changed),
NULL, NULL,
@@ -487,26 +470,26 @@ create_items (WeekdayPicker *wp)
priv->boxes[i] = gnome_canvas_item_new (parent,
GNOME_TYPE_CANVAS_RECT,
NULL);
- g_signal_connect (priv->boxes[i], "event", G_CALLBACK (day_event_cb), wp);
+ g_signal_connect (
+ priv->boxes[i], "event",
+ G_CALLBACK (day_event_cb), wp);
priv->labels[i] = gnome_canvas_item_new (parent,
GNOME_TYPE_CANVAS_TEXT,
NULL);
- g_signal_connect (priv->labels[i], "event", G_CALLBACK (day_event_cb), wp);
+ g_signal_connect (
+ priv->labels[i], "event",
+ G_CALLBACK (day_event_cb), wp);
}
}
static void
weekday_picker_init (WeekdayPicker *wp)
{
- WeekdayPickerPrivate *priv;
-
- priv = g_new0 (WeekdayPickerPrivate, 1);
-
- wp->priv = priv;
+ wp->priv = WEEKDAY_PICKER_GET_PRIVATE (wp);
create_items (wp);
- priv->focus_day = -1;
+ wp->priv->focus_day = -1;
}
/**
@@ -535,14 +518,9 @@ void
weekday_picker_set_days (WeekdayPicker *wp,
guint8 day_mask)
{
- WeekdayPickerPrivate *priv;
-
- g_return_if_fail (wp != NULL);
g_return_if_fail (IS_WEEKDAY_PICKER (wp));
- priv = wp->priv;
-
- priv->day_mask = day_mask;
+ wp->priv->day_mask = day_mask;
colorize_items (wp);
g_signal_emit (G_OBJECT (wp), wp_signals[CHANGED], 0);
@@ -560,13 +538,9 @@ weekday_picker_set_days (WeekdayPicker *wp,
guint8
weekday_picker_get_days (WeekdayPicker *wp)
{
- WeekdayPickerPrivate *priv;
-
- g_return_val_if_fail (wp != NULL, 0);
g_return_val_if_fail (IS_WEEKDAY_PICKER (wp), 0);
- priv = wp->priv;
- return priv->day_mask;
+ return wp->priv->day_mask;
}
/**
@@ -582,13 +556,9 @@ void
weekday_picker_set_blocked_days (WeekdayPicker *wp,
guint8 blocked_day_mask)
{
- WeekdayPickerPrivate *priv;
-
- g_return_if_fail (wp != NULL);
g_return_if_fail (IS_WEEKDAY_PICKER (wp));
- priv = wp->priv;
- priv->blocked_day_mask = blocked_day_mask;
+ wp->priv->blocked_day_mask = blocked_day_mask;
}
/**
@@ -604,13 +574,9 @@ weekday_picker_set_blocked_days (WeekdayPicker *wp,
guint
weekday_picker_get_blocked_days (WeekdayPicker *wp)
{
- WeekdayPickerPrivate *priv;
-
- g_return_val_if_fail (wp != NULL, 0);
g_return_val_if_fail (IS_WEEKDAY_PICKER (wp), 0);
- priv = wp->priv;
- return priv->blocked_day_mask;
+ return wp->priv->blocked_day_mask;
}
/**
@@ -625,14 +591,10 @@ void
weekday_picker_set_week_start_day (WeekdayPicker *wp,
gint week_start_day)
{
- WeekdayPickerPrivate *priv;
-
- g_return_if_fail (wp != NULL);
g_return_if_fail (IS_WEEKDAY_PICKER (wp));
g_return_if_fail (week_start_day >= 0 && week_start_day < 7);
- priv = wp->priv;
- priv->week_start_day = week_start_day;
+ wp->priv->week_start_day = week_start_day;
configure_items (wp);
}
@@ -649,12 +611,8 @@ weekday_picker_set_week_start_day (WeekdayPicker *wp,
gint
weekday_picker_get_week_start_day (WeekdayPicker *wp)
{
- WeekdayPickerPrivate *priv;
-
- g_return_val_if_fail (wp != NULL, -1);
g_return_val_if_fail (IS_WEEKDAY_PICKER (wp), -1);
- priv = wp->priv;
- return priv->week_start_day;
+ return wp->priv->week_start_day;
}
diff --git a/calendar/importers/icalendar-importer.c b/calendar/importers/icalendar-importer.c
index 3887780ed7..9432bc3256 100644
--- a/calendar/importers/icalendar-importer.c
+++ b/calendar/importers/icalendar-importer.c
@@ -317,7 +317,9 @@ ivcal_getwidget (EImport *ei,
primary = e_source_list_peek_source_any (source_list);
e_source_selector_set_primary_selection (E_SOURCE_SELECTOR (selector), primary);
- g_signal_connect (selector, "primary_selection_changed", G_CALLBACK (primary_selection_changed_cb), target);
+ g_signal_connect (
+ selector, "primary_selection_changed",
+ G_CALLBACK (primary_selection_changed_cb), target);
rb = gtk_radio_button_new_with_label (group, _(import_type_strings[i]));
gtk_box_pack_start (GTK_BOX (hbox), rb, FALSE, FALSE, 6);
@@ -1038,12 +1040,16 @@ gnome_calendar_getwidget (EImport *ei,
w = gtk_check_button_new_with_label (_("Calendar Events"));
gtk_toggle_button_set_active ((GtkToggleButton *) w, !done_cal);
- g_signal_connect (w, "toggled", G_CALLBACK (calendar_toggle_cb), target);
+ g_signal_connect (
+ w, "toggled",
+ G_CALLBACK (calendar_toggle_cb), target);
gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0);
w = gtk_check_button_new_with_label (_("Tasks"));
gtk_toggle_button_set_active ((GtkToggleButton *) w, !done_tasks);
- g_signal_connect (w, "toggled", G_CALLBACK (tasks_toggle_cb), target);
+ g_signal_connect (
+ w, "toggled",
+ G_CALLBACK (tasks_toggle_cb), target);
gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0);
gtk_widget_show_all (hbox);
@@ -1511,7 +1517,9 @@ ical_get_preview (icalcomponent *icalcomp)
selection = gtk_tree_view_get_selection (tree_view);
gtk_tree_selection_select_iter (selection, &iter);
- g_signal_connect (selection, "changed", G_CALLBACK (preview_selection_changed_cb), preview);
+ g_signal_connect (
+ selection, "changed",
+ G_CALLBACK (preview_selection_changed_cb), preview);
preview_selection_changed_cb (selection, E_WEB_VIEW_PREVIEW (preview));
diff --git a/capplet/anjal-settings-main.c b/capplet/anjal-settings-main.c
index 081424e3dd..be287fbae8 100644
--- a/capplet/anjal-settings-main.c
+++ b/capplet/anjal-settings-main.c
@@ -103,7 +103,7 @@ create_default_shell (void)
if (!socket_id)
gtk_widget_show (main_window);
- return e_shell_get_default();
+ return e_shell_get_default ();
}
gint
diff --git a/capplet/anjal-settings-main.c.orig b/capplet/anjal-settings-main.c.orig
deleted file mode 100644
index d62fbb5941..0000000000
--- a/capplet/anjal-settings-main.c.orig
+++ /dev/null
@@ -1,229 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with the program; if not, see <http://www.gnu.org/licenses/>
- *
- *
- * Authors:
- * Srinivasa Ragavan <sragavan@novell.com>
- *
- * Copyright (C) 2009 Intel Corporation (www.intel.com)
- *
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <locale.h>
-#include <unistd.h>
-#include <string.h>
-#include <stdio.h>
-
-#include <gtk/gtk.h>
-#include <glib/gi18n.h>
-#include <libedataserverui/e-passwords.h>
-#include <libemail-utils/mail-mt.h>
-#include "settings/mail-capplet-shell.h"
-#include <libedataserver/e-categories.h>
-#include "e-util/e-plugin.h"
-#include "e-util/e-plugin-ui.h"
-#include "shell/es-event.h"
-#include "shell/e-shell-meego.h"
-#include "e-util/e-import.h"
-
-#ifdef G_OS_WIN32
-#define WIN32_LEAN_AND_MEAN
-#ifdef DATADIR
-#undef DATADIR
-#endif
-#define _WIN32_WINNT 0x0601
-#include <windows.h>
-#include <conio.h>
-#include <io.h>
-#ifndef PROCESS_DEP_ENABLE
-#define PROCESS_DEP_ENABLE 0x00000001
-#endif
-#ifndef PROCESS_DEP_DISABLE_ATL_THUNK_EMULATION
-#define PROCESS_DEP_DISABLE_ATL_THUNK_EMULATION 0x00000002
-#endif
-#endif
-
-guint32 socket_id = 0;
-GtkWidget *main_window;
-static gchar **remaining_args;
-
-static void
-categories_icon_theme_hack (void)
-{
- GtkIconTheme *icon_theme;
- const gchar *category_name;
- const gchar *filename;
- gchar *dirname;
-
- /* XXX Allow the category icons to be referenced as named
- * icons, since GtkAction does not support GdkPixbufs. */
-
- /* Get the icon file for some default category. Doesn't matter
- * which, so long as it has an icon. We're just interested in
- * the directory components. */
- category_name = _("Birthday");
- filename = e_categories_get_icon_file_for (category_name);
- g_return_if_fail (filename != NULL && *filename != '\0');
-
- /* Extract the directory components. */
- dirname = g_path_get_dirname (filename);
-
- /* Add it to the icon theme's search path. This relies on
- * GtkIconTheme's legacy feature of using image files found
- * directly in the search path. */
- icon_theme = gtk_icon_theme_get_default ();
- gtk_icon_theme_append_search_path (icon_theme, dirname);
-
- g_free (dirname);
-}
-
-static EShell *
-create_default_shell (void)
-{
- EShell *shell;
- GConfClient *client;
- const gchar *key;
- gboolean is_meego = FALSE, small_screen = FALSE;
- gboolean express_mode = TRUE;
-
- client = gconf_client_get_default ();
- main_window = mail_capplet_shell_new (socket_id, FALSE, TRUE);
- if (!socket_id)
- gtk_widget_show (main_window);
-
- /* Determine whether to run Evolution in "express" mode. */
- key = "/apps/evolution/shell/express_mode";
-
- if (!express_mode)
- express_mode = gconf_client_get_bool (client, key, NULL);
-
- if (express_mode)
- e_shell_detect_meego (&is_meego, &small_screen);
-
- flags = G_APPLICATION_HANDLES_OPEN |
- G_APPLICATION_HANDLES_COMMAND_LINE;
-
- shell = g_initable_new (
- E_TYPE_SHELL, NULL, &error,
- "application-id", "org.gnome.EvolutionSettings",
- "flags", flags,
- "geometry", "",
- "module-directory", EVOLUTION_MODULEDIR,
- "meego-mode", is_meego,
- "express-mode", express_mode,
- "small-screen-mode", small_screen,
- "online", TRUE,
- NULL);
-
- g_object_unref (client);
-
- return shell;
-}
-
-gint
-main (gint argc,
- gchar *argv[])
-{
- GError *error = NULL;
- EShell *shell;
-
-#ifdef G_OS_WIN32
- /* Reduce risks */
- {
- typedef BOOL (WINAPI *t_SetDllDirectoryA) (LPCSTR lpPathName);
- t_SetDllDirectoryA p_SetDllDirectoryA;
-
- p_SetDllDirectoryA = GetProcAddress (GetModuleHandle ("kernel32.dll"), "SetDllDirectoryA");
- if (p_SetDllDirectoryA)
- (*p_SetDllDirectoryA) ("");
- }
-#ifndef _WIN64
- {
- typedef BOOL (WINAPI *t_SetProcessDEPPolicy) (DWORD dwFlags);
- t_SetProcessDEPPolicy p_SetProcessDEPPolicy;
-
- p_SetProcessDEPPolicy = GetProcAddress (GetModuleHandle ("kernel32.dll"), "SetProcessDEPPolicy");
- if (p_SetProcessDEPPolicy)
- (*p_SetProcessDEPPolicy) (PROCESS_DEP_ENABLE | PROCESS_DEP_DISABLE_ATL_THUNK_EMULATION);
- }
-#endif
-
- if (fileno (stdout) != -1 && _get_osfhandle (fileno (stdout)) != -1) {
- /* stdout is fine, presumably redirected to a file or pipe */
- } else {
- typedef BOOL (* WINAPI AttachConsole_t) (DWORD);
-
- AttachConsole_t p_AttachConsole =
- (AttachConsole_t) GetProcAddress (GetModuleHandle ("kernel32.dll"), "AttachConsole");
-
- if (p_AttachConsole && p_AttachConsole (ATTACH_PARENT_PROCESS)) {
- freopen ("CONOUT$", "w", stdout);
- dup2 (fileno (stdout), 1);
- freopen ("CONOUT$", "w", stderr);
- dup2 (fileno (stderr), 2);
- }
- }
-#endif
-
- static GOptionEntry entries[] = {
- { "socket",
- 's',
- G_OPTION_FLAG_IN_MAIN,
- G_OPTION_ARG_INT,
- &socket_id,
- /* TRANSLATORS: don't translate the terms in brackets */
- N_("ID of the socket to embed in"),
- N_("socket") },
- { G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_STRING_ARRAY, &remaining_args, NULL, NULL },
- { NULL, 0, 0, 0, NULL, NULL, NULL }
- };
-
-#ifdef ENABLE_NLS
- bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR);
- bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
- textdomain (GETTEXT_PACKAGE);
-#endif
-
- setlocale (LC_ALL, NULL);
-
- if (!gtk_init_with_args (&argc, &argv, NULL, entries, NULL, &error))
- g_error ("%s", error->message);
-
- e_passwords_init ();
- categories_icon_theme_hack ();
-
- shell = create_default_shell ();
- e_shell_load_modules (shell);
-
- /* Register built-in plugin hook types. */
- es_event_hook_get_type ();
- e_import_hook_get_type ();
- e_plugin_ui_hook_get_type ();
-
- /* All EPlugin and EPluginHook subclasses should be
- * registered in GType now, so load plugins now. */
- e_plugin_load_plugins ();
-
- gtk_main ();
-
- return 0;
-}
diff --git a/capplet/anjal-settings-main.c.rej b/capplet/anjal-settings-main.c.rej
deleted file mode 100644
index d94e997a1a..0000000000
--- a/capplet/anjal-settings-main.c.rej
+++ /dev/null
@@ -1,11 +0,0 @@
---- capplet/anjal-settings-main.c
-+++ capplet/anjal-settings-main.c
-@@ -104,8 +104,6 @@
- gboolean is_meego = FALSE, small_screen = FALSE;
- gboolean express_mode = TRUE;
- GSettings *settings;
-- GError *error = NULL;
-- GApplicationFlags flags;
-
- settings = g_settings_new ("org.gnome.evolution.shell");
-
diff --git a/capplet/settings/Makefile.am.orig b/capplet/settings/Makefile.am.orig
deleted file mode 100644
index 1367fd5a75..0000000000
--- a/capplet/settings/Makefile.am.orig
+++ /dev/null
@@ -1,65 +0,0 @@
-privsolib_LTLIBRARIES = libevolution-mail-settings.la
-
-libevolution_mail_settings_la_CPPFLAGS = \
- $(AM_CPPFLAGS) \
- -I$(top_srcdir)/widgets \
- -I$(top_srcdir)/widgets/misc \
- -I$(top_srcdir) \
- -I$(top_srcdir)/e-util \
- -I$(top_srcdir)/em-format \
- -I$(top_srcdir)/mail \
- -I$(top_srcdir)/composer \
- -I$(top_builddir)/composer \
- -I$(top_builddir)/shell \
- -I$(top_srcdir)/shell \
- -I$(top_srcdir)/smime/lib \
- -I$(top_srcdir)/smime/gui \
- $(EVOLUTION_DATA_SERVER_CFLAGS) \
- $(GNOME_PLATFORM_CFLAGS) \
- $(CERT_UI_CFLAGS) \
- $(CANBERRA_CFLAGS) \
- $(GTKHTML_CFLAGS) \
- -DANJAL_SETTINGS \
- -DEVOLUTION_DATADIR=\""$(datadir)"\" \
- -DEVOLUTION_PRIVDATADIR=\""$(privdatadir)"\" \
- -DEVOLUTION_ETSPECDIR=\""$(etspecdir)"\" \
- -DEVOLUTION_ICONSDIR=\""$(imagesdir)"\" \
- -DEVOLUTION_MODULEDIR=\""$(moduledir)"\" \
- -DEVOLUTION_IMAGES=\""$(imagesdir)"\" \
- -DEVOLUTION_GALVIEWSDIR=\""$(viewsdir)"\" \
- -DEVOLUTION_BUTTONSDIR=\""$(buttonsdir)"\" \
- -DEVOLUTION_LOCALEDIR=\""$(localedir)"\" \
- -DEVOLUTION_UIDIR=\""$(uidir)"\" \
- -DCAMEL_PROVIDERDIR=\""$(camel_providerdir)"\" \
- -DPREFIX=\""$(prefix)"\" \
- -DG_LOG_DOMAIN=\"evolution-mail\" \
- -DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \
- -DPACKAGE_DATA_DIR=\""$(datadir)"\"
-
-libevolution_mail_settings_la_SOURCES = \
- mail-settings-view.c \
- mail-settings-view.h \
- mail-account-view.c \
- mail-account-view.h \
- mail-view.c \
- mail-view.h \
- mail-capplet-shell.c \
- mail-capplet-shell.h \
- anjal-mail-view.h \
- anjal-mail-view.c
-
-libevolution_mail_settings_la_LIBADD = \
- $(EVOLUTION_DATA_SERVER_LIBS) \
- $(GNOME_PLATFORM_LIBS) \
- $(CERT_UI_LIBS) \
- $(CANBERRA_LIBS) \
- $(GTKHTML_LIBS) \
- $(SMIME_LIBS) \
- $(top_builddir)/widgets/misc/libemiscwidgets.la \
- $(top_builddir)/filter/libfilter.la \
- $(top_builddir)/mail/libevolution-mail.la \
- $(top_builddir)/shell/libeshell.la \
- $(top_builddir)/e-util/libeutil.la
-
-libevolution_mail_settings_la_LDFLAGS = $(NO_UNDEFINED)
-
diff --git a/capplet/settings/anjal-mail-view.c b/capplet/settings/anjal-mail-view.c
index 232b8ff118..9307b0aeca 100644
--- a/capplet/settings/anjal-mail-view.c
+++ b/capplet/settings/anjal-mail-view.c
@@ -31,32 +31,9 @@
#include "libemail-engine/mail-ops.h"
#include "mail/em-folder-tree.h"
-struct _AnjalMailViewPrivate {
-
- gboolean started;
-};
-
G_DEFINE_TYPE (AnjalMailView, anjal_mail_view, GTK_TYPE_NOTEBOOK)
static void
-anjal_mail_view_init (AnjalMailView *shell)
-{
- shell->priv = g_new0 (AnjalMailViewPrivate, 1);
- shell->priv->started = TRUE;
-}
-
-static void
-anjal_mail_view_finalize (GObject *object)
-{
- AnjalMailView *shell = (AnjalMailView *) object;
- AnjalMailViewPrivate *priv = shell->priv;
-
- g_free (priv);
-
- G_OBJECT_CLASS (anjal_mail_view_parent_class)->finalize (object);
-}
-
-static void
view_set_folder_uri (AnjalMailView *mail_view,
const gchar *uri)
{
@@ -87,16 +64,17 @@ view_init_search (AnjalMailView *mail_view,
}
static void
-anjal_mail_view_class_init (AnjalMailViewClass *klass)
+anjal_mail_view_class_init (AnjalMailViewClass *class)
{
- GObjectClass * object_class = G_OBJECT_CLASS (klass);
-
- anjal_mail_view_parent_class = g_type_class_peek_parent (klass);
- object_class->finalize = anjal_mail_view_finalize;
- klass->set_folder_uri = view_set_folder_uri;
- klass->set_folder_tree_widget = view_set_folder_tree_widget;
- klass->set_folder_tree = view_set_folder_tree;
- klass->set_search = view_set_search;
- klass->init_search = view_init_search;
+ class->set_folder_uri = view_set_folder_uri;
+ class->set_folder_tree_widget = view_set_folder_tree_widget;
+ class->set_folder_tree = view_set_folder_tree;
+ class->set_search = view_set_search;
+ class->init_search = view_init_search;
};
+static void
+anjal_mail_view_init (AnjalMailView *shell)
+{
+}
+
diff --git a/capplet/settings/mail-account-view.c b/capplet/settings/mail-account-view.c
index 4150c9b51c..7ee0a868f4 100644
--- a/capplet/settings/mail-account-view.c
+++ b/capplet/settings/mail-account-view.c
@@ -103,11 +103,11 @@ mail_account_view_finalize (GObject *object)
}
static void
-mail_account_view_class_init (MailAccountViewClass *klass)
+mail_account_view_class_init (MailAccountViewClass *class)
{
- GObjectClass * object_class = G_OBJECT_CLASS (klass);
+ GObjectClass * object_class = G_OBJECT_CLASS (class);
- mail_account_view_parent_class = g_type_class_peek_parent (klass);
+ mail_account_view_parent_class = g_type_class_peek_parent (class);
object_class->finalize = mail_account_view_finalize;
signals[VIEW_CLOSE] =
@@ -481,9 +481,8 @@ create_review (MailAccountView *view)
gchar *user = NULL;
CamelNetworkSecurityMethod method;
EMConfigTargetSettings *target;
-
- target = (EMConfigTargetSettings *) ((EConfig *)view->edit->config)->target;
+ target = (EMConfigTargetSettings *) ((EConfig *) view->edit->config)->target;
g_object_get (view->edit, "store-settings", &source_settings, NULL);
g_object_get (view->edit, "transport-settings", &transport_settings, NULL);
@@ -596,7 +595,7 @@ create_review (MailAccountView *view)
"host", &host, "user", &user,
"security-method", &method, NULL);
protocol = target->transport_protocol;
-
+
switch (method) {
case CAMEL_NETWORK_SECURITY_METHOD_SSL_ON_ALTERNATE_PORT:
encryption = _("Always (SSL)");
@@ -608,7 +607,7 @@ create_review (MailAccountView *view)
encryption = _("Never");
break;
}
-
+
label = gtk_label_new (NULL);
buff = g_markup_printf_escaped ("<span size=\"large\" weight=\"bold\">%s</span>", _("Sending"));
gtk_label_set_markup ((GtkLabel *) label, buff);
@@ -689,7 +688,7 @@ struct _page_text {
static gboolean
mav_check_same_source_transport (MailAccountView *mav)
{
- EAccount *account = em_account_editor_get_modified_account(mav->edit);
+ EAccount *account = em_account_editor_get_modified_account (mav->edit);
const gchar *uri;
gchar *current = NULL;
gboolean ret = FALSE;
@@ -700,8 +699,8 @@ mav_check_same_source_transport (MailAccountView *mav)
gint len;
if (colon) {
- len = colon-uri;
- current = g_alloca (len+1);
+ len = colon - uri;
+ current = g_alloca (len + 1);
memcpy (current, uri, len);
current[len] = 0;
}
@@ -709,9 +708,9 @@ mav_check_same_source_transport (MailAccountView *mav)
if (current) {
GList *l;
- for (l=mav->priv->providers; l; l=l->next) {
+ for (l = mav->priv->providers; l; l = l->next) {
CamelProvider *provider = l->data;
-
+
if (strcmp (provider->protocol, current) == 0 &&
CAMEL_PROVIDER_IS_STORE_AND_TRANSPORT (provider)) {
ret = TRUE;
@@ -794,7 +793,7 @@ mav_next_pressed (GtkButton *button,
if (mav->current_page == MAV_RECV_OPT_PAGE && mav->original == NULL)
mav->current_page++; /* Skip recv options in new account creation. */
if (mav->current_page == MAV_SEND_PAGE && mav_check_same_source_transport (mav)) {
- mav->current_page++; /* Skip send page if the provider does both source and transport*/
+ mav->current_page++; /* Skip send page if the provider does both source and transport */
}
if (mav->current_page == MAV_DEFAULTS_PAGE && mav->original == NULL)
mav->current_page++; /* Skip defaults in new account creation. */
@@ -805,10 +804,10 @@ mav_next_pressed (GtkButton *button,
EAccount *account = em_account_editor_get_modified_account (mav->edit);
CamelNetworkSettings *settings = NULL;
const gchar *host = NULL;
-
+
g_object_get (mav->edit, "store-settings", &settings, NULL);
host = camel_network_settings_get_host (settings);
-
+
if (page->main)
gtk_widget_destroy (page->main);
@@ -958,8 +957,8 @@ mav_prev_pressed (GtkButton *button,
if (mav->current_page == MAV_DEFAULTS_PAGE && mav->original == NULL)
mav->current_page--; /* Skip defaults in new account creation. */
if (mav->current_page == MAV_SEND_PAGE && mav_check_same_source_transport (mav)) {
- mav->current_page--; /* Skip send page if the provider does both source and transport*/
- }
+ mav->current_page--; /* Skip send page if the provider does both source and transport */
+ }
if (mav->current_page == MAV_RECV_OPT_PAGE && mav->original == NULL)
mav->current_page--; /* Skip recv options in new account creation. */
gtk_widget_show (mav->pages[mav->current_page]->box);
@@ -1032,7 +1031,9 @@ mav_construct_page (MailAccountView *view,
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) {
@@ -1047,7 +1048,9 @@ mav_construct_page (MailAccountView *view,
gtk_widget_set_can_default (page->next, TRUE);
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);
@@ -1117,7 +1120,9 @@ mail_account_view_construct (MailAccountView *view,
pwd = gtk_entry_new ();
gtk_entry_set_visibility ((GtkEntry *) pwd, FALSE);
/* gtk_entry_set_activates_default ((GtkEntry *)pwd, TRUE); */
- g_signal_connect (pwd, "activate", G_CALLBACK (next_page), view);
+ g_signal_connect (
+ pwd, "activate",
+ G_CALLBACK (next_page), view);
gtk_widget_show (label);
gtk_widget_show (pwd);
gtk_table_attach ((GtkTable *) table, label, 0, 1, 2, 3, GTK_FILL, 0, 0, 0);
@@ -1166,7 +1171,9 @@ mail_account_view_get_tab_widget (MailAccountView *mcv)
gtk_button_set_relief ((GtkButton *) tool, GTK_RELIEF_NONE);
gtk_button_set_focus_on_click ((GtkButton *) tool, FALSE);
gtk_widget_set_tooltip_text (tool, _("Close Tab"));
- g_signal_connect (tool, "clicked", G_CALLBACK(mav_close), mcv);
+ g_signal_connect (
+ tool, "clicked",
+ G_CALLBACK (mav_close), mcv);
box = gtk_hbox_new (FALSE, 0);
gtk_box_pack_start ((GtkBox *) box, img, FALSE, FALSE, 0);
diff --git a/capplet/settings/mail-account-view.c.orig b/capplet/settings/mail-account-view.c.orig
deleted file mode 100644
index 594744021b..0000000000
--- a/capplet/settings/mail-account-view.c.orig
+++ /dev/null
@@ -1,1104 +0,0 @@
-/*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with the program; if not, see <http://www.gnu.org/licenses/>
- *
- *
- * Authors:
- * Srinivasa Ragavan <sragavan@novell.com>
- *
- * Copyright (C) 2009 Novell, Inc. (www.novell.com)
- *
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <glib/gi18n.h>
-#include "mail-account-view.h"
-#include <libedataserverui/e-passwords.h>
-#include <libedataserver/e-source-group.h>
-#include <libedataserver/e-source-list.h>
-#include <libedataserver/e-account-list.h>
-#include "mail-view.h"
-#include "e-util/e-config.h"
-#include "mail/e-mail-backend.h"
-
-struct _MailAccountViewPrivate {
- GtkWidget *tab_str;
-
- GtkWidget *calendar;
- GtkWidget *gcontacts;
- GtkWidget *gmail_info_label;
-
- GtkWidget *account_label;
- GtkWidget *gmail_link;
- GtkWidget *yahoo_cal_box;
-
- gboolean is_gmail;
- gboolean is_yahoo;
- gboolean do_gcontacts;
- gboolean do_calendar;
-
- gchar *username;
-
- GtkWidget *yahoo_cal_entry;
-};
-
-G_DEFINE_TYPE (MailAccountView, mail_account_view, GTK_TYPE_VBOX)
-
-enum {
- VIEW_CLOSE,
- LAST_SIGNAL
-};
-
-enum {
- ERROR_NO_FULLNAME = 1,
- ERROR_NO_EMAIL = 2,
- ERROR_INVALID_EMAIL = 3,
- ERROR_NO_PASSWORD = 4,
-};
-
-struct _dialog_errors {
- gint error;
- const gchar *detail;
-} dialog_errors[] = {
- { ERROR_NO_FULLNAME, N_("Please enter your full name.") },
- { ERROR_NO_EMAIL, N_("Please enter your email address.") },
- { ERROR_INVALID_EMAIL, N_("The email address you have entered is invalid.") },
- { ERROR_NO_PASSWORD, N_("Please enter your password.") }
-};
-static guint signals[LAST_SIGNAL] = { 0 };
-
-static void
-mail_account_view_init (MailAccountView *shell)
-{
- shell->priv = g_new0 (MailAccountViewPrivate, 1);
-
- shell->priv->is_gmail = FALSE;
- shell->priv->is_yahoo = FALSE;
- shell->priv->username = NULL;
-}
-
-static void
-mail_account_view_finalize (GObject *object)
-{
- MailAccountView *shell = (MailAccountView *) object;
-
- g_free (shell->priv->username);
-
- G_OBJECT_CLASS (mail_account_view_parent_class)->finalize (object);
-}
-
-static void
-mail_account_view_class_init (MailAccountViewClass *klass)
-{
- GObjectClass * object_class = G_OBJECT_CLASS (klass);
-
- mail_account_view_parent_class = g_type_class_peek_parent (klass);
- object_class->finalize = mail_account_view_finalize;
-
- signals[VIEW_CLOSE] =
- g_signal_new ("view-close",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (MailAccountViewClass , view_close),
- NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
-}
-
-#ifdef NOT_USED
-
-enum {
- GMAIL = 0,
- YAHOO,
- AOL
-};
-struct _server_prefill {
- gchar *key;
- gchar *recv;
- gchar *send;
- gchar *proto;
- gchar *ssl;
-} std_server[] = {
- {"gmail", "imap.gmail.com", "smtp.gmail.com", "imap", "always"},
- {"yahoo", "pop3.yahoo.com", "smtp.yahoo.com", "pop", "never"},
- {"aol", "imap.aol.com", "smtp.aol.com", "pop", "never"},
- {"msn", "pop3.email.msn.com", "smtp.email.msn.com", "pop", "never"}
-};
-static gint
-check_servers (gchar *server)
-{
- gint len = G_N_ELEMENTS (std_server), i;
-
- for (i = 0; i < len; i++) {
- if (strstr (server, std_server[i].key) != NULL)
- return i;
- }
-
- return -1;
-}
-#endif
-static void
-save_identity (MailAccountView *view)
-{
-}
-
-static gint
-validate_identity (MailAccountView *view)
-{
- gchar *user = (gchar *) e_account_get_string (em_account_editor_get_modified_account (view->edit), E_ACCOUNT_ID_NAME);
- gchar *email = (gchar *) e_account_get_string (em_account_editor_get_modified_account (view->edit), E_ACCOUNT_ID_ADDRESS);
- gchar *tmp;
- const gchar *pwd = gtk_entry_get_text ((GtkEntry *) view->password);
-
- if (!user || !*user)
- return ERROR_NO_FULLNAME;
- if (!email || !*email)
- return ERROR_NO_EMAIL;
- if (view->original) /* We don't query/store pwd on edit. */
- return 0;
- if (!pwd || !*pwd)
- return ERROR_NO_PASSWORD;
-
- tmp = strchr (email, '@');
- if (!tmp || tmp[1] == 0)
- return ERROR_INVALID_EMAIL;
-
- return 0;
-}
-#ifdef NOT_USED
-static void
-save_send (MailAccountView *view)
-{
-}
-
-static void
-save_account (MailAccountView *view)
-{
-}
-#endif
-
-#define PACK_BOX(w) box = gtk_hbox_new(FALSE, 0); gtk_box_pack_start((GtkBox *)box, w, FALSE, FALSE, 12); gtk_widget_show(box);
-#define PACK_BOXF(w) box = gtk_hbox_new(FALSE, 0); gtk_box_pack_start((GtkBox *)box, w, FALSE, FALSE, 0); gtk_widget_show(box);
-
-#define CALENDAR_CALDAV_URI "caldav://%s@www.google.com/calendar/dav/%s/events"
-#define GMAIL_CALENDAR_LOCATION "://www.google.com/calendar/feeds/"
-#define CALENDAR_DEFAULT_PATH "/private/full"
-#define SELECTED_CALENDARS "/apps/evolution/calendar/display/selected_calendars"
-#define YAHOO_CALENDAR_LOCATION "%s@caldav.calendar.yahoo.com/dav/%s/Calendar/%s"
-static gboolean
-is_email (const gchar *address)
-{
- /* This is supposed to check if the address's domain could be
- * an FQDN but alas, it's not worth the pain and suffering. */
- const gchar *at;
-
- at = strchr (address, '@');
- /* make sure we have an '@' and that it's not the first or last gchar */
- if (!at || at == address || *(at + 1) == '\0')
- return FALSE;
-
- return TRUE;
-}
-
-static gchar *
-sanitize_user_mail (const gchar *user)
-{
- if (!user)
- return NULL;
-
- if (strstr (user, "%40") != NULL) {
- return g_strdup (user);
- } else if (!is_email (user)) {
- return g_strconcat (user, "%40gmail.com", NULL);
- } else {
- gchar *tmp = g_malloc0 (sizeof (gchar) * (1 + strlen (user) + 2));
- gchar *at = strchr (user, '@');
-
- strncpy (tmp, user, at - user);
- strcat (tmp, "%40");
- strcat (tmp, at + 1);
-
- return tmp;
- }
-}
-
-static void
-add_selected_calendar (const gchar *uid)
-{
- gchar **ids;
- gint i;
- GPtrArray *array;
- GSettings *settings;
-
- settings = g_settings_new ("org.gnome.evolution.calendar");
- ids = g_settings_get_strv (settings, "selected-calendars");
-
- array = g_ptr_array_new ();
- for (i = 0; ids[i] != NULL; i++)
- g_ptr_array_add (array, ids[i]);
- g_ptr_array_add (array, (gpointer) uid);
- g_ptr_array_add (array, NULL);
-
- g_settings_set_strv (settings, "selected-calendars", (const gchar* const *) array->pdata);
-
- g_ptr_array_free (array, TRUE);
- g_object_unref (settings);
-}
-
-static void
-setup_yahoo_account (MailAccountView *mav)
-{
- GConfClient *gconf = gconf_client_get_default ();
-
- mav->priv->do_gcontacts = gtk_toggle_button_get_active ((GtkToggleButton *) mav->priv->gcontacts);
- mav->priv->do_calendar = gtk_toggle_button_get_active ((GtkToggleButton *) mav->priv->calendar);
-
- if (mav->priv->do_calendar) {
- ESourceList *slist;
- ESourceGroup *sgrp;
- ESource *calendar;
- gchar *sanitize_uname, *abs_uri, *rel_uri;
- const gchar *email = e_account_get_string (em_account_editor_get_modified_account (mav->edit), E_ACCOUNT_ID_ADDRESS);
-
- slist = e_source_list_new_for_gconf (gconf, "/apps/evolution/calendar/sources");
- sgrp = e_source_list_peek_group_by_base_uri (slist, "caldav://");
- if (!sgrp) {
- sgrp = e_source_list_ensure_group (slist, _("CalDAV"), "caldav://", TRUE);
- }
-
- printf("Setting up Yahoo Calendar: list:%p CalDAVGrp: %p\n", slist, sgrp);
-
- /* FIXME: Not sure if we should localize 'Calendar' */
- calendar = e_source_new ("Yahoo", "");
- e_source_set_property (calendar, "ssl", "1");
- e_source_set_property (calendar, "refresh", "30");
- e_source_set_property (calendar, "refresh-type", "0");
- e_source_set_property (calendar, "auth", "1");
- e_source_set_property (calendar, "offline_sync", "1");
- e_source_set_property (calendar, "username", email);
- e_source_set_property (calendar, "default", "true");
- e_source_set_property (calendar, "alarm", "true");
-
- e_source_set_readonly (calendar, FALSE);
-
- sanitize_uname = sanitize_user_mail (email);
-
- abs_uri = g_strdup_printf ("caldav://%s@caldav.calendar.yahoo.com/dav/%s/Calendar/%s/", sanitize_uname, email, gtk_entry_get_text((GtkEntry *)mav->priv->yahoo_cal_entry));
- e_passwords_add_password (abs_uri, gtk_entry_get_text ((GtkEntry *) mav->password));
- e_passwords_remember_password (NULL, abs_uri);
-
- rel_uri = g_strdup_printf (YAHOO_CALENDAR_LOCATION, sanitize_uname, email, gtk_entry_get_text ((GtkEntry *) mav->priv->yahoo_cal_entry));
- e_source_set_relative_uri (calendar, rel_uri);
-
- e_source_group_add_source (sgrp, calendar, -1);
- e_source_list_sync (slist, NULL);
-
- add_selected_calendar (e_source_peek_uid (calendar));
-
- g_free (abs_uri);
- g_free (rel_uri);
- g_free (sanitize_uname);
- g_object_unref (slist);
- g_object_unref (sgrp);
- g_object_unref (calendar);
- } else
- printf("Not setting up Yahoo Calendar\n");
-
- if (mav->priv->do_gcontacts) {
- ESourceList *slist;
- ESourceGroup *sgrp;
- ESource *abook;
- gchar *rel_uri;;
-
- slist = e_source_list_new_for_gconf (gconf, "/apps/evolution/addressbook/sources" );
-
- sgrp = e_source_list_peek_group_by_base_uri (slist, "google://");
-
- /* FIXME: Not sure if we should localize 'Contacts' */
- abook = e_source_new ("Contacts", "");
- e_source_set_property (abook, "default", "true");
- e_source_set_property (abook, "offline_sync", "1");
- e_source_set_property (abook, "auth", "plain/password");
- e_source_set_property (abook, "use-ssl", "true");
- e_source_set_property (abook, "remember_password", "true");
- e_source_set_property (abook, "refresh-interval", "86400");
- e_source_set_property (abook, "completion", "true");
- e_source_set_property (abook, "username", mav->priv->username);
- e_source_set_relative_uri (abook, mav->priv->username);
-
- rel_uri = g_strdup_printf("google://%s/", mav->priv->username);
- e_passwords_add_password (rel_uri, gtk_entry_get_text ((GtkEntry *) mav->password));
- e_passwords_remember_password (NULL, rel_uri);
- e_source_group_add_source (sgrp, abook, -1);
- e_source_list_sync (slist, NULL);
-
- g_free (rel_uri);
- g_object_unref (slist);
- g_object_unref (sgrp);
- g_object_unref (abook);
-
- }
-
- g_object_unref (gconf);
-}
-
-static void
-setup_google_accounts (MailAccountView *mav)
-{
- GConfClient *gconf = gconf_client_get_default ();
-
- mav->priv->do_gcontacts = gtk_toggle_button_get_active ((GtkToggleButton *) mav->priv->gcontacts);
- mav->priv->do_calendar = gtk_toggle_button_get_active ((GtkToggleButton *) mav->priv->calendar);
-
- if (mav->priv->do_calendar) {
- ESourceList *slist;
- ESourceGroup *sgrp;
- ESource *calendar;
- gchar *sanitize_uname, *abs_uri, *rel_uri;
-
- slist = e_source_list_new_for_gconf (gconf, "/apps/evolution/calendar/sources");
- sgrp = e_source_list_ensure_group (slist, _("Google"), "google://", TRUE);
-
- /* FIXME: Not sure if we should localize 'Calendar' */
- calendar = e_source_new ("Calendar", "");
- e_source_set_property (calendar, "ssl", "1");
- e_source_set_property (calendar, "refresh", "30");
- e_source_set_property (calendar, "auth", "1");
- e_source_set_property (calendar, "offline_sync", "1");
- e_source_set_property (calendar, "username", mav->priv->username);
- e_source_set_property (calendar, "setup-username", mav->priv->username);
- e_source_set_property (calendar, "default", "true");
- e_source_set_readonly (calendar, FALSE);
-
- e_source_group_add_source (sgrp, calendar, -1);
-
- sanitize_uname = sanitize_user_mail (mav->priv->username);
-
- abs_uri = g_strdup_printf (CALENDAR_CALDAV_URI, sanitize_uname, mav->priv->username);
- e_source_set_absolute_uri (calendar, abs_uri);
-
- e_passwords_add_password (abs_uri, gtk_entry_get_text ((GtkEntry *) mav->password));
- e_passwords_remember_password (NULL, abs_uri);
- rel_uri = g_strconcat ("https", GMAIL_CALENDAR_LOCATION, sanitize_uname, CALENDAR_DEFAULT_PATH, NULL);
- e_source_set_relative_uri (calendar, rel_uri);
-
- e_source_list_sync (slist, NULL);
-
- add_selected_calendar (e_source_peek_uid (calendar));
-
- g_free (abs_uri);
- g_free (rel_uri);
- g_free (sanitize_uname);
- g_object_unref (slist);
- g_object_unref (sgrp);
- g_object_unref (calendar);
- }
-
- if (mav->priv->do_gcontacts) {
- ESourceList *slist;
- ESourceGroup *sgrp;
- GSList *sources;
- gboolean source_already_exists = FALSE;
-
- slist = e_source_list_new_for_gconf (gconf, "/apps/evolution/addressbook/sources" );
-
- sgrp = e_source_list_ensure_group (slist, _("Google"), "google://", TRUE);
-
- sources = e_source_group_peek_sources (sgrp);
- for (; sources; sources = sources->next) {
- ESource *existing = (ESource *) sources->data;
-
- if (!g_strcmp0 (e_source_peek_relative_uri (existing),
- mav->priv->username)) {
- source_already_exists = TRUE;
- break;
- }
- }
-
- if (!source_already_exists) {
- ESource *abook;
- gchar *rel_uri;
-
- /* FIXME: Not sure if we should localize 'Contacts' */
- abook = e_source_new ("Contacts", "");
- e_source_set_property (abook, "default", "true");
- e_source_set_property (abook, "offline_sync", "1");
- e_source_set_property (abook, "auth", "plain/password");
- e_source_set_property (abook, "use-ssl", "true");
- e_source_set_property (abook, "remember_password", "true");
- e_source_set_property (abook, "refresh-interval", "86400");
- e_source_set_property (abook, "completion", "true");
- e_source_set_property (abook, "username", mav->priv->username);
-
- e_source_group_add_source (sgrp, abook, -1);
-
- e_source_set_relative_uri (abook, mav->priv->username);
-
- rel_uri = g_strdup_printf ("google://%s/", mav->priv->username);
- e_passwords_add_password (rel_uri, gtk_entry_get_text ((GtkEntry *) mav->password));
- e_passwords_remember_password (NULL, rel_uri);
- e_source_list_sync (slist, NULL);
-
- g_free (rel_uri);
- g_object_unref (abook);
- }
-
- g_object_unref (slist);
- g_object_unref (sgrp);
- }
-
- g_object_unref (gconf);
-}
-
-#define INDENTATION 10
-
-static GtkWidget *
-create_review (MailAccountView *view)
-{
- GtkWidget *table, *box, *label, *entry;
- gchar *uri;
- gchar *enc;
- CamelURL *url;
- gchar *buff;
-
- uri = (gchar *) e_account_get_string (em_account_editor_get_modified_account (view->edit), E_ACCOUNT_SOURCE_URL);
- if (!uri || (url = camel_url_new (uri, NULL)) == NULL)
- return NULL;
-
- table = gtk_table_new (4,2, FALSE);
- gtk_table_set_row_spacings ((GtkTable *) table, 4);
-
- label = gtk_label_new (NULL);
- buff = g_markup_printf_escaped ("<span size=\"large\" weight=\"bold\">%s</span>", _("Personal details:"));
- gtk_label_set_markup ((GtkLabel *) label, buff);
- 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);
-
- 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);
- 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);
-
- 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);
- 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);
-
- label = gtk_label_new (NULL);
- buff = g_markup_printf_escaped ("<span size=\"large\" weight=\"bold\">%s</span>", _("Details:"));
- gtk_label_set_markup ((GtkLabel *) label, buff);
- 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);
-
- label = gtk_label_new (NULL);
- buff = g_markup_printf_escaped ("<span size=\"large\" weight=\"bold\">%s</span>", _("Receiving"));
- gtk_label_set_markup ((GtkLabel *) label, buff);
- 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);
-
- 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);
- 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);
-
- 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);
- 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);
-
- 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);
- 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);
-
- 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);
- 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);
-
- view->priv->username = g_strdup (url->user);
- camel_url_free (url);
- uri =(gchar *) e_account_get_string (em_account_editor_get_modified_account (view->edit), E_ACCOUNT_TRANSPORT_URL);
- if (!uri || (url = camel_url_new (uri, NULL)) == NULL)
- return NULL;
-
- label = gtk_label_new (NULL);
- buff = g_markup_printf_escaped ("<span size=\"large\" weight=\"bold\">%s</span>", _("Sending"));
- gtk_label_set_markup ((GtkLabel *) label, buff);
- 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);
-
- 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);
-
- 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);
-
- 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);
-
- 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);
-
-/*
- label = gtk_label_new (_("Organization:"));
- gtk_widget_show (label);
- 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_widget_show (table);
-
- return table;
-}
-
-#define IDENTITY_DETAIL N_("To use the email application you'll need to setup an account. Put your email address and password in below and we'll try and work out all the settings. If we can't do it automatically you'll need your server details as well.")
-
-#define RECEIVE_DETAIL N_("Sorry, we can't work out the settings to get your mail automatically. Please enter them below. We've tried to make a start with the details you just entered but you may need to change them.")
-
-#define RECEIVE_OPT_DETAIL N_("You can specify more options to configure the account.")
-
-#define SEND_DETAIL N_("Now we need your settings for sending mail. We've tried to make some guesses but you should check them over to make sure.")
-#define DEFAULTS_DETAIL N_("You can specify your default settings for your account.")
-#define REVIEW_DETAIL N_("Time to check things over before we try and connect to the server and fetch your mail.")
-struct _page_text {
- gint id;
- const gchar *head;
- const gchar *next;
- const gchar *prev;
- const gchar *next_edit;
- const gchar *prev_edit;
- const gchar *detail;
- const gchar *path;
- GtkWidget * (*create_page) (MailAccountView *view);
- void (*fill_page) (MailAccountView *view);
- void (*save_page) (MailAccountView *view);
- gint (*validate_page) (MailAccountView *view);
-} mail_account_pages[] = {
- { MAV_IDENTITY_PAGE, N_("Identity"), N_("Next - Receiving mail"), NULL, N_("Next - Receiving mail"), NULL, IDENTITY_DETAIL, "00.identity",NULL, NULL, save_identity, validate_identity},
- { MAV_RECV_PAGE, N_("Receiving mail"), N_("Next - Sending mail"), N_("Back - Identity"), N_("Next - Receiving options"), N_("Back - Identity"), RECEIVE_DETAIL, "10.receive", NULL, NULL, NULL, NULL },
- { MAV_RECV_OPT_PAGE, N_("Receiving options"), NULL, NULL, N_("Next - Sending mail"), N_("Back - Receiving mail"), RECEIVE_OPT_DETAIL, "10.receive", NULL, NULL, NULL, NULL },
-
- { MAV_SEND_PAGE, N_("Sending mail"), N_("Next - Review account"), N_("Back - Receiving mail"), N_("Next - Defaults"), N_("Back - Receiving options"), SEND_DETAIL, "30.send", NULL, NULL, NULL, NULL},
- { MAV_DEFAULTS_PAGE, N_("Defaults"), NULL, NULL, N_("Next - Review account"), N_("Back - Sending mail"), DEFAULTS_DETAIL, "40.defaults", NULL, NULL, NULL, NULL},
-
- { MAV_REVIEW_PAGE, N_("Review account"), N_("Finish"), N_("Back - Sending"), N_("Finish"), N_("Back - Sending"), REVIEW_DETAIL, NULL, create_review, NULL, NULL},
-};
-
-static void
-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_widget_show (page->error);
- return;
- }
- gtk_widget_hide (page->error);
- gtk_label_set_text ((GtkLabel *)page->error_label, "");
- }
- if (mail_account_pages[mav->current_page].save_page) {
- (*mail_account_pages[mav->current_page].save_page) (mav);
- }
-
- if (mav->current_page == MAV_LAST - 1) {
- gchar *uri = (gchar *) e_account_get_string (em_account_editor_get_modified_account (mav->edit), E_ACCOUNT_SOURCE_URL);
- CamelURL *url;
-
- e_account_set_string (em_account_editor_get_modified_account (mav->edit), E_ACCOUNT_NAME, e_account_get_string (em_account_editor_get_modified_account (mav->edit), E_ACCOUNT_ID_ADDRESS));
- if (uri != NULL && (url = camel_url_new (uri, NULL)) != NULL) {
- camel_url_set_param(url, "check-all", "true");
- camel_url_set_param(url, "stay-synchronized", "true");
- if (!mav->original) {
- e_account_set_bool (em_account_editor_get_modified_account (mav->edit), E_ACCOUNT_SOURCE_AUTO_CHECK, TRUE);
- }
-
- if (!mav->original && strcmp (url->protocol, "pop") == 0) {
- e_account_set_bool (em_account_editor_get_modified_account (mav->edit), E_ACCOUNT_SOURCE_KEEP_ON_SERVER, TRUE);
- }
-
- uri = camel_url_to_string (url, 0);
- e_account_set_string (em_account_editor_get_modified_account (mav->edit), E_ACCOUNT_SOURCE_URL, uri);
- g_free (uri);
- camel_url_free (url);
- }
-
- if (!mav->original) {
- EAccount *account = em_account_editor_get_modified_account (mav->edit);
- CamelURL *aurl;
- gchar *surl;
- /* Save the password ahead of time */
- aurl = camel_url_new (account->source->url, NULL);
- surl = camel_url_to_string (aurl, CAMEL_URL_HIDE_ALL);
- e_passwords_add_password (surl, gtk_entry_get_text ((GtkEntry *) mav->password));
- e_passwords_remember_password (NULL, surl);
- camel_url_free (aurl);
- g_free (surl);
- }
-
- if (mav->priv->is_gmail && !mav->original)
- setup_google_accounts (mav);
- else if (mav->priv->is_yahoo && !mav->original)
- setup_yahoo_account (mav);
-
- em_account_editor_commit (mav->edit);
- g_signal_emit (mav, signals[VIEW_CLOSE], 0);
- return;
- }
-
- gtk_widget_hide (mav->pages[mav->current_page]->box);
- mav->current_page++;
- if (mav->current_page == MAV_RECV_OPT_PAGE && mav->original == NULL)
- mav->current_page++; /* Skip recv options in new account creation. */
- if (mav->current_page == MAV_DEFAULTS_PAGE && mav->original == NULL)
- mav->current_page++; /* Skip defaults in new account creation. */
-
- if (mav->current_page == MAV_LAST - 1) {
- MAVPage *page = mav->pages[mav->current_page];
- GtkWidget *tmp;
- EAccount *account = em_account_editor_get_modified_account (mav->edit);
-
- if (page->main)
- gtk_widget_destroy (page->main);
-
- tmp = mail_account_pages[mav->current_page].create_page (mav);
- page->main = gtk_hbox_new (FALSE, 0);
- gtk_widget_show (page->main);
- if (tmp) {
- gtk_box_pack_start ((GtkBox *) page->main, tmp, FALSE, FALSE, 0);
- gtk_widget_show (tmp);
- }
- gtk_box_pack_start ((GtkBox *) page->box, page->main, FALSE, FALSE, 3);
-
- if (mav->priv->is_gmail) {
- gtk_widget_destroy (mav->priv->gcontacts);
- gtk_widget_destroy (mav->priv->calendar);
- gtk_widget_destroy (mav->priv->gmail_info_label);
- if (mav->priv->account_label) {
- gtk_widget_destroy (mav->priv->account_label);
- mav->priv->account_label = NULL;
- }
- if (mav->priv->gmail_link) {
- gtk_widget_destroy (mav->priv->gmail_link);
- mav->priv->gmail_link = NULL;
- }
- } else if (mav->priv->is_yahoo) {
- gtk_widget_destroy (mav->priv->calendar);
- gtk_widget_destroy (mav->priv->gmail_info_label);
- gtk_widget_destroy (mav->priv->yahoo_cal_entry);
- if (mav->priv->account_label) {
- gtk_widget_destroy (mav->priv->account_label);
- mav->priv->account_label = NULL;
- }
- if (mav->priv->yahoo_cal_box) {
- gtk_widget_destroy (mav->priv->yahoo_cal_box);
- mav->priv->yahoo_cal_box = NULL;
- }
- }
-
- if (mav->original == NULL && (g_strrstr(account->source->url, "gmail") ||
- g_strrstr(account->source->url, "googlemail"))) {
- /* Google accounts*/
- gchar *buff;
- mav->priv->is_gmail = TRUE;
-
- mav->priv->gcontacts = gtk_check_button_new_with_label (_("Setup Google contacts with Evolution"));
- mav->priv->calendar = gtk_check_button_new_with_label (_("Setup Google calendar with Evolution"));
-
- gtk_toggle_button_set_active ((GtkToggleButton *) mav->priv->gcontacts, TRUE);
- gtk_toggle_button_set_active ((GtkToggleButton *) mav->priv->calendar, TRUE);
-
- mav->priv->gmail_info_label = gtk_label_new (_("You may need to enable IMAP access."));
- gtk_label_set_selectable ((GtkLabel *) mav->priv->gmail_info_label, TRUE);
-
- gtk_widget_show (mav->priv->gcontacts);
- gtk_widget_show (mav->priv->calendar);
- gtk_widget_show (mav->priv->gmail_info_label);
-
- mav->priv->account_label = gtk_label_new (NULL);
- buff = g_markup_printf_escaped ("<span size=\"large\" weight=\"bold\">%s</span>", _("Google account settings:"));
- gtk_label_set_markup ((GtkLabel *) mav->priv->account_label, buff);
- g_free (buff);
- gtk_widget_show (mav->priv->account_label);
-
-#define PACK_IN_BOX(wid,child,num) { GtkWidget *tbox; tbox = gtk_hbox_new (FALSE, 0); gtk_box_pack_start ((GtkBox *)tbox, child, FALSE, FALSE, num); gtk_widget_show (tbox); gtk_box_pack_start ((GtkBox *)wid, tbox, FALSE, FALSE, 0); }
-
- PACK_IN_BOX (page->box,mav->priv->account_label,12);
- PACK_IN_BOX (page->box,mav->priv->gcontacts,24);
- PACK_IN_BOX (page->box,mav->priv->calendar,24);
-#undef PACK_IN_BOX
-#define PACK_IN_BOX(wid,child1,child2,num1,num2) { GtkWidget *tbox; tbox = gtk_hbox_new (FALSE, 0); gtk_box_pack_start ((GtkBox *)tbox, child1, FALSE, FALSE, num1); gtk_box_pack_start ((GtkBox *)tbox, child2, FALSE, FALSE, num2); gtk_widget_show_all (tbox); gtk_box_pack_start ((GtkBox *)wid, tbox, FALSE, FALSE, 0); }
-
- mav->priv->gmail_link = gtk_link_button_new ("https://mail.google.com/mail/?ui=2&amp;shva=1#settings/fwdandpop");
- PACK_IN_BOX (page->box,mav->priv->gmail_info_label,mav->priv->gmail_link, 24, 0);
-#undef PACK_IN_BOX
- } else if (mav->original == NULL &&
- (g_strrstr(account->source->url, "yahoo.") ||
- g_strrstr(account->source->url, "ymail.") ||
- g_strrstr(account->source->url, "rocketmail."))) {
- /* Yahoo accounts*/
- gchar *cal_name;
- gchar *buff;
-
- mav->priv->is_yahoo = TRUE;
- printf("Google account: %s\n", account->source->url);
- mav->priv->calendar = gtk_check_button_new_with_label (_("Setup Yahoo calendar with Evolution"));
-
- gtk_toggle_button_set_active ((GtkToggleButton *) mav->priv->calendar, TRUE);
-
- mav->priv->gmail_info_label = gtk_label_new (_("Yahoo calendars are named as firstname_lastname. We have tried to form the calendar name. So please confirm and re-enter the calendar name if it is not correct."));
- gtk_label_set_line_wrap ((GtkLabel *) mav->priv->gmail_info_label, TRUE);
- gtk_label_set_line_wrap_mode ((GtkLabel *) mav->priv->gmail_info_label, PANGO_WRAP_WORD);
- gtk_label_set_selectable ((GtkLabel *) mav->priv->gmail_info_label, TRUE);
-
- gtk_widget_show (mav->priv->calendar);
- gtk_widget_show (mav->priv->gmail_info_label);
-
- mav->priv->account_label = gtk_label_new (NULL);
- buff = g_markup_printf_escaped ("<span size=\"large\" weight=\"bold\">%s</span>", _("Yahoo account settings:"));
- gtk_label_set_markup ((GtkLabel *) mav->priv->account_label, buff);
- g_free (buff);
- gtk_widget_show (mav->priv->account_label);
-
-#define PACK_IN_BOX(wid,child,num) { GtkWidget *tbox; tbox = gtk_hbox_new (FALSE, 0); gtk_box_pack_start ((GtkBox *)tbox, child, FALSE, FALSE, num); gtk_widget_show (tbox); gtk_box_pack_start ((GtkBox *)wid, tbox, FALSE, FALSE, 0); }
-#define PACK_IN_BOX_AND_TEXT(txt,box,child,num) { GtkWidget *txtlbl = gtk_label_new (txt); box = gtk_hbox_new (FALSE, 12); gtk_box_pack_start ((GtkBox *)box, txtlbl, FALSE, FALSE, num); gtk_box_pack_start ((GtkBox *)box, child, FALSE, FALSE, num); gtk_widget_show_all (box);}
-
- PACK_IN_BOX (page->box,mav->priv->account_label,12);
- PACK_IN_BOX (page->box,mav->priv->calendar,24);
-
- mav->priv->yahoo_cal_entry = gtk_entry_new ();
- gtk_widget_show (mav->priv->yahoo_cal_entry);
- PACK_IN_BOX (page->box,mav->priv->gmail_info_label, 24);
- PACK_IN_BOX_AND_TEXT(_("Yahoo Calendar name:"), mav->priv->yahoo_cal_box, mav->priv->yahoo_cal_entry, 0);
- PACK_IN_BOX (page->box, mav->priv->yahoo_cal_box, 24);
- cal_name = g_strdup (e_account_get_string (em_account_editor_get_modified_account (mav->edit), E_ACCOUNT_ID_NAME));
- cal_name = g_strdelimit(cal_name, " ", '_');
- gtk_entry_set_text ((GtkEntry *) mav->priv->yahoo_cal_entry, cal_name);
- g_free (cal_name);
-#undef PACK_IN_BOX
- } else {
- mav->priv->is_gmail = FALSE;
- mav->priv->is_yahoo = FALSE;
- }
-
- }
-
- gtk_widget_show (mav->pages[mav->current_page]->box);
- if (!mav->pages[mav->current_page]->done) {
- mav->pages[mav->current_page]->done = TRUE;
- if (mail_account_pages[mav->current_page].path) {
-
- if (!mav->original && em_account_editor_check (mav->edit, mail_account_pages[mav->current_page].path))
- mav_next_pressed (NULL, mav);
- }
- }
-}
-
-static void
-mav_prev_pressed (GtkButton *button,
- MailAccountView *mav)
-{
- if (mav->current_page == 0)
- return;
-
- gtk_widget_hide (mav->pages[mav->current_page]->box);
- mav->current_page--;
- if (mav->current_page == MAV_RECV_OPT_PAGE && mav->original == NULL)
- mav->current_page--; /* Skip recv options in new account creation. */
- if (mav->current_page == MAV_DEFAULTS_PAGE && mav->original == NULL)
- mav->current_page--; /* Skip defaults in new account creation. */
- gtk_widget_show (mav->pages[mav->current_page]->box);
-
-}
-
-static GtkWidget *
-mav_construct_page (MailAccountView *view,
- MAVPageType type)
-{
- MAVPage *page = g_new0 (MAVPage, 1);
- GtkWidget *box, *tmp, *error_box;
- gchar *str;
-
- page->type = type;
-
- page->box = gtk_vbox_new (FALSE, 2);
-
- error_box = gtk_hbox_new (FALSE, 2);
- page->error_label = gtk_label_new ("");
- tmp = gtk_image_new_from_stock (GTK_STOCK_DIALOG_WARNING, GTK_ICON_SIZE_MENU);
- gtk_box_pack_start ((GtkBox *) error_box, tmp, FALSE, FALSE, 2);
- gtk_box_pack_start ((GtkBox *) error_box, page->error_label, FALSE, FALSE, 2);
- gtk_widget_hide (tmp);
- gtk_widget_show (page->error_label);
- page->error = tmp;
- gtk_widget_show (error_box);
-
- box = gtk_hbox_new (FALSE, 12);
- gtk_widget_show (box);
- gtk_box_pack_start ((GtkBox *) page->box, box, FALSE, FALSE, 12);
- tmp = gtk_label_new (NULL);
- str = g_strdup_printf("<span size=\"xx-large\" weight=\"heavy\">%s</span>", _(mail_account_pages[type].head));
- gtk_label_set_markup ((GtkLabel *) tmp, str);
- g_free (str);
- gtk_widget_show (tmp);
- gtk_box_pack_start ((GtkBox *) box, tmp, FALSE, FALSE, 12);
-
- box = gtk_hbox_new (FALSE, 12);
- gtk_widget_show (box);
- gtk_box_pack_start ((GtkBox *) page->box, box, FALSE, FALSE, 12);
- tmp = gtk_label_new (_(mail_account_pages[type].detail));
- gtk_widget_set_size_request (tmp, 600, -1);
- gtk_label_set_line_wrap ((GtkLabel *) tmp, TRUE);
- gtk_label_set_line_wrap_mode ((GtkLabel *) tmp, PANGO_WRAP_WORD);
- gtk_widget_show (tmp);
- gtk_box_pack_start ((GtkBox *) box, tmp, FALSE, FALSE, 12);
-
- page->main = NULL;
- if (mail_account_pages[type].create_page && mail_account_pages[type].path) {
- tmp = (*mail_account_pages[type].create_page) (view);
- gtk_box_pack_start ((GtkBox *) page->box, tmp, FALSE, FALSE, 3);
- page->main = gtk_hbox_new (FALSE, 0);
- gtk_widget_show (page->main);
- gtk_box_pack_start ((GtkBox *) page->main, tmp, FALSE, FALSE, 0);
- }
-
- if (mail_account_pages[type].fill_page) {
- (*mail_account_pages[type].fill_page) (view);
- }
-
- if ((view->original && mail_account_pages[type].prev_edit) || mail_account_pages[type].prev) {
- box = gtk_hbox_new (FALSE, 0);
- if (FALSE) {
- tmp = gtk_image_new_from_icon_name ("go-previous", GTK_ICON_SIZE_BUTTON);
- gtk_box_pack_start ((GtkBox *) box, tmp, FALSE, FALSE, 0);
- }
- tmp = gtk_label_new (_(view->original ? mail_account_pages[type].prev_edit : mail_account_pages[type].prev));
- gtk_box_pack_start ((GtkBox *) box, tmp, FALSE, FALSE, 3);
- 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);
- }
-
- if ((view->original && mail_account_pages[type].next_edit) || mail_account_pages[type].next) {
- box = gtk_hbox_new (FALSE, 0);
- tmp = gtk_label_new (_(view->original ? mail_account_pages[type].next_edit : mail_account_pages[type].next));
- gtk_box_pack_start ((GtkBox *) box, tmp, FALSE, FALSE, 3);
- if (FALSE) {
- tmp = gtk_image_new_from_icon_name ("go-next", GTK_ICON_SIZE_BUTTON);
- gtk_box_pack_start ((GtkBox *) box, tmp, FALSE, FALSE, 0);
- }
- page->next = gtk_button_new ();
- gtk_widget_set_can_default (page->next, TRUE);
- 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);
- }
-
- box = gtk_hbox_new (FALSE, 0);
- if (page->prev)
- gtk_box_pack_start ((GtkBox *) box, page->prev, FALSE, FALSE, 12);
- if (page->next)
- gtk_box_pack_end ((GtkBox *) box, page->next, FALSE, FALSE, 12);
- gtk_widget_show (box);
- gtk_box_pack_end ((GtkBox *) page->box, box, FALSE, FALSE, 6);
- gtk_widget_show (page->box);
- gtk_box_pack_end ((GtkBox *) page->box, error_box, FALSE, FALSE, 2);
- return (GtkWidget *) page;
-}
-
-static void
-next_page (GtkWidget *entry,
- MailAccountView *mav)
-{
- mav_next_pressed (NULL, mav);
-}
-
-static void
-mail_account_view_construct (MailAccountView *view,
- EMailBackend *backend)
-{
- gint i;
- EShell *shell;
-
- view->scroll = gtk_scrolled_window_new (NULL, NULL);
- gtk_scrolled_window_set_policy ((GtkScrolledWindow *) view->scroll, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
- gtk_scrolled_window_set_shadow_type ((GtkScrolledWindow *) view->scroll, GTK_SHADOW_NONE);
- view->page_widget = gtk_vbox_new (FALSE, 3);
- 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; i < MAV_LAST; i++) {
- view->pages[i] = (MAVPage *) mav_construct_page (view, i);
- view->pages[i]->done = FALSE;
- view->wpages[i] = view->pages[i]->box;
- gtk_box_pack_start ((GtkBox *) view->page_widget, view->pages[i]->box, TRUE, TRUE, 0);
- gtk_widget_hide (view->pages[i]->box);
- }
- gtk_widget_show (view->pages[0]->box);
- view->current_page = 0;
- gtk_box_pack_start ((GtkBox *) view, view->scroll, TRUE, TRUE, 0);
- view->edit = em_account_editor_new_for_pages (
- view->original, EMAE_PAGES, backend,
- "org.gnome.evolution.mail.config.accountWizard", view->wpages);
- gtk_widget_hide (e_config_create_widget (E_CONFIG (view->edit->config)));
- if (!view->original) {
- e_account_set_bool (em_account_editor_get_modified_account (view->edit), E_ACCOUNT_SOURCE_SAVE_PASSWD, TRUE);
- e_account_set_bool (em_account_editor_get_modified_account (view->edit), E_ACCOUNT_TRANSPORT_SAVE_PASSWD, TRUE);
- }
- em_account_editor_check (view->edit, mail_account_pages[0].path);
- view->pages[0]->done = TRUE;
-
- shell = e_shell_get_default ();
- if (!shell || e_shell_get_express_mode (shell)) {
- GtkWidget *table = em_account_editor_get_widget (view->edit, "identity-required-table");
- GtkWidget *label, *pwd;
- gtk_widget_hide (em_account_editor_get_widget (view->edit, "identity-optional-section"));
-
- if (!view->original) {
- label = gtk_label_new (_("Password:"));
- pwd = gtk_entry_new ();
- gtk_entry_set_visibility ((GtkEntry *) pwd, FALSE);
-/* gtk_entry_set_activates_default ((GtkEntry *)pwd, TRUE); */
- g_signal_connect (pwd, "activate", G_CALLBACK (next_page), 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);
-
- view->password = pwd;
- }
- }
-
- /* assume the full name is known from the system */
- gtk_widget_grab_focus (em_account_editor_get_widget (view->edit, "identity_address"));
-}
-
-MailAccountView *
-mail_account_view_new (EAccount *account,
- EMailBackend *backend)
-{
- MailAccountView *view = g_object_new (MAIL_ACCOUNT_VIEW_TYPE, NULL);
- view->type = MAIL_VIEW_ACCOUNT;
- view->uri = "account://";
- view->original = account;
- mail_account_view_construct (view, backend);
-
- return view;
-}
-
-static void
-mav_close (GtkButton *w,
- MailAccountView *mfv)
-{
- g_signal_emit (mfv, signals[VIEW_CLOSE], 0);
-}
-
-GtkWidget *
-mail_account_view_get_tab_widget (MailAccountView *mcv)
-{
- GdkPixbuf *pbuf = gtk_widget_render_icon ((GtkWidget *)mcv, "gtk-close", GTK_ICON_SIZE_MENU, NULL);
-
- GtkWidget *tool, *box, *img;
- gint w=-1, h=-1;
- GtkWidget *tab_label;
-
- img = (GtkWidget *) gtk_image_new_from_pixbuf (pbuf);
-
- tool = gtk_button_new ();
- gtk_button_set_relief ((GtkButton *) tool, GTK_RELIEF_NONE);
- gtk_button_set_focus_on_click ((GtkButton *) tool, FALSE);
- gtk_widget_set_tooltip_text (tool, _("Close Tab"));
- g_signal_connect (tool, "clicked", G_CALLBACK(mav_close), mcv);
-
- box = gtk_hbox_new (FALSE, 0);
- gtk_box_pack_start ((GtkBox *) box, img, FALSE, FALSE, 0);
- 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);
-
- box = gtk_label_new (_("Account Wizard"));
- tab_label = gtk_hbox_new (FALSE, 0);
- gtk_box_pack_start ((GtkBox *) tab_label, box, FALSE, FALSE, 2);
- gtk_box_pack_start ((GtkBox *) tab_label, tool, FALSE, FALSE, 0);
- gtk_widget_show_all (tab_label);
-
- return tab_label;
-
-}
-
-void
-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_set_sensitive (check_mail, TRUE);
- gtk_widget_set_sensitive (sort_by, FALSE);
-}
diff --git a/capplet/settings/mail-capplet-shell.c b/capplet/settings/mail-capplet-shell.c
index c80c36e038..6369baff85 100644
--- a/capplet/settings/mail-capplet-shell.c
+++ b/capplet/settings/mail-capplet-shell.c
@@ -114,15 +114,15 @@ ms_ctrl_q_pressed (MailCappletShell *shell)
}
static void
-mail_capplet_shell_class_init (MailCappletShellClass *klass)
+mail_capplet_shell_class_init (MailCappletShellClass *class)
{
- GObjectClass * object_class = G_OBJECT_CLASS (klass);
+ GObjectClass * object_class = G_OBJECT_CLASS (class);
GtkBindingSet *binding_set;
- mail_capplet_shell_parent_class = g_type_class_peek_parent (klass);
+ mail_capplet_shell_parent_class = g_type_class_peek_parent (class);
object_class->finalize = mail_capplet_shell_finalize;
- klass->ctrl_w_pressed = ms_ctrl_w_pressed;
- klass->ctrl_q_pressed = ms_ctrl_q_pressed;
+ class->ctrl_w_pressed = ms_ctrl_w_pressed;
+ class->ctrl_q_pressed = ms_ctrl_q_pressed;
mail_capplet_shell_signals[CTRL_W_PRESSED] =
g_signal_new ("ctrl_w_pressed",
@@ -142,7 +142,7 @@ mail_capplet_shell_class_init (MailCappletShellClass *klass)
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
- binding_set = gtk_binding_set_by_class (klass);
+ binding_set = gtk_binding_set_by_class (class);
gtk_binding_entry_add_signal (binding_set, GDK_KEY_W, GDK_CONTROL_MASK, "ctrl_w_pressed", 0);
gtk_binding_entry_add_signal (binding_set, GDK_KEY_w, GDK_CONTROL_MASK, "ctrl_w_pressed", 0);
gtk_binding_entry_add_signal (binding_set, GDK_KEY_Q, GDK_CONTROL_MASK, "ctrl_q_pressed", 0);
@@ -175,7 +175,7 @@ mail_capplet_shell_quit (MailCappletShell *shell)
MailCappletShellPrivate *priv = shell->priv;
if (!priv->main_loop)
- gtk_widget_hide ((GtkWidget *)shell);
+ gtk_widget_hide ((GtkWidget *) shell);
}
static void
@@ -184,7 +184,7 @@ ms_delete_event (MailCappletShell *shell,
gpointer data G_GNUC_UNUSED)
{
mail_capplet_shell_quit (shell);
- gtk_main_quit();
+ gtk_main_quit ();
}
static void
@@ -211,7 +211,9 @@ mail_capplet_shell_construct (MailCappletShell *shell,
gtk_window_set_icon_name ((GtkWindow *)shell, "evolution");
gtk_window_set_title ((GtkWindow *)shell, _("Evolution account assistant"));
ms_init_style (style);
- g_signal_connect ((GObject *)shell, "delete-event", G_CALLBACK (ms_delete_event), NULL);
+ g_signal_connect (
+ shell, "delete-event",
+ G_CALLBACK (ms_delete_event), NULL);
gtk_window_set_type_hint ((GtkWindow *) shell, GDK_WINDOW_TYPE_HINT_NORMAL);
if (g_getenv("ANJAL_NO_MAX") == NULL && FALSE) {
GdkScreen *scr = gtk_widget_get_screen ((GtkWidget *) shell);
@@ -231,7 +233,9 @@ mail_capplet_shell_construct (MailCappletShell *shell,
GtkWidget *plug = gtk_plug_new (socket_id);
gtk_container_add ((GtkContainer *) plug, priv->box);
- g_signal_connect (plug, "destroy", G_CALLBACK (gtk_main_quit), NULL);
+ g_signal_connect (
+ plug, "destroy",
+ G_CALLBACK (gtk_main_quit), NULL);
gtk_widget_show (plug);
gtk_widget_hide ((GtkWidget *) shell);
@@ -281,7 +285,9 @@ mail_capplet_shell_construct (MailCappletShell *shell,
gtk_notebook_set_show_tabs ((GtkNotebook *) shell->view, FALSE);
mc = mail_view_add_page ((MailView *) shell->view, MAIL_VIEW_ACCOUNT, NULL);
- g_signal_connect (mc, "view-close", G_CALLBACK(ms_show_post_druid), shell);
+ g_signal_connect (
+ mc, "view-close",
+ G_CALLBACK (ms_show_post_druid), shell);
setup_abooks ();
} else
shell->priv->settings_view = mail_view_add_page ((MailView *) shell->view, MAIL_VIEW_SETTINGS, NULL);
diff --git a/capplet/settings/mail-capplet-shell.c.orig b/capplet/settings/mail-capplet-shell.c.orig
deleted file mode 100644
index 3d3e015e94..0000000000
--- a/capplet/settings/mail-capplet-shell.c.orig
+++ /dev/null
@@ -1,395 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with the program; if not, see <http://www.gnu.org/licenses/>
- *
- *
- * Authors:
- * Srinivasa Ragavan <sragavan@gnome.org>
- * Srinivasa Ragavan <srini@linux.intel.com>
- *
- * Copyright (C) 2010 Intel Corporation. (www.intel.com)
- *
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <gtk/gtkx.h>
-#include <glib/gi18n.h>
-#include <glib/gstdio.h>
-#include "mail-capplet-shell.h"
-#include "mail-view.h"
-#include <gdk/gdkkeysyms.h>
-
-#include <e-util/e-util.h>
-
-#include <mail/em-utils.h>
-#include <mail/em-composer-utils.h>
-#include <libemail-engine/mail-config.h>
-#include <libemail-utils/mail-mt.h>
-
-#include <shell/e-shell.h>
-
-enum {
- CTRL_W_PRESSED,
- CTRL_Q_PRESSED,
- LAST_SIGNAL
-};
-
-/* Re usable colors */
-
-GdkColor *pcolor_sel;
-gchar *scolor_sel;
-GdkColor *pcolor_fg_sel;
-gchar *scolor_fg_sel;
-GdkColor *pcolor_bg_norm;
-gchar *scolor_bg_norm;
-GdkColor *pcolor_norm;
-gchar *scolor_norm;
-GdkColor *pcolor_fg_norm;
-gchar *scolor_fg_norm;
-
-static guint mail_capplet_shell_signals[LAST_SIGNAL];
-
-struct _MailCappletShellPrivate {
-
- EMailBackend *backend;
- GtkWidget *box;
-
- GtkWidget * top_bar;
- GtkWidget *message_pane;
- GtkWidget *bottom_bar;
-
- /* Top Bar */
- GtkWidget *action_bar;
- GtkWidget *quit;
-
- gboolean main_loop;
-
- MailViewChild *settings_view;
-};
-
-static void mail_capplet_shell_quit (MailCappletShell *shell);
-
-G_DEFINE_TYPE (MailCappletShell, mail_capplet_shell, GTK_TYPE_WINDOW)
-
-static void setup_abooks (void);
-
-static void
-mail_capplet_shell_init (MailCappletShell *shell)
-{
- shell->priv = g_new0 (MailCappletShellPrivate, 1);
- shell->priv->settings_view = NULL;
-}
-
-static void
-mail_capplet_shell_finalize (GObject *object)
-{
- G_OBJECT_CLASS (mail_capplet_shell_parent_class)->finalize (object);
-}
-
-static void
-ms_ctrl_w_pressed (MailCappletShell *shell)
-{
- mail_view_close_view ((MailView *) shell->view);
-}
-
-static void
-ms_ctrl_q_pressed (MailCappletShell *shell)
-{
- mail_capplet_shell_quit (shell);
-}
-
-static void
-mail_capplet_shell_class_init (MailCappletShellClass *klass)
-{
- GObjectClass * object_class = G_OBJECT_CLASS (klass);
- GtkBindingSet *binding_set;
-
- mail_capplet_shell_parent_class = g_type_class_peek_parent (klass);
- object_class->finalize = mail_capplet_shell_finalize;
- klass->ctrl_w_pressed = ms_ctrl_w_pressed;
- klass->ctrl_q_pressed = ms_ctrl_q_pressed;
-
- mail_capplet_shell_signals[CTRL_W_PRESSED] =
- g_signal_new ("ctrl_w_pressed",
- G_TYPE_FROM_CLASS (object_class),
- G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
- G_STRUCT_OFFSET (MailCappletShellClass, ctrl_w_pressed),
- NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
- mail_capplet_shell_signals[CTRL_Q_PRESSED] =
- g_signal_new ("ctrl_q_pressed",
- G_TYPE_FROM_CLASS (object_class),
- G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
- G_STRUCT_OFFSET (MailCappletShellClass, ctrl_q_pressed),
- NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
- binding_set = gtk_binding_set_by_class (klass);
- gtk_binding_entry_add_signal (binding_set, GDK_KEY_W, GDK_CONTROL_MASK, "ctrl_w_pressed", 0);
- gtk_binding_entry_add_signal (binding_set, GDK_KEY_w, GDK_CONTROL_MASK, "ctrl_w_pressed", 0);
- gtk_binding_entry_add_signal (binding_set, GDK_KEY_Q, GDK_CONTROL_MASK, "ctrl_q_pressed", 0);
- gtk_binding_entry_add_signal (binding_set, GDK_KEY_Q, GDK_CONTROL_MASK, "ctrl_q_pressed", 0);
-
-};
-
-static void
-ms_init_style (GtkStyle *style)
-{
- pcolor_sel = &style->base[GTK_STATE_SELECTED];
- scolor_sel = gdk_color_to_string (pcolor_sel);
-
- pcolor_norm = &style->bg[GTK_STATE_NORMAL];
- scolor_norm = gdk_color_to_string (pcolor_norm);
-
- pcolor_bg_norm = &style->base[GTK_STATE_NORMAL];
- scolor_bg_norm = gdk_color_to_string (pcolor_bg_norm);
-
- pcolor_fg_sel =&style->fg[GTK_STATE_SELECTED];
- scolor_fg_sel = gdk_color_to_string (pcolor_fg_sel);
-
- pcolor_fg_norm =&style->fg[GTK_STATE_NORMAL];
- scolor_fg_norm = gdk_color_to_string (pcolor_fg_norm);
-}
-
-static void
-mail_capplet_shell_quit (MailCappletShell *shell)
-{
- MailCappletShellPrivate *priv = shell->priv;
-
- if (priv->main_loop)
- gtk_main_quit ();
- else
- gtk_widget_destroy ((GtkWidget *) shell);
-}
-
-static void
-ms_delete_event (MailCappletShell *shell,
- 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)
-{
- gtk_widget_destroy (GTK_WIDGET (shell));
-}
-
-#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)
-{
- MailCappletShellPrivate *priv = shell->priv;
- GtkStyle *style = gtk_widget_get_default_style ();
- EShell *eshell;
- EMailSession *session;
-
- gtk_window_set_icon_name ((GtkWindow *)shell, "evolution");
- gtk_window_set_title ((GtkWindow *)shell, _("Evolution account assistant"));
- ms_init_style (style);
- g_signal_connect ((GObject *)shell, "delete-event", G_CALLBACK (ms_delete_event), NULL);
- gtk_window_set_type_hint ((GtkWindow *) shell, GDK_WINDOW_TYPE_HINT_NORMAL);
- if (g_getenv("ANJAL_NO_MAX") == NULL && FALSE) {
- GdkScreen *scr = gtk_widget_get_screen ((GtkWidget *) shell);
- gtk_window_set_default_size ((GtkWindow *) shell, gdk_screen_get_width (scr), gdk_screen_get_height (scr));
- gtk_window_set_decorated ((GtkWindow *) shell, FALSE);
- } else {
- gtk_window_set_default_size ((GtkWindow *) shell, 1024, 500);
- }
-
- priv->main_loop = main_loop;
- priv->box = (GtkWidget *) gtk_vbox_new (FALSE, 0);
- gtk_widget_show ((GtkWidget *) priv->box);
-
- if (!socket_id) {
- gtk_container_add ((GtkContainer *) shell, priv->box);
- } else {
- GtkWidget *plug = gtk_plug_new (socket_id);
-
- gtk_container_add ((GtkContainer *) plug, priv->box);
- g_signal_connect (plug, "destroy", G_CALLBACK (gtk_main_quit), NULL);
- gtk_widget_show (plug);
- gtk_widget_hide ((GtkWidget *) shell);
-
- }
-
- if (camel_init (e_get_user_data_dir (), TRUE) != 0)
- exit (0);
-
- camel_provider_init ();
-
- eshell = e_shell_get_default ();
-
- if (eshell == NULL) {
- GError *error = NULL;
-
- eshell = g_initable_new (
- E_TYPE_SHELL, NULL, &error,
- "application-id", "org.gnome.Evolution",
- "flags", 0,
- "geometry", NULL,
- "module-directory", EVOLUTION_MODULEDIR,
- "meego-mode", FALSE,
- "express-mode", FALSE,
- "small-screen-mode", FALSE,
- "online", FALSE,
- NULL);
-
- if (error != NULL)
- g_error ("%s", error->message);
-
- e_shell_load_modules (eshell);
- }
-
- shell->priv->backend = E_MAIL_BACKEND (e_shell_get_backend_by_name (eshell, "mail"));
- session = e_mail_backend_get_session (shell->priv->backend);
-
- shell->view = mail_view_new ();
- shell->view->backend = shell->priv->backend;
- gtk_widget_show ((GtkWidget *) shell->view);
- gtk_box_pack_end ((GtkBox *) priv->box, (GtkWidget *) shell->view, TRUE, TRUE, 2);
-
- mail_config_init (session);
- mail_msg_init ();
-
- if (just_druid) {
- MailViewChild *mc;
-
- gtk_notebook_set_show_tabs ((GtkNotebook *) shell->view, FALSE);
- mc = mail_view_add_page ((MailView *) shell->view, MAIL_VIEW_ACCOUNT, NULL);
- g_signal_connect (mc, "view-close", G_CALLBACK(ms_show_post_druid), shell);
- setup_abooks ();
- } else
- shell->priv->settings_view = mail_view_add_page ((MailView *) shell->view, MAIL_VIEW_SETTINGS, NULL);
-
-}
-
-GtkWidget *
-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);
-
- return GTK_WIDGET (shell);
-}
-
-#define LOCAL_BASE_URI "local:"
-#define PERSONAL_RELATIVE_URI "system"
-
-static void
-setup_abooks (void)
-{
- GSList *groups;
- ESourceGroup *group;
- ESourceList *list = NULL;
- ESourceGroup *on_this_computer = NULL;
- ESource *personal_source = NULL;
- GError *error = NULL;
-
- e_book_client_get_sources (&list, &error);
-
- if (error != NULL) {
- g_warning (
- "%s: Unable to get books: %s",
- G_STRFUNC, error->message);
- g_error_free (error);
- return;
- }
-
- groups = e_source_list_peek_groups (list);
- if (groups) {
- /* groups are already there, we need to search for things... */
- GSList *g;
- gchar *base_dir, *base_uri;
-
- base_dir = g_build_filename (
- e_get_user_data_dir (), "addressbook", "local", NULL);
- base_uri = g_filename_to_uri (base_dir, NULL, NULL);
-
- for (g = groups; g; g = g->next) {
- group = E_SOURCE_GROUP (g->data);
-
- if (strcmp (base_uri, e_source_group_peek_base_uri (group)) == 0)
- e_source_group_set_base_uri (group, LOCAL_BASE_URI);
-
- if (!on_this_computer && !strcmp (LOCAL_BASE_URI, e_source_group_peek_base_uri (group))) {
- on_this_computer = g_object_ref (group);
- break;
- }
- }
-
- g_free (base_dir);
- g_free (base_uri);
- }
-
- if (on_this_computer) {
- /* make sure "Personal" shows up as a source under
- * this group */
- GSList *sources = e_source_group_peek_sources (on_this_computer);
- GSList *s;
- for (s = sources; s; s = s->next) {
- ESource *source = E_SOURCE (s->data);
- const gchar *relative_uri;
-
- relative_uri = e_source_peek_relative_uri (source);
- if (relative_uri == NULL)
- continue;
- if (!strcmp (PERSONAL_RELATIVE_URI, relative_uri)) {
- personal_source = g_object_ref (source);
- break;
- }
- }
- }
- else {
- /* create the local source group */
- group = e_source_group_new (_("On This Computer"), LOCAL_BASE_URI);
- e_source_list_add_group (list, group, -1);
-
- on_this_computer = group;
- }
-
- if (!personal_source) {
- /* Create the default Person addressbook */
- ESource *source = e_source_new (_("Personal"), PERSONAL_RELATIVE_URI);
- e_source_group_add_source (on_this_computer, source, -1);
-
- e_source_set_property (source, "completion", "true");
-
- personal_source = source;
- }
-
- if (on_this_computer)
- g_object_unref (on_this_computer);
- if (personal_source)
- g_object_unref (personal_source);
-
- e_source_list_sync (list, NULL);
- g_object_unref (list);
-}
-
diff --git a/capplet/settings/mail-settings-view.c b/capplet/settings/mail-settings-view.c
index 992f705826..2f284c685d 100644
--- a/capplet/settings/mail-settings-view.c
+++ b/capplet/settings/mail-settings-view.c
@@ -69,11 +69,11 @@ mail_settings_view_finalize (GObject *object)
}
static void
-mail_settings_view_class_init (MailSettingsViewClass *klass)
+mail_settings_view_class_init (MailSettingsViewClass *class)
{
- GObjectClass * object_class = G_OBJECT_CLASS (klass);
+ GObjectClass * object_class = G_OBJECT_CLASS (class);
- mail_settings_view_parent_class = g_type_class_peek_parent (klass);
+ mail_settings_view_parent_class = g_type_class_peek_parent (class);
object_class->finalize = mail_settings_view_finalize;
signals[VIEW_CLOSE] =
@@ -160,7 +160,9 @@ build_account_button (MailSettingsView *acview,
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);
@@ -169,7 +171,9 @@ build_account_button (MailSettingsView *acview,
gtk_box_pack_start ((GtkBox *) box1, tlabel, FALSE, FALSE, 12);
gtk_widget_show (tlabel);
g_object_set_data ((GObject *)tlabel, "account", account);
- g_signal_connect (tlabel, "clicked", G_CALLBACK(msv_delete_account), acview);
+ g_signal_connect (
+ tlabel, "clicked",
+ G_CALLBACK (msv_delete_account), acview);
}
PACK_BOX (box1,24);
@@ -214,7 +218,9 @@ mail_settings_view_construct (MailSettingsView *acview)
gtk_scrolled_window_add_with_viewport ((GtkScrolledWindow *) acview->priv->scroll, acview->priv->box);
acview->priv->accounts = e_get_account_list ();
- g_signal_connect (acview->priv->accounts, "account-added", G_CALLBACK(msv_account_added), acview);
+ g_signal_connect (
+ acview->priv->accounts, "account-added",
+ G_CALLBACK (msv_account_added), acview);
msv_regen_view (acview);
gtk_widget_show ((GtkWidget *) acview);
@@ -254,7 +260,9 @@ mail_settings_view_get_tab_widget (MailSettingsView *mcv)
gtk_button_set_relief ((GtkButton *) tool, GTK_RELIEF_NONE);
gtk_button_set_focus_on_click ((GtkButton *) tool, FALSE);
gtk_widget_set_tooltip_text (tool, _("Close Tab"));
- g_signal_connect (tool, "clicked", G_CALLBACK(msv_close), mcv);
+ g_signal_connect (
+ tool, "clicked",
+ G_CALLBACK (msv_close), mcv);
box = gtk_hbox_new (FALSE, 0);
gtk_box_pack_start ((GtkBox *) box, img, FALSE, FALSE, 0);
diff --git a/capplet/settings/mail-view.c b/capplet/settings/mail-view.c
index 4477be517a..db4002b87b 100644
--- a/capplet/settings/mail-view.c
+++ b/capplet/settings/mail-view.c
@@ -42,8 +42,11 @@
#include "mail/em-folder-tree.h"
#include <shell/e-shell-searchbar.h>
-struct _MailViewPrivate {
+#define MAIL_VIEW_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), MAIL_VIEW_TYPE, MailViewPrivate))
+struct _MailViewPrivate {
GtkWidget *box;
GList *children;
MailViewChild *current_view;
@@ -74,22 +77,17 @@ void anjal_shell_view_restore_state (EShellView *view, const gchar *uri);
static void
mail_view_init (MailView *shell)
{
- shell->priv = g_new0 (MailViewPrivate, 1);
- shell->priv->children = NULL;
- shell->priv->current_view = NULL;
- shell->folder_tree = NULL;
- shell->check_mail = NULL;
- shell->sort_by = NULL;
+ shell->priv = MAIL_VIEW_GET_PRIVATE (shell);
}
static void
mail_view_finalize (GObject *object)
{
- MailView *shell = (MailView *) object;
- MailViewPrivate *priv = shell->priv;
+ MailViewPrivate *priv;
+
+ priv = MAIL_VIEW_GET_PRIVATE (object);
g_list_free (priv->children);
- g_free (priv);
G_OBJECT_CLASS (mail_view_parent_class)->finalize (object);
}
@@ -103,7 +101,9 @@ mv_set_folder_uri (AnjalMailView *mv,
#endif
}
-static void set_folder_tree (AnjalMailView *mv, EMFolderTree *tree)
+static void
+set_folder_tree (AnjalMailView *mv,
+ EMFolderTree *tree)
{
mail_view_set_folder_tree ((MailView *) mv, (GtkWidget *) tree);
}
@@ -118,9 +118,15 @@ set_search (AnjalMailView *mv,
}
static void
-mail_view_class_init (MailViewClass *klass)
+mail_view_class_init (MailViewClass *class)
{
- GObjectClass * object_class = G_OBJECT_CLASS (klass);
+ GObjectClass *object_class;
+
+ g_type_class_add_private (class, sizeof (MailViewPrivate));
+
+ object_class = G_OBJECT_CLASS (class);
+ object_class->finalize = mail_view_finalize;
+
signals[VIEW_NEW] =
g_signal_new ("view-new",
G_OBJECT_CLASS_TYPE (object_class),
@@ -130,12 +136,9 @@ mail_view_class_init (MailViewClass *klass)
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
- mail_view_parent_class = g_type_class_peek_parent (klass);
- ((AnjalMailViewClass *) klass)->set_folder_uri = mv_set_folder_uri;
- ((AnjalMailViewClass *) klass)->set_folder_tree = set_folder_tree;
- ((AnjalMailViewClass *) klass)->set_search = set_search;
-
- object_class->finalize = mail_view_finalize;
+ ((AnjalMailViewClass *) class)->set_folder_uri = mv_set_folder_uri;
+ ((AnjalMailViewClass *) class)->set_folder_tree = set_folder_tree;
+ ((AnjalMailViewClass *) class)->set_search = set_search;
};
@@ -184,7 +187,10 @@ mail_view_construct (MailView *shell)
gtk_notebook_set_show_tabs ((GtkNotebook *) shell, TRUE);
gtk_notebook_set_scrollable ((GtkNotebook *) shell, TRUE);
gtk_notebook_popup_disable ((GtkNotebook *) shell);
- g_signal_connect_after (shell, "switch-page", G_CALLBACK(mv_switch), shell);
+
+ g_signal_connect_after (
+ shell, "switch-page",
+ G_CALLBACK (mv_switch), shell);
}
MailView *
@@ -330,13 +336,26 @@ mail_view_add_folder (MailView *mv,
gtk_notebook_set_tab_reorderable (GTK_NOTEBOOK (mv), (GtkWidget *) mfv, TRUE);
gtk_notebook_set_tab_detachable (GTK_NOTEBOOK (mv), (GtkWidget *) mfv, FALSE);
- g_signal_connect (mfv, "view-close", G_CALLBACK(mv_close_mcv), mv);
+ g_signal_connect (
+ mfv, "view-close",
+ G_CALLBACK (mv_close_mcv), mv);
+
if (!block)
gtk_notebook_set_current_page ((GtkNotebook *) mv, position);
- g_signal_connect (mfv, "message-shown", G_CALLBACK(mv_message_shown), mv);
- g_signal_connect (mfv, "message-new", G_CALLBACK(mv_message_new), mv);
- g_signal_connect (mfv, "search-set", G_CALLBACK(mv_search_set), mv);
- g_signal_connect (mfv, "view-loaded", G_CALLBACK (mv_folder_loaded), mv);
+
+ g_signal_connect (
+ mfv, "message-shown",
+ G_CALLBACK (mv_message_shown), mv);
+ g_signal_connect (
+ mfv, "message-new",
+ G_CALLBACK (mv_message_new), mv);
+ g_signal_connect (
+ mfv, "search-set",
+ G_CALLBACK (mv_search_set), mv);
+ g_signal_connect (
+ mfv, "view-loaded",
+ G_CALLBACK (mv_folder_loaded), mv);
+
if (!block)
mail_folder_view_activate (mfv, mv->tree, mv->folder_tree, mv->check_mail, mv->sort_by, mv->slider, TRUE);
@@ -377,8 +396,12 @@ mail_view_add_composer (MailView *mv,
if (!block)
mail_composer_view_activate (mcv, mv->folder_tree, mv->check_mail, mv->sort_by, FALSE);
- g_signal_connect (mcv, "view-close", G_CALLBACK(mv_close_mcv), mv);
- g_signal_connect (mcv, "message-shown", G_CALLBACK(mv_message_shown), mv);
+ g_signal_connect (
+ mcv, "view-close",
+ G_CALLBACK (mv_close_mcv), mv);
+ g_signal_connect (
+ mcv, "message-shown",
+ G_CALLBACK (mv_message_shown), mv);
return (MailViewChild *) mcv;
}
@@ -406,8 +429,12 @@ mail_view_add_message (MailView *mv,
if (!block)
mail_conv_view_activate (mcv, mv->tree, mv->folder_tree, mv->check_mail, mv->sort_by, FALSE);
- g_signal_connect (mcv, "view-close", G_CALLBACK(mv_close_mcv), mv);
- g_signal_connect (mcv, "message-shown", G_CALLBACK(mv_message_shown), mv);
+ g_signal_connect (
+ mcv, "view-close",
+ G_CALLBACK (mv_close_mcv), mv);
+ g_signal_connect (
+ mcv, "message-shown",
+ G_CALLBACK (mv_message_shown), mv);
return (MailViewChild *) mcv;
}
@@ -436,8 +463,12 @@ mail_view_add_settings (MailView *mv,
mv->priv->children = block ? g_list_append (mv->priv->children, msv) : g_list_prepend (mv->priv->children, msv);
position = gtk_notebook_append_page ((GtkNotebook *) mv, (GtkWidget *) msv, mail_settings_view_get_tab_widget (msv));
- g_signal_connect (msv, "view-close", G_CALLBACK(mv_close_mcv), mv);
- g_signal_connect (msv, "show-account", G_CALLBACK(mv_show_acc_mcv), mv);
+ g_signal_connect (
+ msv, "view-close",
+ G_CALLBACK (mv_close_mcv), mv);
+ g_signal_connect (
+ msv, "show-account",
+ G_CALLBACK (mv_show_acc_mcv), mv);
gtk_notebook_set_tab_reorderable (GTK_NOTEBOOK (mv), (GtkWidget *) msv, TRUE);
gtk_notebook_set_tab_detachable (GTK_NOTEBOOK (mv), (GtkWidget *) msv, FALSE);
if (!block)
@@ -462,7 +493,9 @@ mail_view_add_account (MailView *mv,
mv->priv->current_view = (MailViewChild *) msv;
mv->priv->children = block ? g_list_append (mv->priv->children, msv) : g_list_prepend (mv->priv->children, msv);
position = gtk_notebook_append_page ((GtkNotebook *) mv, (GtkWidget *) msv, mail_account_view_get_tab_widget (msv));
- g_signal_connect_after (msv, "view-close", G_CALLBACK(mv_close_mcv), mv);
+ g_signal_connect_after (
+ msv, "view-close",
+ G_CALLBACK (mv_close_mcv), mv);
gtk_notebook_set_tab_reorderable (GTK_NOTEBOOK (mv), (GtkWidget *) msv, TRUE);
gtk_notebook_set_tab_detachable (GTK_NOTEBOOK (mv), (GtkWidget *) msv, FALSE);
if (!block)
diff --git a/composer/e-composer-header-table.c b/composer/e-composer-header-table.c
index 2479eebab7..f2a9356a90 100644
--- a/composer/e-composer-header-table.c
+++ b/composer/e-composer-header-table.c
@@ -34,6 +34,10 @@
#include "e-composer-post-header.h"
#include "e-composer-text-header.h"
+#define E_COMPOSER_HEADER_TABLE_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_COMPOSER_HEADER_TABLE, EComposerHeaderTablePrivate))
+
#define HEADER_TOOLTIP_TO \
_("Enter the recipients of the message")
#define HEADER_TOOLTIP_CC \
diff --git a/composer/e-composer-header.c b/composer/e-composer-header.c
index ebfe564dcb..c92b069113 100644
--- a/composer/e-composer-header.c
+++ b/composer/e-composer-header.c
@@ -47,6 +47,10 @@ struct _EComposerHeaderPrivate {
guint visible : 1;
};
+#define E_COMPOSER_HEADER_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_COMPOSER_HEADER, EComposerHeaderPrivate))
+
enum {
PROP_0,
PROP_BUTTON,
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c
index 6a48950912..9f32d8cabe 100644
--- a/composer/e-msg-composer.c
+++ b/composer/e-msg-composer.c
@@ -1394,7 +1394,7 @@ is_top_signature (EMsgComposer *composer)
{
EShell *shell;
EShellSettings *shell_settings;
- EMsgComposerPrivate *priv = composer->priv;
+ EMsgComposerPrivate *priv = E_MSG_COMPOSER_GET_PRIVATE (composer);
g_return_val_if_fail (priv != NULL, FALSE);
@@ -2540,12 +2540,9 @@ e_msg_composer_alert_sink_init (EAlertSinkInterface *interface)
static void
e_msg_composer_init (EMsgComposer *composer)
{
- composer->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- composer, E_TYPE_MSG_COMPOSER, EMsgComposerPrivate);
+ composer->priv = E_MSG_COMPOSER_GET_PRIVATE (composer);
}
-/* Callbacks. */
-
/**
* e_msg_composer_new:
* @shell: an #EShell
@@ -3082,7 +3079,7 @@ e_msg_composer_new_with_message (EShell *shell,
}
composer = e_msg_composer_new (shell);
- priv = composer->priv;
+ priv = E_MSG_COMPOSER_GET_PRIVATE (composer);
table = e_msg_composer_get_header_table (composer);
if (postto) {
diff --git a/e-util/e-alert-dialog.c b/e-util/e-alert-dialog.c
index 2f27a4fbcd..5f426aacd0 100644
--- a/e-util/e-alert-dialog.c
+++ b/e-util/e-alert-dialog.c
@@ -31,6 +31,10 @@
#include "e-util.h"
+#define E_ALERT_DIALOG_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_ALERT_DIALOG, EAlertDialogPrivate))
+
struct _EAlertDialogPrivate {
GtkWidget *content_area; /* not referenced */
EAlert *alert;
@@ -95,7 +99,7 @@ alert_dialog_dispose (GObject *object)
{
EAlertDialogPrivate *priv;
- priv = E_ALERT_DIALOG (object)->priv;
+ priv = E_ALERT_DIALOG_GET_PRIVATE (object);
if (priv->alert) {
g_signal_handlers_disconnect_matched (
@@ -292,8 +296,7 @@ e_alert_dialog_class_init (EAlertDialogClass *class)
static void
e_alert_dialog_init (EAlertDialog *dialog)
{
- dialog->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- dialog, E_TYPE_ALERT_DIALOG, EAlertDialogPrivate);
+ dialog->priv = E_ALERT_DIALOG_GET_PRIVATE (dialog);
}
GtkWidget *
diff --git a/e-util/e-alert.c b/e-util/e-alert.c
index d4a7a9ea13..9ee7e05581 100644
--- a/e-util/e-alert.c
+++ b/e-util/e-alert.c
@@ -44,6 +44,10 @@
#define d(x)
+#define E_ALERT_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_ALERT, EAlertPrivate))
+
typedef struct _EAlertButton EAlertButton;
struct _e_alert {
@@ -196,19 +200,23 @@ e_alert_load (const gchar *path)
table->alerts = g_hash_table_new (g_str_hash, g_str_equal);
g_hash_table_insert (alert_table, (gpointer) table->domain, table);
- tmp2 = (gchar *)xmlGetProp(root, (const guchar *)"translation-domain");
+ tmp2 = (gchar *) xmlGetProp (
+ root, (const guchar *) "translation-domain");
if (tmp2) {
table->translation_domain = g_strdup (tmp2);
xmlFree (tmp2);
- tmp2 = (gchar *)xmlGetProp(root, (const guchar *)"translation-localedir");
+ tmp2 = (gchar *) xmlGetProp (
+ root, (const guchar *) "translation-localedir");
if (tmp2) {
bindtextdomain (table->translation_domain, tmp2);
xmlFree (tmp2);
}
}
} else
- g_warning("Error file '%s', domain '%s' already used, merging", path, tmp);
+ g_warning (
+ "Error file '%s', domain '%s' "
+ "already used, merging", path, tmp);
xmlFree (tmp);
for (error = root->children; error; error = error->next) {
@@ -537,7 +545,7 @@ alert_finalize (GObject *object)
{
EAlertPrivate *priv;
- priv = E_ALERT (object)->priv;
+ priv = E_ALERT_GET_PRIVATE (object);
g_free (priv->tag);
g_free (priv->primary_text);
@@ -683,8 +691,7 @@ e_alert_class_init (EAlertClass *class)
static void
e_alert_init (EAlert *alert)
{
- alert->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- alert, E_TYPE_ALERT, EAlertPrivate);
+ alert->priv = E_ALERT_GET_PRIVATE (alert);
g_queue_init (&alert->priv->actions);
}
diff --git a/e-util/e-bit-array.c b/e-util/e-bit-array.c
index 62156e9063..456a4d495d 100644
--- a/e-util/e-bit-array.c
+++ b/e-util/e-bit-array.c
@@ -401,11 +401,11 @@ e_bit_array_init (EBitArray *eba)
}
static void
-e_bit_array_class_init (EBitArrayClass *klass)
+e_bit_array_class_init (EBitArrayClass *class)
{
GObjectClass *object_class;
- object_class = G_OBJECT_CLASS (klass);
+ object_class = G_OBJECT_CLASS (class);
object_class->dispose = eba_dispose;
}
diff --git a/e-util/e-config.c b/e-util/e-config.c
index 7257f5a024..c4a6b7c419 100644
--- a/e-util/e-config.c
+++ b/e-util/e-config.c
@@ -34,6 +34,10 @@
#include <glib/gi18n.h>
+#define E_CONFIG_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_CONFIG, EConfigPrivate))
+
#define d(x)
typedef GtkWidget *
@@ -226,8 +230,7 @@ e_config_class_init (EConfigClass *class)
static void
e_config_init (EConfig *config)
{
- config->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- config, E_TYPE_CONFIG, EConfigPrivate);
+ config->priv = E_CONFIG_GET_PRIVATE (config);
}
/**
@@ -1167,7 +1170,9 @@ e_config_create_widget (EConfig *emp)
ec_rebuild (emp);
/* auto-unref it */
- g_signal_connect (emp->widget, "destroy", G_CALLBACK(ec_widget_destroy), emp);
+ g_signal_connect (
+ emp->widget, "destroy",
+ G_CALLBACK (ec_widget_destroy), emp);
/* FIXME: for some reason ec_rebuild puts the widget on page 1, this is just to override that */
if (emp->type == E_CONFIG_BOOK)
diff --git a/e-util/e-datetime-format.c b/e-util/e-datetime-format.c
index a1fb490fdd..1aa7afc78a 100644
--- a/e-util/e-datetime-format.c
+++ b/e-util/e-datetime-format.c
@@ -613,7 +613,9 @@ e_datetime_format_add_setup_widget (GtkWidget *table,
g_object_set_data (G_OBJECT (combo), "format-kind", GINT_TO_POINTER (kind));
g_object_set_data_full (G_OBJECT (combo), "format-key", key, g_free);
g_object_set_data_full (G_OBJECT (combo), "setup-key-file", setup_keyfile, unref_setup_keyfile);
- g_signal_connect (combo, "changed", G_CALLBACK (format_combo_changed_cb), NULL);
+ g_signal_connect (
+ combo, "changed",
+ G_CALLBACK (format_combo_changed_cb), NULL);
update_preview_widget (combo);
diff --git a/e-util/e-dialog-widgets.c b/e-util/e-dialog-widgets.c
index 2793141da0..78b21a4146 100644
--- a/e-util/e-dialog-widgets.c
+++ b/e-util/e-dialog-widgets.c
@@ -133,4 +133,3 @@ e_dialog_combo_box_get (GtkWidget *widget,
return i;
}
-
diff --git a/e-util/e-event.c b/e-util/e-event.c
index ca978820e9..409c23c9a9 100644
--- a/e-util/e-event.c
+++ b/e-util/e-event.c
@@ -33,6 +33,10 @@
#include <glib/gi18n.h>
+#define E_EVENT_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_EVENT, EEventPrivate))
+
#define d(x)
struct _event_node {
@@ -109,8 +113,7 @@ e_event_class_init (EEventClass *class)
static void
e_event_init (EEvent *event)
{
- event->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- event, E_TYPE_EVENT, EEventPrivate);
+ event->priv = E_EVENT_GET_PRIVATE (event);
g_queue_init (&event->priv->events);
}
diff --git a/e-util/e-plugin-ui.c b/e-util/e-plugin-ui.c
index 3ac9eb92db..1e66716183 100644
--- a/e-util/e-plugin-ui.c
+++ b/e-util/e-plugin-ui.c
@@ -26,6 +26,10 @@
#include <string.h>
+#define E_PLUGIN_UI_HOOK_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_PLUGIN_UI_HOOK, EPluginUIHookPrivate))
+
#define E_PLUGIN_UI_DEFAULT_FUNC "e_plugin_ui_init"
#define E_PLUGIN_UI_HOOK_CLASS_ID "org.gnome.evolution.ui:1.0"
@@ -399,7 +403,7 @@ plugin_ui_hook_finalize (GObject *object)
GHashTableIter iter;
gpointer ui_manager;
- priv = E_PLUGIN_UI_HOOK (object)->priv;
+ priv = E_PLUGIN_UI_HOOK_GET_PRIVATE (object);
/* Remove weak reference callbacks to GtkUIManagers. */
g_hash_table_iter_init (&iter, priv->registry);
@@ -423,7 +427,7 @@ plugin_ui_hook_construct (EPluginHook *hook,
{
EPluginUIHookPrivate *priv;
- priv = E_PLUGIN_UI_HOOK (hook)->priv;
+ priv = E_PLUGIN_UI_HOOK_GET_PRIVATE (hook);
/* XXX The EPlugin should be a property of EPluginHookClass.
* Then it could be passed directly to g_object_new() and
@@ -525,8 +529,7 @@ e_plugin_ui_hook_init (EPluginUIHook *hook)
registry = g_hash_table_new_full (g_direct_hash, g_direct_equal,
NULL, (GDestroyNotify) g_hash_table_destroy);
- hook->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- hook, E_TYPE_PLUGIN_UI_HOOK, EPluginUIHookPrivate);
+ hook->priv = E_PLUGIN_UI_HOOK_GET_PRIVATE (hook);
hook->priv->ui_definitions = ui_definitions;
hook->priv->callbacks = callbacks;
hook->priv->registry = registry;
diff --git a/e-util/e-sorter-array.c b/e-util/e-sorter-array.c
index 106a2d66ca..4caa092704 100644
--- a/e-util/e-sorter-array.c
+++ b/e-util/e-sorter-array.c
@@ -283,10 +283,10 @@ e_sorter_array_new (ECreateCmpCacheFunc create_cmp_cache,
}
static void
-e_sorter_array_class_init (ESorterArrayClass *klass)
+e_sorter_array_class_init (ESorterArrayClass *class)
{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
- ESorterClass *sorter_class = E_SORTER_CLASS (klass);
+ GObjectClass *object_class = G_OBJECT_CLASS (class);
+ ESorterClass *sorter_class = E_SORTER_CLASS (class);
object_class->finalize = esa_finalize;
diff --git a/e-util/e-sorter.c b/e-util/e-sorter.c
index de10916634..b55d985daa 100644
--- a/e-util/e-sorter.c
+++ b/e-util/e-sorter.c
@@ -46,13 +46,13 @@ static void es_get_sorted_to_model_array (ESorter *es, gint **array, gint *count
static gboolean es_needs_sorting (ESorter *es);
static void
-e_sorter_class_init (ESorterClass *klass)
+e_sorter_class_init (ESorterClass *class)
{
- klass->model_to_sorted = es_model_to_sorted;
- klass->sorted_to_model = es_sorted_to_model;
- klass->get_model_to_sorted_array = es_get_model_to_sorted_array;
- klass->get_sorted_to_model_array = es_get_sorted_to_model_array;
- klass->needs_sorting = es_needs_sorting;
+ class->model_to_sorted = es_model_to_sorted;
+ class->sorted_to_model = es_sorted_to_model;
+ class->get_model_to_sorted_array = es_get_model_to_sorted_array;
+ class->get_sorted_to_model_array = es_get_sorted_to_model_array;
+ class->needs_sorting = es_needs_sorting;
}
static void
diff --git a/e-util/e-text-event-processor-emacs-like.c b/e-util/e-text-event-processor-emacs-like.c
index d5267d5b30..fa724a2c77 100644
--- a/e-util/e-text-event-processor-emacs-like.c
+++ b/e-util/e-text-event-processor-emacs-like.c
@@ -32,21 +32,15 @@
#include "e-util.h"
static gint e_text_event_processor_emacs_like_event
- (ETextEventProcessor *tep,
- ETextEventProcessorEvent *event);
+ (ETextEventProcessor *tep,
+ ETextEventProcessorEvent *event);
G_DEFINE_TYPE (
ETextEventProcessorEmacsLike,
e_text_event_processor_emacs_like,
E_TEXT_EVENT_PROCESSOR_TYPE)
-/* The arguments we take */
-enum {
- ARG_0
-};
-
-static const ETextEventProcessorCommand control_keys[26] =
-{
+static const ETextEventProcessorCommand control_keys[26] = {
{ E_TEP_START_OF_LINE, E_TEP_MOVE, 0, "" }, /* a */
{ E_TEP_BACKWARD_CHARACTER, E_TEP_MOVE, 0, "" }, /* b */
{ E_TEP_SELECTION, E_TEP_COPY, 0, "" }, /* c */
@@ -75,8 +69,7 @@ static const ETextEventProcessorCommand control_keys[26] =
{ E_TEP_SELECTION, E_TEP_NOP, 0, "" } /* z */
};
-static const ETextEventProcessorCommand alt_keys[26] =
-{
+static const ETextEventProcessorCommand alt_keys[26] = {
{ E_TEP_SELECTION, E_TEP_NOP, 0, "" }, /* a */
{ E_TEP_BACKWARD_WORD, E_TEP_MOVE, 0, "" }, /* b */
{ E_TEP_SELECTION, E_TEP_CAPS, E_TEP_CAPS_TITLE, "" },/* c */
@@ -107,11 +100,11 @@ static const ETextEventProcessorCommand alt_keys[26] =
};
static void
-e_text_event_processor_emacs_like_class_init (ETextEventProcessorEmacsLikeClass *klass)
+e_text_event_processor_emacs_like_class_init (ETextEventProcessorEmacsLikeClass *class)
{
ETextEventProcessorClass *processor_class;
- processor_class = (ETextEventProcessorClass *) klass;
+ processor_class = (ETextEventProcessorClass *) class;
processor_class->event = e_text_event_processor_emacs_like_event;
}
@@ -128,12 +121,13 @@ e_text_event_processor_emacs_like_event (ETextEventProcessor *tep,
ETextEventProcessorCommand command;
ETextEventProcessorEmacsLike *tep_el = E_TEXT_EVENT_PROCESSOR_EMACS_LIKE (tep);
command.action = E_TEP_NOP;
+
/* Warning from the Intel compiler here:
* e-text-event-processor-emacs-like.c(136): warning #589:
* transfer of control bypasses initialization of:
- * * variable "key" (declared at line 194)
- * * switch (event->type) {
- * * ^
+ * variable "key" (declared at line 194)
+ * switch (event->type) {
+ * ^
*/
switch (event->type) {
case GDK_BUTTON_PRESS:
@@ -151,6 +145,7 @@ e_text_event_processor_emacs_like_event (ETextEventProcessor *tep,
tep_el->mouse_down = event->button.button == 1;
}
break;
+
case GDK_2BUTTON_PRESS:
if (event->button.button == 1) {
command.action = E_TEP_SELECT;
@@ -158,6 +153,7 @@ e_text_event_processor_emacs_like_event (ETextEventProcessor *tep,
command.time = event->button.time;
}
break;
+
case GDK_3BUTTON_PRESS:
if (event->button.button == 1) {
command.action = E_TEP_SELECT;
@@ -165,6 +161,7 @@ e_text_event_processor_emacs_like_event (ETextEventProcessor *tep,
command.time = event->button.time;
}
break;
+
case GDK_BUTTON_RELEASE:
if (event->button.button == 1) {
command.action = E_TEP_UNGRAB;
@@ -183,6 +180,7 @@ e_text_event_processor_emacs_like_event (ETextEventProcessor *tep,
command.time = event->button.time;
}
break;
+
case GDK_MOTION_NOTIFY:
if (tep_el->mouse_down) {
command.action = E_TEP_SELECT;
@@ -191,16 +189,20 @@ e_text_event_processor_emacs_like_event (ETextEventProcessor *tep,
command.value = event->motion.position;
}
break;
+
case GDK_KEY_PRESS:
{
ETextEventProcessorEventKey key = event->key;
+
command.time = event->key.time;
+
if (key.state & GDK_SHIFT_MASK)
command.action = E_TEP_SELECT;
else if (key.state & GDK_MOD1_MASK)
command.action = E_TEP_NOP;
else
command.action = E_TEP_MOVE;
+
switch (key.keyval) {
case GDK_KEY_Home:
case GDK_KEY_KP_Home:
@@ -209,6 +211,7 @@ e_text_event_processor_emacs_like_event (ETextEventProcessor *tep,
else
command.position = E_TEP_START_OF_LINE;
break;
+
case GDK_KEY_End:
case GDK_KEY_KP_End:
if (key.state & GDK_CONTROL_MASK)
@@ -216,17 +219,27 @@ e_text_event_processor_emacs_like_event (ETextEventProcessor *tep,
else
command.position = E_TEP_END_OF_LINE;
break;
+
case GDK_KEY_Page_Up:
- case GDK_KEY_KP_Page_Up: command.position = E_TEP_BACKWARD_PAGE; break;
+ case GDK_KEY_KP_Page_Up:
+ command.position = E_TEP_BACKWARD_PAGE;
+ break;
case GDK_KEY_Page_Down:
- case GDK_KEY_KP_Page_Down: command.position = E_TEP_FORWARD_PAGE; break;
- /* CUA has Ctrl-Up/Ctrl-Down as paragraph up down */
+ case GDK_KEY_KP_Page_Down:
+ command.position = E_TEP_FORWARD_PAGE;
+ break;
+
+ /* CUA has Ctrl-Up/Ctrl-Down as paragraph up down */
case GDK_KEY_Up:
- case GDK_KEY_KP_Up: command.position = E_TEP_BACKWARD_LINE; break;
+ case GDK_KEY_KP_Up:
+ command.position = E_TEP_BACKWARD_LINE;
+ break;
case GDK_KEY_Down:
- case GDK_KEY_KP_Down: command.position = E_TEP_FORWARD_LINE; break;
+ case GDK_KEY_KP_Down:
+ command.position = E_TEP_FORWARD_LINE;
+ break;
case GDK_KEY_Left:
case GDK_KEY_KP_Left:
@@ -235,6 +248,7 @@ e_text_event_processor_emacs_like_event (ETextEventProcessor *tep,
else
command.position = E_TEP_BACKWARD_CHARACTER;
break;
+
case GDK_KEY_Right:
case GDK_KEY_KP_Right:
if (key.state & GDK_CONTROL_MASK)
@@ -250,10 +264,12 @@ e_text_event_processor_emacs_like_event (ETextEventProcessor *tep,
else
command.position = E_TEP_BACKWARD_CHARACTER;
break;
+
case GDK_KEY_Clear:
command.action = E_TEP_DELETE;
command.position = E_TEP_END_OF_LINE;
break;
+
case GDK_KEY_Insert:
case GDK_KEY_KP_Insert:
if (key.state & GDK_SHIFT_MASK) {
@@ -266,22 +282,27 @@ e_text_event_processor_emacs_like_event (ETextEventProcessor *tep,
/* gtk_toggle_insert(text) -- IMPLEMENT -- FIXME */
}
break;
+
case GDK_KEY_F16:
command.action = E_TEP_COPY;
command.position = E_TEP_SELECTION;
break;
+
case GDK_KEY_F18:
command.action = E_TEP_PASTE;
command.position = E_TEP_SELECTION;
break;
+
case GDK_KEY_F20:
command.action = E_TEP_COPY;
command.position = E_TEP_SELECTION;
- g_signal_emit_by_name (tep, "command", &command);
+ g_signal_emit_by_name (
+ tep, "command", &command);
command.action = E_TEP_DELETE;
command.position = E_TEP_SELECTION;
break;
+
case GDK_KEY_Delete:
case GDK_KEY_KP_Delete:
if (key.state & GDK_CONTROL_MASK) {
@@ -290,7 +311,8 @@ e_text_event_processor_emacs_like_event (ETextEventProcessor *tep,
} else if (key.state & GDK_SHIFT_MASK) {
command.action = E_TEP_COPY;
command.position = E_TEP_SELECTION;
- g_signal_emit_by_name (tep, "command", &command);
+ g_signal_emit_by_name (
+ tep, "command", &command);
command.action = E_TEP_DELETE;
command.position = E_TEP_SELECTION;
@@ -299,6 +321,7 @@ e_text_event_processor_emacs_like_event (ETextEventProcessor *tep,
command.position = E_TEP_FORWARD_CHARACTER;
}
break;
+
case GDK_KEY_Tab:
case GDK_KEY_KP_Tab:
case GDK_KEY_ISO_Left_Tab:
@@ -307,6 +330,7 @@ e_text_event_processor_emacs_like_event (ETextEventProcessor *tep,
command.action = E_TEP_NOP;
command.position = E_TEP_SELECTION;
break;
+
case GDK_KEY_Return:
case GDK_KEY_KP_Enter:
if (tep->allow_newlines) {
@@ -329,6 +353,7 @@ e_text_event_processor_emacs_like_event (ETextEventProcessor *tep,
}
}
break;
+
case GDK_KEY_Escape:
/* Don't insert literally */
command.action = E_TEP_NOP;
@@ -341,96 +366,112 @@ e_text_event_processor_emacs_like_event (ETextEventProcessor *tep,
command.value = 1;
command.string = " ";
break;
+
case GDK_KEY_KP_Equal:
command.action = E_TEP_INSERT;
command.position = E_TEP_SELECTION;
command.value = 1;
command.string = "=";
break;
+
case GDK_KEY_KP_Multiply:
command.action = E_TEP_INSERT;
command.position = E_TEP_SELECTION;
command.value = 1;
command.string = "*";
break;
+
case GDK_KEY_KP_Add:
command.action = E_TEP_INSERT;
command.position = E_TEP_SELECTION;
command.value = 1;
command.string = "+";
break;
+
case GDK_KEY_KP_Subtract:
command.action = E_TEP_INSERT;
command.position = E_TEP_SELECTION;
command.value = 1;
command.string = "-";
break;
+
case GDK_KEY_KP_Decimal:
command.action = E_TEP_INSERT;
command.position = E_TEP_SELECTION;
command.value = 1;
command.string = ".";
break;
+
case GDK_KEY_KP_Divide:
command.action = E_TEP_INSERT;
command.position = E_TEP_SELECTION;
command.value = 1;
command.string = "/";
break;
+
case GDK_KEY_KP_0:
command.action = E_TEP_INSERT;
command.position = E_TEP_SELECTION;
command.value = 1;
command.string = "0";
break;
+
case GDK_KEY_KP_1:
command.action = E_TEP_INSERT;
command.position = E_TEP_SELECTION;
command.value = 1;
command.string = "1";
break;
+
case GDK_KEY_KP_2:
command.action = E_TEP_INSERT;
command.position = E_TEP_SELECTION;
command.value = 1;
command.string = "2";
break;
+
case GDK_KEY_KP_3:
command.action = E_TEP_INSERT;
command.position = E_TEP_SELECTION;
command.value = 1;
command.string = "3";
break;
+
case GDK_KEY_KP_4:
command.action = E_TEP_INSERT;
command.position = E_TEP_SELECTION;
command.value = 1;
command.string = "4";
break;
+
case GDK_KEY_KP_5:
command.action = E_TEP_INSERT;
command.position = E_TEP_SELECTION;
command.value = 1;
command.string = "5";
break;
+
case GDK_KEY_KP_6:
command.action = E_TEP_INSERT;
command.position = E_TEP_SELECTION;
command.value = 1;
command.string = "6";
break;
+
case GDK_KEY_KP_7:
command.action = E_TEP_INSERT;
command.position = E_TEP_SELECTION;
command.value = 1;
command.string = "7";
break;
+
case GDK_KEY_KP_8:
command.action = E_TEP_INSERT;
command.position = E_TEP_SELECTION;
command.value = 1;
command.string = "8";
break;
+
case GDK_KEY_KP_9:
command.action = E_TEP_INSERT;
command.position = E_TEP_SELECTION;
@@ -439,7 +480,8 @@ e_text_event_processor_emacs_like_event (ETextEventProcessor *tep,
break;
default:
- if ((key.state & GDK_CONTROL_MASK) && !(key.state & GDK_MOD1_MASK)) {
+ if ((key.state & GDK_CONTROL_MASK) &&
+ !(key.state & GDK_MOD1_MASK)) {
if ((key.keyval >= 'A') && (key.keyval <= 'Z'))
key.keyval -= 'A' - 'a';
@@ -465,6 +507,7 @@ e_text_event_processor_emacs_like_event (ETextEventProcessor *tep,
}
break;
+
} else if ((key.state & GDK_MOD1_MASK) &&
!(key.state & GDK_CONTROL_MASK)) {
if ((key.keyval >= 'A') && (key.keyval <= 'Z'))
@@ -480,7 +523,8 @@ e_text_event_processor_emacs_like_event (ETextEventProcessor *tep,
} else if (!(key.state & GDK_MOD1_MASK) &&
!(key.state & GDK_CONTROL_MASK) &&
key.length > 0) {
- if (key.keyval >= GDK_KEY_KP_0 && key.keyval <= GDK_KEY_KP_9) {
+ if (key.keyval >= GDK_KEY_KP_0 &&
+ key.keyval <= GDK_KEY_KP_9) {
key.keyval = '0';
key.string = "0";
}
@@ -494,20 +538,22 @@ e_text_event_processor_emacs_like_event (ETextEventProcessor *tep,
}
}
break;
+
case GDK_KEY_RELEASE:
command.time = event->key.time;
command.action = E_TEP_NOP;
break;
+
default:
command.action = E_TEP_NOP;
break;
}
}
+
if (command.action != E_TEP_NOP) {
g_signal_emit_by_name (tep, "command", &command);
return 1;
- }
- else
+ } else
return 0;
}
diff --git a/e-util/e-text-event-processor.c b/e-util/e-text-event-processor.c
index e8594620c2..049a0142df 100644
--- a/e-util/e-text-event-processor.c
+++ b/e-util/e-text-event-processor.c
@@ -57,11 +57,11 @@ G_DEFINE_TYPE (
G_TYPE_OBJECT)
static void
-e_text_event_processor_class_init (ETextEventProcessorClass *klass)
+e_text_event_processor_class_init (ETextEventProcessorClass *class)
{
GObjectClass *object_class;
- object_class = (GObjectClass *) klass;
+ object_class = (GObjectClass *) class;
object_class->set_property = e_text_event_processor_set_property;
object_class->get_property = e_text_event_processor_get_property;
@@ -83,8 +83,8 @@ e_text_event_processor_class_init (ETextEventProcessorClass *klass)
FALSE,
G_PARAM_READWRITE));
- klass->event = NULL;
- klass->command = NULL;
+ class->event = NULL;
+ class->command = NULL;
}
diff --git a/e-util/e-ui-manager.c b/e-util/e-ui-manager.c
index 35e14a3ae6..98fab98ce5 100644
--- a/e-util/e-ui-manager.c
+++ b/e-util/e-ui-manager.c
@@ -34,6 +34,10 @@
#include <string.h>
+#define E_UI_MANAGER_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_UI_MANAGER, EUIManagerPrivate))
+
/*
* --- NOTE TO SELF ---
*
@@ -163,8 +167,7 @@ e_ui_manager_class_init (EUIManagerClass *class)
static void
e_ui_manager_init (EUIManager *ui_manager)
{
- ui_manager->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- ui_manager, E_TYPE_UI_MANAGER, EUIManagerPrivate);
+ ui_manager->priv = E_UI_MANAGER_GET_PRIVATE (ui_manager);
}
/**
diff --git a/e-util/e-util.c b/e-util/e-util.c
index 80a61f73dc..839e2df496 100644
--- a/e-util/e-util.c
+++ b/e-util/e-util.c
@@ -662,10 +662,9 @@ e_action_group_add_actions_localized (GtkActionGroup *action_group,
guint n_entries,
gpointer user_data)
{
- gint ii;
- GtkAction *action;
- GList *actions, *iter;
GtkActionGroup *tmp_group;
+ GList *list, *iter;
+ gint ii;
g_return_if_fail (action_group != NULL);
g_return_if_fail (entries != NULL);
@@ -677,19 +676,22 @@ e_action_group_add_actions_localized (GtkActionGroup *action_group,
gtk_action_group_set_translation_domain (tmp_group, translation_domain);
gtk_action_group_add_actions (tmp_group, entries, n_entries, user_data);
- actions = gtk_action_group_list_actions (tmp_group);
- for (iter = actions; iter != NULL; iter = iter->next) {
- action = iter->data;
-
- if (!action)
- continue;
+ list = gtk_action_group_list_actions (tmp_group);
+ for (iter = list; iter != NULL; iter = iter->next) {
+ GtkAction *action = GTK_ACTION (iter->data);
+ const gchar *action_name;
g_object_ref (action);
+ action_name = gtk_action_get_name (action);
+
for (ii = 0; ii < n_entries; ii++) {
- if (g_strcmp0 (entries[ii].name, gtk_action_get_name (action)) == 0) {
- gtk_action_group_remove_action (tmp_group, action);
- gtk_action_group_add_action_with_accel (action_group, action, entries[ii].accelerator);
+ if (g_strcmp0 (entries[ii].name, action_name) == 0) {
+ gtk_action_group_remove_action (
+ tmp_group, action);
+ gtk_action_group_add_action_with_accel (
+ action_group, action,
+ entries[ii].accelerator);
break;
}
}
@@ -697,7 +699,7 @@ e_action_group_add_actions_localized (GtkActionGroup *action_group,
g_object_unref (action);
}
- g_list_free (actions);
+ g_list_free (list);
g_object_unref (tmp_group);
}
diff --git a/em-format/em-format-quote.c b/em-format/em-format-quote.c
index fbbd3bcd78..c3f75ec14d 100644
--- a/em-format/em-format-quote.c
+++ b/em-format/em-format-quote.c
@@ -351,7 +351,9 @@ emfq_format_address (GString *out,
mailto = camel_url_encode (a->v.addr, "?=&()");
}
addr = camel_text_to_html (a->v.addr, flags, 0);
- g_string_append_printf (out, "<a href=\"mailto:%s\">%s</a>", mailto, addr);
+ g_string_append_printf (
+ out, "<a href=\"mailto:%s\">%s</a>",
+ mailto, addr);
g_free (mailto);
g_free (addr);
diff --git a/em-format/em-format.c b/em-format/em-format.c
index 71740b34c4..06582c519f 100644
--- a/em-format/em-format.c
+++ b/em-format/em-format.c
@@ -36,6 +36,10 @@
#include "shell/e-shell.h"
#include "shell/e-shell-settings.h"
+#define EM_FORMAT_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), EM_TYPE_FORMAT, EMFormatPrivate))
+
#define d(x)
typedef struct _EMFormatCache EMFormatCache;
@@ -360,8 +364,7 @@ emf_init (EMFormat *emf)
EShell *shell;
EShellSettings *shell_settings;
- emf->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- emf, EM_TYPE_FORMAT, EMFormatPrivate);
+ emf->priv = EM_FORMAT_GET_PRIVATE (emf);
emf->inline_table = g_hash_table_new_full (
g_str_hash, g_str_equal,
@@ -1464,19 +1467,24 @@ em_format_describe_part (CamelMimePart *part,
stext = g_string_new("");
content_type = g_content_type_from_mime_type (mime_type);
- desc = g_content_type_get_description (content_type ? content_type : mime_type);
+ desc = g_content_type_get_description (
+ content_type != NULL ? content_type : mime_type);
g_free (content_type);
- g_string_append_printf (stext, _("%s attachment"), desc ? desc : mime_type);
+ g_string_append_printf (
+ stext, _("%s attachment"), desc ? desc : mime_type);
g_free (desc);
filename = camel_mime_part_get_filename (part);
description = camel_mime_part_get_description (part);
if (!filename || !*filename) {
- CamelDataWrapper *content = camel_medium_get_content (CAMEL_MEDIUM (part));
+ CamelDataWrapper *content;
+
+ content = camel_medium_get_content (CAMEL_MEDIUM (part));
- if (content && CAMEL_IS_MIME_MESSAGE (content))
- filename = camel_mime_message_get_subject (CAMEL_MIME_MESSAGE (content));
+ if (CAMEL_IS_MIME_MESSAGE (content))
+ filename = camel_mime_message_get_subject (
+ CAMEL_MIME_MESSAGE (content));
}
if (filename != NULL && *filename != '\0') {
@@ -1780,7 +1788,7 @@ emf_multipart_encrypted (EMFormat *emf,
/* Currently we only handle RFC2015-style PGP encryption. */
protocol = camel_content_type_param (
((CamelDataWrapper *)mpe)->mime_type, "protocol");
- if (!protocol || g_ascii_strcasecmp (protocol, "application/pgp-encrypted") != 0) {
+ if (protocol == NULL || g_ascii_strcasecmp (protocol, "application/pgp-encrypted") != 0) {
em_format_format_error (
emf, stream, _("Unsupported encryption "
"type for multipart/encrypted"));
@@ -2009,13 +2017,13 @@ emf_multipart_signed (EMFormat *emf,
/* FIXME: duplicated in em-format-html-display.c */
if (mps->protocol) {
#ifdef ENABLE_SMIME
- if (g_ascii_strcasecmp("application/x-pkcs7-signature", mps->protocol) == 0
- || g_ascii_strcasecmp("application/pkcs7-signature", mps->protocol) == 0) {
+ if (g_ascii_strcasecmp ("application/x-pkcs7-signature", mps->protocol) == 0
+ || g_ascii_strcasecmp ("application/pkcs7-signature", mps->protocol) == 0) {
cipher = camel_smime_context_new (emf->session);
emf->validity_found |= EM_FORMAT_VALIDITY_FOUND_SMIME;
} else
#endif
- if (g_ascii_strcasecmp("application/pgp-signature", mps->protocol) == 0) {
+ if (g_ascii_strcasecmp ("application/pgp-signature", mps->protocol) == 0) {
cipher = camel_gpg_context_new (emf->session);
emf->validity_found |= EM_FORMAT_VALIDITY_FOUND_PGP;
}
@@ -2271,7 +2279,8 @@ emf_inlinepgp_signed (EMFormat *emf,
opart = camel_mime_part_new ();
camel_medium_set_content ((CamelMedium *) opart, dw);
- camel_data_wrapper_set_mime_type_field ((CamelDataWrapper *) opart, dw->mime_type);
+ camel_data_wrapper_set_mime_type_field (
+ (CamelDataWrapper *) opart, dw->mime_type);
add_validity_found (emf, valid);
/* Pass it off to the real formatter */
@@ -2333,7 +2342,8 @@ emf_inlinepgp_encrypted (EMFormat *emf,
mime_type = camel_data_wrapper_get_mime_type (dw);
/* this ensures to show the 'opart' as inlined, if possible */
- if (mime_type && g_ascii_strcasecmp (mime_type, "application/octet-stream") == 0) {
+ if (mime_type != NULL && g_ascii_strcasecmp (
+ mime_type, "application/octet-stream") == 0) {
const gchar *snoop = em_format_snoop_type (opart);
if (snoop)
@@ -2441,8 +2451,6 @@ em_format_snoop_type (CamelMimePart *part)
g_object_unref (stream);
}
- d(printf("snooped part, magic_type '%s' name_type '%s'\n", magic_type, name_type));
-
/* If gvfs doesn't recognize the data by magic, but it
* contains English words, it will call it text/plain. If the
* filename-based check came up with something different, use
diff --git a/filter/e-filter-datespec.c b/filter/e-filter-datespec.c
index ef264d6205..4f7b659b52 100644
--- a/filter/e-filter-datespec.c
+++ b/filter/e-filter-datespec.c
@@ -47,6 +47,10 @@
#define localtime_r(tp,tmp) memcpy(tmp,localtime(tp),sizeof(struct tm))
#endif
+#define E_FILTER_DATESPEC_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_FILTER_DATESPEC, EFilterDatespecPrivate))
+
#define d(x)
typedef struct {
@@ -168,7 +172,7 @@ set_button (EFilterDatespec *fds)
static void
get_values (EFilterDatespec *fds)
{
- EFilterDatespecPrivate *p = fds->priv;
+ EFilterDatespecPrivate *p = E_FILTER_DATESPEC_GET_PRIVATE (fds);
switch (fds->priv->type) {
case FDST_SPECIFIED: {
@@ -203,7 +207,7 @@ set_values (EFilterDatespec *fds)
{
gint note_type;
- EFilterDatespecPrivate *p = fds->priv;
+ EFilterDatespecPrivate *p = E_FILTER_DATESPEC_GET_PRIVATE (fds);
p->type = fds->type == FDST_UNKNOWN ? FDST_NOW : fds->type;
@@ -270,7 +274,7 @@ static void
button_clicked (GtkButton *button,
EFilterDatespec *fds)
{
- EFilterDatespecPrivate *p = fds->priv;
+ EFilterDatespecPrivate *p = E_FILTER_DATESPEC_GET_PRIVATE (fds);
GtkWidget *content_area;
GtkWidget *toplevel;
GtkDialog *dialog;
@@ -298,9 +302,15 @@ button_clicked (GtkButton *button,
set_values (fds);
- g_signal_connect (p->combobox_type, "changed", G_CALLBACK (set_combobox_type), fds);
- g_signal_connect (p->combobox_relative, "changed", G_CALLBACK (set_combobox_relative), fds);
- g_signal_connect (p->combobox_past_future, "changed", G_CALLBACK (set_combobox_past_future), fds);
+ g_signal_connect (
+ p->combobox_type, "changed",
+ G_CALLBACK (set_combobox_type), fds);
+ g_signal_connect (
+ p->combobox_relative, "changed",
+ G_CALLBACK (set_combobox_relative), fds);
+ g_signal_connect (
+ p->combobox_past_future, "changed",
+ G_CALLBACK (set_combobox_past_future), fds);
content_area = gtk_dialog_get_content_area (dialog);
gtk_box_pack_start (GTK_BOX (content_area), toplevel, TRUE, TRUE, 3);
@@ -411,7 +421,9 @@ filter_datespec_get_widget (EFilterElement *element)
button = gtk_button_new ();
gtk_container_add (GTK_CONTAINER (button), fds->priv->label_button);
- g_signal_connect (button, "clicked", G_CALLBACK (button_clicked), fds);
+ g_signal_connect (
+ button, "clicked",
+ G_CALLBACK (button_clicked), fds);
gtk_widget_show (button);
gtk_widget_show (fds->priv->label_button);
@@ -483,8 +495,7 @@ e_filter_datespec_class_init (EFilterDatespecClass *class)
static void
e_filter_datespec_init (EFilterDatespec *datespec)
{
- datespec->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- datespec, E_TYPE_FILTER_DATESPEC, EFilterDatespecPrivate);
+ datespec->priv = E_FILTER_DATESPEC_GET_PRIVATE (datespec);
datespec->type = FDST_UNKNOWN;
}
diff --git a/filter/e-filter-option.c b/filter/e-filter-option.c
index 2f5af12e3b..2f6c73454d 100644
--- a/filter/e-filter-option.c
+++ b/filter/e-filter-option.c
@@ -334,7 +334,9 @@ filter_option_get_widget (EFilterElement *element)
if (op->is_dynamic) {
break;
} else {
- e_filter_option_add (option, op->value, op->title, op->code, FALSE);
+ e_filter_option_add (
+ option, op->value,
+ op->title, op->code, FALSE);
}
}
@@ -343,7 +345,9 @@ filter_option_get_widget (EFilterElement *element)
op = i->data;
if (op) {
- e_filter_option_add (option, op->value, op->title, op->code, TRUE);
+ e_filter_option_add (
+ option, op->value,
+ op->title, op->code, TRUE);
free_option (op);
}
}
@@ -355,7 +359,9 @@ filter_option_get_widget (EFilterElement *element)
op = l->data;
if (!op->is_dynamic)
- e_filter_option_add (option, op->value, op->title, op->code, FALSE);
+ e_filter_option_add (
+ option, op->value,
+ op->title, op->code, FALSE);
}
if (old_cur)
diff --git a/filter/e-filter-rule.c b/filter/e-filter-rule.c
index 288e7a8be1..9ad66410d7 100644
--- a/filter/e-filter-rule.c
+++ b/filter/e-filter-rule.c
@@ -35,6 +35,10 @@
#include "e-filter-rule.h"
#include "e-rule-context.h"
+#define E_FILTER_RULE_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_FILTER_RULE, EFilterRulePrivate))
+
typedef struct _FilterPartData FilterPartData;
typedef struct _FilterRuleData FilterRuleData;
@@ -161,7 +165,9 @@ get_rule_part_widget (ERuleContext *context,
}
gtk_combo_box_set_active (GTK_COMBO_BOX (combobox), current);
- g_signal_connect (combobox, "changed", G_CALLBACK (part_combobox_changed), data);
+ g_signal_connect (
+ combobox, "changed",
+ G_CALLBACK (part_combobox_changed), data);
gtk_widget_show (combobox);
gtk_box_pack_start (GTK_BOX (hbox), combobox, FALSE, FALSE, 0);
@@ -213,7 +219,9 @@ attach_rule (GtkWidget *rule,
remove = gtk_button_new_from_stock (GTK_STOCK_REMOVE);
g_object_set_data ((GObject *) remove, "rule", rule);
- g_signal_connect (remove, "clicked", G_CALLBACK (less_parts), data);
+ g_signal_connect (
+ remove, "clicked",
+ G_CALLBACK (less_parts), data);
gtk_table_attach (GTK_TABLE (data->parts), remove, 1, 2, row, row + 1,
0, 0, 0, 0);
@@ -252,7 +260,9 @@ more_parts (GtkWidget *button,
l = g_list_last (data->rule->parts);
part = l->data;
if (!e_filter_part_validate (part, &alert)) {
- e_alert_run_dialog (GTK_WINDOW (gtk_widget_get_toplevel (button)), alert);
+ GtkWidget *toplevel;
+ toplevel = gtk_widget_get_toplevel (button);
+ e_alert_run_dialog (GTK_WINDOW (toplevel), alert);
return;
}
}
@@ -283,7 +293,8 @@ more_parts (GtkWidget *button,
if (w) {
GtkAdjustment *adjustment;
- adjustment = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (w));
+ adjustment = gtk_scrolled_window_get_vadjustment (
+ GTK_SCROLLED_WINDOW (w));
if (adjustment) {
gdouble upper;
@@ -693,7 +704,9 @@ filter_rule_get_widget (EFilterRule *rule,
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox), name, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
- g_signal_connect (name, "changed", G_CALLBACK (name_changed), rule);
+ g_signal_connect (
+ name, "changed",
+ G_CALLBACK (name_changed), rule);
gtk_widget_show (label);
gtk_widget_show (hbox);
@@ -796,7 +809,9 @@ filter_rule_get_widget (EFilterRule *rule,
gtk_button_set_image (
GTK_BUTTON (add), gtk_image_new_from_stock (
GTK_STOCK_ADD, GTK_ICON_SIZE_BUTTON));
- g_signal_connect (add, "clicked", G_CALLBACK (more_parts), data);
+ g_signal_connect (
+ add, "clicked",
+ G_CALLBACK (more_parts), data);
gtk_box_pack_start (GTK_BOX (hbox), add, FALSE, FALSE, 12);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
gtk_widget_show (hbox);
@@ -825,7 +840,9 @@ filter_rule_get_widget (EFilterRule *rule,
vadj = GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 0.0, 1.0, 1.0, 1.0, 1.0));
scrolledwindow = gtk_scrolled_window_new (hadj, vadj);
- g_signal_connect (hadj, "notify::upper", G_CALLBACK (ensure_scrolled_width_cb), scrolledwindow);
+ g_signal_connect (
+ hadj, "notify::upper",
+ G_CALLBACK (ensure_scrolled_width_cb), scrolledwindow);
gtk_scrolled_window_set_policy (
GTK_SCROLLED_WINDOW (scrolledwindow),
@@ -875,8 +892,7 @@ e_filter_rule_class_init (EFilterRuleClass *class)
static void
e_filter_rule_init (EFilterRule *rule)
{
- rule->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- rule, E_TYPE_FILTER_RULE, EFilterRulePrivate);
+ rule->priv = E_FILTER_RULE_GET_PRIVATE (rule);
rule->enabled = TRUE;
}
diff --git a/filter/e-rule-context.c b/filter/e-rule-context.c
index 2f3daca6e7..9cedfa9a2f 100644
--- a/filter/e-rule-context.c
+++ b/filter/e-rule-context.c
@@ -54,6 +54,10 @@
#include "e-filter-rule.h"
#include "e-rule-context.h"
+#define E_RULE_CONTEXT_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_RULE_CONTEXT, ERuleContextPrivate))
+
struct _ERuleContextPrivate {
gint frozen;
};
@@ -543,8 +547,7 @@ e_rule_context_class_init (ERuleContextClass *class)
static void
e_rule_context_init (ERuleContext *context)
{
- context->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- context, E_TYPE_RULE_CONTEXT, ERuleContextPrivate);
+ context->priv = E_RULE_CONTEXT_GET_PRIVATE (context);
context->part_set_map = g_hash_table_new (g_str_hash, g_str_equal);
context->rule_set_map = g_hash_table_new (g_str_hash, g_str_equal);
@@ -813,7 +816,9 @@ e_rule_context_add_rule_gui (ERuleContext *context,
if (path)
g_object_set_data_full ((GObject *) dialog, "path", g_strdup (path), g_free);
- g_signal_connect (dialog, "response", G_CALLBACK (new_rule_response), context);
+ g_signal_connect (
+ dialog, "response",
+ G_CALLBACK (new_rule_response), context);
g_object_ref (context);
diff --git a/filter/e-rule-editor.c b/filter/e-rule-editor.c
index eb52691c5b..280b6fdf48 100644
--- a/filter/e-rule-editor.c
+++ b/filter/e-rule-editor.c
@@ -37,6 +37,10 @@
#include "e-rule-editor.h"
+#define E_RULE_EDITOR_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_RULE_EDITOR, ERuleEditorPrivate))
+
static gint enable_undo = 0;
enum {
@@ -276,10 +280,14 @@ rule_add (GtkWidget *widget,
content_area = gtk_dialog_get_content_area (GTK_DIALOG (editor->dialog));
gtk_box_pack_start (GTK_BOX (content_area), rules, TRUE, TRUE, 3);
- g_signal_connect (editor->dialog, "response", G_CALLBACK (add_editor_response), editor);
+ g_signal_connect (
+ editor->dialog, "response",
+ G_CALLBACK (add_editor_response), editor);
g_object_weak_ref ((GObject *) editor->dialog, (GWeakNotify) editor_destroy, editor);
- g_signal_connect (editor->edit, "changed", G_CALLBACK (dialog_rule_changed), editor->dialog);
+ g_signal_connect (
+ editor->edit, "changed",
+ G_CALLBACK (dialog_rule_changed), editor->dialog);
dialog_rule_changed (editor->edit, editor->dialog);
gtk_widget_set_sensitive (GTK_WIDGET (editor), FALSE);
@@ -365,10 +373,14 @@ rule_edit (GtkWidget *widget,
content_area = gtk_dialog_get_content_area (GTK_DIALOG (editor->dialog));
gtk_box_pack_start (GTK_BOX (content_area), rules, TRUE, TRUE, 3);
- g_signal_connect (editor->dialog, "response", G_CALLBACK (edit_editor_response), editor);
+ g_signal_connect (
+ editor->dialog, "response",
+ G_CALLBACK (edit_editor_response), editor);
g_object_weak_ref ((GObject *) editor->dialog, (GWeakNotify) editor_destroy, editor);
- g_signal_connect (editor->edit, "changed", G_CALLBACK (dialog_rule_changed), editor->dialog);
+ g_signal_connect (
+ editor->edit, "changed",
+ G_CALLBACK (dialog_rule_changed), editor->dialog);
dialog_rule_changed (editor->edit, editor->dialog);
gtk_widget_set_sensitive (GTK_WIDGET (editor), FALSE);
@@ -667,8 +679,7 @@ e_rule_editor_class_init (ERuleEditorClass *class)
static void
e_rule_editor_init (ERuleEditor *editor)
{
- editor->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- editor, E_TYPE_RULE_EDITOR, ERuleEditorPrivate);
+ editor->priv = E_RULE_EDITOR_GET_PRIVATE (editor);
}
/**
diff --git a/libemail-engine/e-mail-folder-utils.c b/libemail-engine/e-mail-folder-utils.c
index 0e8c5b56c3..ddf2bcf54d 100644
--- a/libemail-engine/e-mail-folder-utils.c
+++ b/libemail-engine/e-mail-folder-utils.c
@@ -361,9 +361,9 @@ mail_folder_find_duplicate_messages_thread (GSimpleAsyncResult *simple,
static GHashTable *
emfu_get_messages_hash_sync (CamelFolder *folder,
- GPtrArray *message_uids,
- GCancellable *cancellable,
- GError **error)
+ GPtrArray *message_uids,
+ GCancellable *cancellable,
+ GError **error)
{
GHashTable *hash_table;
CamelMimeMessage *message;
@@ -877,7 +877,9 @@ e_mail_folder_remove_sync (CamelFolder *folder,
if (cancellable) {
transparent_cancellable = g_cancellable_new ();
- cbid = g_cancellable_connect (cancellable, G_CALLBACK (follow_cancel_cb), transparent_cancellable, NULL);
+ cbid = g_cancellable_connect (
+ cancellable, G_CALLBACK (follow_cancel_cb),
+ transparent_cancellable, NULL);
}
success = mail_folder_remove_recursive (
diff --git a/libemail-engine/e-mail-session-utils.c b/libemail-engine/e-mail-session-utils.c
index 979d15388e..6aa090e0e4 100644
--- a/libemail-engine/e-mail-session-utils.c
+++ b/libemail-engine/e-mail-session-utils.c
@@ -392,6 +392,7 @@ mail_session_send_to_thread (GSimpleAsyncResult *simple,
{
AsyncContext *context;
CamelFolder *local_sent_folder;
+ CamelServiceConnectionStatus status;
GString *error_messages;
gboolean copy_to_sent = TRUE;
guint ii;
@@ -417,11 +418,15 @@ mail_session_send_to_thread (GSimpleAsyncResult *simple,
return;
}
- if (camel_service_get_connection_status (service) != CAMEL_SERVICE_CONNECTED) {
+ status = camel_service_get_connection_status (service);
+ if (status != CAMEL_SERVICE_CONNECTED) {
did_connect = TRUE;
/* XXX This API does not allow for cancellation. */
- if (!em_utils_connect_service_sync (service, cancellable, &error)) {
+ em_utils_connect_service_sync (
+ service, cancellable, &error);
+
+ if (error != NULL) {
g_simple_async_result_take_error (simple, error);
return;
}
diff --git a/libemail-engine/e-mail-utils.c b/libemail-engine/e-mail-utils.c
index 246a4e1329..af861ca98c 100644
--- a/libemail-engine/e-mail-utils.c
+++ b/libemail-engine/e-mail-utils.c
@@ -452,13 +452,15 @@ search_address_in_addressbooks (const gchar *address,
const gchar *completion = e_source_get_property (source, "completion");
if (completion && g_ascii_strcasecmp (completion, "true") == 0) {
- addr_sources = g_slist_prepend (addr_sources, g_object_ref (source));
+ addr_sources = g_slist_prepend (
+ addr_sources, g_object_ref (source));
}
}
}
cancellable = g_cancellable_new ();
- hook_cancellable = mail_cancel_hook_add (emu_addr_cancel_cancellable, cancellable);
+ hook_cancellable = mail_cancel_hook_add (
+ emu_addr_cancel_cancellable, cancellable);
for (s = addr_sources; !stop && !found && s; s = g_slist_next (s)) {
ESource *source = s->data;
@@ -536,10 +538,15 @@ search_address_in_addressbooks (const gchar *address,
cached_book = TRUE;
}
- if (book_client && !stop && e_book_client_get_contacts_sync (book_client, query, &contacts, cancellable, &err)) {
+ if (book_client && !stop &&
+ e_book_client_get_contacts_sync (
+ book_client, query, &contacts, cancellable, &err)) {
if (contacts != NULL) {
if (!found_any) {
- g_hash_table_insert (contact_cache, g_strdup (lowercase_addr), book_client);
+ g_hash_table_insert (
+ contact_cache,
+ g_strdup (lowercase_addr),
+ book_client);
}
found_any = TRUE;
@@ -565,7 +572,9 @@ search_address_in_addressbooks (const gchar *address,
if (err && !stop) {
gchar *source_uid = g_strdup (uid);
- g_hash_table_insert (emu_broken_books_hash, source_uid, source_uid);
+ g_hash_table_insert (
+ emu_broken_books_hash,
+ source_uid, source_uid);
g_warning (
"%s: Can't get contacts from '%s': %s",
diff --git a/libemail-engine/mail-config.c b/libemail-engine/mail-config.c
index 51d34a0714..09f0332567 100644
--- a/libemail-engine/mail-config.c
+++ b/libemail-engine/mail-config.c
@@ -261,20 +261,25 @@ mail_config_init (EMailSession *session)
g_signal_connect (
mail_settings, "changed::address-compress",
- G_CALLBACK (settings_bool_value_changed), &config->address_compress);
- config->address_compress = g_settings_get_boolean (mail_settings, "address-compress");
+ G_CALLBACK (settings_bool_value_changed),
+ &config->address_compress);
+ config->address_compress = g_settings_get_boolean (
+ mail_settings, "address-compress");
g_signal_connect (
mail_settings, "changed::address-count",
- G_CALLBACK (settings_int_value_changed), &config->address_count);
- config->address_count = g_settings_get_int (mail_settings, "address-count");
+ G_CALLBACK (settings_int_value_changed),
+ &config->address_count);
+ config->address_count = g_settings_get_int (
+ mail_settings, "address-count");
/* Junk Configuration */
g_signal_connect (
mail_settings, "changed::junk-check-custom-header",
G_CALLBACK (settings_jh_check_changed), session);
- config->jh_check = g_settings_get_boolean (mail_settings, "junk-check-custom-header");
+ config->jh_check = g_settings_get_boolean (
+ mail_settings, "junk-check-custom-header");
g_signal_connect (
mail_settings, "changed::junk-custom-header",
@@ -283,12 +288,15 @@ mail_config_init (EMailSession *session)
g_signal_connect (
mail_settings, "changed::junk-lookup-addressbook",
G_CALLBACK (settings_bool_value_changed), &config->book_lookup);
- config->book_lookup = g_settings_get_boolean (mail_settings, "junk-lookup-addressbook");
+ config->book_lookup = g_settings_get_boolean (
+ mail_settings, "junk-lookup-addressbook");
g_signal_connect (
mail_settings, "changed::junk-lookup-addressbook-local-only",
- G_CALLBACK (settings_bool_value_changed), &config->book_lookup_local_only);
- config->book_lookup_local_only = g_settings_get_boolean (mail_settings, "junk-lookup-addressbook-local-only");
+ G_CALLBACK (settings_bool_value_changed),
+ &config->book_lookup_local_only);
+ config->book_lookup_local_only = g_settings_get_boolean (
+ mail_settings, "junk-lookup-addressbook-local-only");
settings_jh_check_changed (mail_settings, NULL, session);
}
diff --git a/libemail-engine/mail-folder-cache.c b/libemail-engine/mail-folder-cache.c
index 954c14d379..5c459ef8ab 100644
--- a/libemail-engine/mail-folder-cache.c
+++ b/libemail-engine/mail-folder-cache.c
@@ -370,7 +370,8 @@ update_1folder (MailFolderCache *cache,
if (folder_is_drafts || folder_is_outbox) {
guint32 junked = 0;
- if ((deleted = camel_folder_get_deleted_message_count (folder)) > 0)
+ deleted = camel_folder_get_deleted_message_count (folder);
+ if (deleted > 0)
unread -= deleted;
junked = camel_folder_summary_get_junk_count (folder->summary);
@@ -660,8 +661,6 @@ rename_folders (MailFolderCache *cache,
up = g_malloc0 (sizeof (*up));
- d(printf("oldbase '%s' newbase '%s' new '%s'\n", oldbase, newbase, fi->full_name));
-
/* Form what was the old name, and try and look it up */
old = g_strdup_printf("%s%s", oldbase, fi->full_name + strlen(newbase));
mfi = g_hash_table_lookup (si->folders, old);
@@ -967,7 +966,13 @@ store_has_folder_hierarchy (CamelStore *store)
provider = camel_service_get_provider (CAMEL_SERVICE (store));
g_return_val_if_fail (provider != NULL, FALSE);
- return (provider->flags & (CAMEL_PROVIDER_IS_STORAGE | CAMEL_PROVIDER_IS_EXTERNAL)) != 0;
+ if (provider->flags & CAMEL_PROVIDER_IS_STORAGE)
+ return TRUE;
+
+ if (provider->flags & CAMEL_PROVIDER_IS_EXTERNAL)
+ return TRUE;
+
+ return FALSE;
}
static void
diff --git a/libemail-engine/mail-ops.c b/libemail-engine/mail-ops.c
index 514105d9c2..d62b5c6521 100644
--- a/libemail-engine/mail-ops.c
+++ b/libemail-engine/mail-ops.c
@@ -58,12 +58,14 @@ struct _filter_mail_msg {
MailMsg base;
EMailSession *session;
- CamelFolder *source_folder; /* where they come from */
- GPtrArray *source_uids; /* uids to copy, or NULL == copy all */
- CamelUIDCache *cache; /* UID cache if we are to cache the uids, NULL otherwise */
+ CamelFolder *source_folder; /* where they come from */
+ GPtrArray *source_uids; /* uids to copy, or NULL == copy all */
+ CamelUIDCache *cache; /* UID cache if we are to cache
+ * the uids, NULL otherwise */
CamelFilterDriver *driver;
- gint delete; /* delete messages after filtering them? */
- CamelFolder *destination; /* default destination for any messages, NULL for none */
+ gint delete; /* delete messages after filtering? */
+ CamelFolder *destination; /* default destination for any
+ * messages, NULL for none */
};
/* since fetching also filters, we subclass the data here */
@@ -73,7 +75,7 @@ struct _fetch_mail_msg {
CamelStore *store;
GCancellable *cancellable; /* we have our own cancellation
* struct, the other should be empty */
- gint keep; /* keep on server? */
+ gint keep; /* keep on server? */
void (*done)(gpointer data);
gpointer data;
@@ -190,8 +192,10 @@ mail_filter_folder (EMailSession *session,
if (!notify) {
/* FIXME: have a #define NOTIFY_FILTER_NAME macro? */
- /* the filter name has to stay in sync with mail-session::get_filter_driver */
- camel_filter_driver_remove_rule_by_name (m->driver, "new-mail-notification");
+ /* the filter name has to stay in sync
+ * with mail-session::get_filter_driver */
+ camel_filter_driver_remove_rule_by_name (
+ m->driver, "new-mail-notification");
}
mail_msg_unordered_push (m);
@@ -678,13 +682,16 @@ mail_send_message (struct _send_queue_msg *m,
}
if (local_error != NULL) {
- if (g_error_matches (local_error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
+ if (g_error_matches (
+ local_error, G_IO_ERROR,
+ G_IO_ERROR_CANCELLED))
goto exit;
if (err->len)
g_string_append(err, "\n\n");
g_string_append_printf (
- err, _("Failed to append to local 'Sent' folder: %s"),
+ err, _("Failed to append to "
+ "local 'Sent' folder: %s"),
local_error->message);
}
}
@@ -695,7 +702,9 @@ mail_send_message (struct _send_queue_msg *m,
e_mail_session_handle_draft_headers_sync (
m->session, message, cancellable, &local_error);
if (local_error != NULL) {
- g_warning ("%s: Failed to handle draft headers: %s", G_STRFUNC, local_error->message);
+ g_warning (
+ "%s: Failed to handle draft headers: %s",
+ G_STRFUNC, local_error->message);
g_clear_error (&local_error);
}
@@ -705,7 +714,9 @@ mail_send_message (struct _send_queue_msg *m,
e_mail_session_handle_source_headers_sync (
m->session, message, cancellable, &local_error);
if (local_error != NULL) {
- g_warning ("%s: Failed to handle source headers: %s", G_STRFUNC, local_error->message);
+ g_warning (
+ "%s: Failed to handle source headers: %s",
+ G_STRFUNC, local_error->message);
g_clear_error (&local_error);
}
}
@@ -866,7 +877,9 @@ send_queue_exec (struct _send_queue_msg *m,
if (j > 0)
report_status (
m, CAMEL_FILTER_STATUS_END, 100,
- /* Translators: The string is distinguished by total count of messages to be send. Failed messages is always more than zero. */
+ /* Translators: The string is distinguished by total
+ * count of messages to be sent. Failed messages is
+ * always more than zero. */
ngettext ("Failed to send a message",
"Failed to send %d of %d messages",
send_uids->len),
@@ -1436,7 +1449,8 @@ expunge_pop3_stores (CamelFolder *expunging,
}
if (any_found)
- success = camel_folder_synchronize_sync (folder, TRUE, cancellable, error);
+ success = camel_folder_synchronize_sync (
+ folder, TRUE, cancellable, error);
g_object_unref (folder);
diff --git a/libemail-utils/e-signature-list.c b/libemail-utils/e-signature-list.c
index afc1d9eefd..5be5d31ca1 100644
--- a/libemail-utils/e-signature-list.c
+++ b/libemail-utils/e-signature-list.c
@@ -31,6 +31,10 @@
#include <libedataserver/e-uid.h>
+#define E_SIGNATURE_LIST_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_SIGNATURE_LIST, ESignatureListPrivate))
+
struct _ESignatureListPrivate {
GConfClient *gconf;
guint notify_id;
@@ -112,8 +116,7 @@ e_signature_list_class_init (ESignatureListClass *class)
static void
e_signature_list_init (ESignatureList *signature_list)
{
- signature_list->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- signature_list, E_TYPE_SIGNATURE_LIST, ESignatureListPrivate);
+ signature_list->priv = E_SIGNATURE_LIST_GET_PRIVATE (signature_list);
}
static GSList *
diff --git a/libemail-utils/e-signature.c b/libemail-utils/e-signature.c
index 1b49389a82..e568c63bd2 100644
--- a/libemail-utils/e-signature.c
+++ b/libemail-utils/e-signature.c
@@ -35,6 +35,10 @@
#include "e-signature.h"
+#define E_SIGNATURE_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_SIGNATURE, ESignaturePrivate))
+
struct _ESignaturePrivate {
gchar *filename;
gchar *name;
@@ -318,8 +322,7 @@ e_signature_class_init (ESignatureClass *class)
static void
e_signature_init (ESignature *signature)
{
- signature->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- signature, E_TYPE_SIGNATURE, ESignaturePrivate);
+ signature->priv = E_SIGNATURE_GET_PRIVATE (signature);
}
/**
diff --git a/libemail-utils/mail-mt.c b/libemail-utils/mail-mt.c
index cad4859cd1..ec2c52944a 100644
--- a/libemail-utils/mail-mt.c
+++ b/libemail-utils/mail-mt.c
@@ -51,14 +51,16 @@ static MailMsgCompleteActivityFunc complete_activity = NULL;
static MailMsgAlertErrorFunc alert_error = NULL;
static MailMsgCancelActivityFunc cancel_activity = NULL;
-void mail_msg_register_activities (MailMsgCreateActivityFunc acreate,
- MailMsgSubmitActivityFunc asubmit,
- MailMsgFreeActivityFunc freeact,
- MailMsgCompleteActivityFunc comp_act,
- MailMsgCancelActivityFunc cancel_act,
- MailMsgAlertErrorFunc ealert)
+void
+mail_msg_register_activities (MailMsgCreateActivityFunc acreate,
+ MailMsgSubmitActivityFunc asubmit,
+ MailMsgFreeActivityFunc freeact,
+ MailMsgCompleteActivityFunc comp_act,
+ MailMsgCancelActivityFunc cancel_act,
+ MailMsgAlertErrorFunc ealert)
{
- /* This is a utter hack to keep EActivity out of EDS and still let Evolution do EActivity */
+ /* XXX This is an utter hack to keep EActivity out
+ * of EDS and still let Evolution do EActivity. */
create_activity = acreate;
submit_acitivity = asubmit;
free_activity = freeact;
@@ -232,8 +234,10 @@ mail_msg_check_error (gpointer msg)
/* XXX Hmm, no explanation of why this is needed. It looks like
* a lame hack and will be removed at some point, if only to
* reintroduce whatever issue made this necessary so we can
- * document it the source code this time. */
- if (g_error_matches (m->error, CAMEL_FOLDER_ERROR, CAMEL_FOLDER_ERROR_INVALID_UID))
+ * document it in the source code this time. */
+ if (g_error_matches (
+ m->error, CAMEL_FOLDER_ERROR,
+ CAMEL_FOLDER_ERROR_INVALID_UID))
return;
/* FIXME: Submit an error on the dbus */
diff --git a/libemail-utils/mail-mt.h b/libemail-utils/mail-mt.h
index 36865fe8e9..055464b886 100644
--- a/libemail-utils/mail-mt.h
+++ b/libemail-utils/mail-mt.h
@@ -41,7 +41,9 @@ typedef void (*MailMsgSubmitActivityFunc) (GCancellable *cancellable);
typedef void (*MailMsgFreeActivityFunc) (GCancellable *cancellable);
typedef void (*MailMsgCompleteActivityFunc) (GCancellable *cancellable);
typedef void (*MailMsgCancelActivityFunc) (GCancellable *cancellable);
-typedef void (*MailMsgAlertErrorFunc) (GCancellable *cancellable, const gchar *what, const gchar *message);
+typedef void (*MailMsgAlertErrorFunc) (GCancellable *cancellable,
+ const gchar *what,
+ const gchar *message);
struct _MailMsg {
MailMsgInfo *info;
diff --git a/libgnomecanvas/gailcanvas.c b/libgnomecanvas/gailcanvas.c
index 47501c7d1c..5ca87a6cbe 100644
--- a/libgnomecanvas/gailcanvas.c
+++ b/libgnomecanvas/gailcanvas.c
@@ -176,26 +176,24 @@ static void
gail_canvas_real_initialize (AtkObject *obj,
gpointer data)
{
- GnomeCanvas *canvas;
- GtkAdjustment *adj;
+ GnomeCanvas *canvas;
+ GtkAdjustment *adj;
- parent_atk_object_class->initialize (obj, data);
+ parent_atk_object_class->initialize (obj, data);
- canvas = GNOME_CANVAS (data);
+ canvas = GNOME_CANVAS (data);
- adj = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (canvas));
- g_signal_connect (adj,
- "value_changed",
- G_CALLBACK (adjustment_changed),
- canvas);
+ adj = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (canvas));
+ g_signal_connect (
+ adj, "value_changed",
+ G_CALLBACK (adjustment_changed), canvas);
- adj = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (canvas));
- g_signal_connect (adj,
- "value_changed",
- G_CALLBACK (adjustment_changed),
- canvas);
+ adj = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (canvas));
+ g_signal_connect (
+ adj, "value_changed",
+ G_CALLBACK (adjustment_changed), canvas);
- obj->role = ATK_ROLE_LAYERED_PANE;
+ obj->role = ATK_ROLE_LAYERED_PANE;
}
static gint
diff --git a/libgnomecanvas/gailcanvasitem.c b/libgnomecanvas/gailcanvasitem.c
index ce98ee0b40..ab4f6a4dda 100644
--- a/libgnomecanvas/gailcanvasitem.c
+++ b/libgnomecanvas/gailcanvasitem.c
@@ -246,12 +246,12 @@ gail_canvas_item_add_focus_handler (AtkComponent *component,
(gpointer) handler, NULL);
if (!ret)
{
- return g_signal_connect_closure_by_id (component,
- signal_id, 0,
- g_cclosure_new (
- G_CALLBACK (handler), NULL,
- (GClosureNotify) NULL),
- FALSE);
+ return g_signal_connect_closure_by_id (
+ component, signal_id, 0,
+ g_cclosure_new (
+ G_CALLBACK (handler), NULL,
+ (GClosureNotify) NULL),
+ FALSE);
}
else
{
diff --git a/libgnomecanvas/gnome-canvas-pixbuf.c b/libgnomecanvas/gnome-canvas-pixbuf.c
index b9ece1f504..a3f30600de 100644
--- a/libgnomecanvas/gnome-canvas-pixbuf.c
+++ b/libgnomecanvas/gnome-canvas-pixbuf.c
@@ -30,6 +30,10 @@
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "gnome-canvas-pixbuf.h"
+#define GNOME_CANVAS_PIXBUF_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), GNOME_TYPE_CANVAS_PIXBUF, GnomeCanvasPixbufPrivate))
+
/* Private part of the GnomeCanvasPixbuf structure */
struct _GnomeCanvasPixbufPrivate {
/* Our gdk-pixbuf */
@@ -100,8 +104,7 @@ gnome_canvas_pixbuf_class_init (GnomeCanvasPixbufClass *class)
static void
gnome_canvas_pixbuf_init (GnomeCanvasPixbuf *gcp)
{
- gcp->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- gcp, GNOME_TYPE_CANVAS_PIXBUF, GnomeCanvasPixbufPrivate);
+ gcp->priv = GNOME_CANVAS_PIXBUF_GET_PRIVATE (gcp);
}
/* Dispose handler for the pixbuf canvas item */
diff --git a/libgnomecanvas/gnome-canvas-rect.c b/libgnomecanvas/gnome-canvas-rect.c
index 35453506b5..487b7e23ae 100644
--- a/libgnomecanvas/gnome-canvas-rect.c
+++ b/libgnomecanvas/gnome-canvas-rect.c
@@ -32,6 +32,10 @@
#include "gnome-canvas-rect.h"
+#define GNOME_CANVAS_RECT_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), GNOME_TYPE_CANVAS_RECT, GnomeCanvasRectPrivate))
+
struct _GnomeCanvasRectPrivate {
cairo_path_t *path; /* Our bezier path representation */
@@ -704,8 +708,7 @@ gnome_canvas_rect_class_init (GnomeCanvasRectClass *class)
static void
gnome_canvas_rect_init (GnomeCanvasRect *rect)
{
- rect->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- rect, GNOME_TYPE_CANVAS_RECT, GnomeCanvasRectPrivate);
+ rect->priv = GNOME_CANVAS_RECT_GET_PRIVATE (rect);
rect->priv->scale = 1.0;
diff --git a/libgnomecanvas/gnome-canvas-rich-text.c b/libgnomecanvas/gnome-canvas-rich-text.c
index 7cb39b28fd..a632c6989d 100644
--- a/libgnomecanvas/gnome-canvas-rich-text.c
+++ b/libgnomecanvas/gnome-canvas-rich-text.c
@@ -38,6 +38,10 @@
#include "gnome-canvas-rich-text.h"
#include "gnome-canvas-i18n.h"
+#define GNOME_CANVAS_RICH_TEXT_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), GNOME_TYPE_CANVAS_RICH_TEXT, GnomeCanvasRichTextPrivate))
+
struct _GnomeCanvasRichTextPrivate {
GtkTextLayout *layout;
GtkTextBuffer *buffer;
@@ -109,11 +113,8 @@ enum {
LAST_SIGNAL
};
-static GnomeCanvasItemClass *parent_class;
static guint signals[LAST_SIGNAL] = { 0 };
-static void gnome_canvas_rich_text_class_init (GnomeCanvasRichTextClass *klass);
-static void gnome_canvas_rich_text_init (GnomeCanvasRichText *text);
static void gnome_canvas_rich_text_set_property (GObject *object, guint property_id,
const GValue *value, GParamSpec *pspec);
static void gnome_canvas_rich_text_get_property (GObject *object, guint property_id,
@@ -151,58 +152,21 @@ static gint blink_cb (gpointer data);
#define CURSOR_ON_TIME 800
#define CURSOR_OFF_TIME 400
-GType
-gnome_canvas_rich_text_get_type (void)
-{
- static GType rich_text_type;
-
- if (!rich_text_type) {
- const GTypeInfo object_info = {
- sizeof (GnomeCanvasRichTextClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) gnome_canvas_rich_text_class_init,
- (GClassFinalizeFunc) NULL,
- NULL, /* class_data */
- sizeof (GnomeCanvasRichText),
- 0, /* n_preallocs */
- (GInstanceInitFunc) gnome_canvas_rich_text_init,
- NULL /* value_table */
- };
-
- rich_text_type = g_type_register_static (
- GNOME_TYPE_CANVAS_ITEM, "GnomeCanvasRichText",
- &object_info, 0);
- }
-
- return rich_text_type;
-}
-
-static void
-gnome_canvas_rich_text_finalize (GObject *object)
-{
- GnomeCanvasRichText *text;
-
- text = GNOME_CANVAS_RICH_TEXT (object);
-
- g_free (text->_priv);
- text->_priv = NULL;
-
- /* Chain up to parent's finalize() method. */
- G_OBJECT_CLASS (parent_class)->finalize (object);
-}
+G_DEFINE_TYPE (
+ GnomeCanvasRichText,
+ gnome_canvas_rich_text,
+ GNOME_TYPE_CANVAS_ITEM)
static void
-gnome_canvas_rich_text_class_init (GnomeCanvasRichTextClass *klass)
+gnome_canvas_rich_text_class_init (GnomeCanvasRichTextClass *class)
{
- GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
- GnomeCanvasItemClass *item_class = GNOME_CANVAS_ITEM_CLASS (klass);
+ GObjectClass *gobject_class = G_OBJECT_CLASS (class);
+ GnomeCanvasItemClass *item_class = GNOME_CANVAS_ITEM_CLASS (class);
- parent_class = g_type_class_peek_parent (klass);
+ g_type_class_add_private (class, sizeof (GnomeCanvasRichTextPrivate));
gobject_class->set_property = gnome_canvas_rich_text_set_property;
gobject_class->get_property = gnome_canvas_rich_text_get_property;
- gobject_class->finalize = gnome_canvas_rich_text_finalize;
g_object_class_install_property (
gobject_class,
@@ -389,7 +353,7 @@ gnome_canvas_rich_text_class_init (GnomeCanvasRichTextClass *klass)
static void
gnome_canvas_rich_text_init (GnomeCanvasRichText *text)
{
- text->_priv = g_new0 (GnomeCanvasRichTextPrivate, 1);
+ text->_priv = GNOME_CANVAS_RICH_TEXT_GET_PRIVATE (text);
/* Try to set some sane defaults */
text->_priv->cursor_visible = TRUE;
@@ -650,7 +614,7 @@ gnome_canvas_rich_text_realize (GnomeCanvasItem *item)
{
GnomeCanvasRichText *text = GNOME_CANVAS_RICH_TEXT (item);
- (* GNOME_CANVAS_ITEM_CLASS (parent_class)->realize)(item);
+ (* GNOME_CANVAS_ITEM_CLASS (gnome_canvas_rich_text_parent_class)->realize)(item);
gnome_canvas_rich_text_ensure_layout (text);
} /* gnome_canvas_rich_text_realize */
@@ -662,7 +626,7 @@ gnome_canvas_rich_text_unrealize (GnomeCanvasItem *item)
gnome_canvas_rich_text_destroy_layout (text);
- (* GNOME_CANVAS_ITEM_CLASS (parent_class)->unrealize)(item);
+ (* GNOME_CANVAS_ITEM_CLASS (gnome_canvas_rich_text_parent_class)->unrealize)(item);
} /* gnome_canvas_rich_text_unrealize */
static void
@@ -2009,8 +1973,8 @@ gnome_canvas_rich_text_update (GnomeCanvasItem *item,
gdouble x1, y1, x2, y2;
GtkTextIter start;
- (* GNOME_CANVAS_ITEM_CLASS (parent_class)->update)(
- item, matrix, flags);
+ (* GNOME_CANVAS_ITEM_CLASS (gnome_canvas_rich_text_parent_class)->
+ update)(item, matrix, flags);
get_bounds (text, &x1, &y1, &x2, &y2);
diff --git a/libgnomecanvas/gnome-canvas-text.c b/libgnomecanvas/gnome-canvas-text.c
index d14effacca..1558640d8d 100644
--- a/libgnomecanvas/gnome-canvas-text.c
+++ b/libgnomecanvas/gnome-canvas-text.c
@@ -94,8 +94,6 @@ enum {
PROP_TEXT_HEIGHT
};
-static void gnome_canvas_text_class_init (GnomeCanvasTextClass *class);
-static void gnome_canvas_text_init (GnomeCanvasText *text);
static void gnome_canvas_text_dispose (GnomeCanvasItem *object);
static void gnome_canvas_text_set_property (GObject *object,
guint param_id,
@@ -133,40 +131,10 @@ static void add_attr (PangoAttrList *attr_list,
static GnomeCanvasItemClass *parent_class;
-/**
- * gnome_canvas_text_get_type:
- * @void:
- *
- * Registers the &GnomeCanvasText class if necessary, and returns the type ID
- * associated to it.
- *
- * Return value: The type ID of the &GnomeCanvasText class.
- **/
-GType
-gnome_canvas_text_get_type (void)
-{
- static GType text_type;
-
- if (!text_type) {
- const GTypeInfo object_info = {
- sizeof (GnomeCanvasTextClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) gnome_canvas_text_class_init,
- (GClassFinalizeFunc) NULL,
- NULL, /* class_data */
- sizeof (GnomeCanvasText),
- 0, /* n_preallocs */
- (GInstanceInitFunc) gnome_canvas_text_init,
- NULL /* value_table */
- };
-
- text_type = g_type_register_static (GNOME_TYPE_CANVAS_ITEM, "GnomeCanvasText",
- &object_info, 0);
- }
-
- return text_type;
-}
+G_DEFINE_TYPE (
+ GnomeCanvasText,
+ gnome_canvas_text,
+ GNOME_TYPE_CANVAS_ITEM)
/* Class initialization function for the text item */
static void
diff --git a/libgnomecanvas/gnome-canvas-util.c b/libgnomecanvas/gnome-canvas-util.c
index 00e76daae9..ac5250ca13 100644
--- a/libgnomecanvas/gnome-canvas-util.c
+++ b/libgnomecanvas/gnome-canvas-util.c
@@ -80,12 +80,16 @@ gnome_canvas_update_bbox (GnomeCanvasItem *item,
gint x2,
gint y2)
{
- gnome_canvas_request_redraw (item->canvas, item->x1, item->y1, item->x2, item->y2);
+ gnome_canvas_request_redraw (
+ item->canvas, item->x1, item->y1, item->x2, item->y2);
+
item->x1 = x1;
item->y1 = y1;
item->x2 = x2;
item->y2 = y2;
- gnome_canvas_request_redraw (item->canvas, item->x1, item->y1, item->x2, item->y2);
+
+ gnome_canvas_request_redraw (
+ item->canvas, item->x1, item->y1, item->x2, item->y2);
}
/**
diff --git a/libgnomecanvas/gnome-canvas-widget.c b/libgnomecanvas/gnome-canvas-widget.c
index ef516eb5b2..82077af291 100644
--- a/libgnomecanvas/gnome-canvas-widget.c
+++ b/libgnomecanvas/gnome-canvas-widget.c
@@ -49,8 +49,6 @@ enum {
PROP_SIZE_PIXELS
};
-static void gnome_canvas_widget_class_init (GnomeCanvasWidgetClass *class);
-static void gnome_canvas_widget_init (GnomeCanvasWidget *witem);
static void gnome_canvas_widget_dispose (GnomeCanvasItem *object);
static void gnome_canvas_widget_get_property (GObject *object,
guint param_id,
@@ -84,32 +82,10 @@ static void gnome_canvas_widget_draw (GnomeCanvasItem *item,
static GnomeCanvasItemClass *parent_class;
-GType
-gnome_canvas_widget_get_type (void)
-{
- static GType widget_type;
-
- if (!widget_type) {
- const GTypeInfo object_info = {
- sizeof (GnomeCanvasWidgetClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) gnome_canvas_widget_class_init,
- (GClassFinalizeFunc) NULL,
- NULL, /* class_data */
- sizeof (GnomeCanvasWidget),
- 0, /* n_preallocs */
- (GInstanceInitFunc) gnome_canvas_widget_init,
- NULL /* value_table */
- };
-
- widget_type = g_type_register_static (
- GNOME_TYPE_CANVAS_ITEM,
- "GnomeCanvasWidget", &object_info, 0);
- }
-
- return widget_type;
-}
+G_DEFINE_TYPE (
+ GnomeCanvasWidget,
+ gnome_canvas_widget,
+ GNOME_TYPE_CANVAS_ITEM)
static void
gnome_canvas_widget_class_init (GnomeCanvasWidgetClass *class)
diff --git a/libgnomecanvas/gnome-canvas.c b/libgnomecanvas/gnome-canvas.c
index 176c990561..1b4019b7b4 100644
--- a/libgnomecanvas/gnome-canvas.c
+++ b/libgnomecanvas/gnome-canvas.c
@@ -127,48 +127,16 @@ enum {
ITEM_LAST_SIGNAL
};
-static void gnome_canvas_item_class_init (GnomeCanvasItemClass *class);
-static void gnome_canvas_item_init (GnomeCanvasItem *item);
static gint emit_event (GnomeCanvas *canvas, GdkEvent *event);
static guint item_signals[ITEM_LAST_SIGNAL];
static GObjectClass *item_parent_class;
-/**
- * gnome_canvas_item_get_type:
- *
- * Registers the &GnomeCanvasItem class if necessary, and returns the type ID
- * associated to it.
- *
- * Return value: The type ID of the &GnomeCanvasItem class.
- **/
-GType
-gnome_canvas_item_get_type (void)
-{
- static GType canvas_item_type;
-
- if (!canvas_item_type) {
- const GTypeInfo object_info = {
- sizeof (GnomeCanvasItemClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) gnome_canvas_item_class_init,
- (GClassFinalizeFunc) NULL,
- NULL, /* class_data */
- sizeof (GnomeCanvasItem),
- 0, /* n_preallocs */
- (GInstanceInitFunc) gnome_canvas_item_init,
- NULL /* value_table */
- };
-
- canvas_item_type = g_type_register_static (
- G_TYPE_INITIALLY_UNOWNED,
- "GnomeCanvasItem", &object_info, 0);
- }
-
- return canvas_item_type;
-}
+G_DEFINE_TYPE (
+ GnomeCanvasItem,
+ gnome_canvas_item,
+ G_TYPE_INITIALLY_UNOWNED)
/* Object initialization function for GnomeCanvasItem */
static void
@@ -1153,7 +1121,8 @@ gnome_canvas_item_get_bounds (GnomeCanvasItem *item,
/* Get the item's bounds in its coordinate system */
if (GNOME_CANVAS_ITEM_GET_CLASS (item)->bounds)
- (* GNOME_CANVAS_ITEM_GET_CLASS (item)->bounds) (item, &tx1, &ty1, &tx2, &ty2);
+ GNOME_CANVAS_ITEM_GET_CLASS (item)->bounds (
+ item, &tx1, &ty1, &tx2, &ty2);
/* Make the bounds relative to the item's parent coordinate system */
gnome_canvas_matrix_transform_rect (&item->matrix, &tx1, &ty1, &tx2, &ty2);
@@ -1206,8 +1175,6 @@ enum {
GROUP_PROP_Y
};
-static void gnome_canvas_group_class_init (GnomeCanvasGroupClass *class);
-static void gnome_canvas_group_init (GnomeCanvasGroup *group);
static void gnome_canvas_group_set_property (GObject *object,
guint property_id,
const GValue *value,
@@ -1239,40 +1206,10 @@ static void gnome_canvas_group_bounds (GnomeCanvasItem *item,
static GnomeCanvasItemClass *group_parent_class;
-/**
- * gnome_canvas_group_get_type:
- *
- * Registers the &GnomeCanvasGroup class if necessary, and returns the type ID
- * associated to it.
- *
- * Return value: The type ID of the &GnomeCanvasGroup class.
- **/
-GType
-gnome_canvas_group_get_type (void)
-{
- static GType canvas_group_type;
-
- if (!canvas_group_type) {
- const GTypeInfo object_info = {
- sizeof (GnomeCanvasGroupClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) gnome_canvas_group_class_init,
- (GClassFinalizeFunc) NULL,
- NULL, /* class_data */
- sizeof (GnomeCanvasGroup),
- 0, /* n_preallocs */
- (GInstanceInitFunc) gnome_canvas_group_init,
- NULL /* value_table */
- };
-
- canvas_group_type = g_type_register_static (
- GNOME_TYPE_CANVAS_ITEM, "GnomeCanvasGroup",
- &object_info, 0);
- }
-
- return canvas_group_type;
-}
+G_DEFINE_TYPE (
+ GnomeCanvasGroup,
+ gnome_canvas_group,
+ GNOME_TYPE_CANVAS_ITEM)
/* Class initialization function for GnomeCanvasGroupClass */
static void
@@ -1717,8 +1654,6 @@ enum {
LAST_SIGNAL
};
-static void gnome_canvas_class_init (GnomeCanvasClass *class);
-static void gnome_canvas_init (GnomeCanvas *canvas);
static void gnome_canvas_dispose (GObject *object);
static void gnome_canvas_map (GtkWidget *widget);
static void gnome_canvas_unmap (GtkWidget *widget);
@@ -1757,6 +1692,11 @@ enum {
PROP_FOCUSED_ITEM,
};
+G_DEFINE_TYPE (
+ GnomeCanvas,
+ gnome_canvas,
+ GTK_TYPE_LAYOUT)
+
static void
gnome_canvas_paint_rect (GnomeCanvas *canvas,
cairo_t *cr,
@@ -1822,40 +1762,6 @@ gnome_canvas_paint_rect (GnomeCanvas *canvas,
}
}
-/**
- * gnome_canvas_get_type:
- *
- * Registers the &GnomeCanvas class if necessary, and returns the type ID
- * associated to it.
- *
- * Return value: The type ID of the &GnomeCanvas class.
- **/
-GType
-gnome_canvas_get_type (void)
-{
- static GType canvas_type;
-
- if (!canvas_type) {
- const GTypeInfo object_info = {
- sizeof (GnomeCanvasClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) gnome_canvas_class_init,
- (GClassFinalizeFunc) NULL,
- NULL, /* class_data */
- sizeof (GnomeCanvas),
- 0, /* n_preallocs */
- (GInstanceInitFunc) gnome_canvas_init,
- NULL /* value_table */
- };
-
- canvas_type = g_type_register_static (GTK_TYPE_LAYOUT, "GnomeCanvas",
- &object_info, 0);
- }
-
- return canvas_type;
-}
-
static void
gnome_canvas_get_property (GObject *object,
guint property_id,
@@ -1890,15 +1796,15 @@ gnome_canvas_set_property (GObject *object,
/* Class initialization function for GnomeCanvasClass */
static void
-gnome_canvas_class_init (GnomeCanvasClass *klass)
+gnome_canvas_class_init (GnomeCanvasClass *class)
{
GObjectClass *object_class;
GtkWidgetClass *widget_class;
- object_class = (GObjectClass *) klass;
- widget_class = (GtkWidgetClass *) klass;
+ object_class = (GObjectClass *) class;
+ widget_class = (GtkWidgetClass *) class;
- canvas_parent_class = g_type_class_peek_parent (klass);
+ canvas_parent_class = g_type_class_peek_parent (class);
object_class->set_property = gnome_canvas_set_property;
object_class->get_property = gnome_canvas_get_property;
@@ -1920,8 +1826,8 @@ gnome_canvas_class_init (GnomeCanvasClass *klass)
widget_class->focus_in_event = gnome_canvas_focus_in;
widget_class->focus_out_event = gnome_canvas_focus_out;
- klass->draw_background = gnome_canvas_draw_background;
- klass->request_update = gnome_canvas_request_update_real;
+ class->draw_background = gnome_canvas_draw_background;
+ class->request_update = gnome_canvas_request_update_real;
g_object_class_install_property (object_class, PROP_FOCUSED_ITEM,
g_param_spec_object ("focused_item", NULL, NULL,
@@ -2264,7 +2170,8 @@ gnome_canvas_size_allocate (GtkWidget *widget,
g_return_if_fail (allocation != NULL);
if (GTK_WIDGET_CLASS (canvas_parent_class)->size_allocate)
- (* GTK_WIDGET_CLASS (canvas_parent_class)->size_allocate) (widget, allocation);
+ GTK_WIDGET_CLASS (canvas_parent_class)->size_allocate (
+ widget, allocation);
scrollable = GTK_SCROLLABLE (widget);
hadjustment = gtk_scrollable_get_hadjustment (scrollable);
@@ -2993,7 +2900,7 @@ gnome_canvas_set_scroll_region (GnomeCanvas *canvas,
canvas->need_repick = TRUE;
#if 0
/* todo: should be requesting update */
- (* GNOME_CANVAS_ITEM_CLASS (canvas->root->object.klass)->update) (
+ (* GNOME_CANVAS_ITEM_CLASS (canvas->root->object.class)->update) (
canvas->root, NULL, NULL, 0);
#endif
}
diff --git a/mail/e-mail-attachment-bar.c b/mail/e-mail-attachment-bar.c
index a33f8c98b8..21a298c56d 100644
--- a/mail/e-mail-attachment-bar.c
+++ b/mail/e-mail-attachment-bar.c
@@ -326,7 +326,10 @@ mail_attachment_bar_constructed (GObject *object)
/* Set up property-to-GSettings bindings. */
settings = g_settings_new ("org.gnome.evolution.shell");
- g_settings_bind (settings, "attachment-view", object, "active-view", G_SETTINGS_BIND_DEFAULT);
+ g_settings_bind (
+ settings, "attachment-view",
+ object, "active-view",
+ G_SETTINGS_BIND_DEFAULT);
g_object_unref (settings);
/* Chain up to parent's constructed() method. */
diff --git a/mail/e-mail-backend.c b/mail/e-mail-backend.c
index 597a770222..f2e8fb9962 100644
--- a/mail/e-mail-backend.c
+++ b/mail/e-mail-backend.c
@@ -61,6 +61,10 @@
(G_TYPE_INSTANCE_GET_PRIVATE \
((obj), E_TYPE_MAIL_BACKEND, EMailBackendPrivate))
+#define E_MAIL_BACKEND_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_MAIL_BACKEND, EMailBackendPrivate))
+
#define QUIT_POLL_INTERVAL 1 /* seconds */
struct _EMailBackendPrivate {
@@ -589,13 +593,16 @@ mail_backend_folder_changed_cb (MailFolderCache *folder_cache,
folder_uri = e_mail_folder_uri_build (store, folder_name);
- if (folder_uri) {
+ if (folder_uri != NULL) {
CamelFolder *folder = NULL;
- if (mail_folder_cache_get_folder_from_uri (folder_cache, folder_uri, &folder))
- if (folder && !mail_folder_cache_get_folder_info_flags (folder_cache, folder, &flags))
+ if (mail_folder_cache_get_folder_from_uri (
+ folder_cache, folder_uri, &folder))
+ if (folder != NULL &&
+ !mail_folder_cache_get_folder_info_flags (
+ folder_cache, folder, &flags))
g_return_if_reached ();
- if (folder)
+ if (folder != NULL)
g_object_unref (folder);
}
@@ -612,8 +619,14 @@ mail_backend_folder_changed_cb (MailFolderCache *folder_cache,
target->display_name = em_folder_tree_model_get_folder_name (
model, store, folder_name);
- if (target->new > 0)
- e_shell_event (e_shell_backend_get_shell (E_SHELL_BACKEND (mail_backend)), "mail-icon", (gpointer) "mail-unread");
+ if (target->new > 0) {
+ EShell *shell;
+ EShellBackend *shell_backend;
+
+ shell_backend = E_SHELL_BACKEND (mail_backend);
+ shell = e_shell_backend_get_shell (shell_backend);
+ e_shell_event (shell, "mail-icon", (gpointer) "mail-unread");
+ }
/**
* @Event: folder.changed
diff --git a/mail/e-mail-browser.c b/mail/e-mail-browser.c
index 663d25cc75..0dbb3d01e3 100644
--- a/mail/e-mail-browser.c
+++ b/mail/e-mail-browser.c
@@ -702,8 +702,11 @@ mail_browser_constructed (GObject *object)
settings = g_settings_new ("org.gnome.evolution.mail");
- object = G_OBJECT (reader);
- g_settings_bind (settings, "show-deleted", object, "show-deleted", G_SETTINGS_BIND_DEFAULT);
+ g_settings_bind (
+ settings, "show-deleted",
+ reader, "show-deleted",
+ G_SETTINGS_BIND_DEFAULT);
+
g_object_unref (settings);
id = "org.gnome.evolution.mail.browser";
diff --git a/mail/e-mail-label-list-store.c b/mail/e-mail-label-list-store.c
index bc9cb5ab3e..706aaac5e9 100644
--- a/mail/e-mail-label-list-store.c
+++ b/mail/e-mail-label-list-store.c
@@ -32,6 +32,10 @@
(G_TYPE_INSTANCE_GET_PRIVATE \
((obj), E_TYPE_MAIL_LABEL_LIST_STORE, EMailLabelListStorePrivate))
+#define E_MAIL_LABEL_LIST_STORE_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_MAIL_LABEL_LIST_STORE, EMailLabelListStorePrivate))
+
struct _EMailLabelListStorePrivate {
GHashTable *tag_index;
GSettings *mail_settings;
@@ -52,6 +56,9 @@ static struct {
/* Forward Declarations */
static void e_mail_label_list_store_interface_init
(GtkTreeModelIface *interface);
+static void labels_settings_changed_cb (GSettings *settings,
+ const gchar *key,
+ gpointer user_data);
G_DEFINE_TYPE_WITH_CODE (
EMailLabelListStore,
@@ -197,8 +204,6 @@ mail_label_list_store_finalize (GObject *object)
finalize (object);
}
-static void labels_settings_changed_cb (GSettings *settings, const gchar *key, gpointer user_data);
-
static void
labels_model_changed_cb (GtkTreeModel *model,
GtkTreePath *path,
@@ -208,33 +213,45 @@ labels_model_changed_cb (GtkTreeModel *model,
EMailLabelListStore *store;
GPtrArray *array;
GtkTreeIter tmp_iter;
- gboolean res;
+ gboolean iter_set;
store = E_MAIL_LABEL_LIST_STORE (user_data);
/* Make sure we don't enter an infinite synchronizing loop */
- g_signal_handlers_block_by_func (store->priv->mail_settings, labels_settings_changed_cb, store);
+ g_signal_handlers_block_by_func (
+ store->priv->mail_settings,
+ labels_settings_changed_cb, store);
/* Build list to store in GSettings */
+
array = g_ptr_array_new ();
- res = gtk_tree_model_get_iter_first (GTK_TREE_MODEL (store), &tmp_iter);
- while (res) {
+
+ iter_set = gtk_tree_model_get_iter_first (
+ GTK_TREE_MODEL (store), &tmp_iter);
+
+ while (iter_set) {
gchar *string;
- gtk_tree_model_get (GTK_TREE_MODEL (store), &tmp_iter,
- 0, &string, -1);
+ gtk_tree_model_get (
+ GTK_TREE_MODEL (store), &tmp_iter,
+ 0, &string, -1);
g_ptr_array_add (array, string);
- res = gtk_tree_model_iter_next (GTK_TREE_MODEL (store), &tmp_iter);
+ iter_set = gtk_tree_model_iter_next (
+ GTK_TREE_MODEL (store), &tmp_iter);
}
g_ptr_array_add (array, NULL);
+
g_settings_set_strv (
store->priv->mail_settings, "labels",
(const gchar * const *) array->pdata);
g_ptr_array_free (array, TRUE);
- g_signal_handlers_unblock_by_func (store->priv->mail_settings, labels_settings_changed_cb, store);
+
+ g_signal_handlers_unblock_by_func (
+ store->priv->mail_settings,
+ labels_settings_changed_cb, store);
}
static void
@@ -249,23 +266,24 @@ labels_settings_changed_cb (GSettings *settings,
store = E_MAIL_LABEL_LIST_STORE (user_data);
/* Make sure we don't enter an infinite synchronizing loop */
- g_signal_handlers_block_by_func (store, labels_model_changed_cb, store);
+ g_signal_handlers_block_by_func (
+ store, labels_model_changed_cb, store);
gtk_list_store_clear (GTK_LIST_STORE (store));
strv = g_settings_get_strv (store->priv->mail_settings, "labels");
+
for (i = 0; strv[i] != NULL; i++) {
GtkTreeIter iter;
- gtk_list_store_insert_with_values (GTK_LIST_STORE (store),
- &iter, -1,
- 0, strv[i],
- -1);
+ gtk_list_store_insert_with_values (
+ GTK_LIST_STORE (store), &iter, -1, 0, strv[i], -1);
}
g_strfreev (strv);
- g_signal_handlers_unblock_by_func (store, labels_model_changed_cb, store);
+ g_signal_handlers_unblock_by_func (
+ store, labels_model_changed_cb, store);
}
static void
@@ -280,7 +298,8 @@ mail_label_list_store_constructed (GObject *object)
g_signal_connect (
store->priv->mail_settings, "changed::labels",
G_CALLBACK (labels_settings_changed_cb), store);
- labels_settings_changed_cb (store->priv->mail_settings, "labels", store);
+ labels_settings_changed_cb (
+ store->priv->mail_settings, "labels", store);
/* Connect to ListStore change notifications */
g_signal_connect (
diff --git a/mail/e-mail-migrate.c b/mail/e-mail-migrate.c
index 311d5d2359..0d2381ffa0 100644
--- a/mail/e-mail-migrate.c
+++ b/mail/e-mail-migrate.c
@@ -778,7 +778,9 @@ change_sent_and_drafts_local_folders (EShellBackend *shell_backend)
camel_url_free (url);
- tmp_uri = g_strconcat ("mbox:", g_get_home_dir (), "/.evolution/mail/local", NULL);
+ tmp_uri = g_strconcat (
+ "mbox:", g_get_home_dir (),
+ "/.evolution/mail/local", NULL);
url = camel_url_new (tmp_uri, NULL);
g_free (tmp_uri);
@@ -801,7 +803,8 @@ change_sent_and_drafts_local_folders (EShellBackend *shell_backend)
continue;
uri = e_account_get_string (account, E_ACCOUNT_DRAFTS_FOLDER_URI);
- if (g_strcmp0 (uri, drafts_uri) == 0 || g_strcmp0 (uri, old_drafts_uri) == 0) {
+ if (g_strcmp0 (uri, drafts_uri) == 0 ||
+ g_strcmp0 (uri, old_drafts_uri) == 0) {
changed = TRUE;
e_account_set_string (
account, E_ACCOUNT_DRAFTS_FOLDER_URI,
@@ -1167,7 +1170,7 @@ em_ensure_proxy_ignore_hosts_being_list (void)
static void
em_rename_view_in_folder (gpointer data,
- gpointer user_data)
+ gpointer user_data)
{
const gchar *filename = data;
const gchar *views_dir = user_data;
@@ -1188,6 +1191,7 @@ em_rename_view_in_folder (gpointer data,
if (folderpos < dotpos && g_str_equal (dotpos, ".xml")) {
GChecksum *checksum;
gchar *oldname, *newname, *newfile;
+ const gchar *md5_string;
*dotpos = 0;
@@ -1196,7 +1200,8 @@ em_rename_view_in_folder (gpointer data,
g_checksum_update (checksum, (const guchar *) folderpos, -1);
*folderpos = 0;
- newfile = g_strconcat (filename, g_checksum_get_string (checksum), ".xml", NULL);
+ md5_string = g_checksum_get_string (checksum);
+ newfile = g_strconcat (filename, md5_string, ".xml", NULL);
*folderpos = 'f';
*dotpos = '.';
diff --git a/mail/e-mail-notebook-view.c b/mail/e-mail-notebook-view.c
index 5d100cfc21..64995bc8ef 100644
--- a/mail/e-mail-notebook-view.c
+++ b/mail/e-mail-notebook-view.c
@@ -1089,8 +1089,9 @@ mail_netbook_view_open_mail (EMailView *view,
page = e_mail_tab_picker_get_tab_no (priv->tab_picker, tab);
e_mail_tab_picker_set_current_tab (priv->tab_picker, page);
- g_signal_connect (tab , "closed",
- G_CALLBACK (mnv_tab_closed), nview);
+ g_signal_connect (
+ tab , "closed",
+ G_CALLBACK (mnv_tab_closed), nview);
g_object_ref (tab);
timeline = clutter_timeline_new (150);
@@ -1323,14 +1324,19 @@ mail_notebook_view_set_folder (EMailReader *reader,
#endif
} else {
priv->inited = TRUE;
- gtk_notebook_set_tab_label (priv->book, (GtkWidget *) priv->current_view,
- create_tab_label (E_MAIL_NOTEBOOK_VIEW (reader),
- priv->current_view,
- camel_folder_get_full_name (folder)));
+ gtk_notebook_set_tab_label (
+ priv->book,
+ GTK_WIDGET (priv->current_view),
+ create_tab_label (
+ E_MAIL_NOTEBOOK_VIEW (reader),
+ priv->current_view,
+ camel_folder_get_full_name (folder)));
#if HAVE_CLUTTER
- tab = e_mail_tab_picker_get_tab (priv->tab_picker,
- e_mail_tab_picker_get_current_tab (priv->tab_picker));
+ tab = e_mail_tab_picker_get_tab (
+ priv->tab_picker,
+ e_mail_tab_picker_get_current_tab (
+ priv->tab_picker));
g_object_set_data ((GObject *)tab, "page", priv->current_view);
g_object_set_data ((GObject *)priv->current_view, "page", tab);
g_object_set_data ((GObject *)priv->current_view, "tab", tab);
@@ -1345,8 +1351,9 @@ mail_notebook_view_set_folder (EMailReader *reader,
#if HAVE_CLUTTER
list = e_mail_reader_get_message_list (E_MAIL_READER (priv->current_view));
- g_signal_connect (tab , "closed",
- G_CALLBACK (mnv_tab_closed), reader);
+ g_signal_connect (
+ tab , "closed",
+ G_CALLBACK (mnv_tab_closed), reader);
g_object_set_data ((GObject *)priv->current_view, "stage", priv->stage);
g_object_set_data ((GObject *)list, "stage", priv->stage);
g_object_set_data ((GObject *)list, "actor", priv->actor);
@@ -1567,14 +1574,18 @@ e_mail_notebook_view_new (EShellView *shell_view)
widget = g_object_new (
E_TYPE_MAIL_NOTEBOOK_VIEW,
"shell-view", shell_view, NULL);
- g_signal_connect (widget, "show-folder",
- G_CALLBACK (emnv_show_folder), widget);
- g_signal_connect (widget, "show-next-tab",
- G_CALLBACK (emnv_show_nexttab), widget);
- g_signal_connect (widget, "show-previous-tab",
- G_CALLBACK (emnv_show_prevtab), widget);
- g_signal_connect (widget, "close-tab",
- G_CALLBACK (emnv_close_tab), widget);
+ g_signal_connect (
+ widget, "show-folder",
+ G_CALLBACK (emnv_show_folder), widget);
+ g_signal_connect (
+ widget, "show-next-tab",
+ G_CALLBACK (emnv_show_nexttab), widget);
+ g_signal_connect (
+ widget, "show-previous-tab",
+ G_CALLBACK (emnv_show_prevtab), widget);
+ g_signal_connect (
+ widget, "close-tab",
+ G_CALLBACK (emnv_close_tab), widget);
return widget;
}
diff --git a/mail/e-mail-pane.c b/mail/e-mail-pane.c
deleted file mode 100644
index c982ab0267..0000000000
--- a/mail/e-mail-pane.c
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with the program; if not, see <http://www.gnu.org/licenses/>
- *
- *
- * Authors:
- * Srinivasa Ragavan <sragavan@gnome.org>
- *
- * Copyright (C) 2010 Intel corporation. (www.intel.com)
- *
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <glib/gi18n.h>
-#include "e-mail-pane.h"
-
-G_DEFINE_TYPE (EMailPane, e_mail_pane, GTK_TYPE_VBOX)
-
-enum {
- PANE_CLOSE,
- LAST_SIGNAL
-};
-
-static guint signals[LAST_SIGNAL] = { 0 };
-
-static void
-e_mail_pane_init (EMailPane *shell)
-{
- shell->priv = g_new0 (EMailPanePrivate, 1);
-}
-
-static void
-e_mail_pane_finalize (GObject *object)
-{
- /* EMailPane *shell = (EMailPane *)object; */
-
- G_OBJECT_CLASS (e_mail_pane_parent_class)->finalize (object);
-}
-
-static void
-e_mail_pane_class_init (EMailPaneClass *klass)
-{
- GObjectClass * object_class = G_OBJECT_CLASS (klass);
-
- e_mail_pane_parent_class = g_type_class_peek_parent (klass);
- object_class->finalize = e_mail_pane_finalize;
-
- signals[PANE_CLOSE] =
- g_signal_new ("pane-close",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (EMailPaneClass , view_close),
- NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
-}
-
diff --git a/mail/e-mail-pane.h b/mail/e-mail-pane.h
deleted file mode 100644
index 2e20dd772d..0000000000
--- a/mail/e-mail-pane.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * e-mail-pane.h
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with the program; if not, see <http://www.gnu.org/licenses/>
- *
- *
- * Authors:
- * Srinivasa Ragavan <sragavan@gnome.org>
- *
- * Copyright (C) 2010 Intel corporation. (www.intel.com)
- *
- */
-
-#ifndef E_MAIL_PANE_H
-#define E_MAIL_PANE_H
-
-#include <gtk/gtk.h>
-
-#define E_TYPE_MAIL_PANE \
- (e_mail_pane_get_type ())
-#define E_MAIL_PANE(obj) \
- (G_TYPE_CHECK_INSTANCE_CAST \
- ((obj), E_TYPE_MAIL_PANE, MailFolderView))
-#define E_MAIL_PANE_CLASS(cls) \
- (G_TYPE_CHECK_CLASS_CAST \
- ((cls), E_TYPE_MAIL_PANE, MailFolderViewClass))
-#define E_IS_MAIL_PANE(obj) \
- (G_TYPE_CHECK_INSTANCE_TYPE \
- ((obj), E_TYPE_MAIL_PANE))
-#define E_IS_MAIL_PANE_CLASS(cls) \
- (G_TYPE_CHECK_CLASS_TYPE \
- ((cls), E_TYPE_MAIL_PANE))
-#define E_MAIL_PANE_GET_CLASS(obj) \
- (G_TYPE_INSTANCE_GET_CLASS \
- ((obj), E_TYPE_MAIL_PANE, EMailPaneClass))
-
-G_BEGIN_DECLS
-
-typedef struct _EMailPane EMailPane;
-typedef struct _EMailPaneClass EMailPaneClass;
-typedef struct _EMailPanePrivate EMailPanePrivate;
-
-struct _EMailPane {
- GtkVBox parent;
- EMailPanePrivate *priv;
-};
-
-struct _EMailPaneClass {
- GtkVBoxClass parent_class;
-};
-
-G_END_DECLS
-
-#endif /* E_MAIL_PANE_H */
diff --git a/mail/e-mail-paned-view.c b/mail/e-mail-paned-view.c
index ea017c758b..e1779a8c3e 100644
--- a/mail/e-mail-paned-view.c
+++ b/mail/e-mail-paned-view.c
@@ -222,7 +222,6 @@ mail_paned_view_restore_state_cb (EShellWindow *shell_window,
{
EMailPanedViewPrivate *priv;
GSettings *settings;
- GObject *object;
priv = E_MAIL_PANED_VIEW (view)->priv;
@@ -230,11 +229,15 @@ mail_paned_view_restore_state_cb (EShellWindow *shell_window,
settings = g_settings_new ("org.gnome.evolution.mail");
- object = G_OBJECT (priv->paned);
- g_settings_bind (settings, "hpaned-size", object, "hposition", G_SETTINGS_BIND_DEFAULT);
+ g_settings_bind (
+ settings, "hpaned-size",
+ priv->paned, "hposition",
+ G_SETTINGS_BIND_DEFAULT);
- object = G_OBJECT (priv->paned);
- g_settings_bind (settings, "paned-size", object, "vposition", G_SETTINGS_BIND_DEFAULT);
+ g_settings_bind (
+ settings, "paned-size",
+ priv->paned, "vposition",
+ G_SETTINGS_BIND_DEFAULT);
g_object_unref (settings);
}
diff --git a/mail/e-mail-reader-utils.c b/mail/e-mail-reader-utils.c
index c814435119..0981fb327b 100644
--- a/mail/e-mail-reader-utils.c
+++ b/mail/e-mail-reader-utils.c
@@ -855,7 +855,9 @@ e_mail_reader_reply_to_message (EMailReader *reader,
if (curl && curl->path && *curl->path) {
address = camel_internet_address_new ();
- if (camel_address_decode (CAMEL_ADDRESS (address), curl->path) < 0) {
+ if (camel_address_decode (
+ CAMEL_ADDRESS (address),
+ curl->path) < 0) {
g_object_unref (address);
address = NULL;
}
diff --git a/mail/e-mail-reader.c b/mail/e-mail-reader.c
index ef2449eb15..b471e981cb 100644
--- a/mail/e-mail-reader.c
+++ b/mail/e-mail-reader.c
@@ -1356,8 +1356,10 @@ action_mail_reply_sender_check (CamelFolder *folder,
settings = g_settings_new ("org.gnome.evolution.mail");
- ask_ignore_list_reply_to = g_settings_get_boolean (settings, "composer-ignore-list-reply-to");
- ask_list_reply_to = g_settings_get_boolean (settings, "prompt-on-list-reply-to");
+ ask_ignore_list_reply_to = g_settings_get_boolean (
+ settings, "composer-ignore-list-reply-to");
+ ask_list_reply_to = g_settings_get_boolean (
+ settings, "prompt-on-list-reply-to");
munged_list_message = em_utils_is_munged_list_message (message);
@@ -1389,7 +1391,8 @@ action_mail_reply_sender_check (CamelFolder *folder,
active = gtk_toggle_button_get_active (
GTK_TOGGLE_BUTTON (check));
if (active) {
- g_settings_set_boolean (settings, "prompt-on-private-list-reply", FALSE);
+ g_settings_set_boolean (
+ settings, "prompt-on-private-list-reply", FALSE);
}
gtk_widget_destroy (dialog);
@@ -1435,12 +1438,14 @@ action_mail_reply_sender_check (CamelFolder *folder,
active = gtk_toggle_button_get_active (
GTK_TOGGLE_BUTTON (check_again));
if (active) {
- g_settings_set_boolean (settings, "prompt-on-list-reply-to", FALSE);
+ g_settings_set_boolean (
+ settings, "prompt-on-list-reply-to", FALSE);
}
active = gtk_toggle_button_get_active (
GTK_TOGGLE_BUTTON (check_always_ignore));
- g_settings_set_boolean (settings, "composer-ignore-list-reply-to", active);
+ g_settings_set_boolean (
+ settings, "composer-ignore-list-reply-to", active);
gtk_widget_destroy (dialog);
@@ -1482,8 +1487,10 @@ action_mail_reply_sender_cb (GtkAction *action,
state = e_mail_reader_check_state (reader);
settings = g_settings_new ("org.gnome.evolution.mail");
- ask_list_reply_to = g_settings_get_boolean (settings, "prompt-on-list-reply-to");
- ask_private_list_reply = g_settings_get_boolean (settings, "prompt-on-private-list-reply");
+ ask_list_reply_to = g_settings_get_boolean (
+ settings, "prompt-on-list-reply-to");
+ ask_private_list_reply = g_settings_get_boolean (
+ settings, "prompt-on-private-list-reply");
g_object_unref (settings);
ask = (ask_private_list_reply || ask_list_reply_to);
@@ -3670,11 +3677,15 @@ e_mail_reader_init (EMailReader *reader,
action_name = "mail-caret-mode";
action = e_mail_reader_get_action (reader, action_name);
- g_settings_bind (settings, "caret-mode", G_OBJECT (action), "active", G_SETTINGS_BIND_DEFAULT);
+ g_settings_bind (
+ settings, "caret-mode",
+ action, "active", G_SETTINGS_BIND_DEFAULT);
action_name = "mail-show-all-headers";
action = e_mail_reader_get_action (reader, action_name);
- g_settings_bind (settings, "show-all-headers", G_OBJECT (action), "active", G_SETTINGS_BIND_DEFAULT);
+ g_settings_bind (
+ settings, "show-all-headers",
+ action, "active", G_SETTINGS_BIND_DEFAULT);
g_object_unref (settings);
diff --git a/mail/e-mail-tab-picker.c b/mail/e-mail-tab-picker.c
index 8732d4a9c1..d2267dc142 100644
--- a/mail/e-mail-tab-picker.c
+++ b/mail/e-mail-tab-picker.c
@@ -36,6 +36,9 @@ G_DEFINE_TYPE_WITH_CODE (
G_IMPLEMENT_INTERFACE (
MX_TYPE_DROPPABLE, mx_droppable_iface_init))
+#define TAB_PICKER_PRIVATE(o) \
+ (G_TYPE_INSTANCE_GET_PRIVATE ((o), E_MAIL_TYPE_TAB_PICKER, EMailTabPickerPrivate))
+
enum
{
PROP_0,
diff --git a/mail/e-mail-tab.c b/mail/e-mail-tab.c
index b50b14fe2b..d79edf40e8 100644
--- a/mail/e-mail-tab.c
+++ b/mail/e-mail-tab.c
@@ -770,11 +770,13 @@ e_mail_tab_allocate (ClutterActor *actor,
/* Allocate for label */
if ((priv->preview_height_progress <= TAB_S1_ANIM) || (!priv->preview)) {
if (priv->icon)
- child_box.x1 = E_MAIL_PIXBOUND (padding.left + icon_width + priv->spacing);
+ child_box.x1 = E_MAIL_PIXBOUND (
+ padding.left + icon_width + priv->spacing);
else
child_box.x1 = E_MAIL_PIXBOUND (padding.left);
child_box.x2 = (box->x2 - box->x1 - padding.right);
- child_box.y1 = E_MAIL_PIXBOUND ((box->y2 - box->y1) / 2 - label_height / 2);
+ child_box.y1 = E_MAIL_PIXBOUND (
+ (box->y2 - box->y1) / 2 - label_height / 2);
child_box.y2 = child_box.y1 + label_height;
/* If close button is visible, don't overlap it */
@@ -1879,12 +1881,6 @@ e_mail_tab_alert_cb (EMailTab *tab)
if (priv->alert_count < 4)
return TRUE;
- /* This call isn't needed, it should be in the correct state as long as
- * the above check always checks for < (an even number)
- */
- /*if (!priv->preview_mode)
- clutter_actor_set_name (CLUTTER_ACTOR (tab),
- priv->private ? "private-tab" : NULL);*/
priv->alert_source = 0;
return FALSE;
diff --git a/mail/e-mail-ui-session.c b/mail/e-mail-ui-session.c
index 70c4515b47..1d32cc74a7 100644
--- a/mail/e-mail-ui-session.c
+++ b/mail/e-mail-ui-session.c
@@ -230,7 +230,8 @@ user_message_exec (struct _user_message_msg *m,
list = gtk_application_get_windows (GTK_APPLICATION (shell));
- /* ...then iterate through all opened windows and pick one which has it */
+ /* ...then iterate through all opened
+ * windows and pick one which has it */
for (iter = list; iter != NULL && !shell_content; iter = g_list_next (iter)) {
if (E_IS_SHELL_WINDOW (iter->data)) {
shell_window = iter->data;
@@ -241,11 +242,13 @@ user_message_exec (struct _user_message_msg *m,
}
}
- /* when no shell-content found, which might not happen, but just in case,
- * process the information alert like usual, through an EAlertDialog machinery
- */
+ /* When no shell-content found, which might not happen,
+ * but just in case, process the information alert like
+ * usual, through an EAlertDialog machinery. */
if (shell_content) {
- e_alert_submit (E_ALERT_SINK (shell_content), error_type, m->prompt, NULL);
+ e_alert_submit (
+ E_ALERT_SINK (shell_content),
+ error_type, m->prompt, NULL);
return;
} else if (!m->ismain && user_message_dialog != NULL) {
g_queue_push_tail (&user_message_queue, mail_msg_ref (m));
diff --git a/mail/em-account-editor.c b/mail/em-account-editor.c
index d2ff491b82..a82d0899df 100644
--- a/mail/em-account-editor.c
+++ b/mail/em-account-editor.c
@@ -88,6 +88,10 @@
* better visual clarity. This specifies how far to the right. */
#define INDENT_MARGIN 24
+#define EM_ACCOUNT_EDITOR_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), EM_TYPE_ACCOUNT_EDITOR, EMAccountEditorPrivate))
+
#define d(x)
/* econfig item for the extra config hings */
@@ -1658,9 +1662,15 @@ emae_setup_signatures (EMAccountEditor *emae,
signatures = e_get_signature_list ();
if (p->sig_added_id == 0) {
- p->sig_added_id = g_signal_connect (signatures, "signature-added", G_CALLBACK(emae_signature_added), emae);
- p->sig_removed_id = g_signal_connect (signatures, "signature-removed", G_CALLBACK(emae_signature_removed), emae);
- p->sig_changed_id = g_signal_connect (signatures, "signature-changed", G_CALLBACK(emae_signature_changed), emae);
+ p->sig_added_id = g_signal_connect (
+ signatures, "signature-added",
+ G_CALLBACK (emae_signature_added), emae);
+ p->sig_removed_id = g_signal_connect (
+ signatures, "signature-removed",
+ G_CALLBACK (emae_signature_removed), emae);
+ p->sig_changed_id = g_signal_connect (
+ signatures, "signature-changed",
+ G_CALLBACK (emae_signature_changed), emae);
}
/* we need to count the 'none' entry before using the index */
@@ -1691,10 +1701,14 @@ emae_setup_signatures (EMAccountEditor *emae,
gtk_combo_box_set_model (dropdown, (GtkTreeModel *) store);
gtk_combo_box_set_active (dropdown, active);
- g_signal_connect (dropdown, "changed", G_CALLBACK(emae_signaturetype_changed), emae);
+ g_signal_connect (
+ dropdown, "changed",
+ G_CALLBACK (emae_signaturetype_changed), emae);
button = e_builder_get_widget (builder, "sigAddNew");
- g_signal_connect (button, "clicked", G_CALLBACK(emae_signature_new), emae);
+ g_signal_connect (
+ button, "clicked",
+ G_CALLBACK (emae_signature_new), emae);
return (GtkWidget *) dropdown;
}
@@ -1765,7 +1779,9 @@ emae_setup_receipt_policy (EMAccountEditor *emae,
gtk_combo_box_set_active (dropdown, active);
- g_signal_connect (dropdown, "changed", G_CALLBACK(emae_receipt_policy_changed), emae);
+ g_signal_connect (
+ dropdown, "changed",
+ G_CALLBACK (emae_receipt_policy_changed), emae);
return (GtkWidget *) dropdown;
}
@@ -1805,7 +1821,9 @@ emae_account_entry (EMAccountEditor *emae,
if (text)
gtk_entry_set_text (entry, text);
g_object_set_data ((GObject *)entry, "account-item", GINT_TO_POINTER(item));
- g_signal_connect (entry, "changed", G_CALLBACK(emae_account_entry_changed), emae);
+ g_signal_connect (
+ entry, "changed",
+ G_CALLBACK (emae_account_entry_changed), emae);
return entry;
}
@@ -1943,7 +1961,9 @@ emae_account_folder (EMAccountEditor *emae,
g_object_set_data ((GObject *)folder, "account-item", GINT_TO_POINTER(item));
g_object_set_data ((GObject *)folder, "folder-default", GINT_TO_POINTER(deffolder));
- g_signal_connect (folder, "selected", G_CALLBACK(emae_account_folder_changed), emae);
+ g_signal_connect (
+ folder, "selected",
+ G_CALLBACK (emae_account_folder_changed), emae);
gtk_widget_show ((GtkWidget *) folder);
return folder;
@@ -1999,7 +2019,9 @@ smime_sign_key_select (GtkWidget *button,
w = e_cert_selector_new (E_CERT_SELECTOR_SIGNER, gtk_entry_get_text (priv->smime_sign_key));
gtk_window_set_modal ((GtkWindow *) w, TRUE);
gtk_window_set_transient_for ((GtkWindow *) w, (GtkWindow *) gtk_widget_get_toplevel (button));
- g_signal_connect (w, "selected", G_CALLBACK(smime_sign_key_selected), emae);
+ g_signal_connect (
+ w, "selected",
+ G_CALLBACK (smime_sign_key_selected), emae);
gtk_widget_show (w);
}
@@ -2038,7 +2060,9 @@ smime_encrypt_key_select (GtkWidget *button,
w = e_cert_selector_new (E_CERT_SELECTOR_RECIPIENT, gtk_entry_get_text (priv->smime_encrypt_key));
gtk_window_set_modal ((GtkWindow *) w, TRUE);
gtk_window_set_transient_for ((GtkWindow *) w, (GtkWindow *) gtk_widget_get_toplevel (button));
- g_signal_connect (w, "selected", G_CALLBACK(smime_encrypt_key_selected), emae);
+ g_signal_connect (
+ w, "selected",
+ G_CALLBACK (smime_encrypt_key_selected), emae);
gtk_widget_show (w);
}
@@ -3109,15 +3133,15 @@ emae_receive_page (EConfig *ec,
GtkWidget *vbox, *child;
child = (GtkWidget *)g_object_get_data ((GObject *)emae->pages[1], "old-child");
- if (child)
- gtk_container_remove ((GtkContainer *)emae->pages[1], child);
+ if (child)
+ gtk_container_remove ((GtkContainer *) emae->pages[1], child);
vbox = gtk_vbox_new (FALSE, 12);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 12);
gtk_widget_show (vbox);
- gtk_box_pack_start ((GtkBox *)vbox, w, TRUE, TRUE, 0);
+ gtk_box_pack_start ((GtkBox *) vbox, w, TRUE, TRUE, 0);
g_object_set_data ((GObject *)emae->pages[1], "old-child", vbox);
- gtk_box_pack_start ((GtkBox *)emae->pages[1], vbox, TRUE, TRUE, 0);
+ gtk_box_pack_start ((GtkBox *) emae->pages[1], vbox, TRUE, TRUE, 0);
w = page;
} else if (((EConfig *) priv->config)->type == E_CONFIG_ASSISTANT) {
@@ -3155,8 +3179,8 @@ emae_receive_page (EConfig *ec,
static void
emae_set_option_dependency (EMAccountEditorService *service,
- CamelProviderConfEntry *conf,
- GtkWidget *widget)
+ CamelProviderConfEntry *conf,
+ GtkWidget *widget)
{
if (conf->depname != NULL) {
const gchar *depname = conf->depname;
@@ -3727,18 +3751,18 @@ emae_send_page (EConfig *ec,
GtkWidget *vbox, *child;
child = (GtkWidget *)g_object_get_data ((GObject *)emae->pages[3], "old-child");
- if (child)
- gtk_container_remove ((GtkContainer *)emae->pages[3], child);
+ if (child)
+ gtk_container_remove ((GtkContainer *) emae->pages[3], child);
vbox = gtk_vbox_new (FALSE, 12);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 12);
gtk_widget_show (vbox);
- gtk_box_pack_start ((GtkBox *)vbox, w, TRUE, TRUE, 0);
+ gtk_box_pack_start ((GtkBox *) vbox, w, TRUE, TRUE, 0);
g_object_set_data ((GObject *)emae->pages[3], "old-child", vbox);
- gtk_box_pack_start ((GtkBox *)emae->pages[3], vbox, TRUE, TRUE, 0);
+ gtk_box_pack_start ((GtkBox *) emae->pages[3], vbox, TRUE, TRUE, 0);
- w = page;
+ w = page;
} else if (((EConfig *) priv->config)->type == E_CONFIG_ASSISTANT) {
GtkWidget *page;
@@ -4148,7 +4172,9 @@ emae_account_hash_algo_combo (EMAccountEditor *emae,
gtk_combo_box_set_active (combobox, index);
g_object_set_data (G_OBJECT (combobox), "account-item", GINT_TO_POINTER (item));
- g_signal_connect (combobox, "changed", G_CALLBACK (emae_account_hash_algo_combo_changed_cb), emae);
+ g_signal_connect (
+ combobox, "changed",
+ G_CALLBACK (emae_account_hash_algo_combo_changed_cb), emae);
return combobox;
}
@@ -4187,8 +4213,12 @@ emae_security_page (EConfig *ec,
priv->smime_sign_key = emae_account_entry (emae, "smime_sign_key", E_ACCOUNT_SMIME_SIGN_KEY, builder);
priv->smime_sign_key_select = (GtkButton *)e_builder_get_widget (builder, "smime_sign_key_select");
priv->smime_sign_key_clear = (GtkButton *)e_builder_get_widget (builder, "smime_sign_key_clear");
- g_signal_connect (priv->smime_sign_key_select, "clicked", G_CALLBACK(smime_sign_key_select), emae);
- g_signal_connect (priv->smime_sign_key_clear, "clicked", G_CALLBACK(smime_sign_key_clear), emae);
+ g_signal_connect (
+ priv->smime_sign_key_select, "clicked",
+ G_CALLBACK (smime_sign_key_select), emae);
+ g_signal_connect (
+ priv->smime_sign_key_clear, "clicked",
+ G_CALLBACK (smime_sign_key_clear), emae);
emae_account_hash_algo_combo (emae, "smime_hash_algo", E_ACCOUNT_SMIME_HASH_ALGORITHM, builder);
priv->smime_sign_default = emae_account_toggle (emae, "smime_sign_default", E_ACCOUNT_SMIME_SIGN_DEFAULT, builder);
@@ -4196,8 +4226,12 @@ emae_security_page (EConfig *ec,
priv->smime_encrypt_key = emae_account_entry (emae, "smime_encrypt_key", E_ACCOUNT_SMIME_ENCRYPT_KEY, builder);
priv->smime_encrypt_key_select = (GtkButton *)e_builder_get_widget (builder, "smime_encrypt_key_select");
priv->smime_encrypt_key_clear = (GtkButton *)e_builder_get_widget (builder, "smime_encrypt_key_clear");
- g_signal_connect (priv->smime_encrypt_key_select, "clicked", G_CALLBACK(smime_encrypt_key_select), emae);
- g_signal_connect (priv->smime_encrypt_key_clear, "clicked", G_CALLBACK(smime_encrypt_key_clear), emae);
+ g_signal_connect (
+ priv->smime_encrypt_key_select, "clicked",
+ G_CALLBACK (smime_encrypt_key_select), emae);
+ g_signal_connect (
+ priv->smime_encrypt_key_clear, "clicked",
+ G_CALLBACK (smime_encrypt_key_clear), emae);
priv->smime_encrypt_default = emae_account_toggle (emae, "smime_encrypt_default", E_ACCOUNT_SMIME_ENCRYPT_DEFAULT, builder);
priv->smime_encrypt_to_self = emae_account_toggle (emae, "smime_encrypt_to_self", E_ACCOUNT_SMIME_ENCRYPT_TO_SELF, builder);
diff --git a/mail/em-composer-utils.c b/mail/em-composer-utils.c
index 3dd93c1891..23c1755687 100644
--- a/mail/em-composer-utils.c
+++ b/mail/em-composer-utils.c
@@ -1454,31 +1454,40 @@ static void
emu_update_composers_security (EMsgComposer *composer,
guint32 validity_found)
{
- GtkToggleAction *action;
EShell *shell;
EShellSettings *shell_settings;
+ GtkAction *action;
+ gboolean sign_by_default;
g_return_if_fail (composer != NULL);
shell = e_msg_composer_get_shell (composer);
shell_settings = e_shell_get_shell_settings (shell);
+ sign_by_default =
+ (validity_found & EM_FORMAT_VALIDITY_FOUND_SIGNED) != 0 &&
+ e_shell_settings_get_boolean (
+ shell_settings, "composer-sign-reply-if-signed");
+
/* Pre-set only for encrypted messages, not for signed */
- if ((validity_found & EM_FORMAT_VALIDITY_FOUND_SIGNED) != 0
- && e_shell_settings_get_boolean (shell_settings, "composer-sign-reply-if-signed")) {
+ if (sign_by_default) {
if (validity_found & EM_FORMAT_VALIDITY_FOUND_SMIME)
- action = GTK_TOGGLE_ACTION (E_COMPOSER_ACTION_SMIME_SIGN (composer));
+ action = E_COMPOSER_ACTION_SMIME_SIGN (composer);
else
- action = GTK_TOGGLE_ACTION (E_COMPOSER_ACTION_PGP_SIGN (composer));
- gtk_toggle_action_set_active (action, TRUE);
+ action = E_COMPOSER_ACTION_PGP_SIGN (composer);
+
+ gtk_toggle_action_set_active (
+ GTK_TOGGLE_ACTION (action), TRUE);
}
if (validity_found & EM_FORMAT_VALIDITY_FOUND_ENCRYPTED) {
if (validity_found & EM_FORMAT_VALIDITY_FOUND_SMIME)
- action = GTK_TOGGLE_ACTION (E_COMPOSER_ACTION_SMIME_ENCRYPT (composer));
+ action = E_COMPOSER_ACTION_SMIME_ENCRYPT (composer);
else
- action = GTK_TOGGLE_ACTION (E_COMPOSER_ACTION_PGP_ENCRYPT (composer));
- gtk_toggle_action_set_active (action, TRUE);
+ action = E_COMPOSER_ACTION_PGP_ENCRYPT (composer);
+
+ gtk_toggle_action_set_active (
+ GTK_TOGGLE_ACTION (action), TRUE);
}
}
@@ -1775,7 +1784,8 @@ forward_got_messages_cb (CamelFolder *folder,
* @folder: folder containing messages to forward
* @uids: uids of messages to forward
* @style: the forward style to use
- * @destroy_when_done: a #GtkWidget to destroy with gtk_widget_destroy() when done; can be NULL
+ * @destroy_when_done: a #GtkWidget to destroy with gtk_widget_destroy()
+ * when done; can be NULL
*
* Forwards a group of messages in the given style.
*
@@ -2130,7 +2140,8 @@ get_reply_to (CamelMimeMessage *message)
gboolean ignore_list_reply_to;
settings = g_settings_new ("org.gnome.evolution.mail");
- ignore_list_reply_to = g_settings_get_boolean (settings, "composer-ignore-list-reply-to");
+ ignore_list_reply_to = g_settings_get_boolean (
+ settings, "composer-ignore-list-reply-to");
g_object_unref (settings);
if (ignore_list_reply_to && em_utils_is_munged_list_message (message))
diff --git a/mail/em-filter-editor.c b/mail/em-filter-editor.c
index 0785d08163..1d60acdec6 100644
--- a/mail/em-filter-editor.c
+++ b/mail/em-filter-editor.c
@@ -154,7 +154,9 @@ em_filter_editor_construct (EMFilterEditor *fe,
}
gtk_combo_box_set_active (GTK_COMBO_BOX (combobox), 0);
- g_signal_connect (combobox, "changed", G_CALLBACK (select_source), fe);
+ g_signal_connect (
+ combobox, "changed",
+ G_CALLBACK (select_source), fe);
g_object_set_data_full (G_OBJECT (combobox), "sources", sources, free_sources);
gtk_widget_show (combobox);
diff --git a/mail/em-filter-rule.c b/mail/em-filter-rule.c
index 90e82e5744..a02b70fcaf 100644
--- a/mail/em-filter-rule.c
+++ b/mail/em-filter-rule.c
@@ -372,7 +372,9 @@ get_rule_part_widget (EMFilterContext *f,
}
gtk_combo_box_set_active (GTK_COMBO_BOX (combobox), current);
- g_signal_connect (combobox, "changed", G_CALLBACK (part_combobox_changed), data);
+ g_signal_connect (
+ combobox, "changed",
+ G_CALLBACK (part_combobox_changed), data);
gtk_widget_show (combobox);
gtk_box_pack_start (GTK_BOX (hbox), combobox, FALSE, FALSE, 0);
@@ -433,7 +435,9 @@ attach_rule (GtkWidget *rule,
remove = gtk_button_new_from_stock (GTK_STOCK_REMOVE);
g_object_set_data((GObject *)remove, "rule", rule);
/*gtk_button_set_relief(GTK_BUTTON(remove), GTK_RELIEF_NONE);*/
- g_signal_connect (remove, "clicked", G_CALLBACK(less_parts), data);
+ g_signal_connect (
+ remove, "clicked",
+ G_CALLBACK (less_parts), data);
gtk_table_attach (GTK_TABLE (data->parts), remove, 1, 2, row, row + 1,
0, 0, 0, 0);
gtk_widget_show (remove);
@@ -488,7 +492,9 @@ more_parts (GtkWidget *button,
if (w) {
GtkAdjustment *adjustment;
- adjustment = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (w));
+ adjustment = gtk_scrolled_window_get_vadjustment (
+ GTK_SCROLLED_WINDOW (w));
+
if (adjustment) {
gdouble upper;
@@ -553,7 +559,9 @@ get_widget (EFilterRule *fr,
gtk_button_set_image (
GTK_BUTTON (add), gtk_image_new_from_stock (
GTK_STOCK_ADD, GTK_ICON_SIZE_BUTTON));
- g_signal_connect (add, "clicked", G_CALLBACK(more_parts), data);
+ g_signal_connect (
+ add, "clicked",
+ G_CALLBACK (more_parts), data);
gtk_box_pack_start (GTK_BOX (hbox), add, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (inframe), hbox, FALSE, FALSE, 3);
diff --git a/mail/em-folder-properties.c b/mail/em-folder-properties.c
index 69c72b3144..08ed28df59 100644
--- a/mail/em-folder-properties.c
+++ b/mail/em-folder-properties.c
@@ -189,7 +189,7 @@ emfp_get_folder_item (EConfig *ec,
}
}
- if (context->folder) {
+ if (context->folder != NULL) {
CamelStore *store;
CamelSession *session;
CamelFolderInfoFlags fi_flags = 0;
@@ -197,10 +197,13 @@ emfp_get_folder_item (EConfig *ec,
store = camel_folder_get_parent_store (context->folder);
session = camel_service_get_session (CAMEL_SERVICE (store));
- folder_cache = e_mail_session_get_folder_cache (E_MAIL_SESSION (session));
+ folder_cache = e_mail_session_get_folder_cache (
+ E_MAIL_SESSION (session));
- can_apply_filters = !CAMEL_IS_VEE_FOLDER (context->folder) &&
- mail_folder_cache_get_folder_info_flags (folder_cache, context->folder, &fi_flags) &&
+ can_apply_filters =
+ !CAMEL_IS_VEE_FOLDER (context->folder) &&
+ mail_folder_cache_get_folder_info_flags (
+ folder_cache, context->folder, &fi_flags) &&
(fi_flags & CAMEL_FOLDER_TYPE_MASK) != CAMEL_FOLDER_TYPE_INBOX;
}
diff --git a/mail/em-folder-tree-model.c b/mail/em-folder-tree-model.c
index 7ee385c892..623fd55edd 100644
--- a/mail/em-folder-tree-model.c
+++ b/mail/em-folder-tree-model.c
@@ -59,6 +59,10 @@
#define d(x)
+#define EM_FOLDER_TREE_MODEL_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), EM_TYPE_FOLDER_TREE_MODEL, EMFolderTreeModelPrivate))
+
struct _EMFolderTreeModelPrivate {
/* This is set by EMailShellSidebar. It allows new EMFolderTree
* instances to initialize their selection and expanded states to
@@ -573,7 +577,8 @@ em_folder_tree_model_set_session (EMFolderTreeModel *model,
MailFolderCache *folder_cache;
folder_cache = e_mail_session_get_folder_cache (session);
- account_store = e_mail_ui_session_get_account_store (E_MAIL_UI_SESSION (session));
+ account_store = e_mail_ui_session_get_account_store (
+ E_MAIL_UI_SESSION (session));
/* Keep our own reference since we connect to its signals. */
g_warn_if_fail (model->priv->account_store == NULL);
diff --git a/mail/em-folder-tree.c b/mail/em-folder-tree.c
index 46a8c108e8..43b0e246f1 100644
--- a/mail/em-folder-tree.c
+++ b/mail/em-folder-tree.c
@@ -73,6 +73,10 @@
typedef struct _AsyncContext AsyncContext;
+#define EM_FOLDER_TREE_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), EM_TYPE_FOLDER_TREE, EMFolderTreePrivate))
+
struct _selected_uri {
gchar *key; /* store:path or account/path */
gchar *uri;
@@ -2682,11 +2686,13 @@ tree_drag_motion (GtkWidget *widget,
if (priv->autoexpand_id != 0) {
GtkTreePath *autoexpand_path;
- autoexpand_path = gtk_tree_row_reference_get_path (priv->autoexpand_row);
+ autoexpand_path = gtk_tree_row_reference_get_path (
+ priv->autoexpand_row);
if (gtk_tree_path_compare (autoexpand_path, path) != 0) {
/* row changed, restart timer */
gtk_tree_row_reference_free (priv->autoexpand_row);
- priv->autoexpand_row = gtk_tree_row_reference_new (model, path);
+ priv->autoexpand_row =
+ gtk_tree_row_reference_new (model, path);
g_source_remove (priv->autoexpand_id);
priv->autoexpand_id = g_timeout_add (
600, (GSourceFunc)
@@ -2698,7 +2704,8 @@ tree_drag_motion (GtkWidget *widget,
priv->autoexpand_id = g_timeout_add (
600, (GSourceFunc)
tree_autoexpand, folder_tree);
- priv->autoexpand_row = gtk_tree_row_reference_new (model, path);
+ priv->autoexpand_row =
+ gtk_tree_row_reference_new (model, path);
}
} else if (priv->autoexpand_id != 0) {
gtk_tree_row_reference_free (priv->autoexpand_row);
@@ -2718,7 +2725,8 @@ tree_drag_motion (GtkWidget *widget,
case DND_DROP_TYPE_UID_LIST:
case DND_DROP_TYPE_FOLDER:
chosen_action = suggested_action;
- if (chosen_action == GDK_ACTION_COPY && (actions & GDK_ACTION_MOVE))
+ if (chosen_action == GDK_ACTION_COPY &&
+ (actions & GDK_ACTION_MOVE))
chosen_action = GDK_ACTION_MOVE;
gtk_tree_view_set_drag_dest_row (
tree_view, path,
diff --git a/mail/em-format-hook.c b/mail/em-format-hook.c
index 7777914577..233805561b 100644
--- a/mail/em-format-hook.c
+++ b/mail/em-format-hook.c
@@ -172,7 +172,8 @@ emfh_construct (EPluginHook *eph,
d(printf("loading format hook\n"));
- if (((EPluginHookClass *) em_format_hook_parent_class)->construct (eph, ep, root) == -1)
+ if (((EPluginHookClass *) em_format_hook_parent_class)->
+ construct (eph, ep, root) == -1)
return -1;
node = root->children;
diff --git a/mail/em-format-html-display.c b/mail/em-format-html-display.c
index 7e796b1c2a..013e1ac731 100644
--- a/mail/em-format-html-display.c
+++ b/mail/em-format-html-display.c
@@ -72,6 +72,10 @@
#define d(x)
+#define EM_FORMAT_HTML_DISPLAY_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), EM_TYPE_FORMAT_HTML_DISPLAY, EMFormatHTMLDisplayPrivate))
+
struct _EMFormatHTMLDisplayPrivate {
GHashTable *attachment_views; /* weak reference; message_part_id->EAttachmentView */
gboolean attachment_expanded;
@@ -200,7 +204,9 @@ efhd_xpkcs7mime_viewcert_clicked (GtkWidget *button,
/* oddly enough certificate_viewer_show doesn't ... */
gtk_widget_show (w);
- g_signal_connect (w, "response", G_CALLBACK(gtk_widget_destroy), NULL);
+ g_signal_connect (
+ w, "response",
+ G_CALLBACK (gtk_widget_destroy), NULL);
if (w && po->widget)
gtk_window_set_transient_for ((GtkWindow *) w, (GtkWindow *) po->widget);
@@ -253,7 +259,9 @@ efhd_xpkcs7mime_add_cert_table (GtkWidget *grid,
w = gtk_button_new_with_mnemonic(_("_View Certificate"));
gtk_table_attach (table, w, 1, 2, n, n + 1, 0, 0, 3, 3);
g_object_set_data((GObject *)w, "e-cert-info", info);
- g_signal_connect (w, "clicked", G_CALLBACK(efhd_xpkcs7mime_viewcert_clicked), po);
+ g_signal_connect (
+ w, "clicked",
+ G_CALLBACK (efhd_xpkcs7mime_viewcert_clicked), po);
if (info->cert_data)
ec = e_cert_new (CERT_DupCertificate (info->cert_data));
@@ -358,7 +366,10 @@ efhd_xpkcs7mime_validity_clicked (GtkWidget *button,
g_object_unref (builder);
- g_signal_connect (po->widget, "response", G_CALLBACK(efhd_xpkcs7mime_info_response), po);
+ g_signal_connect (
+ po->widget, "response",
+ G_CALLBACK (efhd_xpkcs7mime_info_response), po);
+
gtk_widget_show (po->widget);
}
@@ -1420,7 +1431,9 @@ efhd_attachment_optional (EMFormatHTML *efh,
web_view = em_format_html_get_web_view (efh);
gtk_widget_get_allocation (GTK_WIDGET (web_view), &allocation);
gtk_widget_set_size_request (scroll, allocation.width - 48, 250);
- g_signal_connect (scroll, "size_allocate", G_CALLBACK(efhd_resize), efh);
+ g_signal_connect (
+ scroll, "size_allocate",
+ G_CALLBACK (efhd_resize), efh);
gtk_widget_show (scroll);
if (!info->shown)
diff --git a/mail/em-format-html-print.c b/mail/em-format-html-print.c
index 97a7627c6d..0de9e2303d 100644
--- a/mail/em-format-html-print.c
+++ b/mail/em-format-html-print.c
@@ -231,7 +231,10 @@ em_format_html_print_message (EMFormatHTMLPrint *efhp,
folder, message_uid, message,
(EMFormat *) efhp->source, NULL);
} else {
- em_format_html_clone_sync (folder, message_uid, message, (EMFormatHTML *) efhp, (EMFormat *) efhp->source);
+ em_format_html_clone_sync (
+ folder, message_uid, message,
+ (EMFormatHTML *) efhp,
+ (EMFormat *) efhp->source);
emfhp_complete (efhp);
}
}
diff --git a/mail/em-format-html.c b/mail/em-format-html.c
index 5406223f10..ae2782d568 100644
--- a/mail/em-format-html.c
+++ b/mail/em-format-html.c
@@ -73,6 +73,10 @@
#define d(x)
+#define EM_FORMAT_HTML_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), EM_TYPE_FORMAT_HTML, EMFormatHTMLPrivate))
+
#define EFM_MESSAGE_START_ANAME "evolution#message#start"
#define EFH_MESSAGE_START "<A name=\"" EFM_MESSAGE_START_ANAME "\"></A>"
@@ -3177,10 +3181,11 @@ efh_format_headers (EMFormatHTML *efh,
!photo_name && !g_ascii_strcasecmp (header->name, "From"))
photo_name = header->value;
- if (!mailer_shown && mailer && (!g_ascii_strcasecmp (header->name, "X-Mailer") ||
- !g_ascii_strcasecmp (header->name, "User-Agent") ||
- !g_ascii_strcasecmp (header->name, "X-Newsreader") ||
- !g_ascii_strcasecmp (header->name, "X-MimeOLE"))) {
+ if (!mailer_shown && mailer && (
+ !g_ascii_strcasecmp (header->name, "X-Mailer") ||
+ !g_ascii_strcasecmp (header->name, "User-Agent") ||
+ !g_ascii_strcasecmp (header->name, "X-Newsreader") ||
+ !g_ascii_strcasecmp (header->name, "X-MimeOLE"))) {
struct _camel_header_raw xmailer, *use_header = NULL;
if (!g_ascii_strcasecmp (header->name, "X-MimeOLE")) {
@@ -3213,8 +3218,11 @@ efh_format_headers (EMFormatHTML *efh,
while (*cp == ' ')
cp++;
- face_header_value = g_base64_decode (cp, &face_header_len);
- face_header_value = g_realloc (face_header_value, face_header_len + 1);
+ face_header_value = g_base64_decode (
+ cp, &face_header_len);
+ face_header_value = g_realloc (
+ face_header_value,
+ face_header_len + 1);
face_header_value[face_header_len] = 0;
face_decoded = TRUE;
/* Showing an encoded "Face" header makes little sense */
diff --git a/mail/em-subscription-editor.c b/mail/em-subscription-editor.c
index a8869b6485..f695a88d87 100644
--- a/mail/em-subscription-editor.c
+++ b/mail/em-subscription-editor.c
@@ -36,6 +36,10 @@
#include "em-folder-utils.h"
+#define EM_SUBSCRIPTION_EDITOR_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), EM_TYPE_SUBSCRIPTION_EDITOR, EMSubscriptionEditorPrivate))
+
#define FOLDER_CAN_SELECT(folder_info) \
((folder_info) != NULL && \
((folder_info)->flags & CAMEL_FOLDER_NOSELECT) == 0)
@@ -230,7 +234,8 @@ subscription_editor_populate (EMSubscriptionEditor *editor,
if (folder_info->child != NULL)
subscription_editor_populate (
- editor, folder_info->child, &iter, expand_paths);
+ editor, folder_info->child,
+ &iter, expand_paths);
folder_info = folder_info->next;
}
@@ -345,7 +350,9 @@ subscription_editor_subscribe_folder_done (CamelSubscribable *subscribable,
if (error == NULL)
tree_row_data->folder_info->flags |= CAMEL_FOLDER_SUBSCRIBED;
else {
- e_notice (GTK_WINDOW (context->editor), GTK_MESSAGE_ERROR, "%s", error->message);
+ e_notice (
+ GTK_WINDOW (context->editor),
+ GTK_MESSAGE_ERROR, "%s", error->message);
g_error_free (error);
tree_row_data_free (tree_row_data);
goto exit;
@@ -473,7 +480,9 @@ subscription_editor_unsubscribe_folder_done (CamelSubscribable *subscribable,
if (error == NULL)
tree_row_data->folder_info->flags &= ~CAMEL_FOLDER_SUBSCRIBED;
else {
- e_notice (GTK_WINDOW (context->editor), GTK_MESSAGE_ERROR, "%s", error->message);
+ e_notice (
+ GTK_WINDOW (context->editor),
+ GTK_MESSAGE_ERROR, "%s", error->message);
g_error_free (error);
tree_row_data_free (tree_row_data);
goto exit;
@@ -583,7 +592,8 @@ subscription_editor_create_menu_item (const gchar *label,
gtk_widget_show (item);
- g_signal_connect_swapped (item, "activate", activate_cb, editor);
+ g_signal_connect_swapped (
+ item, "activate", activate_cb, editor);
return item;
}
@@ -605,7 +615,8 @@ position_below_widget_cb (GtkMenu *menu,
gint monitor_num;
widget = under_widget;
- gtk_widget_get_preferred_size (GTK_WIDGET (menu), &menu_requisition, NULL);
+ gtk_widget_get_preferred_size (
+ GTK_WIDGET (menu), &menu_requisition, NULL);
window = gtk_widget_get_parent_window (widget);
screen = gtk_widget_get_screen (GTK_WIDGET (menu));
@@ -701,7 +712,9 @@ pick_all_cb (GtkTreeModel *model,
if (can_pick_folder_info (tree_row_data->folder_info, data->mode) &&
(data->skip_folder_infos == NULL ||
- !g_hash_table_lookup_extended (data->skip_folder_infos, tree_row_data->folder_info, NULL, NULL))) {
+ !g_hash_table_lookup_extended (
+ data->skip_folder_infos,
+ tree_row_data->folder_info, NULL, NULL))) {
g_queue_push_tail (data->out_tree_rows, tree_row_data);
} else
tree_row_data_free (tree_row_data);
@@ -765,7 +778,8 @@ subscription_editor_pick_shown (EMSubscriptionEditor *editor,
tree_row_data_free (tree_row_data);
}
- if (is_expanded && gtk_tree_model_iter_children (tree_model, &iter2, &iter)) {
+ if (is_expanded && gtk_tree_model_iter_children (
+ tree_model, &iter2, &iter)) {
iter = iter2;
found = TRUE;
} else {
@@ -774,9 +788,11 @@ subscription_editor_pick_shown (EMSubscriptionEditor *editor,
iter = iter2;
found = TRUE;
} else {
- while (found = gtk_tree_model_iter_parent (tree_model, &iter2, &iter), found) {
+ while (found = gtk_tree_model_iter_parent (
+ tree_model, &iter2, &iter), found) {
iter = iter2;
- if (gtk_tree_model_iter_next (tree_model, &iter2)) {
+ if (gtk_tree_model_iter_next (
+ tree_model, &iter2)) {
iter = iter2;
break;
}
diff --git a/mail/em-vfolder-rule.c b/mail/em-vfolder-rule.c
index 91bf46128e..c45f3d02e7 100644
--- a/mail/em-vfolder-rule.c
+++ b/mail/em-vfolder-rule.c
@@ -48,6 +48,10 @@
(G_TYPE_INSTANCE_GET_PRIVATE \
((obj), EM_TYPE_VFOLDER_RULE, EMVFolderRulePrivate))
+#define EM_VFOLDER_RULE_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), EM_TYPE_VFOLDER_RULE, EMVFolderRulePrivate))
+
struct _EMVFolderRulePrivate {
EMailSession *session;
};
@@ -627,23 +631,28 @@ source_remove (GtkWidget *widget,
gtk_tree_path_append_index (path, index);
if (gtk_tree_selection_path_is_selected (selection, path)) {
- gtk_tree_model_get_iter (GTK_TREE_MODEL (data->model), &iter, path);
+ gtk_tree_model_get_iter (
+ GTK_TREE_MODEL (data->model), &iter, path);
em_vfolder_rule_remove_source (data->vr, source);
gtk_list_store_remove (data->model, &iter);
gtk_tree_path_free (path);
/* now select the next rule */
- n = gtk_tree_model_iter_n_children (GTK_TREE_MODEL (data->model), NULL);
+ n = gtk_tree_model_iter_n_children (
+ GTK_TREE_MODEL (data->model), NULL);
index = index >= n ? n - 1 : index;
if (index >= 0) {
path = gtk_tree_path_new ();
gtk_tree_path_append_index (path, index);
- gtk_tree_model_get_iter (GTK_TREE_MODEL (data->model), &iter, path);
+ gtk_tree_model_get_iter (
+ GTK_TREE_MODEL (data->model),
+ &iter, path);
gtk_tree_path_free (path);
- gtk_tree_selection_select_iter (selection, &iter);
+ gtk_tree_selection_select_iter (
+ selection, &iter);
gtk_tree_model_get (
GTK_TREE_MODEL (data->model), &iter,
0, &data->current, -1);
@@ -693,7 +702,9 @@ get_widget (EFilterRule *fr,
for (i = 0; i < BUTTON_LAST; i++) {
data->buttons[i] =(GtkButton *)
e_builder_get_widget (builder, edit_buttons[i].name);
- g_signal_connect (data->buttons[i], "clicked", edit_buttons[i].func, data);
+ g_signal_connect (
+ data->buttons[i], "clicked",
+ edit_buttons[i].func, data);
}
object = gtk_builder_get_object (builder, "source_list");
@@ -715,7 +726,9 @@ get_widget (EFilterRule *fr,
g_free (markup);
}
- g_signal_connect (data->list, "cursor-changed", G_CALLBACK(select_source), data);
+ g_signal_connect (
+ data->list, "cursor-changed",
+ G_CALLBACK (select_source), data);
rb = (GtkRadioButton *)e_builder_get_widget (builder, "local_rb");
g_signal_connect (
diff --git a/mail/importers/elm-importer.c b/mail/importers/elm-importer.c
index 288d9fb736..bebcf97dd9 100644
--- a/mail/importers/elm-importer.c
+++ b/mail/importers/elm-importer.c
@@ -225,9 +225,11 @@ elm_import_done (struct _elm_import_msg *m)
if (m->base.error == NULL) {
GConfClient *gconf;
+ const gchar *key;
gconf = gconf_client_get_default ();
- gconf_client_set_bool(gconf, "/apps/evolution/importer/elm/mail", TRUE, NULL);
+ key = "/apps/evolution/importer/elm/mail";
+ gconf_client_set_bool (gconf, key, TRUE, NULL);
g_object_unref (gconf);
}
@@ -350,7 +352,9 @@ elm_getwidget (EImport *ei,
w = gtk_check_button_new_with_label(_("Mail"));
gtk_toggle_button_set_active ((GtkToggleButton *) w, !done_mail);
- g_signal_connect (w, "toggled", G_CALLBACK(checkbox_toggle_cb), target);
+ g_signal_connect (
+ w, "toggled",
+ G_CALLBACK (checkbox_toggle_cb), target);
gtk_box_pack_start ((GtkBox *) box, w, FALSE, FALSE, 0);
gtk_widget_show_all (box);
diff --git a/mail/importers/evolution-mbox-importer.c b/mail/importers/evolution-mbox-importer.c
index f6e5c63613..24a63c3af0 100644
--- a/mail/importers/evolution-mbox-importer.c
+++ b/mail/importers/evolution-mbox-importer.c
@@ -152,7 +152,9 @@ mbox_getwidget (EImport *ei,
EM_FOLDER_SELECTION_BUTTON (w), select_uri);
folder_selected (
EM_FOLDER_SELECTION_BUTTON (w), (EImportTargetURI *) target);
- g_signal_connect (w, "selected", G_CALLBACK(folder_selected), target);
+ g_signal_connect (
+ w, "selected",
+ G_CALLBACK (folder_selected), target);
gtk_box_pack_start ((GtkBox *) hbox, w, FALSE, TRUE, 6);
w = gtk_vbox_new (FALSE, 0);
diff --git a/mail/importers/pine-importer.c b/mail/importers/pine-importer.c
index 3ecfbbc5df..911cb69a99 100644
--- a/mail/importers/pine-importer.c
+++ b/mail/importers/pine-importer.c
@@ -459,12 +459,16 @@ pine_getwidget (EImport *ei,
w = gtk_check_button_new_with_label(_("Mail"));
gtk_toggle_button_set_active ((GtkToggleButton *) w, !done_mail);
- g_signal_connect (w, "toggled", G_CALLBACK(checkbox_mail_toggle_cb), target);
+ g_signal_connect (
+ w, "toggled",
+ G_CALLBACK (checkbox_mail_toggle_cb), target);
gtk_box_pack_start ((GtkBox *) box, w, FALSE, FALSE, 0);
w = gtk_check_button_new_with_label(_("Address Book"));
gtk_toggle_button_set_active ((GtkToggleButton *) w, !done_addr);
- g_signal_connect (w, "toggled", G_CALLBACK(checkbox_addr_toggle_cb), target);
+ g_signal_connect (
+ w, "toggled",
+ G_CALLBACK (checkbox_addr_toggle_cb), target);
gtk_box_pack_start ((GtkBox *) box, w, FALSE, FALSE, 0);
gtk_widget_show_all (box);
diff --git a/mail/mail-autofilter.c b/mail/mail-autofilter.c
index 1a6a7c831d..9a8671063a 100644
--- a/mail/mail-autofilter.c
+++ b/mail/mail-autofilter.c
@@ -402,7 +402,8 @@ filter_gui_add_from_message (EMailSession *session,
e_filter_rule_set_source (rule, source);
- e_rule_context_add_rule_gui ((ERuleContext *)fc, rule, _("Add Filter Rule"), user);
+ e_rule_context_add_rule_gui (
+ (ERuleContext *)fc, rule, _("Add Filter Rule"), user);
g_free (user);
g_object_unref (fc);
}
diff --git a/mail/mail-send-recv.c b/mail/mail-send-recv.c
index 266a740d87..9cfbb8661a 100644
--- a/mail/mail-send-recv.c
+++ b/mail/mail-send-recv.c
@@ -772,7 +772,9 @@ build_dialog (GtkWindow *parent,
if (parent != NULL)
gtk_widget_show (GTK_WIDGET (gd));
- g_signal_connect (gd, "response", G_CALLBACK (dialog_response), data);
+ g_signal_connect (
+ gd, "response",
+ G_CALLBACK (dialog_response), data);
g_object_weak_ref ((GObject *) gd, (GWeakNotify) dialog_destroy_cb, data);
diff --git a/mail/mail-vfolder.c b/mail/mail-vfolder.c
index 13f2c903d1..cc7407f4f8 100644
--- a/mail/mail-vfolder.c
+++ b/mail/mail-vfolder.c
@@ -719,7 +719,8 @@ rule_changed (EFilterRule *rule,
CAMEL_SESSION (session), E_MAIL_SESSION_VFOLDER_UID);
g_return_if_fail (CAMEL_IS_SERVICE (service));
- /* if the folder has changed name, then add it, then remove the old manually */
+ /* If the folder has changed name, then
+ * add it, then remove the old manually. */
if (strcmp (full_name, rule->name) != 0) {
gchar *oldname;
@@ -727,15 +728,18 @@ rule_changed (EFilterRule *rule,
gpointer oldfolder;
G_LOCK (vfolder);
- d(printf("Changing folder name in hash table to '%s'\n", rule->name));
- if (g_hash_table_lookup_extended (vfolder_hash, full_name, &key, &oldfolder)) {
+ if (g_hash_table_lookup_extended (
+ vfolder_hash, full_name, &key, &oldfolder)) {
g_hash_table_remove (vfolder_hash, key);
g_free (key);
- g_hash_table_insert (vfolder_hash, g_strdup (rule->name), folder);
+ g_hash_table_insert (
+ vfolder_hash, g_strdup (rule->name), folder);
G_UNLOCK (vfolder);
} else {
G_UNLOCK (vfolder);
- g_warning("couldn't find a vfolder rule in our table? %s", full_name);
+ g_warning (
+ "couldn't find a vfolder rule "
+ "in our table? %s", full_name);
}
oldname = g_strdup (full_name);
@@ -822,7 +826,9 @@ context_rule_added (ERuleContext *ctx,
folder = camel_store_get_folder_sync (
CAMEL_STORE (service), rule->name, 0, NULL, NULL);
if (folder) {
- g_signal_connect (rule, "changed", G_CALLBACK(rule_changed), folder);
+ g_signal_connect (
+ rule, "changed",
+ G_CALLBACK (rule_changed), folder);
G_LOCK (vfolder);
g_hash_table_insert (vfolder_hash, g_strdup (rule->name), folder);
@@ -943,7 +949,9 @@ store_folder_renamed_cb (CamelStore *store,
rule, G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA,
0, 0, NULL, rule_changed, folder);
e_filter_rule_set_name (rule, info->full_name);
- g_signal_connect (rule, "changed", G_CALLBACK(rule_changed), folder);
+ g_signal_connect (
+ rule, "changed",
+ G_CALLBACK (rule_changed), folder);
config_dir = mail_session_get_config_dir ();
user = g_build_filename (config_dir, "vfolders.xml", NULL);
@@ -1126,11 +1134,16 @@ vfolder_edit_response_cb (GtkWidget *dialog,
gpointer user_data)
{
if (response_id == GTK_RESPONSE_OK) {
- EFilterRule *rule = g_object_get_data (G_OBJECT (dialog), "vfolder-rule");
- EFilterRule *newrule = g_object_get_data (G_OBJECT (dialog), "vfolder-newrule");
+ GObject *object;
+ EFilterRule *rule;
+ EFilterRule *newrule;
const gchar *config_dir;
gchar *user;
+ object = G_OBJECT (dialog);
+ rule = g_object_get_data (object, "vfolder-rule");
+ newrule = g_object_get_data (object, "vfolder-newrule");
+
e_filter_rule_copy (rule, newrule);
config_dir = mail_session_get_config_dir ();
user = g_build_filename (config_dir, "vfolders.xml", NULL);
@@ -1198,10 +1211,16 @@ vfolder_edit_rule (EMailSession *session,
gtk_box_pack_start (GTK_BOX (container), widget, TRUE, TRUE, 0);
gtk_widget_show (widget);
- g_object_set_data_full (G_OBJECT (dialog), "vfolder-rule", rule, g_object_unref);
- g_object_set_data_full (G_OBJECT (dialog), "vfolder-newrule", newrule, g_object_unref);
+ g_object_set_data_full (
+ G_OBJECT (dialog), "vfolder-rule",
+ rule, (GDestroyNotify) g_object_unref);
+ g_object_set_data_full (
+ G_OBJECT (dialog), "vfolder-newrule",
+ newrule, (GDestroyNotify) g_object_unref);
- g_signal_connect (dialog, "response", G_CALLBACK (vfolder_edit_response_cb), NULL);
+ g_signal_connect (
+ dialog, "response",
+ G_CALLBACK (vfolder_edit_response_cb), NULL);
gtk_widget_show (dialog);
}
@@ -1300,10 +1319,16 @@ vfolder_gui_add_rule (EMVFolderRule *rule)
gtk_window_set_default_size (GTK_WINDOW (gd), 500, 500);
gtk_box_pack_start (GTK_BOX (container), w, TRUE, TRUE, 0);
gtk_widget_show ((GtkWidget *) gd);
- g_object_set_data_full(G_OBJECT(gd), "rule", rule, (GDestroyNotify)g_object_unref);
- g_signal_connect (rule, "changed", G_CALLBACK (new_rule_changed_cb), gd);
+ g_object_set_data_full (
+ G_OBJECT (gd), "rule", rule,
+ (GDestroyNotify) g_object_unref);
+ g_signal_connect (
+ rule, "changed",
+ G_CALLBACK (new_rule_changed_cb), gd);
new_rule_changed_cb ((EFilterRule *) rule, gd);
- g_signal_connect (gd, "response", G_CALLBACK(new_rule_clicked), NULL);
+ g_signal_connect (
+ gd, "response",
+ G_CALLBACK (new_rule_clicked), NULL);
gtk_widget_show ((GtkWidget *) gd);
}
diff --git a/mail/message-list.c b/mail/message-list.c
index fc35e3f47f..6e0e5f2064 100644
--- a/mail/message-list.c
+++ b/mail/message-list.c
@@ -2575,9 +2575,15 @@ message_list_init (MessageList *message_list)
gtk_selection_add_target (p->invisible, GDK_SELECTION_CLIPBOARD, matom, 0);
gtk_selection_add_target (p->invisible, GDK_SELECTION_CLIPBOARD, GDK_SELECTION_TYPE_STRING, 2);
- g_signal_connect (p->invisible, "selection_get", G_CALLBACK(ml_selection_get), message_list);
- g_signal_connect (p->invisible, "selection_clear_event", G_CALLBACK(ml_selection_clear_event), message_list);
- g_signal_connect (p->invisible, "selection_received", G_CALLBACK(ml_selection_received), message_list);
+ g_signal_connect (
+ p->invisible, "selection_get",
+ G_CALLBACK (ml_selection_get), message_list);
+ g_signal_connect (
+ p->invisible, "selection_clear_event",
+ G_CALLBACK (ml_selection_clear_event), message_list);
+ g_signal_connect (
+ p->invisible, "selection_received",
+ G_CALLBACK (ml_selection_received), message_list);
/* FIXME This is currently unused. */
target_list = gtk_target_list_new (NULL, 0);
diff --git a/modules/addressbook/addressbook-config.c b/modules/addressbook/addressbook-config.c
index 2d6a9255a6..52283ea523 100644
--- a/modules/addressbook/addressbook-config.c
+++ b/modules/addressbook/addressbook-config.c
@@ -416,7 +416,9 @@ query_for_supported_bases (GtkWidget *button,
supported_bases_table = e_builder_get_widget (builder, "supported-bases-table");
model = gtk_tree_view_get_model (GTK_TREE_VIEW (supported_bases_table));
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (supported_bases_table));
- g_signal_connect (selection, "changed", G_CALLBACK (search_base_selection_model_changed), dialog);
+ g_signal_connect (
+ selection, "changed",
+ G_CALLBACK (search_base_selection_model_changed), dialog);
search_base_selection_model_changed (selection, dialog);
if (do_ldap_root_dse_query (sdialog, GTK_LIST_STORE (model), sdialog->source)) {
@@ -546,7 +548,9 @@ eabc_general_type (EConfig *ec,
gtk_combo_box_set_model (dropdown, (GtkTreeModel *) store);
gtk_combo_box_set_active (dropdown, -1);
gtk_combo_box_set_active (dropdown, row);
- g_signal_connect (dropdown, "changed", G_CALLBACK(eabc_type_changed), sdialog);
+ g_signal_connect (
+ dropdown, "changed",
+ G_CALLBACK (eabc_type_changed), sdialog);
gtk_widget_show ((GtkWidget *) dropdown);
gtk_box_pack_start ((GtkBox *) w, (GtkWidget *) dropdown, TRUE, TRUE, 0);
gtk_label_set_mnemonic_widget ((GtkLabel *) label, (GtkWidget *) dropdown);
@@ -600,7 +604,9 @@ eabc_general_name (EConfig *ec,
gtk_box_pack_start ((GtkBox *) parent, w, FALSE, FALSE, 0);
sdialog->display_name = e_builder_get_widget (builder, "account-editor-display-name-entry");
- g_signal_connect (sdialog->display_name, "changed", G_CALLBACK(name_changed_cb), sdialog);
+ g_signal_connect (
+ sdialog->display_name, "changed",
+ G_CALLBACK (name_changed_cb), sdialog);
gtk_entry_set_text ((GtkEntry *) sdialog->display_name, e_source_peek_name (sdialog->source));
/* Hardcoded: groupwise can't edit the name (or anything else) */
@@ -652,7 +658,9 @@ eabc_general_use_in_cal (EConfig *ec,
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (use_in_cal_setting), (use_in_cal && g_str_equal (use_in_cal, "1")) || (!use_in_cal && base_uri && g_str_has_prefix (base_uri, "local:")));
- g_signal_connect (use_in_cal_setting, "toggled", G_CALLBACK (use_in_cal_changed_cb), sdialog);
+ g_signal_connect (
+ use_in_cal_setting, "toggled",
+ G_CALLBACK (use_in_cal_changed_cb), sdialog);
return use_in_cal_setting;
}
@@ -685,7 +693,9 @@ eabc_general_offline (EConfig *ec,
offline_setting = gtk_check_button_new_with_mnemonic (_("Copy _book content locally for offline operation"));
gtk_widget_show (offline_setting);
gtk_container_add (GTK_CONTAINER (parent), offline_setting);
- g_signal_connect (offline_setting, "toggled", G_CALLBACK (offline_status_changed_cb), sdialog);
+ g_signal_connect (
+ offline_setting, "toggled",
+ G_CALLBACK (offline_status_changed_cb), sdialog);
}
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (offline_setting), (offline_sync && g_str_equal (offline_sync, "1")) ? TRUE : FALSE);
@@ -793,14 +803,19 @@ eabc_general_host (EConfig *ec,
sdialog->host = e_builder_get_widget (builder, "server-name-entry");
gtk_entry_set_text((GtkEntry *)sdialog->host, lud && lud->lud_host ? lud->lud_host : "");
- g_signal_connect (sdialog->host, "changed", G_CALLBACK (host_changed_cb), sdialog);
+ g_signal_connect (
+ sdialog->host, "changed",
+ G_CALLBACK (host_changed_cb), sdialog);
sdialog->port_comboentry = e_builder_get_widget (builder, "port-comboentry");
gtk_widget_set_has_tooltip (sdialog->port_comboentry, TRUE);
gtk_widget_set_tooltip_text (sdialog->port_comboentry, _("This is the port on the LDAP server that Evolution will try to connect to. A list of standard ports has been provided. Ask your system administrator what port you should specify."));
sprintf(port, "%u", lud && lud->lud_port? lud->lud_port : LDAP_PORT);
gtk_entry_set_text (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (sdialog->port_comboentry))), port);
- g_signal_connect (gtk_bin_get_child (GTK_BIN (sdialog->port_comboentry)), "changed", G_CALLBACK (port_entry_changed_cb), sdialog);
+ g_signal_connect (
+ gtk_bin_get_child (
+ GTK_BIN (sdialog->port_comboentry)), "changed",
+ G_CALLBACK (port_entry_changed_cb), sdialog);
if (lud)
ldap_free_urldesc (lud);
@@ -812,7 +827,9 @@ eabc_general_host (EConfig *ec,
gtk_combo_box_set_active (GTK_COMBO_BOX (sdialog->ssl_combobox), sdialog->ssl);
gtk_widget_set_tooltip_text (sdialog->ssl_combobox, ldap_get_ssl_tooltip (sdialog->ssl));
gtk_widget_set_sensitive (sdialog->ssl_combobox, strcmp (port, LDAPS_PORT_STRING) != 0);
- g_signal_connect (sdialog->ssl_combobox, "changed", G_CALLBACK (ssl_combobox_changed_cb), sdialog);
+ g_signal_connect (
+ sdialog->ssl_combobox, "changed",
+ G_CALLBACK (ssl_combobox_changed_cb), sdialog);
g_object_unref (builder);
@@ -882,7 +899,9 @@ eabc_general_auth (EConfig *ec,
tmp = e_source_get_property(sdialog->source, "auth");
sdialog->auth = tmp ? ldap_parse_auth (tmp) : ADDRESSBOOK_LDAP_AUTH_NONE;
gtk_combo_box_set_active (GTK_COMBO_BOX (sdialog->auth_combobox), sdialog->auth);
- g_signal_connect (sdialog->auth_combobox, "changed", G_CALLBACK(auth_combobox_changed_cb), sdialog);
+ g_signal_connect (
+ sdialog->auth_combobox, "changed",
+ G_CALLBACK (auth_combobox_changed_cb), sdialog);
sdialog->auth_principal = e_builder_get_widget (builder, "auth-entry");
switch (sdialog->auth) {
@@ -898,7 +917,9 @@ eabc_general_auth (EConfig *ec,
break;
}
gtk_entry_set_text((GtkEntry *)sdialog->auth_principal, tmp?tmp:"");
- g_signal_connect (sdialog->auth_principal, "changed", G_CALLBACK (auth_entry_changed_cb), sdialog);
+ g_signal_connect (
+ sdialog->auth_principal, "changed",
+ G_CALLBACK (auth_entry_changed_cb), sdialog);
g_object_unref (builder);
@@ -957,7 +978,9 @@ eabc_details_search (EConfig *ec,
sdialog->rootdn = e_builder_get_widget (builder, "rootdn-entry");
gtk_entry_set_text((GtkEntry *)sdialog->rootdn, lud && lud->lud_dn ? lud->lud_dn : "");
- g_signal_connect (sdialog->rootdn, "changed", G_CALLBACK (rootdn_changed_cb), sdialog);
+ g_signal_connect (
+ sdialog->rootdn, "changed",
+ G_CALLBACK (rootdn_changed_cb), sdialog);
sdialog->scope_combobox = e_builder_get_widget (builder, "scope-combobox");
gtk_widget_set_has_tooltip (sdialog->scope_combobox, TRUE);
@@ -977,14 +1000,19 @@ eabc_details_search (EConfig *ec,
}
}
gtk_combo_box_set_active (GTK_COMBO_BOX (sdialog->scope_combobox), sdialog->scope);
- g_signal_connect (sdialog->scope_combobox, "changed", G_CALLBACK(scope_combobox_changed_cb), sdialog);
+ g_signal_connect (
+ sdialog->scope_combobox, "changed",
+ G_CALLBACK (scope_combobox_changed_cb), sdialog);
sdialog->search_filter = e_builder_get_widget (builder, "search-filter-entry");
gtk_entry_set_text((GtkEntry *)sdialog->search_filter, lud && lud->lud_filter ? lud->lud_filter : "");
- g_signal_connect (sdialog->search_filter, "changed", G_CALLBACK (search_filter_changed_cb), sdialog);
+ g_signal_connect (
+ sdialog->search_filter, "changed",
+ G_CALLBACK (search_filter_changed_cb), sdialog);
- g_signal_connect (e_builder_get_widget(builder, "rootdn-button"), "clicked",
- G_CALLBACK (query_for_supported_bases), sdialog);
+ g_signal_connect (
+ e_builder_get_widget (builder, "rootdn-button"), "clicked",
+ G_CALLBACK (query_for_supported_bases), sdialog);
if (lud)
ldap_free_urldesc (lud);
@@ -1065,11 +1093,15 @@ eabc_details_limit (EConfig *ec,
sdialog->limit_spinbutton = e_builder_get_widget (builder, "download-limit-spinbutton");
tmp = e_source_get_property(sdialog->source, "limit");
gtk_spin_button_set_value ((GtkSpinButton *) sdialog->limit_spinbutton, tmp ? g_strtod (tmp, NULL) : 100.0);
- g_signal_connect (sdialog->limit_spinbutton, "value_changed", G_CALLBACK (limit_changed_cb), sdialog);
+ g_signal_connect (
+ sdialog->limit_spinbutton, "value_changed",
+ G_CALLBACK (limit_changed_cb), sdialog);
sdialog->canbrowsecheck = e_builder_get_widget (builder, "canbrowsecheck");
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (sdialog->canbrowsecheck), e_source_get_property (sdialog->source, "can-browse") && strcmp (e_source_get_property (sdialog->source, "can-browse"), "1") == 0);
- g_signal_connect (sdialog->canbrowsecheck, "toggled", G_CALLBACK (canbrowse_toggled_cb), sdialog->source);
+ g_signal_connect (
+ sdialog->canbrowsecheck, "toggled",
+ G_CALLBACK (canbrowse_toggled_cb), sdialog->source);
g_object_unref (builder);
@@ -1288,7 +1320,9 @@ addressbook_config_edit_source (GtkWidget *parent,
xml = e_source_to_standalone_xml (sdialog->source);
printf("but working standalone xml: %s\n", xml);
g_free (xml);
- g_signal_connect (sdialog->source, "changed", source_changed, sdialog);
+ g_signal_connect (
+ sdialog->source, "changed",
+ source_changed, sdialog);
#endif
sdialog->config = ec = eab_config_new(E_CONFIG_BOOK, "com.novell.evolution.addressbook.config.accountEditor");
diff --git a/modules/calendar/e-cal-attachment-handler.c b/modules/calendar/e-cal-attachment-handler.c
index 24a73f6d1a..604bc737da 100644
--- a/modules/calendar/e-cal-attachment-handler.c
+++ b/modules/calendar/e-cal-attachment-handler.c
@@ -32,6 +32,10 @@
#include <libedataserverui/e-source-selector.h>
#include <libedataserverui/e-client-utils.h>
+#define E_CAL_ATTACHMENT_HANDLER_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_CAL_ATTACHMENT_HANDLER, ECalAttachmentHandlerPrivate))
+
typedef struct _ImportContext ImportContext;
struct _ECalAttachmentHandlerPrivate {
@@ -533,9 +537,7 @@ cal_attachment_handler_class_init (ECalAttachmentHandlerClass *class)
static void
cal_attachment_handler_init (ECalAttachmentHandler *handler)
{
- handler->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- handler, E_TYPE_CAL_ATTACHMENT_HANDLER,
- ECalAttachmentHandlerPrivate);
+ handler->priv = E_CAL_ATTACHMENT_HANDLER_GET_PRIVATE (handler);
}
GType
diff --git a/modules/calendar/e-cal-shell-backend.c b/modules/calendar/e-cal-shell-backend.c
index f9400707a2..d538e9bd74 100644
--- a/modules/calendar/e-cal-shell-backend.c
+++ b/modules/calendar/e-cal-shell-backend.c
@@ -379,7 +379,9 @@ action_event_new_cb (GtkAction *action,
view = gnome_calendar_get_calendar_view (gcal, view_type);
if (view) {
- g_object_set (G_OBJECT (shell_backend), "prefer-new-item", action_name, NULL);
+ g_object_set (
+ G_OBJECT (shell_backend),
+ "prefer-new-item", action_name, NULL);
e_calendar_view_new_appointment_full (
view,
diff --git a/modules/calendar/e-cal-shell-settings.c b/modules/calendar/e-cal-shell-settings.c
index 0c77063f46..392bb841cb 100644
--- a/modules/calendar/e-cal-shell-settings.c
+++ b/modules/calendar/e-cal-shell-settings.c
@@ -82,7 +82,8 @@ transform_icaltimezone_to_string (GBinding *binding,
shell_settings, "cal-use-system-timezone");
if (use_system_timezone) {
- location_str = e_shell_settings_get_string (shell_settings, "cal-timezone-string");
+ location_str = e_shell_settings_get_string (
+ shell_settings, "cal-timezone-string");
location = location_str;
} else {
timezone = g_value_get_pointer (source_value);
diff --git a/modules/calendar/e-calendar-preferences.c b/modules/calendar/e-calendar-preferences.c
index 55a91acd70..6df9b8bde3 100644
--- a/modules/calendar/e-calendar-preferences.c
+++ b/modules/calendar/e-calendar-preferences.c
@@ -233,7 +233,9 @@ day_second_zone_clicked (GtkWidget *widget,
if (!second_zone)
gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), TRUE);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
- g_signal_connect (item, "toggled", G_CALLBACK (on_set_day_second_zone), prefs);
+ g_signal_connect (
+ item, "toggled",
+ G_CALLBACK (on_set_day_second_zone), prefs);
recent_zones = calendar_config_get_day_second_zones ();
for (s = recent_zones; s != NULL; s = s->next) {
@@ -248,7 +250,9 @@ day_second_zone_clicked (GtkWidget *widget,
gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), TRUE);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
g_object_set_data_full (G_OBJECT (item), "timezone", g_strdup (s->data), g_free);
- g_signal_connect (item, "toggled", G_CALLBACK (on_set_day_second_zone), prefs);
+ g_signal_connect (
+ item, "toggled",
+ G_CALLBACK (on_set_day_second_zone), prefs);
}
calendar_config_free_day_second_zones (recent_zones);
@@ -256,7 +260,9 @@ day_second_zone_clicked (GtkWidget *widget,
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
item = gtk_menu_item_new_with_label (_("Select..."));
- g_signal_connect (item, "activate", G_CALLBACK (on_select_day_second_zone), prefs);
+ g_signal_connect (
+ item, "activate",
+ G_CALLBACK (on_select_day_second_zone), prefs);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
gtk_widget_show_all (menu);
diff --git a/modules/calendar/e-memo-shell-backend.c b/modules/calendar/e-memo-shell-backend.c
index 93d2084885..2bdd3ef8ed 100644
--- a/modules/calendar/e-memo-shell-backend.c
+++ b/modules/calendar/e-memo-shell-backend.c
@@ -45,6 +45,10 @@
#include "e-memo-shell-migrate.h"
#include "e-memo-shell-view.h"
+#define E_MEMO_SHELL_BACKEND_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_MEMO_SHELL_BACKEND, EMemoShellBackendPrivate))
+
#define WEB_BASE_URI "webcal://"
#define PERSONAL_RELATIVE_URI "system"
diff --git a/modules/calendar/e-memo-shell-migrate.c b/modules/calendar/e-memo-shell-migrate.c
index 171428f408..64b5263008 100644
--- a/modules/calendar/e-memo-shell-migrate.c
+++ b/modules/calendar/e-memo-shell-migrate.c
@@ -67,9 +67,11 @@ create_memo_sources (EShellBackend *shell_backend,
if (groups) {
/* groups are already there, we need to search for things... */
GSList *g;
+ const gchar *data_dir;
gchar *base_dir, *base_uri;
- base_dir = g_build_filename (e_shell_backend_get_data_dir (shell_backend), "local", NULL);
+ data_dir = e_shell_backend_get_data_dir (shell_backend);
+ base_dir = g_build_filename (data_dir, "local", NULL);
base_uri = g_filename_to_uri (base_dir, NULL, NULL);
for (g = groups; g; g = g->next) {
diff --git a/modules/calendar/e-task-shell-view-private.c b/modules/calendar/e-task-shell-view-private.c
index 916494757d..560ce01940 100644
--- a/modules/calendar/e-task-shell-view-private.c
+++ b/modules/calendar/e-task-shell-view-private.c
@@ -47,9 +47,8 @@ task_shell_view_model_row_appended_cb (ETaskShellView *task_shell_view,
}
static gboolean
-task_shell_view_process_completed_tasks (gpointer user_data)
+task_shell_view_process_completed_tasks (ETaskShellView *task_shell_view)
{
- ETaskShellView *task_shell_view = user_data;
ETaskShellContent *task_shell_content;
ETaskShellSidebar *task_shell_sidebar;
ETaskTable *task_table;
@@ -77,11 +76,18 @@ task_shell_view_process_completed_tasks (gpointer user_data)
static void
task_shell_view_schedule_process_completed_tasks (ETaskShellView *task_shell_view)
{
- if (task_shell_view->priv->update_completed_timeout)
- g_source_remove (task_shell_view->priv->update_completed_timeout);
+ guint source_id;
- task_shell_view->priv->update_completed_timeout =
- g_timeout_add_seconds (1, task_shell_view_process_completed_tasks, task_shell_view);
+ source_id = task_shell_view->priv->update_completed_timeout;
+
+ if (source_id > 0)
+ g_source_remove (source_id);
+
+ source_id = g_timeout_add_seconds (
+ 1, (GSourceFunc) task_shell_view_process_completed_tasks,
+ task_shell_view);
+
+ task_shell_view->priv->update_completed_timeout = source_id;
}
static void
diff --git a/modules/mail/e-mail-attachment-handler.c b/modules/mail/e-mail-attachment-handler.c
index 0c00279028..69d8898fc8 100644
--- a/modules/mail/e-mail-attachment-handler.c
+++ b/modules/mail/e-mail-attachment-handler.c
@@ -31,6 +31,10 @@
#include "mail/e-mail-backend.h"
#include "mail/em-composer-utils.h"
+#define E_MAIL_ATTACHMENT_HANDLER_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_MAIL_ATTACHMENT_HANDLER, EMailAttachmentHandlerPrivate))
+
struct _EMailAttachmentHandlerPrivate {
EShell *shell;
EMailSession *session;
@@ -71,7 +75,7 @@ mail_attachment_handler_forward (GtkAction *action,
GList *selected;
view = e_attachment_handler_get_view (handler);
- priv = E_MAIL_ATTACHMENT_HANDLER (handler)->priv;
+ priv = E_MAIL_ATTACHMENT_HANDLER_GET_PRIVATE (handler);
selected = e_attachment_view_get_selected_attachments (view);
g_return_if_fail (g_list_length (selected) == 1);
@@ -106,7 +110,7 @@ mail_attachment_handler_reply_all (GtkAction *action,
GList *selected;
view = e_attachment_handler_get_view (handler);
- priv = E_MAIL_ATTACHMENT_HANDLER (handler)->priv;
+ priv = E_MAIL_ATTACHMENT_HANDLER_GET_PRIVATE (handler);
selected = e_attachment_view_get_selected_attachments (view);
g_return_if_fail (g_list_length (selected) == 1);
@@ -142,7 +146,7 @@ mail_attachment_handler_reply_sender (GtkAction *action,
GList *selected;
view = e_attachment_handler_get_view (handler);
- priv = E_MAIL_ATTACHMENT_HANDLER (handler)->priv;
+ priv = E_MAIL_ATTACHMENT_HANDLER_GET_PRIVATE (handler);
selected = e_attachment_view_get_selected_attachments (view);
g_return_if_fail (g_list_length (selected) == 1);
@@ -286,7 +290,7 @@ mail_attachment_handler_x_uid_list (EAttachmentView *view,
return;
store = e_attachment_view_get_store (view);
- priv = E_MAIL_ATTACHMENT_HANDLER (handler)->priv;
+ priv = E_MAIL_ATTACHMENT_HANDLER_GET_PRIVATE (handler);
parent = gtk_widget_get_toplevel (GTK_WIDGET (view));
parent = gtk_widget_is_toplevel (parent) ? parent : NULL;
@@ -461,7 +465,7 @@ mail_attachment_handler_dispose (GObject *object)
{
EMailAttachmentHandlerPrivate *priv;
- priv = E_MAIL_ATTACHMENT_HANDLER (object)->priv;
+ priv = E_MAIL_ATTACHMENT_HANDLER_GET_PRIVATE (object);
if (priv->shell != NULL) {
g_object_unref (priv->shell);
@@ -491,7 +495,7 @@ mail_attachment_handler_constructed (GObject *object)
GError *error = NULL;
handler = E_ATTACHMENT_HANDLER (object);
- priv = E_MAIL_ATTACHMENT_HANDLER (object)->priv;
+ priv = E_MAIL_ATTACHMENT_HANDLER_GET_PRIVATE (object);
/* Chain up to parent's constructed() method. */
G_OBJECT_CLASS (parent_class)->constructed (object);
@@ -571,9 +575,7 @@ mail_attachment_handler_class_init (EMailAttachmentHandlerClass *class)
static void
mail_attachment_handler_init (EMailAttachmentHandler *handler)
{
- handler->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- handler, E_TYPE_MAIL_ATTACHMENT_HANDLER,
- EMailAttachmentHandlerPrivate);
+ handler->priv = E_MAIL_ATTACHMENT_HANDLER_GET_PRIVATE (handler);
}
GType
diff --git a/modules/mail/e-mail-config-web-view.c b/modules/mail/e-mail-config-web-view.c
index 8f838b3295..80f3f65c0f 100644
--- a/modules/mail/e-mail-config-web-view.c
+++ b/modules/mail/e-mail-config-web-view.c
@@ -73,6 +73,8 @@ mail_config_web_view_load_style (EMailConfigWebView *extension)
gchar *variable_font;
gboolean custom_fonts;
gboolean mark_citations;
+ EExtensible *extensible;
+ GtkStyleContext *style_context;
GError *error = NULL;
/* Some of our mail and composer preferences are passed down to
@@ -138,8 +140,9 @@ mail_config_web_view_load_style (EMailConfigWebView *extension)
g_free (citation_color);
g_free (spell_color);
- gtk_style_context_invalidate (
- gtk_widget_get_style_context (GTK_WIDGET (e_extension_get_extensible (E_EXTENSION (extension)))));
+ extensible = e_extension_get_extensible (E_EXTENSION (extension));
+ style_context = gtk_widget_get_style_context (GTK_WIDGET (extensible));
+ gtk_style_context_invalidate (style_context);
}
static void
diff --git a/modules/mail/e-mail-shell-backend.c b/modules/mail/e-mail-shell-backend.c
index 2012b25660..79832ab499 100644
--- a/modules/mail/e-mail-shell-backend.c
+++ b/modules/mail/e-mail-shell-backend.c
@@ -70,6 +70,10 @@
(G_TYPE_INSTANCE_GET_PRIVATE \
((obj), E_TYPE_MAIL_SHELL_BACKEND, EMailShellBackendPrivate))
+#define E_MAIL_SHELL_BACKEND_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_MAIL_SHELL_BACKEND, EMailShellBackendPrivate))
+
#define BACKEND_NAME "mail"
struct _EMailShellBackendPrivate {
@@ -687,7 +691,7 @@ e_mail_shell_backend_type_register (GTypeModule *type_module)
void
e_mail_shell_backend_new_account (EMailShellBackend *mail_shell_backend,
- GtkWindow *parent)
+ GtkWindow *parent)
{
EMailShellBackendPrivate *priv;
@@ -735,8 +739,8 @@ e_mail_shell_backend_new_account (EMailShellBackend *mail_shell_backend,
void
e_mail_shell_backend_edit_account (EMailShellBackend *mail_shell_backend,
- GtkWindow *parent,
- EAccount *account)
+ GtkWindow *parent,
+ EAccount *account)
{
EMailShellBackendPrivate *priv;
EMAccountEditor *emae;
diff --git a/modules/mail/e-mail-shell-view-actions.c b/modules/mail/e-mail-shell-view-actions.c
index c5c51a715a..b39d22d13d 100644
--- a/modules/mail/e-mail-shell-view-actions.c
+++ b/modules/mail/e-mail-shell-view-actions.c
@@ -115,7 +115,7 @@ action_mail_account_disable_cb (GtkAction *action,
static void
action_mail_account_properties_cb (GtkAction *action,
- EMailShellView *mail_shell_view)
+ EMailShellView *mail_shell_view)
{
EMailShellSidebar *mail_shell_sidebar;
EShellView *shell_view;
diff --git a/modules/mail/e-mail-shell-view-private.c b/modules/mail/e-mail-shell-view-private.c
index f43734f175..8838f1a1ae 100644
--- a/modules/mail/e-mail-shell-view-private.c
+++ b/modules/mail/e-mail-shell-view-private.c
@@ -1516,7 +1516,7 @@ e_mail_shell_view_update_send_receive_menus (EMailShellView *mail_shell_view)
g_return_if_fail (E_IS_MAIL_SHELL_VIEW (mail_shell_view));
- priv = mail_shell_view->priv;
+ priv = E_MAIL_SHELL_VIEW_GET_PRIVATE (mail_shell_view);
shell_view = E_SHELL_VIEW (mail_shell_view);
shell_window = e_shell_view_get_shell_window (shell_view);
diff --git a/modules/mail/em-account-prefs.c b/modules/mail/em-account-prefs.c
index 08434d1a20..516b28aa8f 100644
--- a/modules/mail/em-account-prefs.c
+++ b/modules/mail/em-account-prefs.c
@@ -53,6 +53,10 @@
(G_TYPE_INSTANCE_GET_PRIVATE \
((obj), EM_TYPE_ACCOUNT_PREFS, EMAccountPrefsPrivate))
+#define EM_ACCOUNT_PREFS_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), EM_TYPE_ACCOUNT_PREFS, EMAccountPrefsPrivate))
+
struct _EMAccountPrefsPrivate {
EMailBackend *backend;
};
@@ -173,7 +177,8 @@ account_prefs_add_account (EMailAccountManager *manager)
parent = gtk_widget_get_toplevel (GTK_WIDGET (manager));
parent = gtk_widget_is_toplevel (parent) ? parent : NULL;
- e_mail_shell_backend_new_account (E_MAIL_SHELL_BACKEND (priv->backend), parent);
+ e_mail_shell_backend_new_account (
+ E_MAIL_SHELL_BACKEND (priv->backend), parent);
}
static void
@@ -188,7 +193,8 @@ account_prefs_edit_account (EMailAccountManager *manager,
parent = gtk_widget_get_toplevel (GTK_WIDGET (manager));
parent = gtk_widget_is_toplevel (parent) ? parent : NULL;
- e_mail_shell_backend_edit_account (E_MAIL_SHELL_BACKEND (priv->backend), parent, account);
+ e_mail_shell_backend_edit_account (
+ E_MAIL_SHELL_BACKEND (priv->backend), parent, account);
}
static void
diff --git a/modules/mail/em-mailer-prefs.c b/modules/mail/em-mailer-prefs.c
index 1e7e672f1f..3f5e371296 100644
--- a/modules/mail/em-mailer-prefs.c
+++ b/modules/mail/em-mailer-prefs.c
@@ -194,10 +194,12 @@ jh_add_cb (GtkWidget *widget,
jh_dialog_entry_changed_cb (NULL, builder);
entry = e_builder_get_widget (builder, "junk-header-name");
- g_signal_connect (entry, "changed",
+ g_signal_connect (
+ entry, "changed",
G_CALLBACK (jh_dialog_entry_changed_cb), builder);
entry = e_builder_get_widget (builder, "junk-header-content");
- g_signal_connect (entry, "changed",
+ g_signal_connect (
+ entry, "changed",
G_CALLBACK (jh_dialog_entry_changed_cb), builder);
if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT) {
@@ -534,7 +536,8 @@ toggle_button_init (EMMailerPrefs *prefs,
if (toggled) {
g_object_set_data ((GObject *) toggle, "key", (gpointer) key);
- g_signal_connect (toggle, "toggled", toggled, prefs);
+ g_signal_connect (
+ toggle, "toggled", toggled, prefs);
}
if (!g_settings_is_writable (prefs->settings, key))
@@ -886,9 +889,15 @@ em_mailer_prefs_construct (EMMailerPrefs *prefs,
if (locked)
gtk_widget_set_sensitive ((GtkWidget *) prefs->images_always, FALSE);
- g_signal_connect (prefs->images_never, "toggled", G_CALLBACK (http_images_changed), prefs);
- g_signal_connect (prefs->images_sometimes, "toggled", G_CALLBACK (http_images_changed), prefs);
- g_signal_connect (prefs->images_always, "toggled", G_CALLBACK (http_images_changed), prefs);
+ g_signal_connect (
+ prefs->images_never, "toggled",
+ G_CALLBACK (http_images_changed), prefs);
+ g_signal_connect (
+ prefs->images_sometimes, "toggled",
+ G_CALLBACK (http_images_changed), prefs);
+ g_signal_connect (
+ prefs->images_always, "toggled",
+ G_CALLBACK (http_images_changed), prefs);
widget = e_builder_get_widget (prefs->builder, "chkShowAnimatedImages");
g_object_bind_property (
@@ -951,18 +960,30 @@ em_mailer_prefs_construct (EMMailerPrefs *prefs,
gtk_widget_set_sensitive ((GtkWidget *) prefs->header_list, !locked);
selection = gtk_tree_view_get_selection (prefs->header_list);
- g_signal_connect (selection, "changed", G_CALLBACK (emmp_header_list_row_selected), prefs);
- g_signal_connect (prefs->entry_header, "changed", G_CALLBACK (emmp_header_entry_changed), prefs);
- g_signal_connect (prefs->entry_header, "activate", G_CALLBACK (emmp_header_add_header), prefs);
+ g_signal_connect (
+ selection, "changed",
+ G_CALLBACK (emmp_header_list_row_selected), prefs);
+ g_signal_connect (
+ prefs->entry_header, "changed",
+ G_CALLBACK (emmp_header_entry_changed), prefs);
+ g_signal_connect (
+ prefs->entry_header,
+ "activate", G_CALLBACK (emmp_header_add_header), prefs);
/* initialise the tree with appropriate headings */
prefs->header_list_store = gtk_list_store_newv (HEADER_LIST_N_COLUMNS, col_types);
- g_signal_connect (prefs->add_header, "clicked", G_CALLBACK (emmp_header_add_header), prefs);
- g_signal_connect (prefs->remove_header, "clicked", G_CALLBACK (emmp_header_remove_header), prefs);
+ g_signal_connect (
+ prefs->add_header, "clicked",
+ G_CALLBACK (emmp_header_add_header), prefs);
+ g_signal_connect (
+ prefs->remove_header, "clicked",
+ G_CALLBACK (emmp_header_remove_header), prefs);
gtk_tree_view_set_model (prefs->header_list, GTK_TREE_MODEL (prefs->header_list_store));
renderer = gtk_cell_renderer_toggle_new ();
g_object_set (renderer, "activatable", TRUE, NULL);
- g_signal_connect (renderer, "toggled", G_CALLBACK (emmp_header_list_enabled_toggled), prefs);
+ g_signal_connect (
+ renderer, "toggled",
+ G_CALLBACK (emmp_header_list_enabled_toggled), prefs);
gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (prefs->header_list), -1,
"Enabled", renderer,
"active", HEADER_LIST_ENABLED_COLUMN,
diff --git a/modules/mail/em-network-prefs.c b/modules/mail/em-network-prefs.c
index b52c006ab8..3a7b335191 100644
--- a/modules/mail/em-network-prefs.c
+++ b/modules/mail/em-network-prefs.c
@@ -90,7 +90,9 @@ toggle_button_init (EMNetworkPrefs *prefs,
gtk_toggle_button_set_active (toggle, bval);
SET_KEY_NAME (toggle, key);
- g_signal_connect (toggle, "toggled", G_CALLBACK (toggle_button_toggled), prefs);
+ g_signal_connect (
+ toggle, "toggled",
+ G_CALLBACK (toggle_button_toggled), prefs);
if (!g_settings_is_writable (prefs->proxy_settings, key))
gtk_widget_set_sensitive ((GtkWidget *) toggle, FALSE);
@@ -368,7 +370,9 @@ em_network_prefs_construct (EMNetworkPrefs *prefs)
gtk_toggle_button_set_active (prefs->auto_proxy, val == NETWORK_PROXY_AUTOCONFIG);
SET_KEY_NAME (prefs->auto_proxy_url, "autoconfig-url");
- g_signal_connect (prefs->auto_proxy_url, "changed", G_CALLBACK(widget_entry_changed_cb), prefs->proxy_settings);
+ g_signal_connect (
+ prefs->auto_proxy_url, "changed",
+ G_CALLBACK (widget_entry_changed_cb), prefs->proxy_settings);
if (locked)
gtk_widget_set_sensitive ((GtkWidget *) prefs->auto_proxy, FALSE);
#endif
@@ -399,49 +403,66 @@ em_network_prefs_construct (EMNetworkPrefs *prefs)
/* Manual proxy options */
SET_KEY_NAME (prefs->http_host, "http-host");
- g_signal_connect (prefs->http_host, "changed",
- G_CALLBACK (widget_entry_changed_cb),
- prefs->proxy_settings);
+ g_signal_connect (
+ prefs->http_host, "changed",
+ G_CALLBACK (widget_entry_changed_cb),
+ prefs->proxy_settings);
SET_KEY_NAME (prefs->https_host, "secure-host");
- g_signal_connect (prefs->https_host, "changed",
- G_CALLBACK (widget_entry_changed_cb),
- prefs->proxy_settings);
+ g_signal_connect (
+ prefs->https_host, "changed",
+ G_CALLBACK (widget_entry_changed_cb),
+ prefs->proxy_settings);
SET_KEY_NAME (prefs->ignore_hosts, "ignore-hosts");
- g_signal_connect (prefs->ignore_hosts, "changed",
- G_CALLBACK (ignore_hosts_entry_changed_cb),
- prefs->proxy_settings);
+ g_signal_connect (
+ prefs->ignore_hosts, "changed",
+ G_CALLBACK (ignore_hosts_entry_changed_cb),
+ prefs->proxy_settings);
SET_KEY_NAME (prefs->http_port, "http-port");
- g_signal_connect (prefs->http_port, "value_changed",
- G_CALLBACK (widget_entry_changed_cb),
- prefs->proxy_settings);
+ g_signal_connect (
+ prefs->http_port, "value_changed",
+ G_CALLBACK (widget_entry_changed_cb),
+ prefs->proxy_settings);
SET_KEY_NAME (prefs->https_port, "secure-port");
- g_signal_connect (prefs->https_port, "value_changed",
- G_CALLBACK (widget_entry_changed_cb),
- prefs->proxy_settings);
+ g_signal_connect (
+ prefs->https_port, "value_changed",
+ G_CALLBACK (widget_entry_changed_cb),
+ prefs->proxy_settings);
SET_KEY_NAME (prefs->socks_host, "socks-host");
- g_signal_connect (prefs->socks_host, "changed",
- G_CALLBACK (widget_entry_changed_cb),
- prefs->proxy_settings);
+ g_signal_connect (
+ prefs->socks_host, "changed",
+ G_CALLBACK (widget_entry_changed_cb),
+ prefs->proxy_settings);
SET_KEY_NAME (prefs->socks_port, "socks-port");
- g_signal_connect (prefs->socks_port, "value_changed",
- G_CALLBACK (widget_entry_changed_cb),
- prefs->proxy_settings);
+ g_signal_connect (
+ prefs->socks_port, "value_changed",
+ G_CALLBACK (widget_entry_changed_cb),
+ prefs->proxy_settings);
SET_KEY_NAME (prefs->auth_user, "authentication-user");
- g_signal_connect (prefs->auth_user, "changed",
- G_CALLBACK (widget_entry_changed_cb),
- prefs->proxy_settings);
+ g_signal_connect (
+ prefs->auth_user, "changed",
+ G_CALLBACK (widget_entry_changed_cb),
+ prefs->proxy_settings);
SET_KEY_NAME (prefs->auth_pwd, "authentication-password");
- g_signal_connect (prefs->auth_pwd, "changed",
- G_CALLBACK (widget_entry_changed_cb),
- prefs->proxy_settings);
+ g_signal_connect (
+ prefs->auth_pwd, "changed",
+ G_CALLBACK (widget_entry_changed_cb),
+ prefs->proxy_settings);
gtk_toggle_button_set_active (prefs->manual_proxy, val == NETWORK_PROXY_MANUAL);
- g_signal_connect (prefs->sys_proxy, "toggled", G_CALLBACK (notify_proxy_type_changed), prefs);
- g_signal_connect (prefs->no_proxy, "toggled", G_CALLBACK (notify_proxy_type_changed), prefs);
+ g_signal_connect (
+ prefs->sys_proxy, "toggled",
+ G_CALLBACK (notify_proxy_type_changed), prefs);
+ g_signal_connect (
+ prefs->no_proxy, "toggled",
+ G_CALLBACK (notify_proxy_type_changed), prefs);
#if 0
- g_signal_connect (prefs->auto_proxy, "toggled", G_CALLBACK (notify_proxy_type_changed), prefs);
+ g_signal_connect (
+ prefs->auto_proxy, "toggled",
+ G_CALLBACK (notify_proxy_type_changed), prefs);
#endif
- g_signal_connect (prefs->manual_proxy, "toggled", G_CALLBACK (notify_proxy_type_changed), prefs);
+ g_signal_connect (
+ prefs->manual_proxy, "toggled",
+ G_CALLBACK (notify_proxy_type_changed), prefs);
if (locked)
gtk_widget_set_sensitive ((GtkWidget *) prefs->manual_proxy, FALSE);
diff --git a/modules/plugin-lib/e-plugin-lib.c b/modules/plugin-lib/e-plugin-lib.c
index 8ca0fed570..82c8be58fc 100644
--- a/modules/plugin-lib/e-plugin-lib.c
+++ b/modules/plugin-lib/e-plugin-lib.c
@@ -117,7 +117,9 @@ plugin_lib_invoke (EPlugin *plugin,
EPluginLibFunc func;
if (!plugin->enabled) {
- g_warning ("trying to invoke '%s' on disabled plugin '%s'", name, plugin->id);
+ g_warning (
+ "Trying to invoke '%s' on disabled plugin '%s'",
+ name, plugin->id);
return NULL;
}
diff --git a/modules/plugin-mono/e-plugin-mono.c b/modules/plugin-mono/e-plugin-mono.c
index 1c4113504d..2179e95195 100644
--- a/modules/plugin-mono/e-plugin-mono.c
+++ b/modules/plugin-mono/e-plugin-mono.c
@@ -38,6 +38,10 @@
#include <mono/metadata/mono-config.h>
#include <mono/jit/jit.h>
+#define E_PLUGIN_MONO_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_PLUGIN_MONO, EPluginMonoPrivate))
+
struct _EPluginMonoPrivate {
MonoAssembly *assembly;
MonoClass *class;
@@ -239,8 +243,7 @@ plugin_mono_init (EPluginMono *plugin_mono)
(GDestroyNotify) g_free,
(GDestroyNotify) NULL);
- plugin_mono->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- plugin_mono, E_TYPE_PLUGIN_MONO, EPluginMonoPrivate);
+ plugin_mono->priv = E_PLUGIN_MONO_GET_PRIVATE (plugin_mono);
plugin_mono->priv->methods = methods;
}
diff --git a/modules/plugin-python/e-plugin-python.c b/modules/plugin-python/e-plugin-python.c
index a00e629068..fc13ade627 100644
--- a/modules/plugin-python/e-plugin-python.c
+++ b/modules/plugin-python/e-plugin-python.c
@@ -32,6 +32,10 @@
#include <sys/types.h>
#include <string.h>
+#define E_PLUGIN_PYTHON_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_PLUGIN_PYTHON, EPluginPythonPrivate))
+
struct _EPluginPythonPrivate {
PyObject *pModule;
PyObject *pClass;
@@ -199,8 +203,7 @@ plugin_python_init (EPluginPython *plugin_python)
(GDestroyNotify) g_free,
(GDestroyNotify) NULL);
- plugin_python->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- plugin_python, E_TYPE_PLUGIN_PYTHON, EPluginPythonPrivate);
+ plugin_python->priv = E_PLUGIN_PYTHON_GET_PRIVATE (plugin_python);
plugin_python->priv->methods = methods;
}
diff --git a/modules/startup-wizard/evolution-startup-wizard.c b/modules/startup-wizard/evolution-startup-wizard.c
index e5c1b8e50d..c0cac8d14a 100644
--- a/modules/startup-wizard/evolution-startup-wizard.c
+++ b/modules/startup-wizard/evolution-startup-wizard.c
@@ -565,7 +565,7 @@ startup_wizard_run (EStartupWizard *extension)
gtk_main ();
if (e_list_length (E_LIST (account_list)) <= 0)
- exit(0);
+ exit (0);
}
diff --git a/plugins/attachment-reminder/attachment-reminder.c b/plugins/attachment-reminder/attachment-reminder.c
index 9f2837d923..9eb8dd77af 100644
--- a/plugins/attachment-reminder/attachment-reminder.c
+++ b/plugins/attachment-reminder/attachment-reminder.c
@@ -60,11 +60,16 @@ enum {
CLUE_N_COLUMNS
};
-gint e_plugin_lib_enable (EPlugin *ep, gint enable);
-GtkWidget *e_plugin_lib_get_configure_widget (EPlugin *plugin);
-
-void org_gnome_evolution_attachment_reminder (EPlugin *ep, EMEventTargetComposer *t);
-GtkWidget * org_gnome_attachment_reminder_config_option (EPlugin *plugin, struct _EConfigHookItemFactoryData *data);
+gint e_plugin_lib_enable (EPlugin *ep,
+ gint enable);
+GtkWidget * e_plugin_lib_get_configure_widget
+ (EPlugin *plugin);
+void org_gnome_evolution_attachment_reminder
+ (EPlugin *ep,
+ EMEventTargetComposer *t);
+GtkWidget * org_gnome_attachment_reminder_config_option
+ (EPlugin *plugin,
+ EConfigHookItemFactoryData *data);
static gboolean ask_for_missing_attachment (EPlugin *ep, GtkWindow *widget);
static gboolean check_for_attachment_clues (gchar *msg);
@@ -99,9 +104,14 @@ org_gnome_evolution_attachment_reminder (EPlugin *ep,
g_byte_array_free (raw_msg_barray, TRUE);
/* Set presend_check_status for the composer*/
- if (check_for_attachment_clues (filtered_str) && !check_for_attachment (t->composer))
+ if (check_for_attachment_clues (filtered_str) &&
+ !check_for_attachment (t->composer)) {
if (!ask_for_missing_attachment (ep, (GtkWindow *) t->composer))
- g_object_set_data ((GObject *) t->composer, "presend_check_status", GINT_TO_POINTER(1));
+ g_object_set_data (
+ G_OBJECT (t->composer),
+ "presend_check_status",
+ GINT_TO_POINTER (1));
+ }
g_free (filtered_str);
}
@@ -355,11 +365,14 @@ clue_edit_clicked (GtkButton *button,
if (!gtk_tree_selection_get_selected (selection, &model, &iter))
return;
- focus_col = gtk_tree_view_get_column (GTK_TREE_VIEW (ui->treeview), CLUE_KEYWORD_COLUMN);
+ focus_col = gtk_tree_view_get_column (
+ GTK_TREE_VIEW (ui->treeview), CLUE_KEYWORD_COLUMN);
path = gtk_tree_model_get_path (model, &iter);
if (path) {
- gtk_tree_view_set_cursor (GTK_TREE_VIEW (ui->treeview), path, focus_col, TRUE);
+ gtk_tree_view_set_cursor (
+ GTK_TREE_VIEW (ui->treeview),
+ path, focus_col, TRUE);
gtk_tree_path_free (path);
}
}
@@ -419,12 +432,16 @@ e_plugin_lib_get_configure_widget (EPlugin *plugin)
clue_container = gtk_hbox_new (FALSE, 6);
gtk_widget_show (clue_container);
- gtk_box_pack_start (GTK_BOX (reminder_configuration_box), clue_container, TRUE, TRUE, 0);
+ gtk_box_pack_start (
+ GTK_BOX (reminder_configuration_box),
+ clue_container, TRUE, TRUE, 0);
scrolledwindow1 = gtk_scrolled_window_new (NULL, NULL);
gtk_widget_show (scrolledwindow1);
gtk_box_pack_start (GTK_BOX (clue_container), scrolledwindow1, TRUE, TRUE, 0);
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow1), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+ gtk_scrolled_window_set_policy (
+ GTK_SCROLLED_WINDOW (scrolledwindow1),
+ GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
clue_treeview = gtk_tree_view_new ();
gtk_widget_show (clue_treeview);
@@ -458,11 +475,14 @@ e_plugin_lib_get_configure_widget (EPlugin *plugin)
ui->store = gtk_list_store_new (CLUE_N_COLUMNS, G_TYPE_STRING);
- gtk_tree_view_set_model (GTK_TREE_VIEW (ui->treeview), GTK_TREE_MODEL (ui->store));
+ gtk_tree_view_set_model (
+ GTK_TREE_VIEW (ui->treeview),
+ GTK_TREE_MODEL (ui->store));
renderer = gtk_cell_renderer_text_new ();
- gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (ui->treeview), -1, _("Keywords"),
- renderer, "text", CLUE_KEYWORD_COLUMN, NULL);
+ gtk_tree_view_insert_column_with_attributes (
+ GTK_TREE_VIEW (ui->treeview), -1, _("Keywords"),
+ renderer, "text", CLUE_KEYWORD_COLUMN, NULL);
g_object_set (renderer, "editable", TRUE, NULL);
g_signal_connect (
renderer, "edited",
diff --git a/plugins/backup-restore/backup-restore.c b/plugins/backup-restore/backup-restore.c
index 1a389703e9..5e9770dc8d 100644
--- a/plugins/backup-restore/backup-restore.c
+++ b/plugins/backup-restore/backup-restore.c
@@ -44,7 +44,9 @@
#undef localtime_r
#endif
/* The localtime() in Microsoft's C library *is* thread-safe */
-#define localtime_r(timep, result) (localtime (timep) ? memcpy ((result), localtime (timep), sizeof (*(result))) : 0)
+#define localtime_r(timep, result) \
+ (localtime (timep) ? memcpy ( \
+ (result), localtime (timep), sizeof (*(result))) : 0)
#endif
gboolean e_plugin_ui_init (GtkUIManager *ui_manager,
diff --git a/plugins/backup-restore/backup.c b/plugins/backup-restore/backup.c
index a234a9cf7f..bfbdf85be3 100644
--- a/plugins/backup-restore/backup.c
+++ b/plugins/backup-restore/backup.c
@@ -203,7 +203,9 @@ replace_in_file (const gchar *filename,
filenamestr = replace_variables (filename);
if (!filenamestr) {
- g_warning ("%s: Replace variables in '%s' failed!", G_STRFUNC, filename);
+ g_warning (
+ "%s: Replace variables in '%s' failed!",
+ G_STRFUNC, filename);
return;
}
@@ -215,18 +217,24 @@ replace_in_file (const gchar *filename,
if (str) {
if (!g_file_set_contents (filename, str->str, -1, &error) && error) {
- g_warning ("%s: cannot write file content, error: %s", G_STRFUNC, error->message);
+ g_warning (
+ "%s: cannot write file content, "
+ "error: %s", G_STRFUNC, error->message);
g_error_free (error);
}
g_string_free (str, TRUE);
} else {
- g_warning ("%s: Replace of '%s' to '%s' failed!", G_STRFUNC, find, replace);
+ g_warning (
+ "%s: Replace of '%s' to '%s' failed!",
+ G_STRFUNC, find, replace);
}
g_free (content);
} else if (error) {
- g_warning ("%s: Cannot read file content, error: %s", G_STRFUNC, error->message);
+ g_warning (
+ "%s: Cannot read file content, error: %s",
+ G_STRFUNC, error->message);
g_error_free (error);
}
@@ -460,7 +468,9 @@ restore (const gchar *filename,
g_string_free (dir_fn, TRUE);
if (!data_dir || !config_dir) {
- g_warning ("Failed to get old data_dir (%p)/config_dir (%p)", data_dir, config_dir);
+ g_warning (
+ "Failed to get old data_dir (%p)/"
+ "config_dir (%p)", data_dir, config_dir);
g_free (data_dir);
g_free (config_dir);
goto end;
@@ -586,12 +596,16 @@ check (const gchar *filename,
return FALSE;
}
- command = g_strdup_printf ("tar ztf %s | grep -e \"%s$\"", quotedfname, EVOLUTION_DIR_FILE);
+ command = g_strdup_printf (
+ "tar ztf %s | grep -e \"%s$\"",
+ quotedfname, EVOLUTION_DIR_FILE);
result = system (command);
g_free (command);
if (result) {
- command = g_strdup_printf ("tar ztf %s | grep -e \"^\\.evolution/$\"", quotedfname);
+ command = g_strdup_printf (
+ "tar ztf %s | grep -e \"^\\.evolution/$\"",
+ quotedfname);
result = system (command);
g_free (command);
is_new = FALSE;
@@ -610,7 +624,9 @@ check (const gchar *filename,
return TRUE;
}
- command = g_strdup_printf ("tar ztf %s | grep -e \"^\\.evolution/%s$\"", quotedfname, GCONF_DUMP_FILE);
+ command = g_strdup_printf (
+ "tar ztf %s | grep -e \"^\\.evolution/%s$\"",
+ quotedfname, GCONF_DUMP_FILE);
result = system (command);
g_free (command);
g_free (quotedfname);
@@ -661,18 +677,21 @@ dlg_response (GtkWidget *dlg,
gint response,
GCancellable *cancellable)
{
- /* We will cancel only backup/restore operations and not the check operation */
+ /* We will cancel only backup/restore
+ * operations and not the check operation. */
g_cancellable_cancel (cancellable);
- /* If the response is not of delete_event then destroy the event */
+ /* If the response is not of delete_event then destroy the event. */
if (response != GTK_RESPONSE_NONE)
gtk_widget_destroy (dlg);
- /* We will kill just the tar operation. Rest of the them will be just a second of microseconds.*/
+ /* We will kill just the tar operation. Rest of
+ * them will be just a second of microseconds.*/
run_cmd ("pkill tar");
if (bk_file && backup_op && response == GTK_RESPONSE_REJECT) {
- /* backup was canceled, delete the backup file as it is not needed now */
+ /* Backup was canceled, delete the
+ * backup file as it is not needed now. */
gchar *cmd, *filename;
g_message ("Back up canceled, removing partial back up file.");
@@ -747,13 +766,11 @@ main (gint argc,
if (backup_op) {
title = _("Evolution Back Up");
oper = _("Backing up to the folder %s");
- d(g_message ("Backing up to the folder %s", (gchar *) opt_remaining[ii]));
bk_file = g_strdup ((gchar *) opt_remaining[ii]);
file = bk_file;
} else if (restore_op) {
title = _("Evolution Restore");
oper = _("Restoring from the folder %s");
- d(g_message ("Restoring from the folder %s", (gchar *) opt_remaining[ii]));
res_file = g_strdup ((gchar *) opt_remaining[ii]);
file = res_file;
} else if (check_op) {
diff --git a/plugins/bbdb/bbdb.c b/plugins/bbdb/bbdb.c
index 7889167a78..1fa392b09f 100644
--- a/plugins/bbdb/bbdb.c
+++ b/plugins/bbdb/bbdb.c
@@ -457,7 +457,9 @@ bbdb_open_book_client (EBookClient *client)
if (!client)
return FALSE;
- g_signal_connect (client, "authenticate", G_CALLBACK (e_client_utils_authenticate_handler), NULL);
+ g_signal_connect (
+ client, "authenticate",
+ G_CALLBACK (e_client_utils_authenticate_handler), NULL);
if (!e_client_open_sync (E_CLIENT (client), FALSE, NULL, &error)) {
g_warning ("bbdb: failed to open addressbook: %s", error ? error->message : "Unknown error");
if (error)
@@ -689,7 +691,9 @@ bbdb_page_factory (EPlugin *ep,
/* Enable BBDB checkbox */
check = gtk_check_button_new_with_mnemonic (_("Create _address book entries when sending mails"));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), g_settings_get_boolean (settings, CONF_KEY_ENABLE));
- g_signal_connect (GTK_TOGGLE_BUTTON (check), "toggled", G_CALLBACK (enable_toggled_cb), stuff);
+ g_signal_connect (
+ check, "toggled",
+ G_CALLBACK (enable_toggled_cb), stuff);
gtk_box_pack_start (GTK_BOX (inner_vbox), check, FALSE, FALSE, 0);
stuff->check = check;
@@ -698,7 +702,9 @@ bbdb_page_factory (EPlugin *ep,
/* Source selection combo box */
combo_box = create_addressbook_combo_box (stuff, AUTOMATIC_CONTACTS_ADDRESSBOOK);
- g_signal_connect (combo_box, "changed", G_CALLBACK (source_changed_cb), stuff);
+ g_signal_connect (
+ combo_box, "changed",
+ G_CALLBACK (source_changed_cb), stuff);
gtk_widget_set_sensitive (combo_box, g_settings_get_boolean (settings, CONF_KEY_ENABLE));
gtk_box_pack_start (GTK_BOX (inner_vbox), combo_box, FALSE, FALSE, 0);
stuff->combo_box = combo_box;
@@ -725,7 +731,9 @@ bbdb_page_factory (EPlugin *ep,
/* Enable Gaim Checkbox */
check_gaim = gtk_check_button_new_with_mnemonic (_("_Synchronize contact info and images from Pidgin buddy list"));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check_gaim), g_settings_get_boolean (settings, CONF_KEY_ENABLE_GAIM));
- g_signal_connect (GTK_TOGGLE_BUTTON (check_gaim), "toggled", G_CALLBACK (enable_gaim_toggled_cb), stuff);
+ g_signal_connect (
+ check_gaim, "toggled",
+ G_CALLBACK (enable_gaim_toggled_cb), stuff);
gtk_box_pack_start (GTK_BOX (inner_vbox), check_gaim, FALSE, FALSE, 0);
stuff->check_gaim = check_gaim;
@@ -734,18 +742,24 @@ bbdb_page_factory (EPlugin *ep,
/* Gaim Source Selection Combo Box */
gaim_combo_box = create_addressbook_combo_box (stuff, GAIM_ADDRESSBOOK);
- g_signal_connect (gaim_combo_box, "changed", G_CALLBACK (gaim_source_changed_cb), stuff);
+ g_signal_connect (
+ gaim_combo_box, "changed",
+ G_CALLBACK (gaim_source_changed_cb), stuff);
gtk_widget_set_sensitive (gaim_combo_box, g_settings_get_boolean (settings, CONF_KEY_ENABLE_GAIM));
gtk_box_pack_start (GTK_BOX (inner_vbox), gaim_combo_box, FALSE, FALSE, 0);
stuff->gaim_combo_box = gaim_combo_box;
/* Synchronize now button. */
button = gtk_button_new_with_mnemonic (_("Synchronize with _buddy list now"));
- g_signal_connect (GTK_BUTTON (button), "clicked", G_CALLBACK (synchronize_button_clicked_cb), stuff);
+ g_signal_connect (
+ button, "clicked",
+ G_CALLBACK (synchronize_button_clicked_cb), stuff);
gtk_box_pack_start (GTK_BOX (inner_vbox), button, FALSE, FALSE, 0);
/* Clean up */
- g_signal_connect (page, "destroy", G_CALLBACK (cleanup_cb), stuff);
+ g_signal_connect (
+ page, "destroy",
+ G_CALLBACK (cleanup_cb), stuff);
gtk_widget_show_all (page);
diff --git a/plugins/bbdb/gaimbuddies.c b/plugins/bbdb/gaimbuddies.c
index 68e71eed02..baf985f751 100644
--- a/plugins/bbdb/gaimbuddies.c
+++ b/plugins/bbdb/gaimbuddies.c
@@ -410,7 +410,9 @@ bbdb_merge_buddy_to_contact (EBookClient *client,
if (!g_file_get_contents (
b->icon, &contents,
&photo->data.inlined.length, &error)) {
- g_warning ("bbdb: Could not read buddy icon: %s\n", error->message);
+ g_warning (
+ "bbdb: Could not read buddy icon: "
+ "%s\n", error->message);
g_error_free (error);
return dirty;
}
diff --git a/plugins/caldav/caldav-browse-server.c b/plugins/caldav/caldav-browse-server.c
index 6737e3b006..789396e91a 100644
--- a/plugins/caldav/caldav-browse-server.c
+++ b/plugins/caldav/caldav-browse-server.c
@@ -1374,9 +1374,13 @@ init_dialog (GtkDialog *dialog,
gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (tree), -1, _("href"), renderer, "text", COL_STRING_HREF, "sensitive", COL_BOOL_SENSITIVE, NULL);*/
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree));
- g_signal_connect (selection, "changed", G_CALLBACK (tree_selection_changed_cb), *new_url_entry);
+ g_signal_connect (
+ selection, "changed",
+ G_CALLBACK (tree_selection_changed_cb), *new_url_entry);
- g_signal_connect (tree, "row-expanded", G_CALLBACK (tree_row_expanded_cb), dialog);
+ g_signal_connect (
+ tree, "row-expanded",
+ G_CALLBACK (tree_row_expanded_cb), dialog);
info_box = gtk_hbox_new (FALSE, 2);
@@ -1429,7 +1433,9 @@ init_dialog (GtkDialog *dialog,
g_object_set (session, SOUP_SESSION_PROXY_URI, soup_uri, NULL);
g_object_unref (proxy);
- g_signal_connect (session, "authenticate", G_CALLBACK (soup_authenticate), dialog);
+ g_signal_connect (
+ session, "authenticate",
+ G_CALLBACK (soup_authenticate), dialog);
switch (source_type) {
default:
@@ -1498,7 +1504,9 @@ init_dialog (GtkDialog *dialog,
xmlFreeDoc (doc);
}
- g_signal_connect (dialog, "response", G_CALLBACK (dialog_response_cb), dialog);
+ g_signal_connect (
+ dialog, "response",
+ G_CALLBACK (dialog_response_cb), dialog);
url_entry_changed (GTK_ENTRY (*new_url_entry), G_OBJECT (dialog));
}
diff --git a/plugins/calendar-file/calendar-file.c b/plugins/calendar-file/calendar-file.c
index 6296c71d29..ea85dabc6c 100644
--- a/plugins/calendar-file/calendar-file.c
+++ b/plugins/calendar-file/calendar-file.c
@@ -50,7 +50,9 @@ location_changed (GtkFileChooserButton *widget,
g_return_if_fail (source != NULL);
filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (widget));
- e_source_set_property (source, "custom-file", (filename && *filename) ? filename : NULL);
+ e_source_set_property (
+ source, "custom-file",
+ (filename && *filename) ? filename : NULL);
g_free (filename);
}
@@ -154,7 +156,8 @@ e_calendar_file_customs (EPlugin *epl,
gtk_misc_set_alignment (GTK_MISC (w1), 0.0, 0.5);
gtk_box_pack_start ((GtkBox *) box2, w1, FALSE, TRUE, 2);
- w2 = gtk_file_chooser_button_new (_("Choose calendar file"), GTK_FILE_CHOOSER_ACTION_OPEN);
+ w2 = gtk_file_chooser_button_new (
+ _("Choose calendar file"), GTK_FILE_CHOOSER_ACTION_OPEN);
gtk_file_chooser_set_local_only (GTK_FILE_CHOOSER (w2), TRUE);
gtk_label_set_mnemonic_widget (GTK_LABEL (w1), w2);
gtk_box_pack_start ((GtkBox *) box2, w2, TRUE, TRUE, 2);
@@ -213,7 +216,10 @@ e_calendar_file_customs (EPlugin *epl,
gtk_box_pack_start ((GtkBox *) box2, w2, FALSE, TRUE, 2);
value = e_source_get_property (source, "refresh-type");
- gtk_combo_box_set_active ((GtkComboBox *) w2, (value && *value && !value[1] && value[0] >= '0' && value[0] <= '2') ? value[0] - '0' : 0);
+ gtk_combo_box_set_active (
+ (GtkComboBox *) w2,
+ (value && *value && !value[1] && value[0] >= '0' &&
+ value[0] <= '2') ? value[0] - '0' : 0);
w1 = w2;
w2 = e_plugin_util_add_refresh (NULL, NULL, source, "refresh");
@@ -225,7 +231,9 @@ e_calendar_file_customs (EPlugin *epl,
w1, "changed",
G_CALLBACK (refresh_type_changed), source);
- w2 = e_plugin_util_add_check (NULL, _("Force read _only"), source, "custom-file-readonly", "1", NULL);
+ w2 = e_plugin_util_add_check (
+ NULL, _("Force read _only"), source,
+ "custom-file-readonly", "1", NULL);
gtk_box_pack_start ((GtkBox *) box1, w2, TRUE, TRUE, 2);
gtk_widget_show_all (mainbox);
diff --git a/plugins/calendar-http/calendar-http.c b/plugins/calendar-http/calendar-http.c
index fcf7002ab5..f88b6af879 100644
--- a/plugins/calendar-http/calendar-http.c
+++ b/plugins/calendar-http/calendar-http.c
@@ -62,10 +62,12 @@ url_changed (GtkEntry *entry,
if (uri->scheme && strncmp (uri->scheme, "https", sizeof ("https") - 1) == 0) {
gpointer secure_checkbox;
- secure_checkbox = g_object_get_data (G_OBJECT (gtk_widget_get_parent (GTK_WIDGET (entry))),
- "secure_checkbox");
+ secure_checkbox = g_object_get_data (
+ G_OBJECT (gtk_widget_get_parent (GTK_WIDGET (entry))),
+ "secure_checkbox");
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (secure_checkbox), TRUE);
+ gtk_toggle_button_set_active (
+ GTK_TOGGLE_BUTTON (secure_checkbox), TRUE);
}
soup_uri_set_user (uri, e_source_get_property (source, "username"));
@@ -126,7 +128,8 @@ e_calendar_http_refresh (EPlugin *epl,
return NULL;
}
- return e_plugin_util_add_refresh (data->parent, _("Re_fresh:"), t->source, "refresh");
+ return e_plugin_util_add_refresh (
+ data->parent, _("Re_fresh:"), t->source, "refresh");
}
GtkWidget *
@@ -142,10 +145,14 @@ e_calendar_http_secure (EPlugin *epl,
return NULL;
}
- secure_setting = e_plugin_util_add_check (data->parent, _("Use _secure connection"), t->source, "use_ssl", "1", "0");
+ secure_setting = e_plugin_util_add_check (
+ data->parent, _("Use _secure connection"),
+ t->source, "use_ssl", "1", "0");
/* Store pointer to secure checkbox so we can retrieve it in url_changed() */
- g_object_set_data (G_OBJECT (data->parent), "secure_checkbox", (gpointer)secure_setting);
+ g_object_set_data (
+ G_OBJECT (data->parent), "secure_checkbox",
+ (gpointer) secure_setting);
return secure_setting;
}
diff --git a/plugins/dbx-import/dbx-importer.c b/plugins/dbx-import/dbx-importer.c
index f6b666516a..b985a8bdd4 100644
--- a/plugins/dbx-import/dbx-importer.c
+++ b/plugins/dbx-import/dbx-importer.c
@@ -271,7 +271,9 @@ org_gnome_evolution_readdbx_getwidget (EImport *ei,
EM_FOLDER_SELECTION_BUTTON (w), select_uri);
folder_selected (
EM_FOLDER_SELECTION_BUTTON (w), (EImportTargetURI *) target);
- g_signal_connect (w, "selected", G_CALLBACK(folder_selected), target);
+ g_signal_connect (
+ w, "selected",
+ G_CALLBACK (folder_selected), target);
gtk_box_pack_start ((GtkBox *) hbox, w, FALSE, TRUE, 6);
w = gtk_vbox_new (FALSE, 0);
@@ -488,7 +490,6 @@ dbx_read_mail_body (DbxImporter *m,
buflen = hdr.blocksize;
buffer = g_malloc (buflen);
}
- d(printf("Reading %d bytes from %lx\n", hdr.blocksize, offset + sizeof(hdr)));
if (dbx_pread (m->dbx_fd, buffer, hdr.blocksize,
offset + sizeof (hdr)) != hdr.blocksize) {
g_set_error (
@@ -552,7 +553,11 @@ dbx_read_email (DbxImporter *m,
for (i = 0; i < hdr.count; i++) {
guchar type = buffer[i *4];
- gint val = buffer[i *4 + 1] + (buffer[i *4 + 2] << 8) + (buffer[i *4 + 3] << 16);
+ gint val;
+
+ val = buffer[i *4 + 1] +
+ (buffer[i *4 + 2] << 8) +
+ (buffer[i *4 + 3] << 16);
switch (type) {
case 0x01:
diff --git a/plugins/email-custom-header/email-custom-header.c b/plugins/email-custom-header/email-custom-header.c
index 4e65f21c85..5376d26410 100644
--- a/plugins/email-custom-header/email-custom-header.c
+++ b/plugins/email-custom-header/email-custom-header.c
@@ -38,6 +38,10 @@
#define d(x)
#define GCONF_KEY_CUSTOM_HEADER "/apps/evolution/eplugin/email_custom_header/customHeader"
+#define CUSTOM_HEADER_OPTIONS_DIALOG_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), EMAIL_CUSTOM_HEADER_OPTIONS_DIALOG, CustomHeaderOptionsDialogPrivate))
+
typedef struct {
GConfClient *gconf;
GtkWidget *treeview;
@@ -53,7 +57,7 @@ enum {
HEADER_N_COLUMNS
};
-struct _EmailCustomHeaderOptionsDialogPrivate {
+struct _CustomHeaderOptionsDialogPrivate {
GtkBuilder *builder;
/*Widgets*/
GtkWidget *main;
@@ -68,10 +72,8 @@ struct _EmailCustomHeaderOptionsDialogPrivate {
};
/* epech - e-plugin email custom header*/
-static void epech_dialog_class_init (GObjectClass *object_class);
+GType custom_header_options_dialog_get_type (void);
static void epech_dialog_finalize (GObject *object);
-static void epech_dialog_init (GObject *object);
-static void epech_dialog_dispose (GObject *object);
static void epech_setup_widgets (CustomHeaderOptionsDialog *mch);
static gint epech_check_existing_composer_window (gconstpointer a, gconstpointer b);
static void commit_changes (ConfigData *cd);
@@ -80,6 +82,11 @@ GtkWidget *e_plugin_lib_get_configure_widget (EPlugin *epl);
gboolean e_plugin_ui_init (GtkUIManager *ui_manager, EMsgComposer *composer);
GtkWidget *org_gnome_email_custom_header_config_option (EPlugin *epl, struct _EConfigHookItemFactoryData *data);
+G_DEFINE_TYPE (
+ CustomHeaderOptionsDialog,
+ custom_header_options_dialog,
+ G_TYPE_OBJECT)
+
gint
e_plugin_lib_enable (EPlugin *ep,
gint enable)
@@ -90,7 +97,7 @@ e_plugin_lib_enable (EPlugin *ep,
static void
epech_get_widgets_data (CustomHeaderOptionsDialog *mch)
{
- EmailCustomHeaderOptionsDialogPrivate *priv;
+ CustomHeaderOptionsDialogPrivate *priv;
HeaderValueComboBox *sub_combo_box_get;
gint selected_item;
gint index_column;
@@ -111,7 +118,7 @@ epech_get_widgets_data (CustomHeaderOptionsDialog *mch)
static gboolean
epech_get_widgets (CustomHeaderOptionsDialog *mch)
{
- EmailCustomHeaderOptionsDialogPrivate *priv;
+ CustomHeaderOptionsDialogPrivate *priv;
priv = mch->priv;
#define EMAIL_CUSTOM_HEADER(name) e_builder_get_widget (priv->builder, name)
@@ -131,7 +138,7 @@ epech_get_widgets (CustomHeaderOptionsDialog *mch)
static void
epech_fill_widgets_with_data (CustomHeaderOptionsDialog *mch)
{
- EmailCustomHeaderOptionsDialogPrivate *priv;
+ CustomHeaderOptionsDialogPrivate *priv;
HeaderValueComboBox *sub_combo_box_fill;
gint set_index_column;
@@ -154,37 +161,7 @@ epech_fill_widgets_with_data (CustomHeaderOptionsDialog *mch)
CustomHeaderOptionsDialog *
epech_dialog_new (void)
{
- CustomHeaderOptionsDialog *mch;
-
- mch = g_object_new (EMAIL_CUSTOM_HEADER_OPTIONS_DIALOG, NULL);
-
- return mch;
-}
-
-GType
-epech_dialog_get_type (void)
-{
- static GType type = 0;
-
- if (type == 0) {
- static const GTypeInfo info = {
- sizeof (CustomHeaderOptionsDialogClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) epech_dialog_class_init, /* class_init */
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (CustomHeaderOptionsDialog),
- 0, /* n_preallocs */
- (GInstanceInitFunc) epech_dialog_init,
- NULL /* instance_init */
- };
- type = g_type_register_static (G_TYPE_OBJECT,
- "CustomHeaderOptionsDialogType",
- &info, 0);
- }
-
- return type;
+ return g_object_new (EMAIL_CUSTOM_HEADER_OPTIONS_DIALOG, NULL);
}
static void
@@ -192,7 +169,7 @@ epech_header_options_cb (GtkDialog *dialog,
gint state,
gpointer func_data)
{
- EmailCustomHeaderOptionsDialogPrivate *priv;
+ CustomHeaderOptionsDialogPrivate *priv;
CustomHeaderOptionsDialog *mch;
mch = func_data;
@@ -220,7 +197,7 @@ static gboolean
epech_dialog_run (CustomHeaderOptionsDialog *mch,
GtkWidget *parent)
{
- EmailCustomHeaderOptionsDialogPrivate *priv;
+ CustomHeaderOptionsDialogPrivate *priv;
GtkWidget *toplevel;
g_return_val_if_fail (mch != NULL || EMAIL_CUSTOM_HEADER_OPTIONS_IS_DIALOG (mch), FALSE);
@@ -243,7 +220,9 @@ epech_dialog_run (CustomHeaderOptionsDialog *mch,
gtk_window_set_transient_for (GTK_WINDOW (toplevel),GTK_WINDOW (parent));
epech_fill_widgets_with_data (mch);
- g_signal_connect (GTK_DIALOG (priv->main), "response", G_CALLBACK(epech_header_options_cb), mch);
+ g_signal_connect (
+ priv->main, "response",
+ G_CALLBACK (epech_header_options_cb), mch);
gtk_widget_show (priv->main);
return TRUE;
@@ -267,7 +246,7 @@ epech_load_from_gconf (GConfClient *client,
const gchar *path,
CustomHeaderOptionsDialog *mch)
{
- EmailCustomHeaderOptionsDialogPrivate *priv;
+ CustomHeaderOptionsDialogPrivate *priv;
EmailCustomHeaderDetails temp_header_details= {-1, -1, NULL, NULL};
CustomSubHeader temp_header_value_details = {NULL};
GSList *header_list,*q;
@@ -310,7 +289,7 @@ epech_load_from_gconf (GConfClient *client,
static void
epech_setup_widgets (CustomHeaderOptionsDialog *mch)
{
- EmailCustomHeaderOptionsDialogPrivate *priv;
+ CustomHeaderOptionsDialogPrivate *priv;
EmailCustomHeaderDetails *temp_header_ptr,*temp;
CustomSubHeader *temp_header_value_ptr;
HeaderValueComboBox sub_combo_box = {NULL};
@@ -391,71 +370,44 @@ epech_setup_widgets (CustomHeaderOptionsDialog *mch)
}
static void
-epech_dialog_class_init (GObjectClass *object)
+custom_header_options_dialog_class_init (CustomHeaderOptionsDialogClass *class)
{
- CustomHeaderOptionsDialogClass *klass;
GObjectClass *object_class;
- klass = EMAIL_CUSTOM_HEADEROPTIONS_DIALOG_CLASS (object);
- parent_class = g_type_class_peek_parent (klass);
- object_class = G_OBJECT_CLASS (klass);
+ g_type_class_add_private (
+ class, sizeof (CustomHeaderOptionsDialogPrivate));
+ object_class = G_OBJECT_CLASS (class);
object_class->finalize = epech_dialog_finalize;
- object_class->dispose = epech_dialog_dispose;
-
- signals[MCH_RESPONSE] = g_signal_new ("emch_response",
- G_TYPE_FROM_CLASS (klass),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (CustomHeaderOptionsDialogClass, emch_response),
- NULL, NULL,
- g_cclosure_marshal_VOID__INT,
- G_TYPE_NONE, 1,
- G_TYPE_INT);
+
+ signals[MCH_RESPONSE] = g_signal_new (
+ "emch_response",
+ G_TYPE_FROM_CLASS (class),
+ G_SIGNAL_RUN_FIRST,
+ G_STRUCT_OFFSET (CustomHeaderOptionsDialogClass, emch_response),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__INT,
+ G_TYPE_NONE, 1,
+ G_TYPE_INT);
}
static void
-epech_dialog_init (GObject *object)
+custom_header_options_dialog_init (CustomHeaderOptionsDialog *mch)
{
- CustomHeaderOptionsDialog *mch;
- EmailCustomHeaderOptionsDialogPrivate *priv;
-
- mch = EMAIL_CUSTOM_HEADEROPTIONS_DIALOG (object);
- priv = g_new0 (EmailCustomHeaderOptionsDialogPrivate, 1);
- mch->priv = priv;
- priv->builder = NULL;
- priv->main = NULL;
- priv->page = NULL;
- priv->header_table = NULL;
+ mch->priv = CUSTOM_HEADER_OPTIONS_DIALOG_GET_PRIVATE (mch);
}
static void
epech_dialog_finalize (GObject *object)
{
- CustomHeaderOptionsDialog *mch = (CustomHeaderOptionsDialog *) object;
- EmailCustomHeaderOptionsDialogPrivate *priv;
+ CustomHeaderOptionsDialogPrivate *priv;
- g_return_if_fail (EMAIL_CUSTOM_HEADER_OPTIONS_IS_DIALOG (mch));
- priv = mch->priv;
- g_free (priv->help_section);
-
- if (mch->priv) {
- g_free (mch->priv);
- mch->priv = NULL;
- }
-
- if (parent_class->finalize)
- (* parent_class->finalize) (object);
-}
+ priv = CUSTOM_HEADER_OPTIONS_DIALOG_GET_PRIVATE (object);
-static void
-epech_dialog_dispose (GObject *object)
-{
- CustomHeaderOptionsDialog *mch = (CustomHeaderOptionsDialog *) object;
-
- g_return_if_fail (EMAIL_CUSTOM_HEADER_OPTIONS_IS_DIALOG (mch));
+ g_free (priv->help_section);
- if (parent_class->dispose)
- (* parent_class->dispose) (object);
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (custom_header_options_dialog_parent_class)->finalize (object);
}
static void
@@ -464,7 +416,7 @@ epech_append_to_custom_header (CustomHeaderOptionsDialog *dialog,
gpointer data)
{
EMsgComposer *composer;
- EmailCustomHeaderOptionsDialogPrivate *priv;
+ CustomHeaderOptionsDialogPrivate *priv;
EmailCustomHeaderDetails *temp_header_ptr;
CustomSubHeader *temp_header_value_ptr;
gint index_subtype,sub_type_index;
@@ -573,8 +525,12 @@ static void action_email_custom_header_cb (GtkAction *action, EMsgComposer *comp
}
epech_dialog_run (dialog, GTK_WIDGET (composer));
- g_signal_connect (dialog, "emch_response", G_CALLBACK (epech_append_to_custom_header), GTK_WIDGET (composer));
- g_signal_connect (GTK_WIDGET (composer), "destroy", G_CALLBACK (epech_custom_header_options_commit), composer);
+ g_signal_connect (
+ dialog, "emch_response",
+ G_CALLBACK (epech_append_to_custom_header), composer);
+ g_signal_connect (
+ composer, "destroy",
+ G_CALLBACK (epech_custom_header_options_commit), composer);
}
static GtkActionEntry entries[] = {
diff --git a/plugins/email-custom-header/email-custom-header.h b/plugins/email-custom-header/email-custom-header.h
index 00fa2ef763..1a1c35c5a1 100644
--- a/plugins/email-custom-header/email-custom-header.h
+++ b/plugins/email-custom-header/email-custom-header.h
@@ -22,25 +22,33 @@
*
*/
-#ifndef __EMAIL_CUSTOM_HEADEROPTIONS_DIALOG_H__
-#define __EMAIL_CUSTOM_HEADEROPTIONS_DIALOG_H__
+#ifndef EMAIL_CUSTOM_HEADEROPTIONS_DIALOG_H
+#define EMAIL_CUSTOM_HEADEROPTIONS_DIALOG_H
#include <gtk/gtk.h>
-#define EMAIL_CUSTOM_HEADER_OPTIONS_DIALOG (epech_dialog_get_type ())
-#define EMAIL_CUSTOM_HEADEROPTIONS_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EMAIL_CUSTOM_HEADER_OPTIONS_DIALOG, CustomHeaderOptionsDialog))
-#define EMAIL_CUSTOM_HEADEROPTIONS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EMAIL_CUSTOM_HEADER_OPTIONS_DIALOG, CustomHeaderOptionsDialogClass))
-#define EMAIL_CUSTOM_HEADER_OPTIONS_IS_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EMAIL_CUSTOM_HEADER_OPTIONS_DIALOG))
-#define EMAIL_CUSTOM_HEADER_OPTIONS_IS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EMAIL_CUSTOM_HEADER_OPTIONS_DIALOG))
+#define EMAIL_CUSTOM_HEADER_OPTIONS_DIALOG \
+ (custom_header_options_dialog_get_type ())
+#define EMAIL_CUSTOM_HEADEROPTIONS_DIALOG(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), EMAIL_CUSTOM_HEADER_OPTIONS_DIALOG, CustomHeaderOptionsDialog))
+#define EMAIL_CUSTOM_HEADEROPTIONS_DIALOG_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), EMAIL_CUSTOM_HEADER_OPTIONS_DIALOG, CustomHeaderOptionsDialogClass))
+#define EMAIL_CUSTOM_HEADER_OPTIONS_IS_DIALOG(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), EMAIL_CUSTOM_HEADER_OPTIONS_DIALOG))
+#define EMAIL_CUSTOM_HEADER_OPTIONS_IS_DIALOG_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), EMAIL_CUSTOM_HEADER_OPTIONS_DIALOG))
typedef struct _CustomHeaderOptionsDialog CustomHeaderOptionsDialog;
typedef struct _CustomHeaderOptionsDialogClass CustomHeaderOptionsDialogClass;
-typedef struct _EmailCustomHeaderOptionsDialogPrivate EmailCustomHeaderOptionsDialogPrivate;
+typedef struct _CustomHeaderOptionsDialogPrivate CustomHeaderOptionsDialogPrivate;
struct _CustomHeaderOptionsDialog {
- GObject object;
- /* Private data */
- EmailCustomHeaderOptionsDialogPrivate *priv;
+ GObject parent;
+ CustomHeaderOptionsDialogPrivate *priv;
};
typedef struct {
@@ -55,7 +63,7 @@ typedef struct {
} CustomSubHeader;
typedef struct {
- GtkWidget *header_value_combo_box;
+ GtkWidget *header_value_combo_box;
} HeaderValueComboBox;
struct _CustomHeaderOptionsDialogClass {
@@ -75,9 +83,7 @@ enum {
};
static guint signals[LAST_SIGNAL] = {0};
-static GObjectClass *parent_class = NULL;
-GType epech_dialog_get_type (void);
CustomHeaderOptionsDialog *epech_dialog_new (void);
static gboolean epech_dialog_run (CustomHeaderOptionsDialog *mch, GtkWidget *parent);
static void epech_get_header_list (CustomHeaderOptionsDialog *mch);
diff --git a/plugins/external-editor/external-editor.c b/plugins/external-editor/external-editor.c
index cf9349d674..bcb373d65a 100644
--- a/plugins/external-editor/external-editor.c
+++ b/plugins/external-editor/external-editor.c
@@ -270,8 +270,9 @@ async_external_editor (EMsgComposer *composer)
content = gtkhtml_editor_get_text_plain (GTKHTML_EDITOR (composer), &length);
g_file_set_contents (filename, content, length, NULL);
} else {
- struct run_error_dialog_data *data = g_new0 (struct run_error_dialog_data, 1);
+ struct run_error_dialog_data *data;
+ data = g_new0 (struct run_error_dialog_data, 1);
data->composer = composer;
data->text = "org.gnome.evolution.plugins.external-editor:no-temp-file";
@@ -324,10 +325,11 @@ async_external_editor (EMsgComposer *composer)
editor_cmd_line = g_strconcat (editor_cmd, " ", filename, NULL);
if (!g_spawn_command_line_sync (editor_cmd_line, NULL, NULL, &status, NULL)) {
- struct run_error_dialog_data *data = g_new0 (struct run_error_dialog_data, 1);
+ struct run_error_dialog_data *data;
g_warning ("Unable to launch %s: ", editor_cmd_line);
+ data = g_new0 (struct run_error_dialog_data, 1);
data->composer = composer;
data->text = "org.gnome.evolution.plugins.external-editor:editor-not-launchable";
diff --git a/plugins/face/face.c b/plugins/face/face.c
index 18a1a2d978..f973ebf8eb 100644
--- a/plugins/face/face.c
+++ b/plugins/face/face.c
@@ -305,7 +305,9 @@ choose_new_face (void)
preview = gtk_image_new ();
gtk_file_chooser_set_preview_widget (GTK_FILE_CHOOSER (filesel), preview);
- g_signal_connect (filesel, "update-preview", G_CALLBACK (update_preview_cb), preview);
+ g_signal_connect (
+ filesel, "update-preview",
+ G_CALLBACK (update_preview_cb), preview);
if (GTK_RESPONSE_OK == gtk_dialog_run (GTK_DIALOG (filesel))) {
gchar *image_filename, *file_contents = NULL;
@@ -358,7 +360,9 @@ get_cfg_widget (void)
check = gtk_check_button_new_with_mnemonic (_("_Insert Face picture by default"));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), get_include_face_by_default ());
- g_signal_connect (check, "toggled", G_CALLBACK (toggled_check_include_by_default_cb), NULL);
+ g_signal_connect (
+ check, "toggled",
+ G_CALLBACK (toggled_check_include_by_default_cb), NULL);
gtk_box_pack_start (GTK_BOX (vbox), check, FALSE, FALSE, 0);
@@ -368,7 +372,9 @@ get_cfg_widget (void)
g_object_unref (face);
butt = gtk_button_new_with_mnemonic (_("Load new _Face picture"));
- g_signal_connect (butt, "clicked", G_CALLBACK (click_load_face_cb), img);
+ g_signal_connect (
+ butt, "clicked",
+ G_CALLBACK (click_load_face_cb), img);
gtk_box_pack_start (GTK_BOX (vbox), butt, FALSE, FALSE, 0);
diff --git a/plugins/google-account-setup/google-contacts-source.c b/plugins/google-account-setup/google-contacts-source.c
index c9127d6861..5653881899 100644
--- a/plugins/google-account-setup/google-contacts-source.c
+++ b/plugins/google-account-setup/google-contacts-source.c
@@ -382,17 +382,23 @@ plugin_google_contacts (EPlugin *epl,
gtk_box_pack_start (GTK_BOX (hbox), interval_sb, FALSE, FALSE, 0);
interval_combo = gtk_combo_box_text_new ();
- gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (interval_combo), _("minutes"));
- gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (interval_combo), _("hours"));
- gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (interval_combo), _("days"));
- gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (interval_combo), _("weeks"));
+ gtk_combo_box_text_append_text (
+ GTK_COMBO_BOX_TEXT (interval_combo), _("minutes"));
+ gtk_combo_box_text_append_text (
+ GTK_COMBO_BOX_TEXT (interval_combo), _("hours"));
+ gtk_combo_box_text_append_text (
+ GTK_COMBO_BOX_TEXT (interval_combo), _("days"));
+ gtk_combo_box_text_append_text (
+ GTK_COMBO_BOX_TEXT (interval_combo), _("weeks"));
gtk_combo_box_set_active (GTK_COMBO_BOX (interval_combo), type);
gtk_box_pack_start (GTK_BOX (hbox), interval_combo, FALSE, FALSE, 0);
gtk_widget_show_all (vbox2);
- g_object_set_data (G_OBJECT (interval_sb), "interval-combo", interval_combo);
- g_object_set_data (G_OBJECT (interval_combo), "interval-sb", interval_sb);
+ g_object_set_data (
+ G_OBJECT (interval_sb), "interval-combo", interval_combo);
+ g_object_set_data (
+ G_OBJECT (interval_combo), "interval-sb", interval_sb);
ui = g_malloc0 (sizeof (struct ui_data));
ui->widget = vbox2;
diff --git a/plugins/google-account-setup/google-source.c b/plugins/google-account-setup/google-source.c
index 405d52155e..76dd8ae2c4 100644
--- a/plugins/google-account-setup/google-source.c
+++ b/plugins/google-account-setup/google-source.c
@@ -695,7 +695,9 @@ plugin_google (EPlugin *epl,
e_source_get_property (source, "googlename") ? e_source_get_property (source, "googlename") : _("Default"),
e_source_get_property (source, "googlename") ? e_source_peek_relative_uri (source) : NULL);
- g_signal_connect (combo, "changed", G_CALLBACK (cal_combo_changed), source);
+ g_signal_connect (
+ combo, "changed",
+ G_CALLBACK (cal_combo_changed), source);
g_object_set_data (G_OBJECT (user), "CalendarCombo", combo);
@@ -703,8 +705,12 @@ plugin_google (EPlugin *epl,
gtk_box_pack_start (GTK_BOX (hbox), combo, TRUE, TRUE, 0);
label = gtk_button_new_with_mnemonic (_("Retrieve _List"));
- g_signal_connect (label, "clicked", G_CALLBACK (retrieve_list_clicked), combo);
- g_signal_connect (user, "changed", G_CALLBACK (retrieve_list_sensitize), label);
+ g_signal_connect (
+ label, "clicked",
+ G_CALLBACK (retrieve_list_clicked), combo);
+ g_signal_connect (
+ user, "changed",
+ G_CALLBACK (retrieve_list_sensitize), label);
g_object_set_data (G_OBJECT (label), "ESource", source);
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
gtk_widget_set_sensitive (label, username && *username);
diff --git a/plugins/imap-features/imap-headers.c b/plugins/imap-features/imap-headers.c
index 60f50d7dd6..3a0917fa53 100644
--- a/plugins/imap-features/imap-headers.c
+++ b/plugins/imap-features/imap-headers.c
@@ -337,11 +337,21 @@ org_gnome_imap_headers (EPlugin *epl,
gtk_widget_set_sensitive (GTK_WIDGET (ui->add_header), FALSE);
epif_tv_selection_changed (selection, GTK_WIDGET (ui->remove_header));
- g_signal_connect (ui->add_header, "clicked", G_CALLBACK (epif_add_header), ui);
- g_signal_connect (ui->remove_header, "clicked", G_CALLBACK (epif_remove_header_clicked), ui);
- g_signal_connect (ui->entry_header, "changed", G_CALLBACK (epif_entry_changed), ui);
- g_signal_connect (ui->entry_header, "activate", G_CALLBACK (epif_add_header), ui);
- g_signal_connect (selection, "changed", G_CALLBACK (epif_tv_selection_changed), ui->remove_header);
+ g_signal_connect (
+ ui->add_header, "clicked",
+ G_CALLBACK (epif_add_header), ui);
+ g_signal_connect (
+ ui->remove_header, "clicked",
+ G_CALLBACK (epif_remove_header_clicked), ui);
+ g_signal_connect (
+ ui->entry_header, "changed",
+ G_CALLBACK (epif_entry_changed), ui);
+ g_signal_connect (
+ ui->entry_header, "activate",
+ G_CALLBACK (epif_add_header), ui);
+ g_signal_connect (
+ selection, "changed",
+ G_CALLBACK (epif_tv_selection_changed), ui->remove_header);
gtk_notebook_append_page ((GtkNotebook *)(data->parent), vbox, gtk_label_new(_("IMAP Headers")));
gtk_container_child_set (GTK_CONTAINER (data->parent), vbox, "tab-fill", FALSE, "tab-expand", FALSE, NULL);
diff --git a/plugins/itip-formatter/itip-formatter.c b/plugins/itip-formatter/itip-formatter.c
index 21d24f6da9..4e2b853ff4 100644
--- a/plugins/itip-formatter/itip-formatter.c
+++ b/plugins/itip-formatter/itip-formatter.c
@@ -790,7 +790,9 @@ decrease_find_data (FormatItipFindData *fd)
source = e_source_list_peek_source_any (pitip->source_lists[pitip->type]);
itip_view_set_source_list (ITIP_VIEW (pitip->view), pitip->source_lists[pitip->type]);
- g_signal_connect (pitip->view, "source_selected", G_CALLBACK (source_selected_cb), pitip);
+ g_signal_connect (
+ pitip->view, "source_selected",
+ G_CALLBACK (source_selected_cb), pitip);
if (source) {
itip_view_set_source (ITIP_VIEW (pitip->view), source);
@@ -2344,7 +2346,9 @@ extract_itip_data (struct _itip_puri *pitip,
gtk_widget_show_all (hbox);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
- g_signal_connect (save, "clicked", G_CALLBACK (save_vcalendar_cb), pitip);
+ g_signal_connect (
+ save, "clicked",
+ G_CALLBACK (save_vcalendar_cb), pitip);
return FALSE;
} if (pitip->total > 0) {
pitip->current = 1;
@@ -3002,7 +3006,9 @@ format_itip_object (EMFormatHTML *efh,
}
if (response_enabled) {
- g_signal_connect (info->view, "response", G_CALLBACK (view_response_cb), info);
+ g_signal_connect (
+ info->view, "response",
+ G_CALLBACK (view_response_cb), info);
itip_view_set_show_free_time_check (ITIP_VIEW (info->view), info->type == E_CAL_CLIENT_SOURCE_TYPE_EVENTS && (info->method == ICAL_METHOD_PUBLISH || info->method == ICAL_METHOD_REQUEST));
@@ -3250,7 +3256,9 @@ itip_formatter_page_factory (EPlugin *ep,
check = gtk_check_button_new_with_mnemonic (_("_Delete message after acting"));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), g_settings_get_boolean (settings, CONF_KEY_DELETE));
- g_signal_connect (GTK_TOGGLE_BUTTON (check), "toggled", G_CALLBACK (delete_toggled_cb), NULL);
+ g_signal_connect (
+ check, "toggled",
+ G_CALLBACK (delete_toggled_cb), NULL);
gtk_box_pack_start (GTK_BOX (inner_vbox), check, FALSE, FALSE, 0);
g_object_unref (settings);
@@ -3298,7 +3306,9 @@ itip_formatter_page_factory (EPlugin *ep,
initialize_selection (E_SOURCE_SELECTOR (ess), source_list);
- g_signal_connect (ess, "selection_changed", G_CALLBACK (source_selection_changed), source_list);
+ g_signal_connect (
+ ess, "selection_changed",
+ G_CALLBACK (source_selection_changed), source_list);
g_object_weak_ref (G_OBJECT (page), (GWeakNotify) g_object_unref, source_list);
gtk_widget_show_all (page);
diff --git a/plugins/itip-formatter/itip-view.c b/plugins/itip-formatter/itip-view.c
index 252883662e..273238490b 100644
--- a/plugins/itip-formatter/itip-view.c
+++ b/plugins/itip-formatter/itip-view.c
@@ -42,6 +42,10 @@
#define MEETING_ICON "stock_new-meeting"
+#define ITIP_VIEW_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), ITIP_TYPE_VIEW, ItipViewPrivate))
+
G_DEFINE_TYPE (ItipView, itip_view, GTK_TYPE_HBOX)
typedef struct {
@@ -892,49 +896,46 @@ set_buttons (ItipView *view)
}
static void
-itip_view_dispose (GObject *object)
+itip_view_finalize (GObject *object)
{
- ItipView *view = ITIP_VIEW (object);
- ItipViewPrivate *priv = view->priv;
+ ItipViewPrivate *priv;
- if (priv) {
- g_free (priv->organizer);
- g_free (priv->organizer_sentby);
- g_free (priv->delegator);
- g_free (priv->attendee);
- g_free (priv->attendee_sentby);
- g_free (priv->proxy);
- g_free (priv->summary);
- g_free (priv->location);
- g_free (priv->status);
- g_free (priv->comment);
- g_free (priv->start_tm);
- g_free (priv->end_tm);
- g_free (priv->description);
+ priv = ITIP_VIEW_GET_PRIVATE (object);
- itip_view_clear_upper_info_items (view);
- itip_view_clear_lower_info_items (view);
+ g_free (priv->organizer);
+ g_free (priv->organizer_sentby);
+ g_free (priv->delegator);
+ g_free (priv->attendee);
+ g_free (priv->attendee_sentby);
+ g_free (priv->proxy);
+ g_free (priv->summary);
+ g_free (priv->location);
+ g_free (priv->status);
+ g_free (priv->comment);
+ g_free (priv->start_tm);
+ g_free (priv->end_tm);
+ g_free (priv->description);
- g_free (priv);
- view->priv = NULL;
- }
+ itip_view_clear_upper_info_items (ITIP_VIEW (object));
+ itip_view_clear_lower_info_items (ITIP_VIEW (object));
- /* Chain up to parent's dispose() method. */
- G_OBJECT_CLASS (itip_view_parent_class)->dispose (object);
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (itip_view_parent_class)->finalize (object);
}
static void
-itip_view_class_init (ItipViewClass *klass)
+itip_view_class_init (ItipViewClass *class)
{
GObjectClass *object_class;
- object_class = G_OBJECT_CLASS (klass);
+ g_type_class_add_private (class, sizeof (ItipViewPrivate));
- object_class->dispose = itip_view_dispose;
+ object_class = G_OBJECT_CLASS (class);
+ object_class->finalize = itip_view_finalize;
signals[SOURCE_SELECTED] =
g_signal_new ("source_selected",
- G_TYPE_FROM_CLASS (klass),
+ G_TYPE_FROM_CLASS (class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (ItipViewClass, source_selected),
NULL, NULL,
@@ -943,7 +944,7 @@ itip_view_class_init (ItipViewClass *klass)
signals[RESPONSE] =
g_signal_new ("response",
- G_TYPE_FROM_CLASS (klass),
+ G_TYPE_FROM_CLASS (class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (ItipViewClass, response),
NULL, NULL,
@@ -996,14 +997,12 @@ alarm_check_toggled_cb (GtkWidget *check1,
static void
itip_view_init (ItipView *view)
{
- ItipViewPrivate *priv;
GtkWidget *icon, *vbox, *hbox, *separator, *table, *label;
GtkWidget *scrolled_window;
- priv = g_new0 (ItipViewPrivate, 1);
- view->priv = priv;
+ view->priv = ITIP_VIEW_GET_PRIVATE (view);
- priv->mode = ITIP_VIEW_MODE_NONE;
+ view->priv->mode = ITIP_VIEW_MODE_NONE;
gtk_box_set_spacing (GTK_BOX (view), 12);
@@ -1022,11 +1021,11 @@ itip_view_init (ItipView *view)
/* The first section listing the sender */
/* FIXME What to do if the send and organizer do not match */
- priv->sender_label = gtk_label_new (NULL);
- gtk_label_set_selectable (GTK_LABEL (priv->sender_label), TRUE);
- gtk_misc_set_alignment (GTK_MISC (priv->sender_label), 0, 0.5);
- gtk_widget_show (priv->sender_label);
- gtk_box_pack_start (GTK_BOX (vbox), priv->sender_label, FALSE, FALSE, 0);
+ view->priv->sender_label = gtk_label_new (NULL);
+ gtk_label_set_selectable (GTK_LABEL (view->priv->sender_label), TRUE);
+ gtk_misc_set_alignment (GTK_MISC (view->priv->sender_label), 0, 0.5);
+ gtk_widget_show (view->priv->sender_label);
+ gtk_box_pack_start (GTK_BOX (vbox), view->priv->sender_label, FALSE, FALSE, 0);
separator = gtk_hseparator_new ();
gtk_widget_show (separator);
@@ -1040,116 +1039,118 @@ itip_view_init (ItipView *view)
gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
/* Summary */
- priv->summary_label = gtk_label_new (NULL);
- gtk_label_set_selectable (GTK_LABEL (priv->summary_label), TRUE);
- gtk_misc_set_alignment (GTK_MISC (priv->summary_label), 0, 0.5);
- gtk_label_set_line_wrap_mode (GTK_LABEL (priv->summary_label), PANGO_WRAP_WORD);
- gtk_label_set_line_wrap (GTK_LABEL (priv->summary_label), TRUE);
- gtk_widget_show (priv->summary_label);
- gtk_table_attach (GTK_TABLE (table), priv->summary_label, 0, 2, 0, 1, GTK_FILL | GTK_EXPAND, 0, 0, 0);
+ view->priv->summary_label = gtk_label_new (NULL);
+ gtk_label_set_selectable (GTK_LABEL (view->priv->summary_label), TRUE);
+ gtk_misc_set_alignment (GTK_MISC (view->priv->summary_label), 0, 0.5);
+ gtk_label_set_line_wrap_mode (GTK_LABEL (view->priv->summary_label), PANGO_WRAP_WORD);
+ gtk_label_set_line_wrap (GTK_LABEL (view->priv->summary_label), TRUE);
+ gtk_widget_show (view->priv->summary_label);
+ gtk_table_attach (GTK_TABLE (table), view->priv->summary_label, 0, 2, 0, 1, GTK_FILL | GTK_EXPAND, 0, 0, 0);
/* Location */
- priv->location_header = gtk_label_new (_("Location:"));
- priv->location_label = gtk_label_new (NULL);
- gtk_label_set_selectable (GTK_LABEL (priv->location_header), TRUE);
- gtk_label_set_selectable (GTK_LABEL (priv->location_label), TRUE);
- gtk_misc_set_alignment (GTK_MISC (priv->location_header), 0, 0.5);
- gtk_misc_set_alignment (GTK_MISC (priv->location_label), 0, 0.5);
- gtk_table_attach (GTK_TABLE (table), priv->location_header, 0, 1, 1, 2, GTK_FILL, 0, 0, 0);
- gtk_table_attach (GTK_TABLE (table), priv->location_label, 1, 2, 1, 2, GTK_FILL | GTK_EXPAND, 0, 0, 0);
+ view->priv->location_header = gtk_label_new (_("Location:"));
+ view->priv->location_label = gtk_label_new (NULL);
+ gtk_label_set_selectable (GTK_LABEL (view->priv->location_header), TRUE);
+ gtk_label_set_selectable (GTK_LABEL (view->priv->location_label), TRUE);
+ gtk_misc_set_alignment (GTK_MISC (view->priv->location_header), 0, 0.5);
+ gtk_misc_set_alignment (GTK_MISC (view->priv->location_label), 0, 0.5);
+ gtk_table_attach (GTK_TABLE (table), view->priv->location_header, 0, 1, 1, 2, GTK_FILL, 0, 0, 0);
+ gtk_table_attach (GTK_TABLE (table), view->priv->location_label, 1, 2, 1, 2, GTK_FILL | GTK_EXPAND, 0, 0, 0);
/* Start time */
- priv->start_header = gtk_label_new (_("Start time:"));
- priv->start_label = gtk_label_new (NULL);
- gtk_label_set_selectable (GTK_LABEL (priv->start_header), TRUE);
- gtk_label_set_selectable (GTK_LABEL (priv->start_label), TRUE);
- gtk_misc_set_alignment (GTK_MISC (priv->start_header), 0, 0.5);
- gtk_misc_set_alignment (GTK_MISC (priv->start_label), 0, 0.5);
- gtk_widget_show (priv->start_header);
- gtk_table_attach (GTK_TABLE (table), priv->start_header, 0, 1, 2, 3, GTK_FILL, 0, 0, 0);
- gtk_table_attach (GTK_TABLE (table), priv->start_label, 1, 2, 2, 3, GTK_FILL | GTK_EXPAND, 0, 0, 0);
+ view->priv->start_header = gtk_label_new (_("Start time:"));
+ view->priv->start_label = gtk_label_new (NULL);
+ gtk_label_set_selectable (GTK_LABEL (view->priv->start_header), TRUE);
+ gtk_label_set_selectable (GTK_LABEL (view->priv->start_label), TRUE);
+ gtk_misc_set_alignment (GTK_MISC (view->priv->start_header), 0, 0.5);
+ gtk_misc_set_alignment (GTK_MISC (view->priv->start_label), 0, 0.5);
+ gtk_widget_show (view->priv->start_header);
+ gtk_table_attach (GTK_TABLE (table), view->priv->start_header, 0, 1, 2, 3, GTK_FILL, 0, 0, 0);
+ gtk_table_attach (GTK_TABLE (table), view->priv->start_label, 1, 2, 2, 3, GTK_FILL | GTK_EXPAND, 0, 0, 0);
/* End time */
- priv->end_header = gtk_label_new (_("End time:"));
- priv->end_label = gtk_label_new (NULL);
- gtk_label_set_selectable (GTK_LABEL (priv->end_header), TRUE);
- gtk_label_set_selectable (GTK_LABEL (priv->end_label), TRUE);
- gtk_misc_set_alignment (GTK_MISC (priv->end_header), 0, 0.5);
- gtk_misc_set_alignment (GTK_MISC (priv->end_label), 0, 0.5);
- gtk_table_attach (GTK_TABLE (table), priv->end_header, 0, 1, 3, 4, GTK_FILL, 0, 0, 0);
- gtk_table_attach (GTK_TABLE (table), priv->end_label, 1, 2, 3, 4, GTK_FILL | GTK_EXPAND, 0, 0, 0);
+ view->priv->end_header = gtk_label_new (_("End time:"));
+ view->priv->end_label = gtk_label_new (NULL);
+ gtk_label_set_selectable (GTK_LABEL (view->priv->end_header), TRUE);
+ gtk_label_set_selectable (GTK_LABEL (view->priv->end_label), TRUE);
+ gtk_misc_set_alignment (GTK_MISC (view->priv->end_header), 0, 0.5);
+ gtk_misc_set_alignment (GTK_MISC (view->priv->end_label), 0, 0.5);
+ gtk_table_attach (GTK_TABLE (table), view->priv->end_header, 0, 1, 3, 4, GTK_FILL, 0, 0, 0);
+ gtk_table_attach (GTK_TABLE (table), view->priv->end_label, 1, 2, 3, 4, GTK_FILL | GTK_EXPAND, 0, 0, 0);
/* Status */
- priv->status_header = gtk_label_new (_("Status:"));
- priv->status_label = gtk_label_new (NULL);
- gtk_label_set_selectable (GTK_LABEL (priv->status_header), TRUE);
- gtk_label_set_selectable (GTK_LABEL (priv->status_label), TRUE);
- gtk_misc_set_alignment (GTK_MISC (priv->status_header), 0, 0.5);
- gtk_misc_set_alignment (GTK_MISC (priv->status_label), 0, 0.5);
- gtk_table_attach (GTK_TABLE (table), priv->status_header, 0, 1, 4, 5, GTK_FILL, 0, 0, 0);
- gtk_table_attach (GTK_TABLE (table), priv->status_label, 1, 2, 4, 5, GTK_FILL | GTK_EXPAND, 0, 0, 0);
+ view->priv->status_header = gtk_label_new (_("Status:"));
+ view->priv->status_label = gtk_label_new (NULL);
+ gtk_label_set_selectable (GTK_LABEL (view->priv->status_header), TRUE);
+ gtk_label_set_selectable (GTK_LABEL (view->priv->status_label), TRUE);
+ gtk_misc_set_alignment (GTK_MISC (view->priv->status_header), 0, 0.5);
+ gtk_misc_set_alignment (GTK_MISC (view->priv->status_label), 0, 0.5);
+ gtk_table_attach (GTK_TABLE (table), view->priv->status_header, 0, 1, 4, 5, GTK_FILL, 0, 0, 0);
+ gtk_table_attach (GTK_TABLE (table), view->priv->status_label, 1, 2, 4, 5, GTK_FILL | GTK_EXPAND, 0, 0, 0);
/* Comment */
- priv->comment_header = gtk_label_new (_("Comment:"));
- priv->comment_label = gtk_label_new (NULL);
- gtk_label_set_selectable (GTK_LABEL (priv->comment_header), TRUE);
- gtk_label_set_selectable (GTK_LABEL (priv->comment_label), TRUE);
- gtk_misc_set_alignment (GTK_MISC (priv->comment_header), 0, 0.5);
- gtk_misc_set_alignment (GTK_MISC (priv->comment_label), 0, 0.5);
- gtk_table_attach (GTK_TABLE (table), priv->comment_header, 0, 1, 5, 6, GTK_FILL, 0, 0, 0);
- gtk_table_attach (GTK_TABLE (table), priv->comment_label, 1, 2, 5, 6, GTK_FILL | GTK_EXPAND, 0, 0, 0);
+ view->priv->comment_header = gtk_label_new (_("Comment:"));
+ view->priv->comment_label = gtk_label_new (NULL);
+ gtk_label_set_selectable (GTK_LABEL (view->priv->comment_header), TRUE);
+ gtk_label_set_selectable (GTK_LABEL (view->priv->comment_label), TRUE);
+ gtk_misc_set_alignment (GTK_MISC (view->priv->comment_header), 0, 0.5);
+ gtk_misc_set_alignment (GTK_MISC (view->priv->comment_label), 0, 0.5);
+ gtk_table_attach (GTK_TABLE (table), view->priv->comment_header, 0, 1, 5, 6, GTK_FILL, 0, 0, 0);
+ gtk_table_attach (GTK_TABLE (table), view->priv->comment_label, 1, 2, 5, 6, GTK_FILL | GTK_EXPAND, 0, 0, 0);
/* Upper Info items */
- priv->upper_info_box = gtk_vbox_new (FALSE, 12);
- gtk_widget_show (priv->upper_info_box);
- gtk_box_pack_start (GTK_BOX (vbox), priv->upper_info_box, FALSE, FALSE, 0);
+ view->priv->upper_info_box = gtk_vbox_new (FALSE, 12);
+ gtk_widget_show (view->priv->upper_info_box);
+ gtk_box_pack_start (GTK_BOX (vbox), view->priv->upper_info_box, FALSE, FALSE, 0);
/* Description */
- priv->description_label = gtk_label_new (NULL);
- gtk_label_set_selectable (GTK_LABEL (priv->description_label), TRUE);
- gtk_label_set_line_wrap (GTK_LABEL (priv->description_label), TRUE);
- gtk_misc_set_alignment (GTK_MISC (priv->description_label), 0, 0.5);
- gtk_box_pack_start (GTK_BOX (vbox), priv->description_label, FALSE, FALSE, 0);
+ view->priv->description_label = gtk_label_new (NULL);
+ gtk_label_set_selectable (GTK_LABEL (view->priv->description_label), TRUE);
+ gtk_label_set_line_wrap (GTK_LABEL (view->priv->description_label), TRUE);
+ gtk_misc_set_alignment (GTK_MISC (view->priv->description_label), 0, 0.5);
+ gtk_box_pack_start (GTK_BOX (vbox), view->priv->description_label, FALSE, FALSE, 0);
separator = gtk_hseparator_new ();
gtk_widget_show (separator);
gtk_box_pack_start (GTK_BOX (vbox), separator, FALSE, FALSE, 0);
/* Lower Info items */
- priv->lower_info_box = gtk_vbox_new (FALSE, 12);
- gtk_widget_show (priv->lower_info_box);
- gtk_box_pack_start (GTK_BOX (vbox), priv->lower_info_box, FALSE, FALSE, 0);
+ view->priv->lower_info_box = gtk_vbox_new (FALSE, 12);
+ gtk_widget_show (view->priv->lower_info_box);
+ gtk_box_pack_start (GTK_BOX (vbox), view->priv->lower_info_box, FALSE, FALSE, 0);
/* Selector area */
- priv->selector_box = gtk_hbox_new (FALSE, 12);
- gtk_widget_show (priv->selector_box);
- gtk_box_pack_start (GTK_BOX (vbox), priv->selector_box, FALSE, FALSE, 0);
+ view->priv->selector_box = gtk_hbox_new (FALSE, 12);
+ gtk_widget_show (view->priv->selector_box);
+ gtk_box_pack_start (GTK_BOX (vbox), view->priv->selector_box, FALSE, FALSE, 0);
/* RSVP area */
- priv->rsvp_box = gtk_vbox_new (FALSE, 12);
- gtk_box_pack_start (GTK_BOX (vbox), priv->rsvp_box, FALSE, FALSE, 0);
+ view->priv->rsvp_box = gtk_vbox_new (FALSE, 12);
+ gtk_box_pack_start (GTK_BOX (vbox), view->priv->rsvp_box, FALSE, FALSE, 0);
- priv->rsvp_check = gtk_check_button_new_with_mnemonic (_("Send _reply to sender"));
- gtk_widget_show (priv->rsvp_check);
- gtk_box_pack_start (GTK_BOX (priv->rsvp_box), priv->rsvp_check, FALSE, FALSE, 0);
+ view->priv->rsvp_check = gtk_check_button_new_with_mnemonic (_("Send _reply to sender"));
+ gtk_widget_show (view->priv->rsvp_check);
+ gtk_box_pack_start (GTK_BOX (view->priv->rsvp_box), view->priv->rsvp_check, FALSE, FALSE, 0);
- g_signal_connect (priv->rsvp_check, "toggled", G_CALLBACK (rsvp_toggled_cb), view);
+ g_signal_connect (
+ view->priv->rsvp_check, "toggled",
+ G_CALLBACK (rsvp_toggled_cb), view);
hbox = gtk_hbox_new (FALSE, 12);
gtk_widget_show (hbox);
- gtk_box_pack_start (GTK_BOX (priv->rsvp_box), hbox, FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (view->priv->rsvp_box), hbox, FALSE, FALSE, 0);
label = gtk_label_new (NULL);
gtk_label_set_selectable (GTK_LABEL (label), TRUE);
gtk_widget_show (label);
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
- priv->rsvp_comment_header = gtk_label_new (_("Comment:"));
- gtk_label_set_selectable (GTK_LABEL (priv->rsvp_comment_header), TRUE);
- gtk_misc_set_alignment (GTK_MISC (priv->rsvp_comment_header), 0.0, 0.0);
- gtk_widget_set_sensitive (priv->rsvp_comment_header, FALSE);
- gtk_widget_show (priv->rsvp_comment_header);
- gtk_box_pack_start (GTK_BOX (hbox), priv->rsvp_comment_header, FALSE, FALSE, 0);
+ view->priv->rsvp_comment_header = gtk_label_new (_("Comment:"));
+ gtk_label_set_selectable (GTK_LABEL (view->priv->rsvp_comment_header), TRUE);
+ gtk_misc_set_alignment (GTK_MISC (view->priv->rsvp_comment_header), 0.0, 0.0);
+ gtk_widget_set_sensitive (view->priv->rsvp_comment_header, FALSE);
+ gtk_widget_show (view->priv->rsvp_comment_header);
+ gtk_box_pack_start (GTK_BOX (hbox), view->priv->rsvp_comment_header, FALSE, FALSE, 0);
scrolled_window = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
@@ -1157,57 +1158,65 @@ itip_view_init (ItipView *view)
gtk_widget_show (scrolled_window);
gtk_box_pack_start (GTK_BOX (hbox), scrolled_window, TRUE, TRUE, 0);
- priv->rsvp_comment_text = gtk_text_view_new ();
- gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (priv->rsvp_comment_text), GTK_WRAP_WORD_CHAR);
- gtk_widget_set_sensitive (priv->rsvp_comment_text, FALSE);
- gtk_widget_show (priv->rsvp_comment_text);
- gtk_container_add (GTK_CONTAINER (scrolled_window), priv->rsvp_comment_text);
+ view->priv->rsvp_comment_text = gtk_text_view_new ();
+ gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (view->priv->rsvp_comment_text), GTK_WRAP_WORD_CHAR);
+ gtk_widget_set_sensitive (view->priv->rsvp_comment_text, FALSE);
+ gtk_widget_show (view->priv->rsvp_comment_text);
+ gtk_container_add (GTK_CONTAINER (scrolled_window), view->priv->rsvp_comment_text);
/* RSVP area */
- priv->update_box = gtk_vbox_new (FALSE, 12);
- gtk_box_pack_start (GTK_BOX (vbox), priv->update_box, FALSE, FALSE, 0);
+ view->priv->update_box = gtk_vbox_new (FALSE, 12);
+ gtk_box_pack_start (GTK_BOX (vbox), view->priv->update_box, FALSE, FALSE, 0);
- priv->update_check = gtk_check_button_new_with_mnemonic (_("Send _updates to attendees"));
- gtk_widget_show (priv->update_check);
- gtk_box_pack_start (GTK_BOX (priv->update_box), priv->update_check, FALSE, FALSE, 0);
+ view->priv->update_check = gtk_check_button_new_with_mnemonic (_("Send _updates to attendees"));
+ gtk_widget_show (view->priv->update_check);
+ gtk_box_pack_start (GTK_BOX (view->priv->update_box), view->priv->update_check, FALSE, FALSE, 0);
/* The recurrence check button */
- priv->recur_box = gtk_vbox_new (FALSE, 12);
- gtk_widget_show (priv->recur_box);
- gtk_box_pack_start (GTK_BOX (vbox), priv->recur_box, FALSE, FALSE, 0);
+ view->priv->recur_box = gtk_vbox_new (FALSE, 12);
+ gtk_widget_show (view->priv->recur_box);
+ gtk_box_pack_start (GTK_BOX (vbox), view->priv->recur_box, FALSE, FALSE, 0);
- priv->recur_check = gtk_check_button_new_with_mnemonic (_("_Apply to all instances"));
- gtk_box_pack_start (GTK_BOX (priv->recur_box), priv->recur_check, FALSE, FALSE, 0);
+ view->priv->recur_check = gtk_check_button_new_with_mnemonic (_("_Apply to all instances"));
+ gtk_box_pack_start (GTK_BOX (view->priv->recur_box), view->priv->recur_check, FALSE, FALSE, 0);
- g_signal_connect (priv->recur_check, "toggled", G_CALLBACK (recur_toggled_cb), view);
+ g_signal_connect (
+ view->priv->recur_check, "toggled",
+ G_CALLBACK (recur_toggled_cb), view);
- priv->options_box = gtk_vbox_new (FALSE, 2);
- gtk_widget_show (priv->options_box);
- gtk_box_pack_start (GTK_BOX (vbox), priv->options_box, FALSE, FALSE, 0);
+ view->priv->options_box = gtk_vbox_new (FALSE, 2);
+ gtk_widget_show (view->priv->options_box);
+ gtk_box_pack_start (GTK_BOX (vbox), view->priv->options_box, FALSE, FALSE, 0);
- priv->free_time_check = gtk_check_button_new_with_mnemonic (_("Show time as _free"));
- gtk_box_pack_start (GTK_BOX (priv->options_box), priv->free_time_check, FALSE, FALSE, 0);
+ view->priv->free_time_check = gtk_check_button_new_with_mnemonic (_("Show time as _free"));
+ gtk_box_pack_start (GTK_BOX (view->priv->options_box), view->priv->free_time_check, FALSE, FALSE, 0);
- priv->keep_alarm_check = gtk_check_button_new_with_mnemonic (_("_Preserve my reminder"));
+ view->priv->keep_alarm_check = gtk_check_button_new_with_mnemonic (_("_Preserve my reminder"));
/* default value is to keep user's alarms */
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (view->priv->keep_alarm_check), TRUE);
- gtk_box_pack_start (GTK_BOX (priv->options_box), priv->keep_alarm_check, FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (view->priv->options_box), view->priv->keep_alarm_check, FALSE, FALSE, 0);
/* To Translators: This is a check box to inherit a reminder. */
- priv->inherit_alarm_check = gtk_check_button_new_with_mnemonic (_("_Inherit reminder"));
- gtk_box_pack_start (GTK_BOX (priv->options_box), priv->inherit_alarm_check, FALSE, FALSE, 0);
+ view->priv->inherit_alarm_check = gtk_check_button_new_with_mnemonic (_("_Inherit reminder"));
+ gtk_box_pack_start (GTK_BOX (view->priv->options_box), view->priv->inherit_alarm_check, FALSE, FALSE, 0);
- g_signal_connect (priv->keep_alarm_check, "toggled", G_CALLBACK (alarm_check_toggled_cb), priv->inherit_alarm_check);
- g_signal_connect (priv->inherit_alarm_check, "toggled", G_CALLBACK (alarm_check_toggled_cb), priv->keep_alarm_check);
+ g_signal_connect (
+ view->priv->keep_alarm_check, "toggled",
+ G_CALLBACK (alarm_check_toggled_cb),
+ view->priv->inherit_alarm_check);
+ g_signal_connect (
+ view->priv->inherit_alarm_check, "toggled",
+ G_CALLBACK (alarm_check_toggled_cb),
+ view->priv->keep_alarm_check);
/* The buttons for actions */
- priv->button_box = gtk_hbutton_box_new ();
- gtk_button_box_set_layout (GTK_BUTTON_BOX (priv->button_box), GTK_BUTTONBOX_START);
- gtk_box_set_spacing (GTK_BOX (priv->button_box), 12);
- gtk_widget_show (priv->button_box);
- gtk_box_pack_start (GTK_BOX (vbox), priv->button_box, FALSE, FALSE, 0);
+ view->priv->button_box = gtk_hbutton_box_new ();
+ gtk_button_box_set_layout (GTK_BUTTON_BOX (view->priv->button_box), GTK_BUTTONBOX_START);
+ gtk_box_set_spacing (GTK_BOX (view->priv->button_box), 12);
+ gtk_widget_show (view->priv->button_box);
+ gtk_box_pack_start (GTK_BOX (vbox), view->priv->button_box, FALSE, FALSE, 0);
- priv->buttons_sensitive = TRUE;
+ view->priv->buttons_sensitive = TRUE;
}
GtkWidget *
diff --git a/plugins/mail-notification/mail-notification.c b/plugins/mail-notification/mail-notification.c
index 0c6714d856..005ee66b74 100644
--- a/plugins/mail-notification/mail-notification.c
+++ b/plugins/mail-notification/mail-notification.c
@@ -665,7 +665,9 @@ get_config_widget_sound (void)
settings = g_settings_new ("org.gnome.evolution.plugin.mail-notification");
- g_settings_bind (settings, CONF_KEY_ENABLED_SOUND, G_OBJECT (widget), "active", G_SETTINGS_BIND_DEFAULT);
+ g_settings_bind (
+ settings, CONF_KEY_ENABLED_SOUND,
+ widget, "active", G_SETTINGS_BIND_DEFAULT);
master = widget;
scw->enable = GTK_TOGGLE_BUTTON (widget);
@@ -693,7 +695,9 @@ get_config_widget_sound (void)
gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0);
gtk_widget_show (widget);
- g_settings_bind (settings, CONF_KEY_SOUND_BEEP, G_OBJECT (widget), "active", G_SETTINGS_BIND_DEFAULT);
+ g_settings_bind (
+ settings, CONF_KEY_SOUND_BEEP,
+ widget, "active", G_SETTINGS_BIND_DEFAULT);
scw->beep = GTK_TOGGLE_BUTTON (widget);
@@ -704,7 +708,9 @@ get_config_widget_sound (void)
gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0);
gtk_widget_show (widget);
- g_settings_bind (settings, CONF_KEY_SOUND_USE_THEME, G_OBJECT (widget), "active", G_SETTINGS_BIND_DEFAULT);
+ g_settings_bind (
+ settings, CONF_KEY_SOUND_USE_THEME,
+ widget, "active", G_SETTINGS_BIND_DEFAULT);
scw->use_theme = GTK_TOGGLE_BUTTON (widget);
@@ -721,7 +727,9 @@ get_config_widget_sound (void)
gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0);
gtk_widget_show (widget);
- g_settings_bind (settings, CONF_KEY_SOUND_PLAY_FILE, G_OBJECT (widget), "active", G_SETTINGS_BIND_DEFAULT);
+ g_settings_bind (
+ settings, CONF_KEY_SOUND_PLAY_FILE,
+ widget, "active", G_SETTINGS_BIND_DEFAULT);
text = _("Select sound file");
widget = gtk_file_chooser_button_new (
@@ -784,7 +792,9 @@ get_cfg_widget (void)
gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0);
gtk_widget_show (widget);
- g_settings_bind (settings, CONF_KEY_NOTIFY_ONLY_INBOX, G_OBJECT (widget), "active", G_SETTINGS_BIND_DEFAULT);
+ g_settings_bind (
+ settings, CONF_KEY_NOTIFY_ONLY_INBOX,
+ widget, "active", G_SETTINGS_BIND_DEFAULT);
#ifdef HAVE_LIBNOTIFY
text = _("Show _notification when a new message arrives");
@@ -792,7 +802,9 @@ get_cfg_widget (void)
gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0);
gtk_widget_show (widget);
- g_settings_bind (settings, CONF_KEY_ENABLED_STATUS, G_OBJECT (widget), "active", G_SETTINGS_BIND_DEFAULT);
+ g_settings_bind (
+ settings, CONF_KEY_ENABLED_STATUS,
+ widget, "active", G_SETTINGS_BIND_DEFAULT);
#endif
widget = get_config_widget_sound ();
diff --git a/plugins/mail-to-task/mail-to-task.c b/plugins/mail-to-task/mail-to-task.c
index fbb10669bf..6cf942acb4 100644
--- a/plugins/mail-to-task/mail-to-task.c
+++ b/plugins/mail-to-task/mail-to-task.c
@@ -633,7 +633,7 @@ get_question_edit_old (ECalClientSourceType source_type)
static const gchar *
get_question_add_all_mails (ECalClientSourceType source_type,
- gint count)
+ gint count)
{
const gchar *ask = NULL;
@@ -790,10 +790,12 @@ do_manage_comp_idle (struct _manage_comp *mc)
/* Force editor's title change */
comp_editor_title_changed (GTK_WIDGET (editor), NULL, mc);
- g_signal_connect (editor, "notify::title",
- G_CALLBACK (comp_editor_title_changed), mc);
- g_signal_connect (editor, "comp_closed",
- G_CALLBACK (comp_editor_closed), mc);
+ g_signal_connect (
+ editor, "notify::title",
+ G_CALLBACK (comp_editor_title_changed), mc);
+ g_signal_connect (
+ editor, "comp_closed",
+ G_CALLBACK (comp_editor_closed), mc);
gtk_window_present (GTK_WINDOW (editor));
@@ -1191,7 +1193,9 @@ mail_to_event (ECalClientSourceType source_type,
return;
}
- g_signal_connect (client, "authenticate", G_CALLBACK (e_client_utils_authenticate_handler), NULL);
+ g_signal_connect (
+ client, "authenticate",
+ G_CALLBACK (e_client_utils_authenticate_handler), NULL);
/* Fill the elements in AsynData */
data = g_new0 (AsyncData, 1);
diff --git a/plugins/mark-all-read/mark-all-read.c b/plugins/mark-all-read/mark-all-read.c
index beac49ae47..69b3893e6f 100644
--- a/plugins/mark-all-read/mark-all-read.c
+++ b/plugins/mark-all-read/mark-all-read.c
@@ -267,7 +267,11 @@ scan_folder_tree_for_unread_helper (GtkTreeModel *model,
gboolean folder_has_unread;
gboolean is_draft = FALSE;
gboolean is_store = FALSE;
- guint unread = 0, folder_flags = 0;
+ gboolean is_trash;
+ gboolean is_virtual;
+ guint unread = 0;
+ guint folder_flags = 0;
+ guint folder_type;
gtk_tree_model_get (
model, iter,
@@ -276,10 +280,13 @@ scan_folder_tree_for_unread_helper (GtkTreeModel *model,
COL_BOOL_IS_STORE, &is_store,
COL_BOOL_IS_DRAFT, &is_draft, -1);
+ folder_type = (folder_flags & CAMEL_FOLDER_TYPE_MASK);
+ is_virtual = ((folder_flags & CAMEL_FOLDER_VIRTUAL) != 0);
+ is_trash = (folder_type == CAMEL_FOLDER_TYPE_TRASH);
+
folder_has_unread =
!is_store && !is_draft &&
- ((folder_flags & CAMEL_FOLDER_VIRTUAL) == 0 ||
- (folder_flags & CAMEL_FOLDER_TYPE_MASK) != CAMEL_FOLDER_TYPE_TRASH) &&
+ (!is_virtual || !is_trash) &&
unread > 0 && unread != ~((guint) 0);
if (folder_has_unread) {
diff --git a/plugins/prefer-plain/prefer-plain.c b/plugins/prefer-plain/prefer-plain.c
index 5a8c4b6d5b..4b1ac49010 100644
--- a/plugins/prefer-plain/prefer-plain.c
+++ b/plugins/prefer-plain/prefer-plain.c
@@ -311,7 +311,9 @@ org_gnome_prefer_plain_config_mode (EPlugin *epl,
check = gtk_check_button_new_with_mnemonic (_("Show s_uppressed HTML parts as attachments"));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), epp_show_suppressed);
gtk_widget_show (check);
- g_signal_connect (check, "toggled", G_CALLBACK (epp_show_suppressed_toggled), NULL);
+ g_signal_connect (
+ check, "toggled",
+ G_CALLBACK (epp_show_suppressed_toggled), NULL);
dropdown = (GtkComboBox *) gtk_combo_box_new ();
cell = gtk_cell_renderer_text_new ();
@@ -339,7 +341,9 @@ org_gnome_prefer_plain_config_mode (EPlugin *epl,
gtk_widget_show (info);
update_info_label (info, epp_mode);
- g_signal_connect (dropdown, "changed", G_CALLBACK(epp_mode_changed), info);
+ g_signal_connect (
+ dropdown, "changed",
+ G_CALLBACK (epp_mode_changed), info);
g_object_get (data->parent, "n-rows", &i, NULL);
gtk_table_attach ((GtkTable *) data->parent, check, 0, 2, i, i + 1, GTK_FILL | GTK_EXPAND, 0, 0, 0);
diff --git a/plugins/pst-import/pst-importer.c b/plugins/pst-import/pst-importer.c
index f1e61dd07c..e86fa2ab81 100644
--- a/plugins/pst-import/pst-importer.c
+++ b/plugins/pst-import/pst-importer.c
@@ -542,7 +542,9 @@ org_credativ_evolution_readpst_getwidget (EImport *ei,
hbox = gtk_hbox_new (FALSE, 0);
check = gtk_check_button_new_with_mnemonic (_("_Mail"));
gtk_toggle_button_set_active ((GtkToggleButton *) check, GPOINTER_TO_INT (g_datalist_get_data (&target->data, "pst-do-mail")));
- g_signal_connect (check, "toggled", G_CALLBACK (checkbox_mail_toggle_cb), target);
+ g_signal_connect (
+ check, "toggled",
+ G_CALLBACK (checkbox_mail_toggle_cb), target);
gtk_box_pack_start ((GtkBox *) hbox, check, FALSE, FALSE, 0);
shell = e_shell_get_default ();
@@ -557,14 +559,20 @@ org_credativ_evolution_readpst_getwidget (EImport *ei,
foldername = get_suggested_foldername ((EImportTargetURI *) target);
((EImportTargetURI *) target)->uri_dest = g_strdup (foldername);
em_folder_selection_button_set_folder_uri ((EMFolderSelectionButton *) w, foldername);
- g_signal_connect (w, "selected", G_CALLBACK (folder_selected), target);
+ g_signal_connect (
+ w, "selected",
+ G_CALLBACK (folder_selected), target);
gtk_box_pack_end ((GtkBox *) hbox, w, FALSE, FALSE, 0);
- g_signal_connect (check, "toggled", G_CALLBACK (widget_sanitizer_cb), w);
+ g_signal_connect (
+ check, "toggled",
+ G_CALLBACK (widget_sanitizer_cb), w);
widget_sanitizer_cb (GTK_TOGGLE_BUTTON (check), w);
w = gtk_label_new (_("Destination folder:"));
gtk_box_pack_end ((GtkBox *) hbox, w, FALSE, TRUE, 6);
- g_signal_connect (check, "toggled", G_CALLBACK (widget_sanitizer_cb), w);
+ g_signal_connect (
+ check, "toggled",
+ G_CALLBACK (widget_sanitizer_cb), w);
widget_sanitizer_cb (GTK_TOGGLE_BUTTON (check), w);
gtk_box_pack_start ((GtkBox *) framebox, hbox, FALSE, FALSE, 0);
diff --git a/plugins/publish-calendar/publish-calendar.c b/plugins/publish-calendar/publish-calendar.c
index 1ce9f17e41..57e0d2e899 100644
--- a/plugins/publish-calendar/publish-calendar.c
+++ b/plugins/publish-calendar/publish-calendar.c
@@ -161,7 +161,9 @@ update_publish_notification (GtkMessageType msg_type,
notify_notification_set_timeout (notify, NOTIFY_EXPIRES_DEFAULT);
g_timeout_add (500, show_notify_cb, NULL);
- g_signal_connect (notify, "closed", G_CALLBACK (remove_notification), NULL);
+ g_signal_connect (
+ notify, "closed",
+ G_CALLBACK (remove_notification), NULL);
}
}
#endif
@@ -426,8 +428,12 @@ mount_first (EPublishUri *uri,
ms->mount_op = g_mount_operation_new ();
ms->can_report_success = can_report_success;
- g_signal_connect (ms->mount_op, "ask-password", G_CALLBACK (ask_password), ms);
- g_signal_connect (ms->mount_op, "ask-question", G_CALLBACK (ask_question), ms);
+ g_signal_connect (
+ ms->mount_op, "ask-password",
+ G_CALLBACK (ask_password), ms);
+ g_signal_connect (
+ ms->mount_op, "ask-question",
+ G_CALLBACK (ask_question), ms);
g_file_mount_enclosing_volume (file, G_MOUNT_MOUNT_NONE, ms->mount_op, NULL, mount_ready_cb, ms);
}
@@ -969,7 +975,9 @@ e_plugin_lib_enable (EPlugin *ep,
g_signal_handlers_disconnect_by_func (shell, G_CALLBACK (online_state_changed), NULL);
if (enable) {
online = e_shell_get_online (shell);
- g_signal_connect (shell, "notify::online", G_CALLBACK (online_state_changed), NULL);
+ g_signal_connect (
+ shell, "notify::online",
+ G_CALLBACK (online_state_changed), NULL);
}
}
diff --git a/plugins/publish-calendar/publish-format-fb.c b/plugins/publish-calendar/publish-format-fb.c
index b5895ae4c0..7b9e3e1660 100644
--- a/plugins/publish-calendar/publish-format-fb.c
+++ b/plugins/publish-calendar/publish-format-fb.c
@@ -95,7 +95,9 @@ write_calendar (const gchar *uid,
return FALSE;
}
- g_signal_connect (client, "authenticate", G_CALLBACK (e_client_utils_authenticate_handler), NULL);
+ g_signal_connect (
+ client, "authenticate",
+ G_CALLBACK (e_client_utils_authenticate_handler), NULL);
if (!e_client_open_sync (E_CLIENT (client), TRUE, NULL, error)) {
g_object_unref (client);
@@ -109,7 +111,9 @@ write_calendar (const gchar *uid,
top_level = e_cal_util_new_top_level ();
- g_signal_connect (client, "free-busy-data", G_CALLBACK (free_busy_data_cb), &objects);
+ g_signal_connect (
+ client, "free-busy-data",
+ G_CALLBACK (free_busy_data_cb), &objects);
if (e_cal_client_get_free_busy_sync (client, start, end, users, NULL, error)) {
gchar *ical_string;
diff --git a/plugins/publish-calendar/publish-format-ical.c b/plugins/publish-calendar/publish-format-ical.c
index 4d110aed30..171fd6c1c0 100644
--- a/plugins/publish-calendar/publish-format-ical.c
+++ b/plugins/publish-calendar/publish-format-ical.c
@@ -92,7 +92,9 @@ write_calendar (const gchar *uid,
return FALSE;
}
- g_signal_connect (client, "authenticate", G_CALLBACK (e_client_utils_authenticate_handler), NULL);
+ g_signal_connect (
+ client, "authenticate",
+ G_CALLBACK (e_client_utils_authenticate_handler), NULL);
if (!e_client_open_sync (E_CLIENT (client), TRUE, NULL, error)) {
g_object_unref (client);
diff --git a/plugins/publish-calendar/url-editor-dialog.c b/plugins/publish-calendar/url-editor-dialog.c
index 9467705040..db3dd28bdc 100644
--- a/plugins/publish-calendar/url-editor-dialog.c
+++ b/plugins/publish-calendar/url-editor-dialog.c
@@ -32,7 +32,10 @@
#include <e-util/e-util.h>
#include <e-util/e-util-private.h>
-static GtkDialogClass *parent_class = NULL;
+G_DEFINE_TYPE (
+ UrlEditorDialog,
+ url_editor_dialog,
+ GTK_TYPE_DIALOG)
static void
create_uri (UrlEditorDialog *dialog)
@@ -540,17 +543,15 @@ url_editor_dialog_dispose (GObject *obj)
dialog->builder = NULL;
}
- ((GObjectClass *)(parent_class))->dispose (obj);
+ G_OBJECT_CLASS (url_editor_dialog_parent_class)->dispose (obj);
}
static void
-url_editor_dialog_class_init (UrlEditorDialogClass *klass)
+url_editor_dialog_class_init (UrlEditorDialogClass *class)
{
GObjectClass *object_class;
- object_class = (GObjectClass *) klass;
- parent_class = g_type_class_ref (GTK_TYPE_DIALOG);
-
+ object_class = G_OBJECT_CLASS (class);
object_class->dispose = url_editor_dialog_dispose;
}
@@ -559,28 +560,6 @@ url_editor_dialog_init (UrlEditorDialog *dialog)
{
}
-GType
-url_editor_dialog_get_type (void)
-{
- static GType type = 0;
-
- if (!type) {
- static GTypeInfo info = {
- sizeof (UrlEditorDialogClass),
- NULL, NULL,
- (GClassInitFunc) url_editor_dialog_class_init,
- NULL, NULL,
- sizeof (UrlEditorDialog),
- 0,
- (GInstanceInitFunc) url_editor_dialog_init,
- };
-
- type = g_type_register_static (GTK_TYPE_DIALOG, "UrlEditorDialog", &info, 0);
- }
-
- return type;
-}
-
gboolean
url_editor_dialog_run (UrlEditorDialog *dialog)
{
diff --git a/plugins/save-calendar/ical-format.c b/plugins/save-calendar/ical-format.c
index bf0a8db03a..77e5558e29 100644
--- a/plugins/save-calendar/ical-format.c
+++ b/plugins/save-calendar/ical-format.c
@@ -105,7 +105,9 @@ do_save_calendar_ical (FormatHandler *handler,
/* open source client */
source_client = e_cal_client_new (primary_source, type, &error);
if (source_client)
- g_signal_connect (source_client, "authenticate", G_CALLBACK (e_client_utils_authenticate_handler), NULL);
+ g_signal_connect (
+ source_client, "authenticate",
+ G_CALLBACK (e_client_utils_authenticate_handler), NULL);
if (!source_client || !e_client_open_sync (E_CLIENT (source_client), TRUE, NULL, &error)) {
display_error_message (gtk_widget_get_toplevel (GTK_WIDGET (selector)), error->message);
diff --git a/plugins/save-calendar/rdf-format.c b/plugins/save-calendar/rdf-format.c
index d840177dfe..11c29fa854 100644
--- a/plugins/save-calendar/rdf-format.c
+++ b/plugins/save-calendar/rdf-format.c
@@ -206,7 +206,9 @@ do_save_calendar_rdf (FormatHandler *handler,
/* open source client */
source_client = e_cal_client_new (primary_source, type, &error);
if (source_client)
- g_signal_connect (source_client, "authenticate", G_CALLBACK (e_client_utils_authenticate_handler), NULL);
+ g_signal_connect (
+ source_client, "authenticate",
+ G_CALLBACK (e_client_utils_authenticate_handler), NULL);
if (!source_client || !e_client_open_sync (E_CLIENT (source_client), TRUE, NULL, &error)) {
display_error_message (gtk_widget_get_toplevel (GTK_WIDGET (selector)), error);
diff --git a/plugins/templates/templates.c b/plugins/templates/templates.c
index 2b62dc922d..63b688619c 100644
--- a/plugins/templates/templates.c
+++ b/plugins/templates/templates.c
@@ -462,13 +462,17 @@ e_plugin_lib_get_configure_widget (EPlugin *epl)
gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (ui->treeview), -1, _("Keywords"),
renderer_key, "text", CLUE_KEYWORD_COLUMN, NULL);
g_object_set (renderer_key, "editable", TRUE, NULL);
- g_signal_connect (renderer_key, "edited", (GCallback) key_cell_edited_callback, ui);
+ g_signal_connect (
+ renderer_key, "edited",
+ (GCallback) key_cell_edited_callback, ui);
renderer_value = gtk_cell_renderer_text_new ();
gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (ui->treeview), -1, _("Values"),
renderer_value, "text", CLUE_VALUE_COLUMN, NULL);
g_object_set (renderer_value, "editable", TRUE, NULL);
- g_signal_connect (renderer_value, "edited", (GCallback) value_cell_edited_callback, ui);
+ g_signal_connect (
+ renderer_value, "edited",
+ (GCallback) value_cell_edited_callback, ui);
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (ui->treeview));
gtk_tree_selection_set_mode (selection, GTK_SELECTION_SINGLE);
diff --git a/plugins/webdav-account-setup/webdav-contacts-source.c b/plugins/webdav-account-setup/webdav-contacts-source.c
index 1d4ab22e23..b611852db3 100644
--- a/plugins/webdav-account-setup/webdav-contacts-source.c
+++ b/plugins/webdav-account-setup/webdav-contacts-source.c
@@ -59,7 +59,8 @@ ensure_webdav_contacts_source_group (void)
{
ESourceList *source_list;
- source_list = e_source_list_new_for_gconf_default("/apps/evolution/addressbook/sources");
+ source_list = e_source_list_new_for_gconf_default (
+ "/apps/evolution/addressbook/sources");
if (source_list == NULL) {
return;
@@ -75,7 +76,8 @@ remove_webdav_contacts_source_group (void)
ESourceList *source_list;
ESourceGroup *group;
- source_list = e_source_list_new_for_gconf_default("/apps/evolution/addressbook/sources");
+ source_list = e_source_list_new_for_gconf_default (
+ "/apps/evolution/addressbook/sources");
if (source_list == NULL) {
return;
@@ -157,7 +159,7 @@ static void
set_source_from_ui (ui_data *data)
{
ESource *source = data->source;
- gboolean avoid_ifmatch = gtk_toggle_button_get_active (data->avoid_ifmatch_toggle);
+ gboolean avoid_ifmatch;
const gchar *url = gtk_entry_get_text (data->url_entry);
SoupURI *suri = soup_uri_new (url);
gchar *url_noprotocol;
@@ -166,6 +168,7 @@ set_source_from_ui (ui_data *data)
if (!suri)
return;
+ avoid_ifmatch = gtk_toggle_button_get_active (data->avoid_ifmatch_toggle);
e_source_set_property(source, "avoid_ifmatch", avoid_ifmatch ? "1" : "0");
/* put username into uri */
@@ -290,11 +293,21 @@ plugin_webdav_contacts (EPlugin *epl,
uidata->box = vbox2;
g_object_set_data_full(G_OBJECT(epl), "wwidget", uidata, destroy_ui_data);
- g_signal_connect (uidata->box, "destroy", G_CALLBACK (gtk_widget_destroyed), &uidata->box);
+ g_signal_connect (
+ uidata->box, "destroy",
+ G_CALLBACK (gtk_widget_destroyed), &uidata->box);
+
+ g_signal_connect_swapped (
+ uidata->username_entry, "changed",
+ G_CALLBACK (set_source_from_ui), uidata);
+
+ g_signal_connect_swapped (
+ uidata->url_entry, "changed",
+ G_CALLBACK (set_source_from_ui), uidata);
- g_signal_connect_swapped (G_OBJECT(uidata->username_entry), "changed", G_CALLBACK (set_source_from_ui), uidata);
- g_signal_connect_swapped (G_OBJECT(uidata->url_entry), "changed", G_CALLBACK (set_source_from_ui), uidata);
- g_signal_connect_swapped (G_OBJECT(uidata->avoid_ifmatch_toggle), "toggled", G_CALLBACK (set_source_from_ui), uidata);
+ g_signal_connect_swapped (
+ uidata->avoid_ifmatch_toggle, "toggled",
+ G_CALLBACK (set_source_from_ui), uidata);
return NULL;
}
diff --git a/shell/e-shell-backend.c b/shell/e-shell-backend.c
index f4baca770f..3310122cb5 100644
--- a/shell/e-shell-backend.c
+++ b/shell/e-shell-backend.c
@@ -513,7 +513,7 @@ e_shell_backend_is_busy (EShellBackend *shell_backend)
**/
void
e_shell_backend_set_prefer_new_item (EShellBackend *shell_backend,
- const gchar *prefer_new_item)
+ const gchar *prefer_new_item)
{
g_return_if_fail (shell_backend != NULL);
g_return_if_fail (E_IS_SHELL_BACKEND (shell_backend));
diff --git a/shell/e-shell-migrate.c b/shell/e-shell-migrate.c
index b0fa40d146..3efddee61d 100644
--- a/shell/e-shell-migrate.c
+++ b/shell/e-shell-migrate.c
@@ -933,8 +933,8 @@ e_shell_migrate_attempt (EShell *shell)
if (!shell_migrate_attempt (shell, major, minor, micro))
_exit (EXIT_SUCCESS);
- /* The 2.32.x (except of 2.32.2) lefts duplicate On This Computer/Personal sources,
- * thus clean the mess up */
+ /* The 2.32.x (except of 2.32.2) lefts duplicate
+ * On This Computer/Personal sources, thus clean the mess up */
client = gconf_client_get_default ();
merge_duplicate_local_sources (client, "/apps/evolution/addressbook/sources");
merge_duplicate_local_sources (client, "/apps/evolution/calendar/sources");
diff --git a/shell/e-shell-settings.c b/shell/e-shell-settings.c
index a46123f325..bae19f1309 100644
--- a/shell/e-shell-settings.c
+++ b/shell/e-shell-settings.c
@@ -35,6 +35,10 @@
(G_TYPE_INSTANCE_GET_PRIVATE \
((obj), E_TYPE_SHELL_SETTINGS, EShellSettingsPrivate))
+#define E_SHELL_SETTINGS_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_SHELL_SETTINGS, EShellSettingsPrivate))
+
struct _EShellSettingsPrivate {
GArray *value_array;
guint debug : 1;
diff --git a/shell/e-shell-switcher.c b/shell/e-shell-switcher.c
index 1deefa5613..74d1a0538f 100644
--- a/shell/e-shell-switcher.c
+++ b/shell/e-shell-switcher.c
@@ -38,6 +38,10 @@
(G_TYPE_INSTANCE_GET_PRIVATE \
((obj), E_TYPE_SHELL_SWITCHER, EShellSwitcherPrivate))
+#define E_SHELL_SWITCHER_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_SHELL_SWITCHER, EShellSwitcherPrivate))
+
#define H_PADDING 6
#define V_PADDING 6
diff --git a/shell/e-shell-window.c b/shell/e-shell-window.c
index a8b44e67db..ee87446209 100644
--- a/shell/e-shell-window.c
+++ b/shell/e-shell-window.c
@@ -81,9 +81,10 @@ shell_window_menubar_update_new_menu (EShellWindow *shell_window)
gtk_widget_show (widget);
}
-static void shell_window_backend_prefer_item_changed_cb (EShellBackend *backend,
- GParamSpec *pspec,
- EShellWindow *shell_window);
+static void shell_window_backend_prefer_item_changed_cb
+ (EShellBackend *backend,
+ GParamSpec *pspec,
+ EShellWindow *shell_window);
static void
shell_window_toolbar_update_new_menu (EShellWindow *shell_window,
@@ -106,19 +107,25 @@ shell_window_toolbar_update_new_menu (EShellWindow *shell_window,
shell_backend = e_shell_view_get_shell_backend (shell_view);
- g_signal_handlers_disconnect_by_func (shell_backend,
- shell_window_backend_prefer_item_changed_cb, shell_window);
- g_signal_connect (shell_backend, "notify::prefer-new-item",
- G_CALLBACK (shell_window_backend_prefer_item_changed_cb), shell_window);
+ g_signal_handlers_disconnect_by_func (
+ shell_backend,
+ shell_window_backend_prefer_item_changed_cb,
+ shell_window);
- shell_window_backend_prefer_item_changed_cb (shell_backend, NULL, shell_window);
+ g_signal_connect (
+ shell_backend, "notify::prefer-new-item",
+ G_CALLBACK (shell_window_backend_prefer_item_changed_cb),
+ shell_window);
+
+ shell_window_backend_prefer_item_changed_cb (
+ shell_backend, NULL, shell_window);
}
}
static void
shell_window_backend_prefer_item_changed_cb (EShellBackend *backend,
- GParamSpec *pspec,
- EShellWindow *shell_window)
+ GParamSpec *pspec,
+ EShellWindow *shell_window)
{
EShellView *shell_view;
EShellBackend *shell_backend;
@@ -1560,7 +1567,7 @@ e_shell_window_set_toolbar_visible (EShellWindow *shell_window,
**/
void
e_shell_window_set_toolbar_new_prefer_item (EShellWindow *shell_window,
- const gchar *prefer_item)
+ const gchar *prefer_item)
{
GtkWidget *toolbar;
GtkToolItem *item;
diff --git a/shell/es-event.c b/shell/es-event.c
index f6920e5d09..3ca16f9fe5 100644
--- a/shell/es-event.c
+++ b/shell/es-event.c
@@ -30,39 +30,18 @@
#include "es-event.h"
#include "e-shell.h"
-static GObjectClass *eme_parent;
static ESEvent *es_event;
-static void
-eme_class_init (GObjectClass *class)
-{
-}
+G_DEFINE_TYPE (ESEvent, es_event, E_TYPE_EVENT)
static void
-eme_init (GObject *o)
+es_event_class_init (ESEventClass *class)
{
- /*ESEvent *eme = (ESEvent *)o; */
}
-GType
-es_event_get_type (void)
+static void
+es_event_init (ESEvent *event)
{
- static GType type = 0;
-
- if (type == 0) {
- static const GTypeInfo info = {
- sizeof (ESEventClass),
- NULL, NULL,
- (GClassInitFunc) eme_class_init,
- NULL, NULL,
- sizeof (ESEvent), 0,
- (GInstanceInitFunc) eme_init
- };
- eme_parent = g_type_class_ref (e_event_get_type ());
- type = g_type_register_static(e_event_get_type(), "ESEvent", &info, 0);
- }
-
- return type;
}
/**
@@ -72,7 +51,8 @@ es_event_get_type (void)
*
* Return: the shell event handler
**/
-ESEvent *es_event_peek (void)
+ESEvent *
+es_event_peek (void)
{
if (es_event == NULL) {
es_event = g_object_new (es_event_get_type (), NULL);
@@ -106,8 +86,7 @@ es_event_target_new_upgrade (ESEvent *eme,
/* ********************************************************************** */
-static gpointer emeh_parent_class;
-#define emeh ((ESEventHook *)eph)
+G_DEFINE_TYPE (ESEventHook, es_event_hook, E_TYPE_EVENT_HOOK)
static const EEventHookTargetMap emeh_targets[] = {
{ "upgrade", ES_EVENT_TARGET_UPGRADE, NULL },
@@ -115,16 +94,10 @@ static const EEventHookTargetMap emeh_targets[] = {
};
static void
-emeh_finalize (GObject *o)
-{
- /*EPluginHook *eph = (EPluginHook *)o;*/
-
- ((GObjectClass *) emeh_parent_class)->finalize (o);
-}
-
-static void
-emeh_class_init (EPluginHookClass *class)
+es_event_hook_class_init (ESEventHookClass *class)
{
+ EPluginHookClass *plugin_hook_class;
+ EEventHookClass *event_hook_class;
gint i;
/** @HookClass: Shell Main Menu
@@ -134,35 +107,19 @@ emeh_class_init (EPluginHookClass *class)
* A hook for events coming from the shell.
**/
- ((GObjectClass *) class)->finalize = emeh_finalize;
- ((EPluginHookClass *)class)->id = "org.gnome.evolution.shell.events:1.0";
+ plugin_hook_class = E_PLUGIN_HOOK_CLASS (class);
+ plugin_hook_class->id = "org.gnome.evolution.shell.events:1.0";
for (i = 0; emeh_targets[i].type; i++)
e_event_hook_class_add_target_map (
(EEventHookClass *) class, &emeh_targets[i]);
- ((EEventHookClass *) class)->event = (EEvent *) es_event_peek ();
+ event_hook_class = E_EVENT_HOOK_CLASS (class);
+ event_hook_class->event = (EEvent *) es_event_peek ();
}
-GType
-es_event_hook_get_type (void)
+static void
+es_event_hook_init (ESEventHook *hook)
{
- static GType type = 0;
-
- if (!type) {
- static const GTypeInfo info = {
- sizeof (ESEventHookClass),
- NULL, NULL,
- (GClassInitFunc) emeh_class_init,
- NULL, NULL,
- sizeof (ESEventHook),
- 0, (GInstanceInitFunc) NULL
- };
-
- emeh_parent_class = g_type_class_ref (e_event_hook_get_type ());
- type = g_type_register_static (
- e_event_hook_get_type(), "ESEventHook", &info, 0);
- }
-
- return type;
}
+
diff --git a/smclient/eggsmclient-win32.c b/smclient/eggsmclient-win32.c
index caa06d8a2e..b404a490cc 100644
--- a/smclient/eggsmclient-win32.c
+++ b/smclient/eggsmclient-win32.c
@@ -60,9 +60,9 @@
#define EGG_TYPE_SM_CLIENT_WIN32 (egg_sm_client_win32_get_type ())
#define EGG_SM_CLIENT_WIN32(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EGG_TYPE_SM_CLIENT_WIN32, EggSMClientWin32))
-#define EGG_SM_CLIENT_WIN32_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EGG_TYPE_SM_CLIENT_WIN32, EggSMClientWin32Class))
+#define EGG_SM_CLIENT_WIN32_CLASS(cls) (G_TYPE_CHECK_CLASS_CAST ((cls), EGG_TYPE_SM_CLIENT_WIN32, EggSMClientWin32Class))
#define EGG_IS_SM_CLIENT_WIN32(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EGG_TYPE_SM_CLIENT_WIN32))
-#define EGG_IS_SM_CLIENT_WIN32_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EGG_TYPE_SM_CLIENT_WIN32))
+#define EGG_IS_SM_CLIENT_WIN32_CLASS(cls) (G_TYPE_CHECK_CLASS_TYPE ((cls), EGG_TYPE_SM_CLIENT_WIN32))
#define EGG_SM_CLIENT_WIN32_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EGG_TYPE_SM_CLIENT_WIN32, EggSMClientWin32Class))
typedef struct _EggSMClientWin32 EggSMClientWin32;
@@ -105,9 +105,9 @@ egg_sm_client_win32_init (EggSMClientWin32 *win32)
}
static void
-egg_sm_client_win32_class_init (EggSMClientWin32Class *klass)
+egg_sm_client_win32_class_init (EggSMClientWin32Class *class)
{
- EggSMClientClass *sm_client_class = EGG_SM_CLIENT_CLASS (klass);
+ EggSMClientClass *sm_client_class = EGG_SM_CLIENT_CLASS (class);
sm_client_class->startup = sm_client_win32_startup;
sm_client_class->will_quit = sm_client_win32_will_quit;
diff --git a/smclient/eggsmclient.c b/smclient/eggsmclient.c
index 91720c2832..a704ead6ce 100644
--- a/smclient/eggsmclient.c
+++ b/smclient/eggsmclient.c
@@ -46,6 +46,10 @@ struct _EggSMClientPrivate {
GKeyFile *state_file;
};
+#define EGG_SM_CLIENT_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), EGG_TYPE_SM_CLIENT, EggSMClientPrivate))
+
G_DEFINE_TYPE (EggSMClient, egg_sm_client, G_TYPE_OBJECT)
static EggSMClient *global_client;
@@ -54,16 +58,15 @@ static EggSMClientMode global_client_mode = EGG_SM_CLIENT_MODE_NORMAL;
static void
egg_sm_client_init (EggSMClient *client)
{
- client->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- client, EGG_TYPE_SM_CLIENT, EggSMClientPrivate);
+ client->priv = EGG_SM_CLIENT_GET_PRIVATE (client);
}
static void
-egg_sm_client_class_init (EggSMClientClass *klass)
+egg_sm_client_class_init (EggSMClientClass *class)
{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ GObjectClass *object_class = G_OBJECT_CLASS (class);
- g_type_class_add_private (klass, sizeof (EggSMClientPrivate));
+ g_type_class_add_private (class, sizeof (EggSMClientPrivate));
/**
* EggSMClient::save_state:
@@ -391,7 +394,7 @@ egg_sm_client_is_resumed (EggSMClient *client)
GKeyFile *
egg_sm_client_get_state_file (EggSMClient *client)
{
- EggSMClientPrivate *priv = client->priv;
+ EggSMClientPrivate *priv = EGG_SM_CLIENT_GET_PRIVATE (client);
gchar *state_file_path;
GError *err = NULL;
diff --git a/smime/gui/ca-trust-dialog.c b/smime/gui/ca-trust-dialog.c
index df2a1f825a..5827d9821a 100644
--- a/smime/gui/ca-trust-dialog.c
+++ b/smime/gui/ca-trust-dialog.c
@@ -108,7 +108,9 @@ ca_trust_dialog_show (ECert *cert,
gtk_label_set_text ((GtkLabel *) w, txt);
g_free (txt);
- g_signal_connect (ctd_data->dialog, "response", G_CALLBACK (catd_response), ctd_data);
+ g_signal_connect (
+ ctd_data->dialog, "response",
+ G_CALLBACK (catd_response), ctd_data);
g_object_set_data_full (G_OBJECT (ctd_data->dialog), "CATrustDialogData", ctd_data, free_data);
diff --git a/smime/gui/cert-trust-dialog.c b/smime/gui/cert-trust-dialog.c
index d4d6648b32..f18a28f446 100644
--- a/smime/gui/cert-trust-dialog.c
+++ b/smime/gui/cert-trust-dialog.c
@@ -130,7 +130,9 @@ cert_trust_dialog_show (ECert *cert)
ctd_data->label = e_builder_get_widget(ctd_data->builder, "trust-label");
- g_signal_connect (ctd_data->dialog, "response", G_CALLBACK(ctd_response), ctd_data);
+ g_signal_connect (
+ ctd_data->dialog, "response",
+ G_CALLBACK (ctd_response), ctd_data);
g_object_set_data_full (G_OBJECT (ctd_data->dialog), "CertTrustDialogData", ctd_data, free_data);
diff --git a/smime/gui/certificate-manager.c b/smime/gui/certificate-manager.c
index be30929cda..ac42e1d5ad 100644
--- a/smime/gui/certificate-manager.c
+++ b/smime/gui/certificate-manager.c
@@ -51,6 +51,10 @@
#include "e-util/e-util-private.h"
#include "widgets/misc/e-preferences-window.h"
+#define E_CERT_MANAGER_CONFIG_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_CERT_MANAGER_CONFIG, ECertManagerConfigPrivate))
+
G_DEFINE_TYPE (ECertManagerConfig, e_cert_manager_config, GTK_TYPE_BOX);
enum {
@@ -406,7 +410,8 @@ treeview_add_column (CertPage *cp,
gtk_tree_view_append_column (cp->treeview, column);
header = gtk_tree_view_column_get_button (column);
- g_signal_connect (header, "button-release-event",
+ g_signal_connect (
+ header, "button-release-event",
G_CALLBACK (treeview_header_clicked), cp->popup_menu);
/* The first column should not be concealable so there's no point in displaying
@@ -419,9 +424,11 @@ treeview_add_column (CertPage *cp,
gettext (cp->columns[column_index].column_title));
gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), cp->columns[column_index].visible);
gtk_menu_attach (cp->popup_menu, item, 0, 1, column_index - 1, column_index);
- g_signal_connect (item, "toggled",
+ g_signal_connect (
+ item, "toggled",
G_CALLBACK (header_popup_item_toggled), column);
- g_signal_connect (column, "notify::visible",
+ g_signal_connect (
+ column, "notify::visible",
G_CALLBACK (treeview_column_visibility_changed), item);
}
@@ -504,8 +511,9 @@ view_cert (GtkWidget *button,
if (cert) {
GtkWidget *dialog = certificate_viewer_show (cert);
- g_signal_connect (dialog, "response",
- G_CALLBACK (gtk_widget_destroy), NULL);
+ g_signal_connect (
+ dialog, "response",
+ G_CALLBACK (gtk_widget_destroy), NULL);
gtk_widget_show (dialog);
}
}
@@ -816,23 +824,28 @@ initialize_ui (CertPage *cp)
treeview_add_column (cp, i);
selection = gtk_tree_view_get_selection (cp->treeview);
- g_signal_connect (selection, "changed",
+ g_signal_connect (
+ selection, "changed",
G_CALLBACK (treeview_selection_changed), cp);
if (cp->import_button)
- g_signal_connect (cp->import_button, "clicked",
+ g_signal_connect (
+ cp->import_button, "clicked",
G_CALLBACK (import_cert), cp);
if (cp->edit_button)
- g_signal_connect (cp->edit_button, "clicked",
+ g_signal_connect (
+ cp->edit_button, "clicked",
G_CALLBACK (edit_cert), cp);
if (cp->delete_button)
- g_signal_connect (cp->delete_button, "clicked",
+ g_signal_connect (
+ cp->delete_button, "clicked",
G_CALLBACK (delete_cert), cp);
if (cp->view_button)
- g_signal_connect (cp->view_button, "clicked",
+ g_signal_connect (
+ cp->view_button, "clicked",
G_CALLBACK (view_cert), cp);
}
@@ -930,7 +943,8 @@ cert_manager_config_set_property (GObject *object,
ecmc->priv->pref_window = g_value_get_object (value);
/* When the preferences window is "closed" (= hidden), save
* state of all treeviews. */
- g_signal_connect_swapped (ecmc->priv->pref_window, "hide",
+ g_signal_connect_swapped (
+ ecmc->priv->pref_window, "hide",
G_CALLBACK (cert_manager_config_window_hide), ecmc);
return;
}
@@ -967,8 +981,7 @@ e_cert_manager_config_init (ECertManagerConfig *ecmc)
GtkWidget *parent, *widget;
CertPage *cp;
- priv = G_TYPE_INSTANCE_GET_PRIVATE (
- ecmc, E_TYPE_CERT_MANAGER_CONFIG, ECertManagerConfigPrivate);
+ priv = E_CERT_MANAGER_CONFIG_GET_PRIVATE (ecmc);
ecmc->priv = priv;
/* We need to peek the db here to make sure it (and NSS) are fully initialized. */
diff --git a/smime/gui/certificate-manager.h b/smime/gui/certificate-manager.h
index 13a60ce161..2eba92cd01 100644
--- a/smime/gui/certificate-manager.h
+++ b/smime/gui/certificate-manager.h
@@ -47,8 +47,8 @@
((obj), E_TYPE_CERT_MANAGER_CONFIG, ECertManagerConfigClass))
typedef struct _ECertManagerConfig ECertManagerConfig;
-typedef struct _ECertManagerConfigPrivate ECertManagerConfigPrivate;
typedef struct _ECertManagerConfigClass ECertManagerConfigClass;
+typedef struct _ECertManagerConfigPrivate ECertManagerConfigPrivate;
struct _ECertManagerConfig {
GtkBox parent;
diff --git a/smime/gui/certificate-viewer.c b/smime/gui/certificate-viewer.c
index 89f7d1fd8d..6691d1fbec 100644
--- a/smime/gui/certificate-viewer.c
+++ b/smime/gui/certificate-viewer.c
@@ -274,7 +274,9 @@ fill_in_details (CertificateViewerData *cvm_data,
"text", 0, NULL);
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (cvm_data->hierarchy_tree));
- g_signal_connect (selection, "changed", G_CALLBACK (hierarchy_selection_changed), cvm_data);
+ g_signal_connect (
+ selection, "changed",
+ G_CALLBACK (hierarchy_selection_changed), cvm_data);
/* hook up all the fields tree foo */
cvm_data->fields_tree = e_builder_get_widget (cvm_data->builder, "cert-fields-treeview");
@@ -284,7 +286,9 @@ fill_in_details (CertificateViewerData *cvm_data,
"text", 0, NULL);
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (cvm_data->fields_tree));
- g_signal_connect (selection, "changed", G_CALLBACK (fields_selection_changed), cvm_data);
+ g_signal_connect (
+ selection, "changed",
+ G_CALLBACK (fields_selection_changed), cvm_data);
/* hook up all the field display foo */
cvm_data->field_text = e_builder_get_widget (cvm_data->builder, "cert-field-value-textview");
diff --git a/smime/gui/component.c b/smime/gui/component.c
index fcbb9faf9f..e902f43fd0 100644
--- a/smime/gui/component.c
+++ b/smime/gui/component.c
@@ -117,15 +117,15 @@ smime_component_init (void)
return;
init_done = TRUE;
- g_signal_connect (e_cert_db_peek (),
- "pk11_passwd",
- G_CALLBACK (smime_pk11_passwd), NULL);
+ g_signal_connect (
+ e_cert_db_peek (), "pk11_passwd",
+ G_CALLBACK (smime_pk11_passwd), NULL);
- g_signal_connect (e_cert_db_peek (),
- "pk11_change_passwd",
- G_CALLBACK (smime_pk11_change_passwd), NULL);
+ g_signal_connect (
+ e_cert_db_peek (), "pk11_change_passwd",
+ G_CALLBACK (smime_pk11_change_passwd), NULL);
- g_signal_connect (e_cert_db_peek (),
- "confirm_ca_cert_import",
- G_CALLBACK (smime_confirm_ca_cert_import), NULL);
+ g_signal_connect (
+ e_cert_db_peek (), "confirm_ca_cert_import",
+ G_CALLBACK (smime_confirm_ca_cert_import), NULL);
}
diff --git a/smime/gui/e-cert-selector.c b/smime/gui/e-cert-selector.c
index 24cc9b374a..a5135d2c7d 100644
--- a/smime/gui/e-cert-selector.c
+++ b/smime/gui/e-cert-selector.c
@@ -37,6 +37,10 @@
#include "e-util/e-util.h"
#include "e-util/e-util-private.h"
+#define E_CERT_SELECTOR_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_CERT_SELECTOR, ECertSelectorPrivate))
+
struct _ECertSelectorPrivate {
CERTCertList *certlist;
@@ -209,7 +213,9 @@ e_cert_selector_new (gint type,
gtk_combo_box_set_active (GTK_COMBO_BOX (p->combobox), active);
- g_signal_connect (p->combobox, "changed", G_CALLBACK(ecs_cert_changed), ecs);
+ g_signal_connect (
+ p->combobox, "changed",
+ G_CALLBACK (ecs_cert_changed), ecs);
g_object_unref (builder);
@@ -221,38 +227,50 @@ e_cert_selector_new (gint type,
static void
e_cert_selector_init (ECertSelector *ecs)
{
- gtk_dialog_add_buttons ((GtkDialog *) ecs,
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- GTK_STOCK_OK, GTK_RESPONSE_OK, NULL);
+ gtk_dialog_add_buttons (
+ GTK_DIALOG (ecs),
+ GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+ GTK_STOCK_OK, GTK_RESPONSE_OK, NULL);
- ecs->priv = g_malloc0 (sizeof (*ecs->priv));
+ ecs->priv = E_CERT_SELECTOR_GET_PRIVATE (ecs);
}
static void
-e_cert_selector_finalize (GObject *o)
+e_cert_selector_finalize (GObject *object)
{
- ECertSelector *ecs = (ECertSelector *) o;
+ ECertSelectorPrivate *priv;
- if (ecs->priv->certlist)
- CERT_DestroyCertList (ecs->priv->certlist);
+ priv = E_CERT_SELECTOR_GET_PRIVATE (object);
- g_free (ecs->priv);
+ if (priv->certlist)
+ CERT_DestroyCertList (priv->certlist);
- ((GObjectClass *) e_cert_selector_parent_class)->finalize (o);
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (e_cert_selector_parent_class)->finalize (object);
}
static void
-e_cert_selector_class_init (ECertSelectorClass *klass)
+e_cert_selector_class_init (ECertSelectorClass *class)
{
- ((GObjectClass *) klass)->finalize = e_cert_selector_finalize;
- ((GtkDialogClass *) klass)->response = e_cert_selector_response;
-
- ecs_signals[ECS_SELECTED] =
- g_signal_new("selected",
- G_OBJECT_CLASS_TYPE (klass),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ECertSelectorClass, selected),
- NULL, NULL,
- g_cclosure_marshal_VOID__POINTER,
- G_TYPE_NONE, 1, G_TYPE_POINTER);
+ GObjectClass *object_class;
+ GtkDialogClass *dialog_class;
+
+ g_type_class_add_private (class, sizeof (ECertSelectorPrivate));
+
+ object_class = G_OBJECT_CLASS (class);
+ object_class->finalize = e_cert_selector_finalize;
+
+ dialog_class = GTK_DIALOG_CLASS (class);
+ dialog_class->response = e_cert_selector_response;
+
+ ecs_signals[ECS_SELECTED] = g_signal_new (
+ "selected",
+ G_OBJECT_CLASS_TYPE (class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ECertSelectorClass, selected),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__POINTER,
+ G_TYPE_NONE, 1,
+ G_TYPE_POINTER);
}
+
diff --git a/smime/gui/e-cert-selector.h b/smime/gui/e-cert-selector.h
index 5520b5621c..e51f1263ef 100644
--- a/smime/gui/e-cert-selector.h
+++ b/smime/gui/e-cert-selector.h
@@ -26,24 +26,34 @@
#include <gtk/gtk.h>
-#ifdef cplusplus
-extern "C" {
-#pragma }
-#endif /* cplusplus */
+/* Standard GObject macros */
+#define E_TYPE_CERT_SELECTOR \
+ (e_cert_selector_get_type ())
+#define E_CERT_SELECTOR(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), E_TYPE_CERT_SELECTOR, ECertSelector))
+#define E_CERT_SELECTOR_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), E_TYPE_CERT_SELECTOR, ECertSelectorClass))
+#define E_IS_CERT_SELECTOR(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), E_TYPE_CERT_SELECTOR))
+#define E_IS_CERT_SELECTOR_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), E_TYPE_CERT_SELECTOR))
+#define E_CERT_SELECTOR_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), E_TYPE_CERT_SELECTOR, ECertSelectorClass))
-#define E_TYPE_CERT_SELECTOR (e_cert_selector_get_type ())
-#define E_CERT_SELECTOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_CERT_SELECTOR, ECertSelector))
-#define E_CERT_SELECTOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_CERT_SELECTOR, ECertSelectorClass))
-#define E_IS_CERT_SELECTOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_CERT_SELECTOR))
-#define E_IS_CERT_SELECTOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), E_TYPE_CERT_SELECTOR))
+G_BEGIN_DECLS
-typedef struct _ECertSelector ECertSelector;
-typedef struct _ECertSelectorClass ECertSelectorClass;
+typedef struct _ECertSelector ECertSelector;
+typedef struct _ECertSelectorClass ECertSelectorClass;
+typedef struct _ECertSelectorPrivate ECertSelectorPrivate;
struct _ECertSelector {
GtkDialog parent;
-
- struct _ECertSelectorPrivate *priv;
+ ECertSelectorPrivate *priv;
};
struct _ECertSelectorClass {
@@ -60,8 +70,7 @@ enum _e_cert_selector_type {
GType e_cert_selector_get_type (void);
GtkWidget *e_cert_selector_new (gint type, const gchar *currentid);
-#ifdef cplusplus
-}
-#endif /* cplusplus */
+G_END_DECLS
#endif /* E_CERT_SELECTOR_H */
+
diff --git a/smime/lib/e-asn1-object.c b/smime/lib/e-asn1-object.c
index 4dd519e2d4..53441516f5 100644
--- a/smime/lib/e-asn1-object.c
+++ b/smime/lib/e-asn1-object.c
@@ -47,6 +47,10 @@
#include "secasn1.h"
+#define E_ASN1_OBJECT_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_ASN1_OBJECT, EASN1ObjectPrivate))
+
struct _EASN1ObjectPrivate {
PRUint32 tag;
PRUint32 type;
@@ -61,74 +65,43 @@ struct _EASN1ObjectPrivate {
guint data_len;
};
-#define PARENT_TYPE G_TYPE_OBJECT
-static GObjectClass *parent_class;
+G_DEFINE_TYPE (EASN1Object, e_asn1_object, G_TYPE_OBJECT)
static void
-e_asn1_object_dispose (GObject *object)
+e_asn1_object_finalize (GObject *object)
{
- EASN1Object *obj = E_ASN1_OBJECT (object);
- if (obj->priv) {
+ EASN1ObjectPrivate *priv;
- if (obj->priv->display_name)
- g_free (obj->priv->display_name);
+ priv = E_ASN1_OBJECT_GET_PRIVATE (object);
- if (obj->priv->value)
- g_free (obj->priv->value);
+ g_free (priv->display_name);
+ g_free (priv->value);
- g_list_foreach (obj->priv->children, (GFunc) g_object_unref, NULL);
- g_list_free (obj->priv->children);
+ g_list_free_full (priv->children, (GDestroyNotify) g_object_unref);
- g_free (obj->priv);
- obj->priv = NULL;
- }
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (e_asn1_object_parent_class)->finalize (object);
}
static void
-e_asn1_object_class_init (EASN1ObjectClass *klass)
+e_asn1_object_class_init (EASN1ObjectClass *class)
{
GObjectClass *object_class;
- object_class = G_OBJECT_CLASS (klass);
+ g_type_class_add_private (class, sizeof (EASN1ObjectPrivate));
- parent_class = g_type_class_ref (PARENT_TYPE);
-
- object_class->dispose = e_asn1_object_dispose;
+ object_class = G_OBJECT_CLASS (class);
+ object_class->finalize = e_asn1_object_finalize;
}
static void
e_asn1_object_init (EASN1Object *asn1)
{
- asn1->priv = g_new0 (EASN1ObjectPrivate, 1);
+ asn1->priv = E_ASN1_OBJECT_GET_PRIVATE (asn1);
asn1->priv->valid_container = TRUE;
}
-GType
-e_asn1_object_get_type (void)
-{
- static GType asn1_object_type = 0;
-
- if (!asn1_object_type) {
- static const GTypeInfo asn1_object_info = {
- sizeof (EASN1ObjectClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) e_asn1_object_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (EASN1Object),
- 0, /* n_preallocs */
- (GInstanceInitFunc) e_asn1_object_init,
- };
-
- asn1_object_type = g_type_register_static (
- PARENT_TYPE, "EASN1Object", &asn1_object_info, 0);
- }
-
- return asn1_object_type;
-}
-
/* This function is used to interpret an integer that
* was encoded in a DER buffer. This function is used
* when converting a DER buffer into a nsIASN1Object
diff --git a/smime/lib/e-cert-db.c b/smime/lib/e-cert-db.c
index 6006168e20..7cc7fc0939 100644
--- a/smime/lib/e-cert-db.c
+++ b/smime/lib/e-cert-db.c
@@ -88,12 +88,7 @@ enum {
static guint e_cert_db_signals[LAST_SIGNAL];
-struct _ECertDBPrivate {
- guint reserved;
-};
-
-#define PARENT_TYPE G_TYPE_OBJECT
-static GObjectClass *parent_class;
+G_DEFINE_TYPE (ECertDB, e_cert_db, G_TYPE_OBJECT)
GQuark
e_certdb_error_quark (void)
@@ -368,23 +363,6 @@ e_cert_db_get_certs_from_package (PRArenaPool *arena,
return collectArgs;
}
-static void
-e_cert_db_dispose (GObject *object)
-{
- ECertDB *ec = E_CERT_DB (object);
-
- if (!ec->priv)
- return;
-
- /* XXX free instance specific data */
-
- g_free (ec->priv);
- ec->priv = NULL;
-
- /* Chain up to parent's dispose() method. */
- G_OBJECT_CLASS (parent_class)->dispose (object);
-}
-
#ifdef notyet
PRBool
ucs2_ascii_conversion_fn (PRBool toUnicode,
@@ -541,15 +519,11 @@ install_loadable_roots (void)
}
static void
-e_cert_db_class_init (ECertDBClass *klass)
+e_cert_db_class_init (ECertDBClass *class)
{
GObjectClass *object_class;
- object_class = G_OBJECT_CLASS (klass);
-
- parent_class = g_type_class_ref (PARENT_TYPE);
-
- object_class->dispose = e_cert_db_dispose;
+ object_class = G_OBJECT_CLASS (class);
initialize_nss ();
/* check to see if you have a rootcert module installed */
@@ -589,31 +563,6 @@ e_cert_db_class_init (ECertDBClass *klass)
static void
e_cert_db_init (ECertDB *ec)
{
- ec->priv = g_new0 (ECertDBPrivate, 1);
-}
-
-GType
-e_cert_db_get_type (void)
-{
- static GType cert_type = 0;
-
- if (!cert_type) {
- static const GTypeInfo cert_info = {
- sizeof (ECertDBClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) e_cert_db_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (ECertDB),
- 0, /* n_preallocs */
- (GInstanceInitFunc) e_cert_db_init,
- };
-
- cert_type = g_type_register_static (PARENT_TYPE, "ECertDB", &cert_info, 0);
- }
-
- return cert_type;
}
GStaticMutex init_mutex = G_STATIC_MUTEX_INIT;
diff --git a/smime/lib/e-cert-trust.c b/smime/lib/e-cert-trust.c
index e1c7124e41..a23e0a7083 100644
--- a/smime/lib/e-cert-trust.c
+++ b/smime/lib/e-cert-trust.c
@@ -181,19 +181,33 @@ e_cert_trust_set_objsign_trust (CERTCertTrust *trust,
{
trust->objectSigningFlags = 0;
if (peer || tPeer)
- e_cert_trust_add_trust (&trust->objectSigningFlags, CERTDB_VALID_PEER);
+ e_cert_trust_add_trust (
+ &trust->objectSigningFlags,
+ CERTDB_VALID_PEER);
if (tPeer)
- e_cert_trust_add_trust (&trust->objectSigningFlags, CERTDB_TRUSTED);
+ e_cert_trust_add_trust (
+ &trust->objectSigningFlags,
+ CERTDB_TRUSTED);
if (ca || tCA)
- e_cert_trust_add_trust (&trust->objectSigningFlags, CERTDB_VALID_CA);
+ e_cert_trust_add_trust (
+ &trust->objectSigningFlags,
+ CERTDB_VALID_CA);
if (tClientCA)
- e_cert_trust_add_trust (&trust->objectSigningFlags, CERTDB_TRUSTED_CLIENT_CA);
+ e_cert_trust_add_trust (
+ &trust->objectSigningFlags,
+ CERTDB_TRUSTED_CLIENT_CA);
if (tCA)
- e_cert_trust_add_trust (&trust->objectSigningFlags, CERTDB_TRUSTED_CA);
+ e_cert_trust_add_trust (
+ &trust->objectSigningFlags,
+ CERTDB_TRUSTED_CA);
if (user)
- e_cert_trust_add_trust (&trust->objectSigningFlags, CERTDB_USER);
+ e_cert_trust_add_trust (
+ &trust->objectSigningFlags,
+ CERTDB_USER);
if (warn)
- e_cert_trust_add_trust (&trust->objectSigningFlags, CERTDB_SEND_WARN);
+ e_cert_trust_add_trust (
+ &trust->objectSigningFlags,
+ CERTDB_SEND_WARN);
}
void
diff --git a/smime/lib/e-cert.c b/smime/lib/e-cert.c
index 930dd65474..0849634767 100644
--- a/smime/lib/e-cert.c
+++ b/smime/lib/e-cert.c
@@ -47,7 +47,9 @@
#include <glib/gi18n.h>
#include <libedataserver/e-data-server-util.h>
-#include <e-util/e-util.h> /* for e_utf8_strftime, what about e_time_format_time? */
+
+/* for e_utf8_strftime, what about e_time_format_time? */
+#include <e-util/e-util.h>
#include "e-cert.h"
#include "e-cert-trust.h"
@@ -55,6 +57,10 @@
#include "certdb.h"
#include "hasht.h"
+#define E_CERT_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_CERT, ECertPrivate))
+
struct _ECertPrivate {
CERTCertificate *cert;
@@ -86,112 +92,80 @@ struct _ECertPrivate {
gboolean delete;
};
-#define PARENT_TYPE G_TYPE_OBJECT
-static GObjectClass *parent_class;
+G_DEFINE_TYPE (ECert, e_cert, G_TYPE_OBJECT)
static void
-e_cert_dispose (GObject *object)
+e_cert_finalize (GObject *object)
{
- ECert *ec = E_CERT (object);
-
- if (!ec->priv)
- return;
-
- if (ec->priv->org_name)
- PORT_Free (ec->priv->org_name);
- if (ec->priv->org_unit_name)
- PORT_Free (ec->priv->org_unit_name);
- if (ec->priv->cn)
- PORT_Free (ec->priv->cn);
-
- if (ec->priv->issuer_org_name)
- PORT_Free (ec->priv->issuer_org_name);
- if (ec->priv->issuer_org_unit_name)
- PORT_Free (ec->priv->issuer_org_unit_name);
- if (ec->priv->issuer_cn)
- PORT_Free (ec->priv->issuer_cn);
-
- if (ec->priv->issued_on_string)
- PORT_Free (ec->priv->issued_on_string);
- if (ec->priv->expires_on_string)
- PORT_Free (ec->priv->expires_on_string);
- if (ec->priv->serial_number)
- PORT_Free (ec->priv->serial_number);
-
- g_free (ec->priv->usage_string);
-
- if (ec->priv->sha1_fingerprint)
- PORT_Free (ec->priv->sha1_fingerprint);
- if (ec->priv->md5_fingerprint)
- PORT_Free (ec->priv->md5_fingerprint);
-
- if (ec->priv->asn1)
- g_object_unref (ec->priv->asn1);
-
- if (ec->priv->delete) {
+ ECertPrivate *priv;
+
+ priv = E_CERT_GET_PRIVATE (object);
+
+ if (priv->org_name)
+ PORT_Free (priv->org_name);
+ if (priv->org_unit_name)
+ PORT_Free (priv->org_unit_name);
+ if (priv->cn)
+ PORT_Free (priv->cn);
+
+ if (priv->issuer_org_name)
+ PORT_Free (priv->issuer_org_name);
+ if (priv->issuer_org_unit_name)
+ PORT_Free (priv->issuer_org_unit_name);
+ if (priv->issuer_cn)
+ PORT_Free (priv->issuer_cn);
+
+ if (priv->issued_on_string)
+ PORT_Free (priv->issued_on_string);
+ if (priv->expires_on_string)
+ PORT_Free (priv->expires_on_string);
+ if (priv->serial_number)
+ PORT_Free (priv->serial_number);
+
+ g_free (priv->usage_string);
+
+ if (priv->sha1_fingerprint)
+ PORT_Free (priv->sha1_fingerprint);
+ if (priv->md5_fingerprint)
+ PORT_Free (priv->md5_fingerprint);
+
+ if (priv->asn1)
+ g_object_unref (priv->asn1);
+
+ if (priv->delete) {
printf ("attempting to delete cert marked for deletion\n");
- if (e_cert_get_cert_type (ec) == E_CERT_USER) {
- PK11_DeleteTokenCertAndKey (ec->priv->cert, NULL);
- } else if (!PK11_IsReadOnly (ec->priv->cert->slot)) {
+ if (e_cert_get_cert_type (E_CERT (object)) == E_CERT_USER) {
+ PK11_DeleteTokenCertAndKey (priv->cert, NULL);
+ } else if (!PK11_IsReadOnly (priv->cert->slot)) {
/* If the list of built-ins does contain a non-removable
* copy of this certificate, our call will not remove
* the certificate permanently, but rather remove all trust. */
- SEC_DeletePermCertificate (ec->priv->cert);
+ SEC_DeletePermCertificate (priv->cert);
}
}
- if (ec->priv->cert) {
- CERT_DestroyCertificate (ec->priv->cert);
- ec->priv->cert = NULL;
- }
+ if (priv->cert)
+ CERT_DestroyCertificate (priv->cert);
- g_free (ec->priv);
- ec->priv = NULL;
-
- /* Chain up to parent's dispose() method. */
- G_OBJECT_CLASS (parent_class)->dispose (object);
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (e_cert_parent_class)->finalize (object);
}
static void
-e_cert_class_init (ECertClass *klass)
+e_cert_class_init (ECertClass *class)
{
GObjectClass *object_class;
- object_class = G_OBJECT_CLASS (klass);
-
- parent_class = g_type_class_ref (PARENT_TYPE);
+ g_type_class_add_private (class, sizeof (ECertPrivate));
- object_class->dispose = e_cert_dispose;
+ object_class = G_OBJECT_CLASS (class);
+ object_class->finalize = e_cert_finalize;
}
static void
e_cert_init (ECert *ec)
{
- ec->priv = g_new0 (ECertPrivate, 1);
-}
-
-GType
-e_cert_get_type (void)
-{
- static GType cert_type = 0;
-
- if (!cert_type) {
- static const GTypeInfo cert_info = {
- sizeof (ECertClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) e_cert_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (ECert),
- 0, /* n_preallocs */
- (GInstanceInitFunc) e_cert_init,
- };
-
- cert_type = g_type_register_static (PARENT_TYPE, "ECert", &cert_info, 0);
- }
-
- return cert_type;
+ ec->priv = E_CERT_GET_PRIVATE (ec);
}
static void
@@ -216,7 +190,9 @@ e_cert_populate (ECert *cert)
struct tm exploded_tm;
gchar buf[32];
- PR_ExplodeTime (cert->priv->issued_on, PR_LocalTimeParameters, &explodedTime);
+ PR_ExplodeTime (
+ cert->priv->issued_on,
+ PR_LocalTimeParameters, &explodedTime);
exploded_tm.tm_sec = explodedTime.tm_sec;
exploded_tm.tm_min = explodedTime.tm_min;
exploded_tm.tm_hour = explodedTime.tm_hour;
@@ -226,7 +202,9 @@ e_cert_populate (ECert *cert)
e_utf8_strftime (buf, sizeof(buf), _("%d/%m/%Y"), &exploded_tm);
cert->priv->issued_on_string = g_strdup (buf);
- PR_ExplodeTime (cert->priv->expires_on, PR_LocalTimeParameters, &explodedTime);
+ PR_ExplodeTime (
+ cert->priv->expires_on,
+ PR_LocalTimeParameters, &explodedTime);
exploded_tm.tm_sec = explodedTime.tm_sec;
exploded_tm.tm_min = explodedTime.tm_min;
exploded_tm.tm_hour = explodedTime.tm_hour;
@@ -1036,7 +1014,8 @@ process_name (CERTName *name,
return FALSE;
}
- avavalue = g_string_new_len ((gchar *) decodeItem->data, decodeItem->len);
+ avavalue = g_string_new_len (
+ (gchar *) decodeItem->data, decodeItem->len);
SECITEM_FreeItem (decodeItem, PR_TRUE);
@@ -1271,7 +1250,8 @@ e_cert_mark_for_deletion (ECert *cert)
if (PK11_NeedLogin (cert->priv->cert->slot)
&& !PK11_NeedUserInit (cert->priv->cert->slot)
&& !PK11_IsInternal (cert->priv->cert->slot)) {
- if (SECSuccess != PK11_Authenticate (cert->priv->cert->slot, PR_TRUE, NULL)) {
+ if (PK11_Authenticate (
+ cert->priv->cert->slot, PR_TRUE, NULL) != SECSuccess) {
return FALSE;
}
}
diff --git a/smime/lib/e-pkcs12.c b/smime/lib/e-pkcs12.c
index 5f7a73ce65..7bdc9e7f1c 100644
--- a/smime/lib/e-pkcs12.c
+++ b/smime/lib/e-pkcs12.c
@@ -63,13 +63,6 @@
#include "pk11func.h"
#include "secerr.h"
-struct _EPKCS12Private {
- gint mumble;
-};
-
-#define PARENT_TYPE G_TYPE_OBJECT
-static GObjectClass *parent_class;
-
/* static callback functions for the NSS PKCS#12 library */
static SECItem * PR_CALLBACK nickname_collision (SECItem *, PRBool *, gpointer );
@@ -84,71 +77,22 @@ static gboolean handle_error (gint myerr);
#define PKCS12_BACKUP_FAILED 6
#define PKCS12_NSS_ERROR 7
-static void
-e_pkcs12_dispose (GObject *object)
-{
- EPKCS12 *pk = E_PKCS12 (object);
-
- if (!pk->priv)
- return;
-
- /* XXX free instance private foo */
-
- g_free (pk->priv);
- pk->priv = NULL;
-
- /* Chain up to parent's dispose() method. */
- G_OBJECT_CLASS (parent_class)->dispose (object);
-}
+G_DEFINE_TYPE (EPKCS12, e_pkcs12, G_TYPE_OBJECT)
static void
-e_pkcs12_class_init (EPKCS12Class *klass)
+e_pkcs12_class_init (EPKCS12Class *class)
{
- GObjectClass *object_class;
-
- object_class = G_OBJECT_CLASS (klass);
-
- parent_class = g_type_class_ref (PARENT_TYPE);
-
- object_class->dispose = e_pkcs12_dispose;
}
static void
e_pkcs12_init (EPKCS12 *ec)
{
- ec->priv = g_new0 (EPKCS12Private, 1);
-}
-
-GType
-e_pkcs12_get_type (void)
-{
- static GType pkcs12_type = 0;
-
- if (!pkcs12_type) {
- static const GTypeInfo pkcs12_info = {
- sizeof (EPKCS12Class),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) e_pkcs12_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (EPKCS12),
- 0, /* n_preallocs */
- (GInstanceInitFunc) e_pkcs12_init,
- };
-
- pkcs12_type = g_type_register_static (PARENT_TYPE, "EPKCS12", &pkcs12_info, 0);
- }
-
- return pkcs12_type;
}
EPKCS12 *
e_pkcs12_new (void)
{
- EPKCS12 *pk = E_PKCS12 (g_object_new (E_TYPE_PKCS12, NULL));
-
- return pk;
+ return g_object_new (E_TYPE_PKCS12, NULL);
}
static gboolean
diff --git a/widgets/e-timezone-dialog/e-timezone-dialog.c b/widgets/e-timezone-dialog/e-timezone-dialog.c
index 717a9ea024..c5ccfd3a4c 100644
--- a/widgets/e-timezone-dialog/e-timezone-dialog.c
+++ b/widgets/e-timezone-dialog/e-timezone-dialog.c
@@ -54,6 +54,10 @@
#define E_TIMEZONE_DIALOG_MAP_POINT_SELECTED_1_RGBA 0xff60e0ff
#define E_TIMEZONE_DIALOG_MAP_POINT_SELECTED_2_RGBA 0x000000ff
+#define E_TIMEZONE_DIALOG_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_TIMEZONE_DIALOG, ETimezoneDialogPrivate))
+
struct _ETimezoneDialogPrivate {
/* The selected timezone. May be NULL for a 'local time' (i.e. when
* the displayed name is ""). */
@@ -78,7 +82,6 @@ struct _ETimezoneDialogPrivate {
};
static void e_timezone_dialog_dispose (GObject *object);
-static void e_timezone_dialog_finalize (GObject *object);
static gboolean get_widgets (ETimezoneDialog *etd);
static gboolean on_map_timeout (gpointer data);
@@ -118,37 +121,26 @@ e_timezone_dialog_class_init (ETimezoneDialogClass *class)
{
GObjectClass *object_class;
+ g_type_class_add_private (class, sizeof (ETimezoneDialogPrivate));
+
object_class = G_OBJECT_CLASS (class);
object_class->dispose = e_timezone_dialog_dispose;
- object_class->finalize = e_timezone_dialog_finalize;
}
/* Object initialization function for the event editor */
static void
e_timezone_dialog_init (ETimezoneDialog *etd)
{
- ETimezoneDialogPrivate *priv;
-
- priv = g_new0 (ETimezoneDialogPrivate, 1);
- etd->priv = priv;
-
- priv->point_selected = NULL;
- priv->point_hover = NULL;
- priv->timeout_id = 0;
+ etd->priv = E_TIMEZONE_DIALOG_GET_PRIVATE (etd);
}
/* Dispose handler for the event editor */
static void
e_timezone_dialog_dispose (GObject *object)
{
- ETimezoneDialog *etd;
ETimezoneDialogPrivate *priv;
- g_return_if_fail (object != NULL);
- g_return_if_fail (E_IS_TIMEZONE_DIALOG (object));
-
- etd = E_TIMEZONE_DIALOG (object);
- priv = etd->priv;
+ priv = E_TIMEZONE_DIALOG_GET_PRIVATE (object);
/* Destroy the actual dialog. */
if (priv->app != NULL) {
@@ -166,25 +158,8 @@ e_timezone_dialog_dispose (GObject *object)
priv->builder = NULL;
}
- (* G_OBJECT_CLASS (e_timezone_dialog_parent_class)->dispose) (object);
-}
-
-/* Finalize handler for the event editor */
-static void
-e_timezone_dialog_finalize (GObject *object)
-{
- ETimezoneDialog *etd;
- ETimezoneDialogPrivate *priv;
-
- g_return_if_fail (object != NULL);
- g_return_if_fail (E_IS_TIMEZONE_DIALOG (object));
-
- etd = E_TIMEZONE_DIALOG (object);
- priv = etd->priv;
-
- g_free (priv);
-
- (* G_OBJECT_CLASS (e_timezone_dialog_parent_class)->finalize) (object);
+ /* Chain up to parent's dispose() method. */
+ G_OBJECT_CLASS (e_timezone_dialog_parent_class)->dispose (object);
}
static void
@@ -414,33 +389,39 @@ static void
format_utc_offset (gint utc_offset,
gchar *buffer)
{
- const gchar *sign = "+";
- gint hours, minutes, seconds;
-
- if (utc_offset < 0) {
- utc_offset = -utc_offset;
- sign = "-";
- }
-
- hours = utc_offset / 3600;
- minutes = (utc_offset % 3600) / 60;
- seconds = utc_offset % 60;
-
- /* Sanity check. Standard timezone offsets shouldn't be much more than 12
- hours, and daylight saving shouldn't change it by more than a few hours.
- (The maximum offset is 15 hours 56 minutes at present.) */
- if (hours < 0 || hours >= 24 || minutes < 0 || minutes >= 60
- || seconds < 0 || seconds >= 60) {
- fprintf (stderr, "Warning: Strange timezone offset: H:%i M:%i S:%i\n",
- hours, minutes, seconds);
- }
-
- if (hours == 0 && minutes == 0 && seconds == 0)
- strcpy (buffer, _("UTC"));
- else if (seconds == 0)
- sprintf (buffer, "%s %s%02i:%02i", _("UTC"), sign, hours, minutes);
- else
- sprintf (buffer, "%s %s%02i:%02i:%02i", _("UTC"), sign, hours, minutes, seconds);
+ const gchar *sign = "+";
+ gint hours, minutes, seconds;
+
+ if (utc_offset < 0) {
+ utc_offset = -utc_offset;
+ sign = "-";
+ }
+
+ hours = utc_offset / 3600;
+ minutes = (utc_offset % 3600) / 60;
+ seconds = utc_offset % 60;
+
+ /* Sanity check. Standard timezone offsets shouldn't be much more
+ * than 12 hours, and daylight saving shouldn't change it by more
+ * than a few hours. (The maximum offset is 15 hours 56 minutes
+ * at present.) */
+ if (hours < 0 || hours >= 24 || minutes < 0 || minutes >= 60
+ || seconds < 0 || seconds >= 60) {
+ fprintf (
+ stderr, "Warning: Strange timezone offset: "
+ "H:%i M:%i S:%i\n", hours, minutes, seconds);
+ }
+
+ if (hours == 0 && minutes == 0 && seconds == 0)
+ strcpy (buffer, _("UTC"));
+ else if (seconds == 0)
+ sprintf (
+ buffer, "%s %s%02i:%02i",
+ _("UTC"), sign, hours, minutes);
+ else
+ sprintf (
+ buffer, "%s %s%02i:%02i:%02i",
+ _("UTC"), sign, hours, minutes, seconds);
}
static gchar *
diff --git a/widgets/menus/gal-define-views-dialog.c b/widgets/menus/gal-define-views-dialog.c
index 1c4ff5172e..fb0d852a24 100644
--- a/widgets/menus/gal-define-views-dialog.c
+++ b/widgets/menus/gal-define-views-dialog.c
@@ -61,11 +61,11 @@ typedef struct {
G_DEFINE_TYPE (GalDefineViewsDialog, gal_define_views_dialog, GTK_TYPE_DIALOG)
static void
-gal_define_views_dialog_class_init (GalDefineViewsDialogClass *klass)
+gal_define_views_dialog_class_init (GalDefineViewsDialogClass *class)
{
GObjectClass *object_class;
- object_class = (GObjectClass *) klass;
+ object_class = (GObjectClass *) class;
object_class->set_property = gal_define_views_dialog_set_property;
object_class->get_property = gal_define_views_dialog_get_property;
@@ -130,8 +130,9 @@ gdvd_button_new_callback (GtkWidget *widget,
{
GtkWidget *view_new_dialog = gal_view_new_dialog_new (dialog->collection);
gtk_window_set_transient_for (GTK_WINDOW (view_new_dialog), GTK_WINDOW (dialog));
- g_signal_connect (view_new_dialog, "response",
- G_CALLBACK (gdvd_button_new_dialog_callback), dialog);
+ g_signal_connect (
+ view_new_dialog, "response",
+ G_CALLBACK (gdvd_button_new_dialog_callback), dialog);
gtk_widget_show (view_new_dialog);
}
@@ -280,10 +281,14 @@ gal_define_views_dialog_init (GalDefineViewsDialog *dialog)
gdvd_connect_signal (dialog, "button-new", "clicked", G_CALLBACK (gdvd_button_new_callback));
gdvd_connect_signal (dialog, "button-modify", "clicked", G_CALLBACK (gdvd_button_modify_callback));
gdvd_connect_signal (dialog, "button-delete", "clicked", G_CALLBACK (gdvd_button_delete_callback));
- g_signal_connect (dialog, "response", G_CALLBACK (dialog_response), NULL);
+ g_signal_connect (
+ dialog, "response",
+ G_CALLBACK (dialog_response), NULL);
selection = gtk_tree_view_get_selection (dialog->treeview);
- g_signal_connect (selection, "changed", G_CALLBACK (gdvd_selection_changed_callback), dialog);
+ g_signal_connect (
+ selection, "changed",
+ G_CALLBACK (gdvd_selection_changed_callback), dialog);
gdvd_selection_changed_callback (selection, dialog);
gtk_widget_show (GTK_WIDGET (dialog));
diff --git a/widgets/menus/gal-define-views-model.c b/widgets/menus/gal-define-views-model.c
index 7c69bce720..bdfd970761 100644
--- a/widgets/menus/gal-define-views-model.c
+++ b/widgets/menus/gal-define-views-model.c
@@ -131,11 +131,13 @@ gdvm_value_at (ETableModel *etc,
gint row)
{
GalDefineViewsModel *views = GAL_DEFINE_VIEWS_MODEL (etc);
+ GalView *view;
const gchar *value;
- value = gal_view_get_title (gal_view_collection_get_view (views->collection, row));
+ view = gal_view_collection_get_view (views->collection, row);
+ value = gal_view_get_title (view);
- return (gpointer)(value ? value : "");
+ return (gpointer) ((value != NULL) ? value : "");
}
/* This function sets the value at a particular point in our ETableModel. */
@@ -234,10 +236,10 @@ gal_define_views_model_append (GalDefineViewsModel *model,
}
static void
-gal_define_views_model_class_init (GalDefineViewsModelClass *klass)
+gal_define_views_model_class_init (GalDefineViewsModelClass *class)
{
- ETableModelClass *model_class = E_TABLE_MODEL_CLASS (klass);
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ ETableModelClass *model_class = E_TABLE_MODEL_CLASS (class);
+ GObjectClass *object_class = G_OBJECT_CLASS (class);
object_class->dispose = gdvm_dispose;
object_class->set_property = gal_define_views_model_set_property;
diff --git a/widgets/menus/gal-view-collection.c b/widgets/menus/gal-view-collection.c
index 1d565d7c21..2cd26c96c5 100644
--- a/widgets/menus/gal-view-collection.c
+++ b/widgets/menus/gal-view-collection.c
@@ -190,9 +190,9 @@ gal_view_collection_dispose (GObject *object)
}
static void
-gal_view_collection_class_init (GalViewCollectionClass *klass)
+gal_view_collection_class_init (GalViewCollectionClass *class)
{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ GObjectClass *object_class = G_OBJECT_CLASS (class);
object_class->dispose = gal_view_collection_dispose;
@@ -214,8 +214,8 @@ gal_view_collection_class_init (GalViewCollectionClass *klass)
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
- klass->display_view = NULL;
- klass->changed = NULL;
+ class->display_view = NULL;
+ class->changed = NULL;
}
static void
@@ -376,9 +376,9 @@ load_single_file (GalViewCollection *collection,
item->view = gal_view_collection_real_load_view_from_file (collection, item->type, item->title, dir, fullpath);
g_free (fullpath);
if (item->view) {
- item->view_changed_id =
- g_signal_connect (item->view, "changed",
- G_CALLBACK (view_changed), item);
+ item->view_changed_id = g_signal_connect (
+ item->view, "changed",
+ G_CALLBACK (view_changed), item);
}
}
return item;
@@ -654,9 +654,9 @@ gal_view_collection_append (GalViewCollection *collection,
item->collection = collection;
g_object_ref (view);
- item->view_changed_id =
- g_signal_connect (item->view, "changed",
- G_CALLBACK (view_changed), item);
+ item->view_changed_id = g_signal_connect (
+ item->view, "changed",
+ G_CALLBACK (view_changed), item);
collection->view_data = g_renew (GalViewCollectionItem *, collection->view_data, collection->view_count + 1);
collection->view_data[collection->view_count] = item;
@@ -714,9 +714,9 @@ gal_view_collection_copy_view (GalViewCollection *collection,
item->view = gal_view_clone (view);
item->collection = collection;
- item->view_changed_id =
- g_signal_connect (item->view, "changed",
- G_CALLBACK (view_changed), item);
+ item->view_changed_id = g_signal_connect (
+ item->view, "changed",
+ G_CALLBACK (view_changed), item);
collection->view_data = g_renew (GalViewCollectionItem *, collection->view_data, collection->view_count + 1);
collection->view_data[collection->view_count] = item;
@@ -757,9 +757,9 @@ gal_view_collection_append_with_title (GalViewCollection *collection,
item->collection = collection;
g_object_ref (view);
- item->view_changed_id =
- g_signal_connect (item->view, "changed",
- G_CALLBACK (view_changed), item);
+ item->view_changed_id = g_signal_connect (
+ item->view, "changed",
+ G_CALLBACK (view_changed), item);
collection->view_data = g_renew (GalViewCollectionItem *, collection->view_data, collection->view_count + 1);
collection->view_data[collection->view_count] = item;
@@ -798,9 +798,9 @@ gal_view_collection_set_nth_view (GalViewCollection *collection,
item->changed = TRUE;
item->type = g_strdup (gal_view_get_type_code (view));
- item->view_changed_id =
- g_signal_connect (item->view, "changed",
- G_CALLBACK (view_changed), item);
+ item->view_changed_id = g_signal_connect (
+ item->view, "changed",
+ G_CALLBACK (view_changed), item);
gal_view_collection_changed (collection);
return item->id;
diff --git a/widgets/menus/gal-view-etable.c b/widgets/menus/gal-view-etable.c
index a16c72bcc0..c097db0ded 100644
--- a/widgets/menus/gal-view-etable.c
+++ b/widgets/menus/gal-view-etable.c
@@ -86,8 +86,9 @@ gal_view_etable_edit (GalView *view,
etable_view->state,
parent);
- g_signal_connect (config, "changed",
- G_CALLBACK (config_changed), view);
+ g_signal_connect (
+ config, "changed",
+ G_CALLBACK (config_changed), view);
}
static void
@@ -165,10 +166,10 @@ gal_view_etable_dispose (GObject *object)
}
static void
-gal_view_etable_class_init (GalViewEtableClass *klass)
+gal_view_etable_class_init (GalViewEtableClass *class)
{
- GalViewClass *gal_view_class = GAL_VIEW_CLASS (klass);
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ GalViewClass *gal_view_class = GAL_VIEW_CLASS (class);
+ GObjectClass *object_class = G_OBJECT_CLASS (class);
gal_view_class->edit = gal_view_etable_edit;
gal_view_class->load = gal_view_etable_load;
@@ -297,9 +298,9 @@ gal_view_etable_attach_table (GalViewEtable *view,
e_table_set_state_object (view->table, view->state);
g_object_ref (view->table);
- view->table_state_changed_id =
- g_signal_connect (view->table, "state_change",
- G_CALLBACK (table_state_changed), view);
+ view->table_state_changed_id = g_signal_connect (
+ view->table, "state_change",
+ G_CALLBACK (table_state_changed), view);
}
void
@@ -315,9 +316,9 @@ gal_view_etable_attach_tree (GalViewEtable *view,
e_tree_set_state_object (view->tree, view->state);
g_object_ref (view->tree);
- view->tree_state_changed_id =
- g_signal_connect (view->tree, "state_change",
- G_CALLBACK (tree_state_changed), view);
+ view->tree_state_changed_id = g_signal_connect (
+ view->tree, "state_change",
+ G_CALLBACK (tree_state_changed), view);
}
void
diff --git a/widgets/menus/gal-view-factory-etable.c b/widgets/menus/gal-view-factory-etable.c
index 3d5d0d23c3..8570d3c98c 100644
--- a/widgets/menus/gal-view-factory-etable.c
+++ b/widgets/menus/gal-view-factory-etable.c
@@ -31,6 +31,10 @@
#include "gal-view-etable.h"
#include "gal-view-factory-etable.h"
+#define GAL_VIEW_FACTORY_ETABLE_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), GAL_TYPE_VIEW_FACTORY_ETABLE, GalViewFactoryEtablePrivate))
+
struct _GalViewFactoryEtablePrivate {
ETableSpecification *specification;
};
@@ -94,7 +98,7 @@ view_factory_etable_dispose (GObject *object)
{
GalViewFactoryEtablePrivate *priv;
- priv = GAL_VIEW_FACTORY_ETABLE (object)->priv;
+ priv = GAL_VIEW_FACTORY_ETABLE_GET_PRIVATE (object);
if (priv->specification != NULL) {
g_object_unref (priv->specification);
@@ -123,7 +127,7 @@ view_factory_etable_new_view (GalViewFactory *factory,
{
GalViewFactoryEtablePrivate *priv;
- priv = GAL_VIEW_FACTORY_ETABLE (factory)->priv;
+ priv = GAL_VIEW_FACTORY_ETABLE_GET_PRIVATE (factory);
return gal_view_etable_new (priv->specification, name);
}
@@ -161,9 +165,7 @@ gal_view_factory_etable_class_init (GalViewFactoryEtableClass *class)
static void
gal_view_factory_etable_init (GalViewFactoryEtable *factory)
{
- factory->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- factory, GAL_TYPE_VIEW_FACTORY_ETABLE,
- GalViewFactoryEtablePrivate);
+ factory->priv = GAL_VIEW_FACTORY_ETABLE_GET_PRIVATE (factory);
}
/**
diff --git a/widgets/menus/gal-view-instance-save-as-dialog.c b/widgets/menus/gal-view-instance-save-as-dialog.c
index a098e094b8..414a287f45 100644
--- a/widgets/menus/gal-view-instance-save-as-dialog.c
+++ b/widgets/menus/gal-view-instance-save-as-dialog.c
@@ -218,11 +218,11 @@ gal_view_instance_save_as_dialog_dispose (GObject *object)
/* Init functions */
static void
-gal_view_instance_save_as_dialog_class_init (GalViewInstanceSaveAsDialogClass *klass)
+gal_view_instance_save_as_dialog_class_init (GalViewInstanceSaveAsDialogClass *class)
{
GObjectClass *object_class;
- object_class = (GObjectClass *) klass;
+ object_class = (GObjectClass *) class;
object_class->set_property = gal_view_instance_save_as_dialog_set_property;
object_class->get_property = gal_view_instance_save_as_dialog_get_property;
@@ -273,9 +273,15 @@ gal_view_instance_save_as_dialog_init (GalViewInstanceSaveAsDialog *dialog)
gtk_tree_view_set_reorderable (GTK_TREE_VIEW (dialog->treeview), FALSE);
gtk_tree_view_set_headers_visible (dialog->treeview, FALSE);
- g_signal_connect (dialog->radiobutton_replace, "toggled", G_CALLBACK (gvisad_radio_toggled), dialog);
- g_signal_connect (dialog->radiobutton_create, "toggled", G_CALLBACK (gvisad_radio_toggled), dialog);
- g_signal_connect (dialog->entry_create, "changed", G_CALLBACK (gvisad_entry_changed), dialog);
+ g_signal_connect (
+ dialog->radiobutton_replace, "toggled",
+ G_CALLBACK (gvisad_radio_toggled), dialog);
+ g_signal_connect (
+ dialog->radiobutton_create, "toggled",
+ G_CALLBACK (gvisad_radio_toggled), dialog);
+ g_signal_connect (
+ dialog->entry_create, "changed",
+ G_CALLBACK (gvisad_entry_changed), dialog);
gvisad_setup_radio_buttons (dialog);
gvisad_setup_validate_button (dialog);
diff --git a/widgets/menus/gal-view-instance.c b/widgets/menus/gal-view-instance.c
index f127868ab3..84e4872955 100644
--- a/widgets/menus/gal-view-instance.c
+++ b/widgets/menus/gal-view-instance.c
@@ -144,9 +144,9 @@ connect_view (GalViewInstance *instance,
instance->current_title = g_strdup (gal_view_get_title (view));
instance->current_type = g_strdup (gal_view_get_type_code (view));
- instance->view_changed_id =
- g_signal_connect (instance->current_view, "changed",
- G_CALLBACK (view_changed), instance);
+ instance->view_changed_id = g_signal_connect (
+ instance->current_view, "changed",
+ G_CALLBACK (view_changed), instance);
gal_view_instance_display_view (instance, instance->current_view);
}
@@ -178,9 +178,9 @@ gal_view_instance_dispose (GObject *object)
}
static void
-gal_view_instance_class_init (GalViewInstanceClass *klass)
+gal_view_instance_class_init (GalViewInstanceClass *class)
{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ GObjectClass *object_class = G_OBJECT_CLASS (class);
object_class->dispose = gal_view_instance_dispose;
@@ -211,8 +211,8 @@ gal_view_instance_class_init (GalViewInstanceClass *klass)
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
- klass->display_view = NULL;
- klass->changed = NULL;
+ class->display_view = NULL;
+ class->changed = NULL;
}
static void
@@ -345,9 +345,9 @@ gal_view_instance_construct (GalViewInstance *instance,
instance->collection = collection;
if (collection)
g_object_ref (collection);
- instance->collection_changed_id =
- g_signal_connect (collection, "changed",
- G_CALLBACK (collection_changed), instance);
+ instance->collection_changed_id = g_signal_connect (
+ collection, "changed",
+ G_CALLBACK (collection_changed), instance);
if (instance_id)
instance->instance_id = g_strdup (instance_id);
@@ -448,8 +448,9 @@ gal_view_instance_save_as (GalViewInstance *instance)
g_return_if_fail (instance != NULL);
dialog = gal_view_instance_save_as_dialog_new (instance);
- g_signal_connect (dialog, "response",
- G_CALLBACK (dialog_response), instance);
+ g_signal_connect (
+ dialog, "response",
+ G_CALLBACK (dialog_response), instance);
gtk_widget_show (dialog);
}
diff --git a/widgets/menus/gal-view-new-dialog.c b/widgets/menus/gal-view-new-dialog.c
index c26619f2bd..36d742963a 100644
--- a/widgets/menus/gal-view-new-dialog.c
+++ b/widgets/menus/gal-view-new-dialog.c
@@ -33,11 +33,6 @@
#include "gal-define-views-model.h"
#include "gal-view-new-dialog.h"
-static void gal_view_new_dialog_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec);
-static void gal_view_new_dialog_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec);
-static void gal_view_new_dialog_dispose (GObject *object);
-
-/* The arguments we take */
enum {
PROP_0,
PROP_NAME,
@@ -47,29 +42,98 @@ enum {
G_DEFINE_TYPE (GalViewNewDialog, gal_view_new_dialog, GTK_TYPE_DIALOG)
static void
-gal_view_new_dialog_class_init (GalViewNewDialogClass *klass)
+gal_view_new_dialog_set_property (GObject *object,
+ guint property_id,
+ const GValue *value,
+ GParamSpec *pspec)
{
- GObjectClass *object_class;
+ GalViewNewDialog *dialog;
+ GtkWidget *entry;
+
+ dialog = GAL_VIEW_NEW_DIALOG (object);
+
+ switch (property_id) {
+ case PROP_NAME:
+ entry = e_builder_get_widget(dialog->builder, "entry-name");
+ if (entry && GTK_IS_ENTRY (entry)) {
+ gtk_entry_set_text (GTK_ENTRY (entry), g_value_get_string (value));
+ }
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ return;
+ }
+}
+
+static void
+gal_view_new_dialog_get_property (GObject *object,
+ guint property_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ GalViewNewDialog *dialog;
+ GtkWidget *entry;
+
+ dialog = GAL_VIEW_NEW_DIALOG (object);
+
+ switch (property_id) {
+ case PROP_NAME:
+ entry = e_builder_get_widget(dialog->builder, "entry-name");
+ if (entry && GTK_IS_ENTRY (entry)) {
+ g_value_set_string (value, gtk_entry_get_text (GTK_ENTRY (entry)));
+ }
+ break;
+ case PROP_FACTORY:
+ g_value_set_object (value, dialog->selected_factory);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ break;
+ }
+}
- object_class = (GObjectClass *) klass;
+static void
+gal_view_new_dialog_dispose (GObject *object)
+{
+ GalViewNewDialog *gal_view_new_dialog = GAL_VIEW_NEW_DIALOG (object);
+
+ if (gal_view_new_dialog->builder)
+ g_object_unref (gal_view_new_dialog->builder);
+ gal_view_new_dialog->builder = NULL;
+
+ /* Chain up to parent's dispose() method. */
+ G_OBJECT_CLASS (gal_view_new_dialog_parent_class)->dispose (object);
+}
+
+static void
+gal_view_new_dialog_class_init (GalViewNewDialogClass *class)
+{
+ GObjectClass *object_class;
+ object_class = G_OBJECT_CLASS (class);
object_class->set_property = gal_view_new_dialog_set_property;
object_class->get_property = gal_view_new_dialog_get_property;
- object_class->dispose = gal_view_new_dialog_dispose;
-
- g_object_class_install_property (object_class, PROP_NAME,
- g_param_spec_string ("name",
- "Name",
- NULL,
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_FACTORY,
- g_param_spec_object ("factory",
- "Factory",
- NULL,
- GAL_TYPE_VIEW_FACTORY,
- G_PARAM_READWRITE));
+ object_class->dispose = gal_view_new_dialog_dispose;
+
+ g_object_class_install_property (
+ object_class,
+ PROP_NAME,
+ g_param_spec_string (
+ "name",
+ "Name",
+ NULL,
+ NULL,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_FACTORY,
+ g_param_spec_object (
+ "factory",
+ "Factory",
+ NULL,
+ GAL_TYPE_VIEW_FACTORY,
+ G_PARAM_READWRITE));
}
static void
@@ -111,19 +175,6 @@ gal_view_new_dialog_init (GalViewNewDialog *dialog)
dialog->selected_factory = NULL;
}
-static void
-gal_view_new_dialog_dispose (GObject *object)
-{
- GalViewNewDialog *gal_view_new_dialog = GAL_VIEW_NEW_DIALOG (object);
-
- if (gal_view_new_dialog->builder)
- g_object_unref (gal_view_new_dialog->builder);
- gal_view_new_dialog->builder = NULL;
-
- /* Chain up to parent's dispose() method. */
- G_OBJECT_CLASS (gal_view_new_dialog_parent_class)->dispose (object);
-}
-
GtkWidget *
gal_view_new_dialog_new (GalViewCollection *collection)
{
@@ -162,16 +213,10 @@ selection_func (GtkTreeSelection *selection,
if (path_currently_selected)
return TRUE;
- gtk_tree_model_get_iter (GTK_TREE_MODEL (dialog->list_store),
- &iter,
- (GtkTreePath *) path);
+ model = GTK_TREE_MODEL (dialog->list_store);
- gtk_tree_model_get (GTK_TREE_MODEL (dialog->list_store),
- &iter,
- 1, &dialog->selected_factory,
- -1);
-
- printf ("%s factory selected\n", gal_view_factory_get_title(dialog->selected_factory));
+ gtk_tree_model_get_iter (model, &iter, path);
+ gtk_tree_model_get (model, &iter, 1, &dialog->selected_factory, -1);
sensitize_ok_response (dialog);
@@ -199,15 +244,13 @@ gal_view_new_dialog_construct (GalViewNewDialog *dialog,
dialog->collection = collection;
dialog->list = e_builder_get_widget(dialog->builder,"list-type-list");
dialog->entry = e_builder_get_widget(dialog->builder, "entry-name");
- dialog->list_store = gtk_list_store_new (2,
- G_TYPE_STRING,
- G_TYPE_POINTER);
+
+ dialog->list_store = gtk_list_store_new (
+ 2, G_TYPE_STRING, G_TYPE_POINTER);
rend = gtk_cell_renderer_text_new ();
- column = gtk_tree_view_column_new_with_attributes ("factory title",
- rend,
- "text", 0,
- NULL);
+ column = gtk_tree_view_column_new_with_attributes (
+ "factory title", rend, "text", 0, NULL);
gtk_tree_view_append_column (GTK_TREE_VIEW (dialog->list), column);
@@ -217,75 +260,30 @@ gal_view_new_dialog_construct (GalViewNewDialog *dialog,
GtkTreeIter iter;
g_object_ref (factory);
- gtk_list_store_append (dialog->list_store,
- &iter);
- gtk_list_store_set (dialog->list_store,
- &iter,
- 0, gal_view_factory_get_title (factory),
- 1, factory,
- -1);
+ gtk_list_store_append (
+ dialog->list_store, &iter);
+ gtk_list_store_set (
+ dialog->list_store, &iter,
+ 0, gal_view_factory_get_title (factory),
+ 1, factory,
+ -1);
}
- gtk_tree_view_set_model (GTK_TREE_VIEW (dialog->list), GTK_TREE_MODEL (dialog->list_store));
+ gtk_tree_view_set_model (
+ GTK_TREE_VIEW (dialog->list),
+ GTK_TREE_MODEL (dialog->list_store));
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (dialog->list));
- gtk_tree_selection_set_select_function (selection, selection_func, dialog, NULL);
- g_signal_connect (dialog->entry, "changed",
- G_CALLBACK (entry_changed), dialog);
+ gtk_tree_selection_set_select_function (
+ selection, selection_func, dialog, NULL);
+
+ g_signal_connect (
+ dialog->entry, "changed",
+ G_CALLBACK (entry_changed), dialog);
sensitize_ok_response (dialog);
return GTK_WIDGET (dialog);
}
-static void
-gal_view_new_dialog_set_property (GObject *object,
- guint property_id,
- const GValue *value,
- GParamSpec *pspec)
-{
- GalViewNewDialog *dialog;
- GtkWidget *entry;
-
- dialog = GAL_VIEW_NEW_DIALOG (object);
-
- switch (property_id) {
- case PROP_NAME:
- entry = e_builder_get_widget(dialog->builder, "entry-name");
- if (entry && GTK_IS_ENTRY (entry)) {
- gtk_entry_set_text (GTK_ENTRY (entry), g_value_get_string (value));
- }
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
- return;
- }
-}
-
-static void
-gal_view_new_dialog_get_property (GObject *object,
- guint property_id,
- GValue *value,
- GParamSpec *pspec)
-{
- GalViewNewDialog *dialog;
- GtkWidget *entry;
-
- dialog = GAL_VIEW_NEW_DIALOG (object);
-
- switch (property_id) {
- case PROP_NAME:
- entry = e_builder_get_widget(dialog->builder, "entry-name");
- if (entry && GTK_IS_ENTRY (entry)) {
- g_value_set_string (value, gtk_entry_get_text (GTK_ENTRY (entry)));
- }
- break;
- case PROP_FACTORY:
- g_value_set_object (value, dialog->selected_factory);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
- break;
- }
-}
diff --git a/widgets/misc/e-account-combo-box.c b/widgets/misc/e-account-combo-box.c
index a649df5f8b..9c750f9ec4 100644
--- a/widgets/misc/e-account-combo-box.c
+++ b/widgets/misc/e-account-combo-box.c
@@ -27,6 +27,10 @@
#include <string.h>
+#define E_ACCOUNT_COMBO_BOX_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_ACCOUNT_COMBO_BOX, EAccountComboBoxPrivate))
+
enum {
COLUMN_STRING,
COLUMN_ACCOUNT
@@ -255,7 +259,7 @@ account_combo_box_dispose (GObject *object)
{
EAccountComboBoxPrivate *priv;
- priv = E_ACCOUNT_COMBO_BOX (object)->priv;
+ priv = E_ACCOUNT_COMBO_BOX_GET_PRIVATE (object);
if (priv->account_list != NULL) {
g_signal_handlers_disconnect_by_func (
@@ -276,7 +280,7 @@ account_combo_box_finalize (GObject *object)
{
EAccountComboBoxPrivate *priv;
- priv = E_ACCOUNT_COMBO_BOX (object)->priv;
+ priv = E_ACCOUNT_COMBO_BOX_GET_PRIVATE (object);
g_hash_table_destroy (priv->index);
@@ -316,8 +320,7 @@ e_account_combo_box_init (EAccountComboBox *combo_box)
(GDestroyNotify) g_object_unref,
(GDestroyNotify) gtk_tree_row_reference_free);
- combo_box->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- combo_box, E_TYPE_ACCOUNT_COMBO_BOX, EAccountComboBoxPrivate);
+ combo_box->priv = E_ACCOUNT_COMBO_BOX_GET_PRIVATE (combo_box);
combo_box->priv->index = index;
}
@@ -364,7 +367,7 @@ e_account_combo_box_set_account_list (EAccountComboBox *combo_box,
if (account_list != NULL)
g_return_if_fail (E_IS_ACCOUNT_LIST (account_list));
- priv = combo_box->priv;
+ priv = E_ACCOUNT_COMBO_BOX_GET_PRIVATE (combo_box);
if (priv->account_list != NULL) {
g_signal_handlers_disconnect_by_func (
diff --git a/widgets/misc/e-action-combo-box.c b/widgets/misc/e-action-combo-box.c
index cd99c346fb..0747a6ed27 100644
--- a/widgets/misc/e-action-combo-box.c
+++ b/widgets/misc/e-action-combo-box.c
@@ -26,6 +26,10 @@
#include <glib/gi18n.h>
+#define E_ACTION_COMBO_BOX_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_ACTION_COMBO_BOX, EActionComboBoxPrivate))
+
enum {
COLUMN_ACTION,
COLUMN_SORT
@@ -319,7 +323,7 @@ action_combo_box_get_property (GObject *object,
static void
action_combo_box_dispose (GObject *object)
{
- EActionComboBoxPrivate *priv = E_ACTION_COMBO_BOX (object)->priv;
+ EActionComboBoxPrivate *priv = E_ACTION_COMBO_BOX_GET_PRIVATE (object);
if (priv->action != NULL) {
g_object_unref (priv->action);
@@ -340,7 +344,7 @@ action_combo_box_dispose (GObject *object)
static void
action_combo_box_finalize (GObject *object)
{
- EActionComboBoxPrivate *priv = E_ACTION_COMBO_BOX (object)->priv;
+ EActionComboBoxPrivate *priv = E_ACTION_COMBO_BOX_GET_PRIVATE (object);
g_hash_table_destroy (priv->index);
@@ -431,8 +435,7 @@ e_action_combo_box_class_init (EActionComboBoxClass *class)
static void
e_action_combo_box_init (EActionComboBox *combo_box)
{
- combo_box->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- combo_box, E_TYPE_ACTION_COMBO_BOX, EActionComboBoxPrivate);
+ combo_box->priv = E_ACTION_COMBO_BOX_GET_PRIVATE (combo_box);
combo_box->priv->index = g_hash_table_new_full (
g_direct_hash, g_direct_equal,
diff --git a/widgets/misc/e-alert-bar.c b/widgets/misc/e-alert-bar.c
index 75bf55ff25..eb4afdde8c 100644
--- a/widgets/misc/e-alert-bar.c
+++ b/widgets/misc/e-alert-bar.c
@@ -25,6 +25,10 @@
(G_TYPE_INSTANCE_GET_PRIVATE \
((obj), E_TYPE_ALERT_BAR, EAlertBarPrivate))
+#define E_ALERT_BAR_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_ALERT_BAR, EAlertBarPrivate))
+
/* GTK_ICON_SIZE_DIALOG is a tad too big. */
#define ICON_SIZE GTK_ICON_SIZE_DND
diff --git a/widgets/misc/e-attachment-button.c b/widgets/misc/e-attachment-button.c
index efc184b090..4847cd204a 100644
--- a/widgets/misc/e-attachment-button.c
+++ b/widgets/misc/e-attachment-button.c
@@ -27,6 +27,10 @@
#include "e-attachment-button.h"
+#define E_ATTACHMENT_BUTTON_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_ATTACHMENT_BUTTON, EAttachmentButtonPrivate))
+
struct _EAttachmentButtonPrivate {
EAttachmentView *view;
@@ -450,7 +454,7 @@ attachment_button_dispose (GObject *object)
{
EAttachmentButtonPrivate *priv;
- priv = E_ATTACHMENT_BUTTON (object)->priv;
+ priv = E_ATTACHMENT_BUTTON_GET_PRIVATE (object);
if (priv->view != NULL) {
g_object_unref (priv->view);
@@ -577,8 +581,7 @@ e_attachment_button_init (EAttachmentButton *button)
GtkWidget *widget;
gint n_targets;
- button->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- button, E_TYPE_ATTACHMENT_BUTTON, EAttachmentButtonPrivate);
+ button->priv = E_ATTACHMENT_BUTTON_GET_PRIVATE (button);
/* Configure Widgets */
diff --git a/widgets/misc/e-attachment-dialog.c b/widgets/misc/e-attachment-dialog.c
index 1f31f9d5a3..9a9a1e7942 100644
--- a/widgets/misc/e-attachment-dialog.c
+++ b/widgets/misc/e-attachment-dialog.c
@@ -27,6 +27,10 @@
#include <glib/gi18n.h>
+#define E_ATTACHMENT_DIALOG_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_ATTACHMENT_DIALOG, EAttachmentDialogPrivate))
+
struct _EAttachmentDialogPrivate {
EAttachment *attachment;
GtkWidget *display_name_entry;
@@ -158,7 +162,7 @@ attachment_dialog_dispose (GObject *object)
{
EAttachmentDialogPrivate *priv;
- priv = E_ATTACHMENT_DIALOG (object)->priv;
+ priv = E_ATTACHMENT_DIALOG_GET_PRIVATE (object);
if (priv->attachment != NULL) {
g_object_unref (priv->attachment);
@@ -223,7 +227,7 @@ attachment_dialog_response (GtkDialog *dialog,
if (response_id != GTK_RESPONSE_OK)
return;
- priv = E_ATTACHMENT_DIALOG (dialog)->priv;
+ priv = E_ATTACHMENT_DIALOG_GET_PRIVATE (dialog);
g_return_if_fail (E_IS_ATTACHMENT (priv->attachment));
attachment = priv->attachment;
@@ -295,8 +299,7 @@ e_attachment_dialog_init (EAttachmentDialog *dialog)
GtkWidget *container;
GtkWidget *widget;
- dialog->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- dialog, E_TYPE_ATTACHMENT_DIALOG, EAttachmentDialogPrivate);
+ dialog->priv = E_ATTACHMENT_DIALOG_GET_PRIVATE (dialog);
gtk_dialog_add_button (
GTK_DIALOG (dialog), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
diff --git a/widgets/misc/e-attachment-handler-image.c b/widgets/misc/e-attachment-handler-image.c
index a66aa1d5a6..a8c29f24c0 100644
--- a/widgets/misc/e-attachment-handler-image.c
+++ b/widgets/misc/e-attachment-handler-image.c
@@ -30,6 +30,10 @@
#include <e-util/e-util.h>
+#define E_ATTACHMENT_HANDLER_IMAGE_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_ATTACHMENT_HANDLER_IMAGE, EAttachmentHandlerImagePrivate))
+
struct _EAttachmentHandlerImagePrivate {
gint placeholder;
};
@@ -240,7 +244,5 @@ e_attachment_handler_image_class_init (EAttachmentHandlerImageClass *class)
static void
e_attachment_handler_image_init (EAttachmentHandlerImage *handler)
{
- handler->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- handler, E_TYPE_ATTACHMENT_HANDLER_IMAGE,
- EAttachmentHandlerImagePrivate);
+ handler->priv = E_ATTACHMENT_HANDLER_IMAGE_GET_PRIVATE (handler);
}
diff --git a/widgets/misc/e-attachment-handler.c b/widgets/misc/e-attachment-handler.c
index 054cd24a1e..87b9abddb5 100644
--- a/widgets/misc/e-attachment-handler.c
+++ b/widgets/misc/e-attachment-handler.c
@@ -25,6 +25,10 @@
#include "e-attachment-handler.h"
+#define E_ATTACHMENT_HANDLER_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_ATTACHMENT_HANDLER, EAttachmentHandlerPrivate))
+
struct _EAttachmentHandlerPrivate {
gpointer placeholder;
};
@@ -77,8 +81,7 @@ e_attachment_handler_class_init (EAttachmentHandlerClass *class)
static void
e_attachment_handler_init (EAttachmentHandler *handler)
{
- handler->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- handler, E_TYPE_ATTACHMENT_HANDLER, EAttachmentHandlerPrivate);
+ handler->priv = E_ATTACHMENT_HANDLER_GET_PRIVATE (handler);
}
EAttachmentView *
diff --git a/widgets/misc/e-attachment-icon-view.c b/widgets/misc/e-attachment-icon-view.c
index cf14d97746..26ffe9e056 100644
--- a/widgets/misc/e-attachment-icon-view.c
+++ b/widgets/misc/e-attachment-icon-view.c
@@ -32,6 +32,10 @@
#include "e-attachment-store.h"
#include "e-attachment-view.h"
+#define E_ATTACHMENT_ICON_VIEW_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_ATTACHMENT_ICON_VIEW, EAttachmentIconViewPrivate))
+
struct _EAttachmentIconViewPrivate {
EAttachmentViewPrivate view_priv;
};
@@ -348,7 +352,7 @@ attachment_icon_view_get_private (EAttachmentView *view)
{
EAttachmentIconViewPrivate *priv;
- priv = E_ATTACHMENT_ICON_VIEW (view)->priv;
+ priv = E_ATTACHMENT_ICON_VIEW_GET_PRIVATE (view);
return &priv->view_priv;
}
@@ -531,9 +535,7 @@ e_attachment_icon_view_class_init (EAttachmentIconViewClass *class)
static void
e_attachment_icon_view_init (EAttachmentIconView *icon_view)
{
- icon_view->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- icon_view, E_TYPE_ATTACHMENT_ICON_VIEW,
- EAttachmentIconViewPrivate);
+ icon_view->priv = E_ATTACHMENT_ICON_VIEW_GET_PRIVATE (icon_view);
e_attachment_view_init (E_ATTACHMENT_VIEW (icon_view));
diff --git a/widgets/misc/e-attachment-paned.c b/widgets/misc/e-attachment-paned.c
index c5fb9b43b5..c0048fcd31 100644
--- a/widgets/misc/e-attachment-paned.c
+++ b/widgets/misc/e-attachment-paned.c
@@ -32,6 +32,10 @@
#include "e-attachment-icon-view.h"
#include "e-attachment-tree-view.h"
+#define E_ATTACHMENT_PANED_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_ATTACHMENT_PANED, EAttachmentPanedPrivate))
+
#define NUM_VIEWS 2
/* Initial height of the lower pane. */
@@ -283,7 +287,7 @@ attachment_paned_dispose (GObject *object)
{
EAttachmentPanedPrivate *priv;
- priv = E_ATTACHMENT_PANED (object)->priv;
+ priv = E_ATTACHMENT_PANED_GET_PRIVATE (object);
if (priv->model != NULL) {
e_attachment_store_remove_all (E_ATTACHMENT_STORE (priv->model));
@@ -346,7 +350,7 @@ attachment_paned_constructed (GObject *object)
EAttachmentPanedPrivate *priv;
GSettings *settings;
- priv = E_ATTACHMENT_PANED (object)->priv;
+ priv = E_ATTACHMENT_PANED_GET_PRIVATE (object);
settings = g_settings_new ("org.gnome.evolution.shell");
@@ -407,7 +411,11 @@ attachment_paned_constructed (GObject *object)
G_BINDING_SYNC_CREATE);
/* Set up property-to-GSettings bindings. */
- g_settings_bind (settings, "attachment-view", object, "active-view", G_SETTINGS_BIND_DEFAULT);
+ g_settings_bind (
+ settings, "attachment-view",
+ object, "active-view",
+ G_SETTINGS_BIND_DEFAULT);
+
g_object_unref (settings);
/* Chain up to parent's constructed() method. */
@@ -419,7 +427,7 @@ attachment_paned_get_private (EAttachmentView *view)
{
EAttachmentPanedPrivate *priv;
- priv = E_ATTACHMENT_PANED (view)->priv;
+ priv = E_ATTACHMENT_PANED_GET_PRIVATE (view);
view = E_ATTACHMENT_VIEW (priv->icon_view);
return e_attachment_view_get_private (view);
@@ -430,7 +438,7 @@ attachment_paned_get_store (EAttachmentView *view)
{
EAttachmentPanedPrivate *priv;
- priv = E_ATTACHMENT_PANED (view)->priv;
+ priv = E_ATTACHMENT_PANED_GET_PRIVATE (view);
view = E_ATTACHMENT_VIEW (priv->icon_view);
return e_attachment_view_get_store (view);
@@ -443,7 +451,7 @@ attachment_paned_get_path_at_pos (EAttachmentView *view,
{
EAttachmentPanedPrivate *priv;
- priv = E_ATTACHMENT_PANED (view)->priv;
+ priv = E_ATTACHMENT_PANED_GET_PRIVATE (view);
view = E_ATTACHMENT_VIEW (priv->icon_view);
return e_attachment_view_get_path_at_pos (view, x, y);
@@ -454,7 +462,7 @@ attachment_paned_get_selected_paths (EAttachmentView *view)
{
EAttachmentPanedPrivate *priv;
- priv = E_ATTACHMENT_PANED (view)->priv;
+ priv = E_ATTACHMENT_PANED_GET_PRIVATE (view);
view = E_ATTACHMENT_VIEW (priv->icon_view);
return e_attachment_view_get_selected_paths (view);
@@ -466,7 +474,7 @@ attachment_paned_path_is_selected (EAttachmentView *view,
{
EAttachmentPanedPrivate *priv;
- priv = E_ATTACHMENT_PANED (view)->priv;
+ priv = E_ATTACHMENT_PANED_GET_PRIVATE (view);
view = E_ATTACHMENT_VIEW (priv->icon_view);
return e_attachment_view_path_is_selected (view, path);
@@ -478,7 +486,7 @@ attachment_paned_select_path (EAttachmentView *view,
{
EAttachmentPanedPrivate *priv;
- priv = E_ATTACHMENT_PANED (view)->priv;
+ priv = E_ATTACHMENT_PANED_GET_PRIVATE (view);
view = E_ATTACHMENT_VIEW (priv->icon_view);
e_attachment_view_select_path (view, path);
@@ -490,7 +498,7 @@ attachment_paned_unselect_path (EAttachmentView *view,
{
EAttachmentPanedPrivate *priv;
- priv = E_ATTACHMENT_PANED (view)->priv;
+ priv = E_ATTACHMENT_PANED_GET_PRIVATE (view);
view = E_ATTACHMENT_VIEW (priv->icon_view);
e_attachment_view_unselect_path (view, path);
@@ -501,7 +509,7 @@ attachment_paned_select_all (EAttachmentView *view)
{
EAttachmentPanedPrivate *priv;
- priv = E_ATTACHMENT_PANED (view)->priv;
+ priv = E_ATTACHMENT_PANED_GET_PRIVATE (view);
view = E_ATTACHMENT_VIEW (priv->icon_view);
e_attachment_view_select_all (view);
@@ -512,7 +520,7 @@ attachment_paned_unselect_all (EAttachmentView *view)
{
EAttachmentPanedPrivate *priv;
- priv = E_ATTACHMENT_PANED (view)->priv;
+ priv = E_ATTACHMENT_PANED_GET_PRIVATE (view);
view = E_ATTACHMENT_VIEW (priv->icon_view);
e_attachment_view_unselect_all (view);
@@ -523,7 +531,7 @@ attachment_paned_update_actions (EAttachmentView *view)
{
EAttachmentPanedPrivate *priv;
- priv = E_ATTACHMENT_PANED (view)->priv;
+ priv = E_ATTACHMENT_PANED_GET_PRIVATE (view);
view = E_ATTACHMENT_VIEW (priv->icon_view);
e_attachment_view_update_actions (view);
@@ -596,8 +604,7 @@ e_attachment_paned_init (EAttachmentPaned *paned)
GtkWidget *widget;
GtkAction *action;
- paned->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- paned, E_TYPE_ATTACHMENT_PANED, EAttachmentPanedPrivate);
+ paned->priv = E_ATTACHMENT_PANED_GET_PRIVATE (paned);
paned->priv->model = e_attachment_store_new ();
/* Keep the expander label and combo box the same height. */
diff --git a/widgets/misc/e-attachment-store.c b/widgets/misc/e-attachment-store.c
index c6208b6866..95465eba81 100644
--- a/widgets/misc/e-attachment-store.c
+++ b/widgets/misc/e-attachment-store.c
@@ -31,6 +31,10 @@
#include "e-util/e-util.h"
#include "e-util/e-mktemp.h"
+#define E_ATTACHMENT_STORE_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_ATTACHMENT_STORE, EAttachmentStorePrivate))
+
struct _EAttachmentStorePrivate {
GHashTable *attachment_index;
@@ -95,7 +99,7 @@ attachment_store_finalize (GObject *object)
{
EAttachmentStorePrivate *priv;
- priv = E_ATTACHMENT_STORE (object)->priv;
+ priv = E_ATTACHMENT_STORE_GET_PRIVATE (object);
g_hash_table_destroy (priv->attachment_index);
@@ -164,8 +168,7 @@ e_attachment_store_init (EAttachmentStore *store)
(GDestroyNotify) g_object_unref,
(GDestroyNotify) gtk_tree_row_reference_free);
- store->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- store, E_TYPE_ATTACHMENT_STORE, EAttachmentStorePrivate);
+ store->priv = E_ATTACHMENT_STORE_GET_PRIVATE (store);
store->priv->attachment_index = attachment_index;
types[column++] = E_TYPE_ATTACHMENT; /* COLUMN_ATTACHMENT */
diff --git a/widgets/misc/e-attachment-tree-view.c b/widgets/misc/e-attachment-tree-view.c
index 7c67fdb917..59a9e43436 100644
--- a/widgets/misc/e-attachment-tree-view.c
+++ b/widgets/misc/e-attachment-tree-view.c
@@ -32,6 +32,10 @@
#include "e-attachment-store.h"
#include "e-attachment-view.h"
+#define E_ATTACHMENT_TREE_VIEW_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_ATTACHMENT_TREE_VIEW, EAttachmentTreeViewPrivate))
+
struct _EAttachmentTreeViewPrivate {
EAttachmentViewPrivate view_priv;
};
@@ -305,7 +309,7 @@ attachment_tree_view_get_private (EAttachmentView *view)
{
EAttachmentTreeViewPrivate *priv;
- priv = E_ATTACHMENT_TREE_VIEW (view)->priv;
+ priv = E_ATTACHMENT_TREE_VIEW_GET_PRIVATE (view);
return &priv->view_priv;
}
@@ -508,9 +512,7 @@ e_attachment_tree_view_init (EAttachmentTreeView *tree_view)
GtkTreeViewColumn *column;
GtkCellRenderer *renderer;
- tree_view->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- tree_view, E_TYPE_ATTACHMENT_TREE_VIEW,
- EAttachmentTreeViewPrivate);
+ tree_view->priv = E_ATTACHMENT_TREE_VIEW_GET_PRIVATE (tree_view);
e_attachment_view_init (E_ATTACHMENT_VIEW (tree_view));
diff --git a/widgets/misc/e-attachment.c b/widgets/misc/e-attachment.c
index 166020596e..0678296767 100644
--- a/widgets/misc/e-attachment.c
+++ b/widgets/misc/e-attachment.c
@@ -36,6 +36,10 @@
#include "e-util/e-mktemp.h"
#include "e-attachment-store.h"
+#define E_ATTACHMENT_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_ATTACHMENT, EAttachmentPrivate))
+
/* Fallback Icon */
#define DEFAULT_ICON_NAME "mail-attachment"
@@ -162,7 +166,8 @@ attachment_get_default_charset (void)
charset = g_settings_get_string (settings, "composer-charset");
if (charset == NULL || *charset == '\0') {
g_free (charset);
- /* FIXME: this was "/apps/evolution/mail/format/charset", not sure it relates to "charset" */
+ /* FIXME This was "/apps/evolution/mail/format/charset",
+ * not sure it relates to "charset" */
charset = g_settings_get_string (settings, "charset");
if (charset == NULL || *charset == '\0') {
g_free (charset);
@@ -665,7 +670,7 @@ attachment_dispose (GObject *object)
{
EAttachmentPrivate *priv;
- priv = E_ATTACHMENT (object)->priv;
+ priv = E_ATTACHMENT_GET_PRIVATE (object);
if (priv->file != NULL) {
g_object_unref (priv->file);
@@ -710,7 +715,7 @@ attachment_finalize (GObject *object)
{
EAttachmentPrivate *priv;
- priv = E_ATTACHMENT (object)->priv;
+ priv = E_ATTACHMENT_GET_PRIVATE (object);
g_free (priv->disposition);
@@ -879,8 +884,7 @@ e_attachment_class_init (EAttachmentClass *class)
static void
e_attachment_init (EAttachment *attachment)
{
- attachment->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- attachment, E_TYPE_ATTACHMENT, EAttachmentPrivate);
+ attachment->priv = E_ATTACHMENT_GET_PRIVATE (attachment);
attachment->priv->cancellable = g_cancellable_new ();
attachment->priv->encrypted = CAMEL_CIPHER_VALIDITY_ENCRYPT_NONE;
attachment->priv->signed_ = CAMEL_CIPHER_VALIDITY_SIGN_NONE;
diff --git a/widgets/misc/e-buffer-tagger.c b/widgets/misc/e-buffer-tagger.c
index cd260252de..0baa96ce69 100644
--- a/widgets/misc/e-buffer-tagger.c
+++ b/widgets/misc/e-buffer-tagger.c
@@ -565,17 +565,33 @@ e_buffer_tagger_connect (GtkTextView *textview)
set_state (buffer, E_BUFFER_TAGGER_STATE_NONE);
- g_signal_connect (buffer, "insert-text", G_CALLBACK (buffer_insert_text), NULL);
- g_signal_connect (buffer, "delete-range", G_CALLBACK (buffer_delete_range), NULL);
- g_signal_connect (buffer, "notify::cursor-position", G_CALLBACK (buffer_cursor_position), NULL);
+ g_signal_connect (
+ buffer, "insert-text",
+ G_CALLBACK (buffer_insert_text), NULL);
+ g_signal_connect (
+ buffer, "delete-range",
+ G_CALLBACK (buffer_delete_range), NULL);
+ g_signal_connect (
+ buffer, "notify::cursor-position",
+ G_CALLBACK (buffer_cursor_position), NULL);
gtk_widget_set_has_tooltip (GTK_WIDGET (textview), TRUE);
- g_signal_connect (textview, "query-tooltip", G_CALLBACK (textview_query_tooltip), NULL);
- g_signal_connect (textview, "key-press-event", G_CALLBACK (textview_key_press_event), NULL);
- g_signal_connect (textview, "event-after", G_CALLBACK (textview_event_after), NULL);
- g_signal_connect (textview, "motion-notify-event", G_CALLBACK (textview_motion_notify_event), NULL);
- g_signal_connect (textview, "visibility-notify-event", G_CALLBACK (textview_visibility_notify_event), NULL);
+ g_signal_connect (
+ textview, "query-tooltip",
+ G_CALLBACK (textview_query_tooltip), NULL);
+ g_signal_connect (
+ textview, "key-press-event",
+ G_CALLBACK (textview_key_press_event), NULL);
+ g_signal_connect (
+ textview, "event-after",
+ G_CALLBACK (textview_event_after), NULL);
+ g_signal_connect (
+ textview, "motion-notify-event",
+ G_CALLBACK (textview_motion_notify_event), NULL);
+ g_signal_connect (
+ textview, "visibility-notify-event",
+ G_CALLBACK (textview_visibility_notify_event), NULL);
}
void
diff --git a/widgets/misc/e-calendar-item.c b/widgets/misc/e-calendar-item.c
index c7f2e049d9..577741054b 100644
--- a/widgets/misc/e-calendar-item.c
+++ b/widgets/misc/e-calendar-item.c
@@ -47,150 +47,169 @@ static const gint e_calendar_item_days_in_month[12] = {
e_calendar_item_days_in_month[month] + (((month) == 1 \
&& ((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0))) ? 1 : 0)
-static void e_calendar_item_dispose (GObject *object);
-static void e_calendar_item_get_property (GObject *object,
- guint property_id,
- GValue *value,
- GParamSpec *pspec);
-static void e_calendar_item_set_property (GObject *object,
- guint property_id,
- const GValue *value,
- GParamSpec *pspec);
-static void e_calendar_item_realize (GnomeCanvasItem *item);
-static void e_calendar_item_unmap (GnomeCanvasItem *item);
-static void e_calendar_item_update (GnomeCanvasItem *item,
- const cairo_matrix_t *i2c,
- gint flags);
-static void e_calendar_item_draw (GnomeCanvasItem *item,
- cairo_t *cr,
- gint x,
- gint y,
- gint width,
- gint height);
-static void e_calendar_item_draw_month (ECalendarItem *calitem,
- cairo_t *cr,
- gint x,
- gint y,
- gint width,
- gint height,
- gint row,
- gint col);
-static void e_calendar_item_draw_day_numbers (ECalendarItem *calitem,
- cairo_t *cr,
- gint width,
- gint height,
- gint row,
- gint col,
- gint year,
- gint month,
- gint start_weekday,
- gint cells_x,
- gint cells_y);
+static void e_calendar_item_dispose (GObject *object);
+static void e_calendar_item_get_property (GObject *object,
+ guint property_id,
+ GValue *value,
+ GParamSpec *pspec);
+static void e_calendar_item_set_property (GObject *object,
+ guint property_id,
+ const GValue *value,
+ GParamSpec *pspec);
+static void e_calendar_item_realize (GnomeCanvasItem *item);
+static void e_calendar_item_unmap (GnomeCanvasItem *item);
+static void e_calendar_item_update (GnomeCanvasItem *item,
+ const cairo_matrix_t *i2c,
+ gint flags);
+static void e_calendar_item_draw (GnomeCanvasItem *item,
+ cairo_t *cr,
+ gint x,
+ gint y,
+ gint width,
+ gint height);
+static void e_calendar_item_draw_month (ECalendarItem *calitem,
+ cairo_t *cr,
+ gint x,
+ gint y,
+ gint width,
+ gint height,
+ gint row,
+ gint col);
+static void e_calendar_item_draw_day_numbers
+ (ECalendarItem *calitem,
+ cairo_t *cr,
+ gint width,
+ gint height,
+ gint row,
+ gint col,
+ gint year,
+ gint month,
+ gint start_weekday,
+ gint cells_x,
+ gint cells_y);
static GnomeCanvasItem *e_calendar_item_point (GnomeCanvasItem *item,
- gdouble x,
- gdouble y,
- gint cx,
- gint cy);
-static void e_calendar_item_stop_selecting (ECalendarItem *calitem,
- guint32 time);
-static void e_calendar_item_selection_add_days (ECalendarItem *calitem,
- gint n_days,
- gboolean multi_selection);
-static gint e_calendar_item_key_press_event (ECalendarItem *item,
- GdkEvent *event);
-static gint e_calendar_item_event (GnomeCanvasItem *item,
- GdkEvent *event);
-static void e_calendar_item_bounds (GnomeCanvasItem *item, gdouble *x1, gdouble *y1,
- gdouble *x2, gdouble *y2);
-
-static gboolean e_calendar_item_button_press (ECalendarItem *calitem,
- GdkEvent *event);
-static gboolean e_calendar_item_button_release (ECalendarItem *calitem,
- GdkEvent *event);
-static gboolean e_calendar_item_motion (ECalendarItem *calitem,
- GdkEvent *event);
-
-static gboolean e_calendar_item_convert_position_to_day (ECalendarItem *calitem,
- gint x,
- gint y,
- gboolean round_empty_positions,
- gint *month_offset,
- gint *day,
- gboolean *entire_week);
-static void e_calendar_item_get_month_info (ECalendarItem *calitem,
- gint row,
- gint col,
- gint *first_day_offset,
- gint *days_in_month,
- gint *days_in_prev_month);
-static void e_calendar_item_recalc_sizes (ECalendarItem *calitem);
-
-static void e_calendar_item_get_day_style (ECalendarItem *calitem,
- gint year,
- gint month,
- gint day,
- gint day_style,
- gboolean today,
- gboolean prev_or_next_month,
- gboolean selected,
- gboolean has_focus,
- gboolean drop_target,
- GdkColor **bg_color,
- GdkColor **fg_color,
- GdkColor **box_color,
- gboolean *bold,
- gboolean *italic);
-static void e_calendar_item_check_selection_end (ECalendarItem *calitem,
- gint start_month,
- gint start_day,
- gint *end_month,
- gint *end_day);
-static void e_calendar_item_check_selection_start (ECalendarItem *calitem,
- gint *start_month,
- gint *start_day,
- gint end_month,
- gint end_day);
-static void e_calendar_item_add_days_to_selection (ECalendarItem *calitem,
- gint days);
-static void e_calendar_item_round_up_selection (ECalendarItem *calitem,
- gint *month_offset,
- gint *day);
-static void e_calendar_item_round_down_selection (ECalendarItem *calitem,
- gint *month_offset,
- gint *day);
-static gint e_calendar_item_get_inclusive_days (ECalendarItem *calitem,
- gint start_month_offset,
- gint start_day,
- gint end_month_offset,
- gint end_day);
-static void e_calendar_item_ensure_valid_day (ECalendarItem *calitem,
- gint *month_offset,
- gint *day);
-static gboolean e_calendar_item_ensure_days_visible (ECalendarItem *calitem,
- gint start_year,
- gint start_month,
- gint start_day,
- gint end_year,
- gint end_month,
- gint end_day,
- gboolean emission);
-static void e_calendar_item_show_popup_menu (ECalendarItem *calitem,
- GdkEventButton *event,
- gint month_offset);
-static void e_calendar_item_on_menu_item_activate (GtkWidget *menuitem,
- ECalendarItem *calitem);
-static void e_calendar_item_position_menu (GtkMenu *menu,
- gint *x,
- gint *y,
- gboolean *push_in,
- gpointer user_data);
-static void e_calendar_item_date_range_changed (ECalendarItem *calitem);
-static void e_calendar_item_queue_signal_emission (ECalendarItem *calitem);
-static gboolean e_calendar_item_signal_emission_idle_cb (gpointer data);
-static void e_calendar_item_set_selection_if_emission (ECalendarItem *calitem,
- const GDate *start_date,
- const GDate *end_date,
- gboolean emission);
+ gdouble x,
+ gdouble y,
+ gint cx,
+ gint cy);
+static void e_calendar_item_stop_selecting (ECalendarItem *calitem,
+ guint32 time);
+static void e_calendar_item_selection_add_days
+ (ECalendarItem *calitem,
+ gint n_days,
+ gboolean multi_selection);
+static gint e_calendar_item_key_press_event (ECalendarItem *item,
+ GdkEvent *event);
+static gint e_calendar_item_event (GnomeCanvasItem *item,
+ GdkEvent *event);
+static void e_calendar_item_bounds (GnomeCanvasItem *item,
+ gdouble *x1,
+ gdouble *y1,
+ gdouble *x2,
+ gdouble *y2);
+
+static gboolean e_calendar_item_button_press (ECalendarItem *calitem,
+ GdkEvent *event);
+static gboolean e_calendar_item_button_release (ECalendarItem *calitem,
+ GdkEvent *event);
+static gboolean e_calendar_item_motion (ECalendarItem *calitem,
+ GdkEvent *event);
+
+static gboolean e_calendar_item_convert_position_to_day
+ (ECalendarItem *calitem,
+ gint x,
+ gint y,
+ gboolean round_empty_positions,
+ gint *month_offset,
+ gint *day,
+ gboolean *entire_week);
+static void e_calendar_item_get_month_info (ECalendarItem *calitem,
+ gint row,
+ gint col,
+ gint *first_day_offset,
+ gint *days_in_month,
+ gint *days_in_prev_month);
+static void e_calendar_item_recalc_sizes (ECalendarItem *calitem);
+
+static void e_calendar_item_get_day_style (ECalendarItem *calitem,
+ gint year,
+ gint month,
+ gint day,
+ gint day_style,
+ gboolean today,
+ gboolean prev_or_next_month,
+ gboolean selected,
+ gboolean has_focus,
+ gboolean drop_target,
+ GdkColor **bg_color,
+ GdkColor **fg_color,
+ GdkColor **box_color,
+ gboolean *bold,
+ gboolean *italic);
+static void e_calendar_item_check_selection_end
+ (ECalendarItem *calitem,
+ gint start_month,
+ gint start_day,
+ gint *end_month,
+ gint *end_day);
+static void e_calendar_item_check_selection_start
+ (ECalendarItem *calitem,
+ gint *start_month,
+ gint *start_day,
+ gint end_month,
+ gint end_day);
+static void e_calendar_item_add_days_to_selection
+ (ECalendarItem *calitem,
+ gint days);
+static void e_calendar_item_round_up_selection
+ (ECalendarItem *calitem,
+ gint *month_offset,
+ gint *day);
+static void e_calendar_item_round_down_selection
+ (ECalendarItem *calitem,
+ gint *month_offset,
+ gint *day);
+static gint e_calendar_item_get_inclusive_days
+ (ECalendarItem *calitem,
+ gint start_month_offset,
+ gint start_day,
+ gint end_month_offset,
+ gint end_day);
+static void e_calendar_item_ensure_valid_day
+ (ECalendarItem *calitem,
+ gint *month_offset,
+ gint *day);
+static gboolean e_calendar_item_ensure_days_visible
+ (ECalendarItem *calitem,
+ gint start_year,
+ gint start_month,
+ gint start_day,
+ gint end_year,
+ gint end_month,
+ gint end_day,
+ gboolean emission);
+static void e_calendar_item_show_popup_menu (ECalendarItem *calitem,
+ GdkEventButton *event,
+ gint month_offset);
+static void e_calendar_item_on_menu_item_activate
+ (GtkWidget *menuitem,
+ ECalendarItem *calitem);
+static void e_calendar_item_position_menu (GtkMenu *menu,
+ gint *x,
+ gint *y,
+ gboolean *push_in,
+ gpointer user_data);
+static void e_calendar_item_date_range_changed
+ (ECalendarItem *calitem);
+static void e_calendar_item_queue_signal_emission
+ (ECalendarItem *calitem);
+static gboolean e_calendar_item_signal_emission_idle_cb
+ (gpointer data);
+static void e_calendar_item_set_selection_if_emission
+ (ECalendarItem *calitem,
+ const GDate *start_date,
+ const GDate *end_date,
+ gboolean emission);
/* Our arguments. */
enum {
@@ -1483,7 +1502,8 @@ e_calendar_item_draw_day_numbers (ECalendarItem *calitem,
/* Get today's date, so we can highlight it. */
if (calitem->time_callback) {
- today_tm = (*calitem->time_callback) (calitem, calitem->time_callback_data);
+ today_tm = calitem->time_callback (
+ calitem, calitem->time_callback_data);
} else {
t = time (NULL);
today_tm = *localtime (&t);
@@ -1499,10 +1519,8 @@ e_calendar_item_draw_day_numbers (ECalendarItem *calitem,
for (drow = 0; drow < 6; drow++) {
/* Draw the week number. */
if (calitem->show_week_numbers) {
- week_num = e_calendar_item_get_week_number (calitem,
- day_num,
- months[mon],
- years[mon]);
+ week_num = e_calendar_item_get_week_number (
+ calitem, day_num, months[mon], years[mon]);
text_x = cells_x - E_CALENDAR_ITEM_XPAD_BEFORE_CELLS - 1
- E_CALENDAR_ITEM_XPAD_AFTER_WEEK_NUMBERS;
@@ -1513,15 +1531,20 @@ e_calendar_item_draw_day_numbers (ECalendarItem *calitem,
if (week_num >= 10) {
digit = week_num / 10;
text_x -= calitem->week_number_digit_widths[digit];
- num_chars += sprintf (&buffer[num_chars], get_digit_fomat (), digit);
+ num_chars += sprintf (
+ &buffer[num_chars],
+ get_digit_fomat (), digit);
}
digit = week_num % 10;
text_x -= calitem->week_number_digit_widths[digit] + 6;
- num_chars += sprintf (&buffer[num_chars], get_digit_fomat (), digit);
+ num_chars += sprintf (
+ &buffer[num_chars],
+ get_digit_fomat (), digit);
cairo_save (cr);
- gdk_cairo_set_source_color (cr, &style->text[GTK_STATE_ACTIVE]);
+ gdk_cairo_set_source_color (
+ cr, &style->text[GTK_STATE_ACTIVE]);
pango_layout_set_font_description (layout, font_desc);
pango_layout_set_text (layout, buffer, num_chars);
cairo_move_to (cr, text_x, text_y);
@@ -1564,8 +1587,8 @@ e_calendar_item_draw_day_numbers (ECalendarItem *calitem,
italic = FALSE;
if (calitem->style_callback)
- (*calitem->style_callback)
- (calitem,
+ calitem->style_callback (
+ calitem,
years[mon],
months[mon],
day_num,
@@ -1582,8 +1605,8 @@ e_calendar_item_draw_day_numbers (ECalendarItem *calitem,
&italic,
calitem->style_callback_data);
else
- e_calendar_item_get_day_style
- (calitem,
+ e_calendar_item_get_day_style (
+ calitem,
years[mon],
months[mon],
day_num,
@@ -1603,9 +1626,10 @@ e_calendar_item_draw_day_numbers (ECalendarItem *calitem,
if (bg_color) {
cairo_save (cr);
gdk_cairo_set_source_color (cr, bg_color);
- cairo_rectangle (cr, day_x , day_y,
- calitem->cell_width,
- calitem->cell_height);
+ cairo_rectangle (
+ cr, day_x , day_y,
+ calitem->cell_width,
+ calitem->cell_height);
cairo_fill (cr);
cairo_restore (cr);
}
@@ -1614,9 +1638,10 @@ e_calendar_item_draw_day_numbers (ECalendarItem *calitem,
if (box_color) {
cairo_save (cr);
gdk_cairo_set_source_color (cr, box_color);
- cairo_rectangle (cr, day_x , day_y,
- calitem->cell_width - 1,
- calitem->cell_height - 1);
+ cairo_rectangle (
+ cr, day_x , day_y,
+ calitem->cell_width - 1,
+ calitem->cell_height - 1);
cairo_stroke (cr);
cairo_restore (cr);
}
@@ -1640,25 +1665,33 @@ e_calendar_item_draw_day_numbers (ECalendarItem *calitem,
digit = day_num % 10;
day_x -= calitem->digit_widths[digit];
- num_chars += sprintf (&buffer[num_chars], get_digit_fomat (), digit);
+ num_chars += sprintf (
+ &buffer[num_chars],
+ get_digit_fomat (), digit);
cairo_save (cr);
if (fg_color) {
- gdk_cairo_set_source_color (cr, fg_color);
+ gdk_cairo_set_source_color (
+ cr, fg_color);
} else {
- gdk_cairo_set_source_color (cr, &style->fg[GTK_STATE_NORMAL]);
+ gdk_cairo_set_source_color (
+ cr, &style->fg[GTK_STATE_NORMAL]);
}
if (bold) {
- pango_font_description_set_weight (font_desc, PANGO_WEIGHT_BOLD);
+ pango_font_description_set_weight (
+ font_desc, PANGO_WEIGHT_BOLD);
} else {
- pango_font_description_set_weight (font_desc, PANGO_WEIGHT_NORMAL);
+ pango_font_description_set_weight (
+ font_desc, PANGO_WEIGHT_NORMAL);
}
if (italic) {
- pango_font_description_set_style (font_desc, PANGO_STYLE_ITALIC);
+ pango_font_description_set_style (
+ font_desc, PANGO_STYLE_ITALIC);
} else {
- pango_font_description_set_style (font_desc, PANGO_STYLE_NORMAL);
+ pango_font_description_set_style (
+ font_desc, PANGO_STYLE_NORMAL);
}
pango_layout_set_font_description (layout, font_desc);
@@ -1715,7 +1748,8 @@ e_calendar_item_get_week_number (ECalendarItem *calitem,
g_date_clear (&date, 1);
g_date_set_dmy (&date, day, month + 1, year);
- /* This results in a value of 0 (Monday) - 6 (Sunday). (or -1 on error - oops!!) */
+ /* This results in a value of 0 (Monday) - 6 (Sunday).
+ * (or -1 on error - oops!!) */
weekday = g_date_get_weekday (&date) - 1;
if (weekday > 0) {
@@ -1962,9 +1996,11 @@ e_calendar_item_recalc_sizes (ECalendarItem *calitem)
if (!font_desc)
font_desc = style->font_desc;
- pango_context = gtk_widget_create_pango_context (GTK_WIDGET (canvas_item->canvas));
- font_metrics = pango_context_get_metrics (pango_context, font_desc,
- pango_context_get_language (pango_context));
+ pango_context = gtk_widget_create_pango_context (
+ GTK_WIDGET (canvas_item->canvas));
+ font_metrics = pango_context_get_metrics (
+ pango_context, font_desc,
+ pango_context_get_language (pango_context));
layout = pango_layout_new (pango_context);
char_height =
@@ -2067,8 +2103,10 @@ e_calendar_item_get_day_style (ECalendarItem *calitem,
*fg_color = NULL;
*box_color = NULL;
- *bold = (day_style & E_CALENDAR_ITEM_MARK_BOLD) == E_CALENDAR_ITEM_MARK_BOLD;
- *italic = (day_style & E_CALENDAR_ITEM_MARK_ITALIC) == E_CALENDAR_ITEM_MARK_ITALIC;
+ *bold = (day_style & E_CALENDAR_ITEM_MARK_BOLD) ==
+ E_CALENDAR_ITEM_MARK_BOLD;
+ *italic = (day_style & E_CALENDAR_ITEM_MARK_ITALIC) ==
+ E_CALENDAR_ITEM_MARK_ITALIC;
if (today)
*box_color = &calitem->colors[E_CALENDAR_ITEM_COLOR_TODAY_BOX];
@@ -3399,18 +3437,25 @@ e_calendar_item_show_popup_menu (ECalendarItem *calitem,
gtk_widget_show (label);
gtk_container_add (GTK_CONTAINER (menuitem), label);
- g_object_set_data(G_OBJECT(menuitem), "month",
- GINT_TO_POINTER (month));
+ g_object_set_data (
+ G_OBJECT (menuitem), "month",
+ GINT_TO_POINTER (month));
- g_signal_connect ((menuitem), "activate",
- G_CALLBACK (e_calendar_item_on_menu_item_activate), calitem);
+ g_signal_connect (
+ menuitem, "activate",
+ G_CALLBACK (e_calendar_item_on_menu_item_activate),
+ calitem);
}
}
- g_signal_connect (menu, "deactivate", G_CALLBACK (deactivate_menu_cb), NULL);
- gtk_menu_popup (GTK_MENU (menu), NULL, NULL,
- e_calendar_item_position_menu, calitem,
- event->button, event->time);
+ g_signal_connect (
+ menu, "deactivate",
+ G_CALLBACK (deactivate_menu_cb), NULL);
+
+ gtk_menu_popup (
+ GTK_MENU (menu), NULL, NULL,
+ e_calendar_item_position_menu, calitem,
+ event->button, event->time);
}
static void
diff --git a/widgets/misc/e-canvas-background.c b/widgets/misc/e-canvas-background.c
index ea45aab4d5..a12a36471d 100644
--- a/widgets/misc/e-canvas-background.c
+++ b/widgets/misc/e-canvas-background.c
@@ -40,6 +40,10 @@
#include "e-canvas-background.h"
+#define E_CANVAS_BACKGROUND_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_CANVAS_BACKGROUND_TYPE, ECanvasBackgroundPrivate))
+
/* workaround for avoiding API broken */
#define ecb_get_type e_canvas_background_get_type
G_DEFINE_TYPE (
@@ -103,20 +107,6 @@ ecb_update (GnomeCanvasItem *item,
}
static void
-ecb_dispose (GObject *object)
-{
- ECanvasBackground *ecb = E_CANVAS_BACKGROUND (object);
-
- if (ecb->priv) {
- g_free (ecb->priv);
- ecb->priv = NULL;
- }
-
- /* Chain up to parent's dispose() method. */
- G_OBJECT_CLASS (ecb_parent_class)->dispose (object);
-}
-
-static void
ecb_set_property (GObject *object,
guint property_id,
const GValue *value,
@@ -184,7 +174,7 @@ ecb_get_property (GObject *object,
static void
ecb_init (ECanvasBackground *ecb)
{
- ecb->priv = g_new (ECanvasBackgroundPrivate, 1);
+ ecb->priv = E_CANVAS_BACKGROUND_GET_PRIVATE (ecb);
}
static void
@@ -233,7 +223,8 @@ ecb_class_init (ECanvasBackgroundClass *ecb_class)
GnomeCanvasItemClass *item_class = GNOME_CANVAS_ITEM_CLASS (ecb_class);
GObjectClass *object_class = G_OBJECT_CLASS (ecb_class);
- object_class->dispose = ecb_dispose;
+ g_type_class_add_private (ecb_class, sizeof (ECanvasBackgroundPrivate));
+
object_class->set_property = ecb_set_property;
object_class->get_property = ecb_get_property;
diff --git a/widgets/misc/e-canvas-vbox.c b/widgets/misc/e-canvas-vbox.c
index 1b7e6ac900..db5ad51319 100644
--- a/widgets/misc/e-canvas-vbox.c
+++ b/widgets/misc/e-canvas-vbox.c
@@ -64,16 +64,16 @@ G_DEFINE_TYPE (
GNOME_TYPE_CANVAS_GROUP)
static void
-e_canvas_vbox_class_init (ECanvasVboxClass *klass)
+e_canvas_vbox_class_init (ECanvasVboxClass *class)
{
GObjectClass *object_class;
GnomeCanvasItemClass *item_class;
- object_class = (GObjectClass *) klass;
- item_class = (GnomeCanvasItemClass *) klass;
+ object_class = (GObjectClass *) class;
+ item_class = (GnomeCanvasItemClass *) class;
- klass->add_item = e_canvas_vbox_real_add_item;
- klass->add_item_start = e_canvas_vbox_real_add_item_start;
+ class->add_item = e_canvas_vbox_real_add_item;
+ class->add_item_start = e_canvas_vbox_real_add_item_start;
object_class->set_property = e_canvas_vbox_set_property;
object_class->get_property = e_canvas_vbox_get_property;
diff --git a/widgets/misc/e-canvas.c b/widgets/misc/e-canvas.c
index 5e6889fa8e..91bd7c4091 100644
--- a/widgets/misc/e-canvas.c
+++ b/widgets/misc/e-canvas.c
@@ -262,11 +262,15 @@ pick_current_item (GnomeCanvas *canvas,
/* these fields don't have the same offsets in both types of events */
if (canvas->pick_event.type == GDK_ENTER_NOTIFY) {
- x = canvas->pick_event.crossing.x + canvas->scroll_x1 - canvas->zoom_xofs;
- y = canvas->pick_event.crossing.y + canvas->scroll_y1 - canvas->zoom_yofs;
+ x = canvas->pick_event.crossing.x +
+ canvas->scroll_x1 - canvas->zoom_xofs;
+ y = canvas->pick_event.crossing.y +
+ canvas->scroll_y1 - canvas->zoom_yofs;
} else {
- x = canvas->pick_event.motion.x + canvas->scroll_x1 - canvas->zoom_xofs;
- y = canvas->pick_event.motion.y + canvas->scroll_y1 - canvas->zoom_yofs;
+ x = canvas->pick_event.motion.x +
+ canvas->scroll_x1 - canvas->zoom_xofs;
+ y = canvas->pick_event.motion.y +
+ canvas->scroll_y1 - canvas->zoom_yofs;
}
/* canvas pixel coords */
diff --git a/widgets/misc/e-charset-combo-box.c b/widgets/misc/e-charset-combo-box.c
index a2ec3489f6..01a814ad10 100644
--- a/widgets/misc/e-charset-combo-box.c
+++ b/widgets/misc/e-charset-combo-box.c
@@ -30,6 +30,10 @@
#include "e-util/e-charset.h"
#include "e-util/e-util.h"
+#define E_CHARSET_COMBO_BOX_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_CHARSET_COMBO_BOX, ECharsetComboBoxPrivate))
+
#define DEFAULT_CHARSET "UTF-8"
#define OTHER_VALUE G_MAXINT
@@ -221,7 +225,7 @@ charset_combo_box_dispose (GObject *object)
{
ECharsetComboBoxPrivate *priv;
- priv = E_CHARSET_COMBO_BOX (object)->priv;
+ priv = E_CHARSET_COMBO_BOX_GET_PRIVATE (object);
if (priv->action_group != NULL) {
g_object_unref (priv->action_group);
@@ -244,7 +248,7 @@ charset_combo_box_finalize (GObject *object)
{
ECharsetComboBoxPrivate *priv;
- priv = E_CHARSET_COMBO_BOX (object)->priv;
+ priv = E_CHARSET_COMBO_BOX_GET_PRIVATE (object);
g_hash_table_destroy (priv->charset_index);
@@ -257,7 +261,7 @@ charset_combo_box_changed (GtkComboBox *combo_box)
{
ECharsetComboBoxPrivate *priv;
- priv = E_CHARSET_COMBO_BOX (combo_box)->priv;
+ priv = E_CHARSET_COMBO_BOX_GET_PRIVATE (combo_box);
/* Chain up to parent's changed() method. */
GTK_COMBO_BOX_CLASS (e_charset_combo_box_parent_class)->
@@ -312,8 +316,7 @@ e_charset_combo_box_init (ECharsetComboBox *combo_box)
(GDestroyNotify) g_free,
(GDestroyNotify) g_object_unref);
- combo_box->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- combo_box, E_TYPE_CHARSET_COMBO_BOX, ECharsetComboBoxPrivate);
+ combo_box->priv = E_CHARSET_COMBO_BOX_GET_PRIVATE (combo_box);
combo_box->priv->action_group = action_group;
combo_box->priv->charset_index = charset_index;
diff --git a/widgets/misc/e-contact-map-window.c b/widgets/misc/e-contact-map-window.c
index 9612f0d6ac..87ce665793 100644
--- a/widgets/misc/e-contact-map-window.c
+++ b/widgets/misc/e-contact-map-window.c
@@ -165,7 +165,8 @@ map_contact_added_cb (EContactMap *map,
gtk_list_store_set (priv->completion_model, &iter,
0, name, -1);
- g_signal_connect (E_CONTACT_MARKER (marker), "double-clicked",
+ g_signal_connect (
+ marker, "double-clicked",
G_CALLBACK (marker_doubleclick_cb), user_data);
priv->tasks_cnt--;
@@ -342,8 +343,7 @@ e_contact_map_window_init (EContactMapWindow *window)
ChamplainView *view;
GHashTable *hash_table;
- priv = G_TYPE_INSTANCE_GET_PRIVATE (
- window, E_TYPE_CONTACT_MAP_WINDOW, EContactMapWindowPrivate);
+ priv = E_CONTACT_MAP_WINDOW_GET_PRIVATE (window);
window->priv = priv;
priv->tasks_cnt = 0;
@@ -361,15 +361,20 @@ e_contact_map_window_init (EContactMapWindow *window)
view = e_contact_map_get_view (E_CONTACT_MAP (map));
champlain_view_set_zoom_level (view, 2);
priv->map = E_CONTACT_MAP (map);
- g_signal_connect (view, "notify::zoom-level",
+ g_signal_connect (
+ view, "notify::zoom-level",
G_CALLBACK (zoom_level_changed_cb), window);
- g_signal_connect (map, "contact-added",
+ g_signal_connect (
+ map, "contact-added",
G_CALLBACK (map_contact_added_cb), window);
- g_signal_connect (map, "contact-removed",
+ g_signal_connect (
+ map, "contact-removed",
G_CALLBACK (map_contact_removed_cb), window);
- g_signal_connect (map, "geocoding-started",
+ g_signal_connect (
+ map, "geocoding-started",
G_CALLBACK (map_contact_geocoding_started_cb), window);
- g_signal_connect (map, "geocoding-failed",
+ g_signal_connect (
+ map, "geocoding-failed",
G_CALLBACK (map_contact_geocoding_failed_cb), window);
/* HBox container */
@@ -383,14 +388,16 @@ e_contact_map_window_init (EContactMapWindow *window)
/* Zoom-in button */
button = gtk_button_new_from_stock (GTK_STOCK_ZOOM_IN);
- g_signal_connect (button, "clicked",
+ g_signal_connect (
+ button, "clicked",
G_CALLBACK (contact_map_window_zoom_in_cb), window);
priv->zoom_in_btn = button;
gtk_container_add (GTK_CONTAINER (hbox), button);
/* Zoom-out button */
button = gtk_button_new_from_stock (GTK_STOCK_ZOOM_OUT);
- g_signal_connect (button, "clicked",
+ g_signal_connect (
+ button, "clicked",
G_CALLBACK (contact_map_window_zoom_out_cb), window);
priv->zoom_out_btn = button;
gtk_container_add (GTK_CONTAINER (hbox), button);
@@ -404,20 +411,23 @@ e_contact_map_window_init (EContactMapWindow *window)
gtk_entry_completion_set_model (
entry_completion, GTK_TREE_MODEL (completion_model));
gtk_entry_completion_set_text_column (entry_completion, 0);
- g_signal_connect (entry_completion, "match-selected",
+ g_signal_connect (
+ entry_completion, "match-selected",
G_CALLBACK (entry_completion_match_selected_cb), window);
/* Search entry */
entry = gtk_entry_new ();
gtk_entry_set_completion (GTK_ENTRY (entry), entry_completion);
- g_signal_connect (entry, "key-press-event",
+ g_signal_connect (
+ entry, "key-press-event",
G_CALLBACK (contact_map_window_entry_key_pressed_cb), window);
window->priv->search_entry = entry;
gtk_container_add (GTK_CONTAINER (hbox), entry);
/* Search button */
button = gtk_button_new_from_stock (GTK_STOCK_FIND);
- g_signal_connect (button, "clicked",
+ g_signal_connect (
+ button, "clicked",
G_CALLBACK (contact_map_window_find_contact_cb), window);
gtk_container_add (GTK_CONTAINER (hbox), button);
diff --git a/widgets/misc/e-contact-map.c b/widgets/misc/e-contact-map.c
index b2f6ff591e..7158aaeed5 100644
--- a/widgets/misc/e-contact-map.c
+++ b/widgets/misc/e-contact-map.c
@@ -205,7 +205,7 @@ e_contact_map_class_init (EContactMapClass *class)
{
GObjectClass *object_class;
- g_type_class_add_private (class, sizeof (EContactMap));
+ g_type_class_add_private (class, sizeof (EContactMapPrivate));
object_class = G_OBJECT_CLASS (class);
object_class->finalize = contact_map_finalize;
@@ -254,8 +254,7 @@ e_contact_map_init (EContactMap *map)
ChamplainMarkerLayer *layer;
ChamplainView *view;
- map->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- map, E_TYPE_CONTACT_MAP, EContactMapPrivate);
+ map->priv = E_CONTACT_MAP_GET_PRIVATE (map);
hash_table = g_hash_table_new_full (g_str_hash, g_str_equal,
(GDestroyNotify) g_free, NULL);
diff --git a/widgets/misc/e-contact-marker.c b/widgets/misc/e-contact-marker.c
index 7d7f57db25..2f7c2cbf45 100644
--- a/widgets/misc/e-contact-marker.c
+++ b/widgets/misc/e-contact-marker.c
@@ -546,8 +546,7 @@ e_contact_marker_init (EContactMarker *marker)
{
EContactMarkerPrivate *priv;
- priv = G_TYPE_INSTANCE_GET_PRIVATE (
- marker, E_TYPE_CONTACT_MARKER, EContactMarkerPrivate);
+ priv = E_CONTACT_MARKER_GET_PRIVATE (marker);
marker->priv = priv;
priv->contact_uid = NULL;
@@ -565,9 +564,11 @@ e_contact_marker_init (EContactMarker *marker)
priv->total_width = 0;
priv->total_height = 0;
- g_signal_connect (marker, "notify::selected",
+ g_signal_connect (
+ marker, "notify::selected",
G_CALLBACK (notify_selected), NULL);
- g_signal_connect (CLUTTER_ACTOR (marker), "button-release-event",
+ g_signal_connect (
+ marker, "button-release-event",
G_CALLBACK (contact_marker_clicked_cb), NULL);
}
diff --git a/widgets/misc/e-dateedit.c b/widgets/misc/e-dateedit.c
index 970a06b402..4513aec28f 100644
--- a/widgets/misc/e-dateedit.c
+++ b/widgets/misc/e-dateedit.c
@@ -43,6 +43,10 @@
#include <e-util/e-util.h>
#include "e-calendar.h"
+#define E_DATE_EDIT_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_DATE_EDIT, EDateEditPrivate))
+
struct _EDateEditPrivate {
GtkWidget *date_entry;
GtkWidget *date_button;
@@ -451,8 +455,7 @@ e_date_edit_class_init (EDateEditClass *class)
static void
e_date_edit_init (EDateEdit *dedit)
{
- dedit->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- dedit, E_TYPE_DATE_EDIT, EDateEditPrivate);
+ dedit->priv = E_DATE_EDIT_GET_PRIVATE (dedit);
dedit->priv->show_date = TRUE;
dedit->priv->show_time = TRUE;
@@ -524,20 +527,20 @@ create_children (EDateEdit *dedit)
gtk_box_pack_start (GTK_BOX (dedit), priv->date_entry, FALSE, TRUE, 0);
gtk_widget_set_size_request (priv->date_entry, 100, -1);
- g_signal_connect (priv->date_entry, "key_press_event",
- G_CALLBACK (on_date_entry_key_press),
- dedit);
- g_signal_connect (priv->date_entry, "key_release_event",
- G_CALLBACK (on_date_entry_key_release),
- dedit);
- g_signal_connect_after (priv->date_entry,
- "focus_out_event",
- G_CALLBACK (on_date_entry_focus_out),
- dedit);
+ g_signal_connect (
+ priv->date_entry, "key_press_event",
+ G_CALLBACK (on_date_entry_key_press), dedit);
+ g_signal_connect (
+ priv->date_entry, "key_release_event",
+ G_CALLBACK (on_date_entry_key_release), dedit);
+ g_signal_connect_after (
+ priv->date_entry, "focus_out_event",
+ G_CALLBACK (on_date_entry_focus_out), dedit);
priv->date_button = gtk_button_new ();
- g_signal_connect (priv->date_button, "clicked",
- G_CALLBACK (on_date_button_clicked), dedit);
+ g_signal_connect (
+ priv->date_button, "clicked",
+ G_CALLBACK (on_date_button_clicked), dedit);
gtk_box_pack_start (GTK_BOX (dedit), priv->date_button,
FALSE, FALSE, 0);
a11y = gtk_widget_get_accessible (priv->date_button);
@@ -620,15 +623,15 @@ create_children (EDateEdit *dedit)
gtk_widget_set_events (priv->cal_popup,
gtk_widget_get_events (priv->cal_popup)
| GDK_KEY_PRESS_MASK);
- g_signal_connect (priv->cal_popup, "delete_event",
- G_CALLBACK (on_date_popup_delete_event),
- dedit);
- g_signal_connect (priv->cal_popup, "key_press_event",
- G_CALLBACK (on_date_popup_key_press),
- dedit);
- g_signal_connect (priv->cal_popup, "button_press_event",
- G_CALLBACK (on_date_popup_button_press),
- dedit);
+ g_signal_connect (
+ priv->cal_popup, "delete_event",
+ G_CALLBACK (on_date_popup_delete_event), dedit);
+ g_signal_connect (
+ priv->cal_popup, "key_press_event",
+ G_CALLBACK (on_date_popup_key_press), dedit);
+ g_signal_connect (
+ priv->cal_popup, "button_press_event",
+ G_CALLBACK (on_date_popup_button_press), dedit);
gtk_window_set_resizable (GTK_WINDOW (priv->cal_popup), TRUE);
frame = gtk_frame_new (NULL);
@@ -647,9 +650,9 @@ create_children (EDateEdit *dedit)
"move_selection_when_moving", FALSE,
NULL);
- g_signal_connect (calendar->calitem,
- "selection_changed",
- G_CALLBACK (on_date_popup_date_selected), dedit);
+ g_signal_connect (
+ calendar->calitem, "selection_changed",
+ G_CALLBACK (on_date_popup_date_selected), dedit);
gtk_box_pack_start (GTK_BOX (vbox), priv->calendar, FALSE, FALSE, 0);
gtk_widget_show (priv->calendar);
@@ -663,21 +666,24 @@ create_children (EDateEdit *dedit)
priv->now_button = gtk_button_new_with_mnemonic (_("No_w"));
gtk_container_add (GTK_CONTAINER (bbox), priv->now_button);
gtk_widget_show (priv->now_button);
- g_signal_connect (priv->now_button, "clicked",
- G_CALLBACK (on_date_popup_now_button_clicked), dedit);
+ g_signal_connect (
+ priv->now_button, "clicked",
+ G_CALLBACK (on_date_popup_now_button_clicked), dedit);
priv->today_button = gtk_button_new_with_mnemonic (_("_Today"));
gtk_container_add (GTK_CONTAINER (bbox), priv->today_button);
gtk_widget_show (priv->today_button);
- g_signal_connect (priv->today_button, "clicked",
- G_CALLBACK (on_date_popup_today_button_clicked), dedit);
+ g_signal_connect (
+ priv->today_button, "clicked",
+ G_CALLBACK (on_date_popup_today_button_clicked), dedit);
/* Note that we don't show this here, since by default a 'None' date
* is not permitted. */
priv->none_button = gtk_button_new_with_mnemonic (_("_None"));
gtk_container_add (GTK_CONTAINER (bbox), priv->none_button);
- g_signal_connect (priv->none_button, "clicked",
- G_CALLBACK (on_date_popup_none_button_clicked), dedit);
+ g_signal_connect (
+ priv->none_button, "clicked",
+ G_CALLBACK (on_date_popup_none_button_clicked), dedit);
g_object_bind_property (
dedit, "allow-no-date-set",
priv->none_button, "visible",
diff --git a/widgets/misc/e-focus-tracker.c b/widgets/misc/e-focus-tracker.c
index 1e7082b207..505d991a2f 100644
--- a/widgets/misc/e-focus-tracker.c
+++ b/widgets/misc/e-focus-tracker.c
@@ -29,6 +29,10 @@
#include <misc/e-selectable.h>
+#define E_FOCUS_TRACKER_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_FOCUS_TRACKER, EFocusTrackerPrivate))
+
struct _EFocusTrackerPrivate {
GtkWidget *focus; /* not referenced */
GtkWindow *window;
@@ -356,7 +360,7 @@ focus_tracker_dispose (GObject *object)
{
EFocusTrackerPrivate *priv;
- priv = E_FOCUS_TRACKER (object)->priv;
+ priv = E_FOCUS_TRACKER_GET_PRIVATE (object);
g_signal_handlers_disconnect_matched (
gtk_clipboard_get (GDK_SELECTION_PRIMARY),
@@ -538,8 +542,7 @@ e_focus_tracker_init (EFocusTracker *focus_tracker)
{
GtkAction *action;
- focus_tracker->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- focus_tracker, E_TYPE_FOCUS_TRACKER, EFocusTrackerPrivate);
+ focus_tracker->priv = E_FOCUS_TRACKER_GET_PRIVATE (focus_tracker);
/* Define dummy actions. These will most likely be overridden,
* but for cases where they're not it ensures ESelectable objects
diff --git a/widgets/misc/e-image-chooser.c b/widgets/misc/e-image-chooser.c
index 932d4ebc51..5fe6941d58 100644
--- a/widgets/misc/e-image-chooser.c
+++ b/widgets/misc/e-image-chooser.c
@@ -32,6 +32,10 @@
#include "e-util/e-util.h"
#include "e-util/e-icon-factory.h"
+#define E_IMAGE_CHOOSER_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_IMAGE_CHOOSER, EImageChooserPrivate))
+
struct _EImageChooserPrivate {
GtkWidget *frame;
GtkWidget *image;
@@ -372,7 +376,7 @@ image_chooser_dispose (GObject *object)
{
EImageChooserPrivate *priv;
- priv = E_IMAGE_CHOOSER (object)->priv;
+ priv = E_IMAGE_CHOOSER_GET_PRIVATE (object);
if (priv->frame != NULL) {
g_object_unref (priv->frame);
@@ -393,7 +397,7 @@ image_chooser_finalize (GObject *object)
{
EImageChooserPrivate *priv;
- priv = E_IMAGE_CHOOSER (object)->priv;
+ priv = E_IMAGE_CHOOSER_GET_PRIVATE (object);
g_free (priv->image_buf);
g_free (priv->icon_name);
@@ -442,8 +446,7 @@ e_image_chooser_init (EImageChooser *chooser)
GtkWidget *container;
GtkWidget *widget;
- chooser->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- chooser, E_TYPE_IMAGE_CHOOSER, EImageChooserPrivate);
+ chooser->priv = E_IMAGE_CHOOSER_GET_PRIVATE (chooser);
container = GTK_WIDGET (chooser);
diff --git a/widgets/misc/e-import-assistant.c b/widgets/misc/e-import-assistant.c
index a2588cd075..6bda3952b2 100644
--- a/widgets/misc/e-import-assistant.c
+++ b/widgets/misc/e-import-assistant.c
@@ -37,6 +37,10 @@
#include <e-util/e-import.h>
#include <e-util/e-util-private.h>
+#define E_IMPORT_ASSISTANT_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_IMPORT_ASSISTANT, EImportAssistantPrivate))
+
typedef struct _ImportFilePage ImportFilePage;
typedef struct _ImportDestinationPage ImportDestinationPage;
typedef struct _ImportTypePage ImportTypePage;
@@ -147,12 +151,15 @@ filename_changed (GtkWidget *widget,
const gchar *filename;
gint fileok;
- priv = E_IMPORT_ASSISTANT (assistant)->priv;
+ priv = E_IMPORT_ASSISTANT_GET_PRIVATE (assistant);
page = &priv->file_page;
filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (widget));
- fileok = filename && filename[0] && g_file_test (filename, G_FILE_TEST_IS_REGULAR);
+ fileok =
+ filename != NULL && *filename != '\0' &&
+ g_file_test (filename, G_FILE_TEST_IS_REGULAR);
+
if (fileok) {
GtkTreeIter iter;
GtkTreeModel *model;
@@ -219,7 +226,7 @@ filetype_changed_cb (GtkComboBox *combo_box,
GtkTreeModel *model;
GtkTreeIter iter;
- priv = E_IMPORT_ASSISTANT (assistant)->priv;
+ priv = E_IMPORT_ASSISTANT_GET_PRIVATE (assistant);
g_return_if_fail (gtk_combo_box_get_active_iter (combo_box, &iter));
@@ -503,7 +510,7 @@ prepare_intelligent_page (GtkAssistant *assistant,
gint row;
ImportSelectionPage *page;
- priv = E_IMPORT_ASSISTANT (assistant)->priv;
+ priv = E_IMPORT_ASSISTANT_GET_PRIVATE (assistant);
page = &priv->selection_page;
if (page->target != NULL) {
@@ -666,7 +673,7 @@ prepare_file_page (GtkAssistant *assistant,
GtkListStore *store;
ImportFilePage *page;
- priv = E_IMPORT_ASSISTANT (assistant)->priv;
+ priv = E_IMPORT_ASSISTANT_GET_PRIVATE (assistant);
page = &priv->file_page;
if (page->target != NULL) {
@@ -729,7 +736,7 @@ prepare_destination_page (GtkAssistant *assistant,
EImportAssistantPrivate *priv;
ImportDestinationPage *page;
- priv = E_IMPORT_ASSISTANT (assistant)->priv;
+ priv = E_IMPORT_ASSISTANT_GET_PRIVATE (assistant);
page = &priv->destination_page;
if (page->control)
@@ -756,7 +763,7 @@ prepare_progress_page (GtkAssistant *assistant,
gboolean intelligent_import;
gboolean is_simple = FALSE;
- priv = E_IMPORT_ASSISTANT (assistant)->priv;
+ priv = E_IMPORT_ASSISTANT_GET_PRIVATE (assistant);
page = &priv->selection_page;
/* Because we're a GTK_ASSISTANT_PAGE_PROGRESS, this will
@@ -820,7 +827,7 @@ simple_filetype_changed_cb (GtkComboBox *combo_box,
GtkWidget *vbox;
GtkWidget *control;
- priv = E_IMPORT_ASSISTANT (assistant)->priv;
+ priv = E_IMPORT_ASSISTANT_GET_PRIVATE (assistant);
page = &priv->simple_page;
g_return_if_fail (gtk_combo_box_get_active_iter (combo_box, &iter));
@@ -864,7 +871,7 @@ prepare_simple_page (GtkAssistant *assistant,
ImportSimplePage *page;
gchar *uri;
- priv = E_IMPORT_ASSISTANT (assistant)->priv;
+ priv = E_IMPORT_ASSISTANT_GET_PRIVATE (assistant);
page = &priv->simple_page;
g_return_if_fail (priv->fileuris != NULL);
@@ -942,7 +949,7 @@ prepare_simple_destination_page (GtkAssistant *assistant,
ImportDestinationPage *page;
ImportSimplePage *simple_page;
- priv = E_IMPORT_ASSISTANT (assistant)->priv;
+ priv = E_IMPORT_ASSISTANT_GET_PRIVATE (assistant);
page = &priv->destination_page;
simple_page = &priv->simple_page;
@@ -1004,7 +1011,7 @@ set_import_uris (EImportAssistant *assistant,
g_return_val_if_fail (assistant->priv->import != NULL, FALSE);
g_return_val_if_fail (uris != NULL, FALSE);
- priv = E_IMPORT_ASSISTANT (assistant)->priv;
+ priv = E_IMPORT_ASSISTANT_GET_PRIVATE (assistant);
for (i = 0; uris[i]; i++) {
const gchar *uri = uris[i];
@@ -1014,7 +1021,8 @@ set_import_uris (EImportAssistant *assistant,
if (!filename)
filename = g_strdup (uri);
- if (filename && *filename && g_file_test (filename, G_FILE_TEST_IS_REGULAR)) {
+ if (filename && *filename &&
+ g_file_test (filename, G_FILE_TEST_IS_REGULAR)) {
gchar *furi;
if (!g_path_is_absolute (filename)) {
@@ -1069,11 +1077,49 @@ set_import_uris (EImportAssistant *assistant,
}
static void
+import_assistant_set_property (GObject *object,
+ guint property_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ EImportAssistantPrivate *priv;
+
+ priv = E_IMPORT_ASSISTANT_GET_PRIVATE (object);
+
+ switch (property_id) {
+ case PROP_IS_SIMPLE:
+ priv->is_simple = g_value_get_boolean (value);
+ return;
+ }
+
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+}
+
+static void
+import_assistant_get_property (GObject *object,
+ guint property_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ EImportAssistantPrivate *priv;
+
+ priv = E_IMPORT_ASSISTANT_GET_PRIVATE (object);
+
+ switch (property_id) {
+ case PROP_IS_SIMPLE:
+ g_value_set_boolean (value, priv->is_simple);
+ return;
+ }
+
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+}
+
+static void
import_assistant_dispose (GObject *object)
{
EImportAssistantPrivate *priv;
- priv = E_IMPORT_ASSISTANT (object)->priv;
+ priv = E_IMPORT_ASSISTANT_GET_PRIVATE (object);
if (priv->file_page.target != NULL) {
e_import_target_free (
@@ -1116,7 +1162,7 @@ import_assistant_finalize (GObject *object)
{
EImportAssistantPrivate *priv;
- priv = E_IMPORT_ASSISTANT (object)->priv;
+ priv = E_IMPORT_ASSISTANT_GET_PRIVATE (object);
g_slist_free (priv->selection_page.importers);
@@ -1124,37 +1170,6 @@ import_assistant_finalize (GObject *object)
G_OBJECT_CLASS (e_import_assistant_parent_class)->finalize (object);
}
-static void
-import_assistant_set_property (GObject *object,
- guint property_id,
- const GValue *value,
- GParamSpec *pspec)
-{
- switch (property_id) {
- case PROP_IS_SIMPLE:
- E_IMPORT_ASSISTANT (object)->priv->is_simple = g_value_get_boolean (value);
- return;
- }
-
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
-}
-
-static void
-import_assistant_get_property (GObject *object,
- guint property_id,
- GValue *value,
- GParamSpec *pspec)
-{
- switch (property_id) {
- case PROP_IS_SIMPLE:
- g_value_set_boolean (value,
- E_IMPORT_ASSISTANT (object)->priv->is_simple);
- return;
- }
-
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
-}
-
static gboolean
import_assistant_key_press_event (GtkWidget *widget,
GdkEventKey *event)
@@ -1372,9 +1387,8 @@ import_assistant_construct (EImportAssistant *import_assistant)
static void
e_import_assistant_init (EImportAssistant *import_assistant)
{
- import_assistant->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- import_assistant, E_TYPE_IMPORT_ASSISTANT,
- EImportAssistantPrivate);
+ import_assistant->priv =
+ E_IMPORT_ASSISTANT_GET_PRIVATE (import_assistant);
}
GtkWidget *
diff --git a/widgets/misc/e-map.c b/widgets/misc/e-map.c
index a239709415..1d114d0c07 100644
--- a/widgets/misc/e-map.c
+++ b/widgets/misc/e-map.c
@@ -36,6 +36,10 @@
#include "e-map.h"
+#define E_MAP_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_MAP, EMapPrivate))
+
#define E_MAP_TWEEN_TIMEOUT_MSECS 25
#define E_MAP_TWEEN_DURATION_MSECS 150
@@ -563,9 +567,6 @@ e_map_finalize (GObject *object)
/* gone in unrealize */
g_assert (map->priv->map_render_surface == NULL);
- g_free (map->priv);
- map->priv = NULL;
-
G_OBJECT_CLASS (e_map_parent_class)->finalize (object);
}
@@ -807,10 +808,12 @@ e_map_class_init (EMapClass *class)
GObjectClass *object_class;
GtkWidgetClass *widget_class;
+ g_type_class_add_private (class, sizeof (EMapPrivate));
+
object_class = G_OBJECT_CLASS (class);
- object_class->finalize = e_map_finalize;
object_class->set_property = e_map_set_property;
object_class->get_property = e_map_get_property;
+ object_class->finalize = e_map_finalize;
/* Scrollable interface properties */
g_object_class_override_property (
@@ -846,7 +849,7 @@ e_map_init (EMap *map)
widget = GTK_WIDGET (map);
- map->priv = g_new0 (EMapPrivate, 1);
+ map->priv = E_MAP_GET_PRIVATE (map);
load_map_background (map, map_file_name);
g_free (map_file_name);
@@ -1244,10 +1247,12 @@ update_render_surface (EMap *map,
/* Scale the original map into the rendering pixbuf */
- if (width > 1 && height > 1)
- {
+ if (width > 1 && height > 1) {
cairo_t *cr = cairo_create (map->priv->map_render_surface);
- cairo_scale (cr, (gdouble) width / orig_width, (gdouble) height / orig_height);
+ cairo_scale (
+ cr,
+ (gdouble) width / orig_width,
+ (gdouble) height / orig_height);
gdk_cairo_set_source_pixbuf (cr, map->priv->map_pixbuf, 0, 0);
cairo_paint (cr);
cairo_destroy (cr);
@@ -1260,8 +1265,7 @@ update_render_surface (EMap *map,
if (render_overlays) {
/* Add points */
- for (i = 0; i < map->priv->points->len; i++)
- {
+ for (i = 0; i < map->priv->points->len; i++) {
point = g_ptr_array_index (map->priv->points, i);
update_render_point (map, point);
}
diff --git a/widgets/misc/e-menu-tool-button.c b/widgets/misc/e-menu-tool-button.c
index 5a052a1844..c2a68d0c05 100644
--- a/widgets/misc/e-menu-tool-button.c
+++ b/widgets/misc/e-menu-tool-button.c
@@ -25,16 +25,19 @@
#include "e-menu-tool-button.h"
+#define E_MENU_TOOL_BUTTON_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_MENU_TOOL_BUTTON, EMenuToolButtonPrivate))
+
+struct _EMenuToolButtonPrivate {
+ gchar *prefer_item;
+};
+
enum {
PROP_0,
PROP_PREFER_ITEM
};
-struct _EMenuToolButtonPrivate
-{
- gchar *prefer_item;
-};
-
G_DEFINE_TYPE (
EMenuToolButton,
e_menu_tool_button,
@@ -73,8 +76,9 @@ menu_tool_button_get_prefer_menu_item (GtkMenuToolButton *menu_tool_button)
if (children == NULL)
return NULL;
- prefer_item = e_menu_tool_button_get_prefer_item (E_MENU_TOOL_BUTTON (menu_tool_button));
- if (prefer_item && *prefer_item) {
+ prefer_item = e_menu_tool_button_get_prefer_item (
+ E_MENU_TOOL_BUTTON (menu_tool_button));
+ if (prefer_item != NULL && *prefer_item != '\0') {
GtkAction *action;
GList *iter;
@@ -84,7 +88,8 @@ menu_tool_button_get_prefer_menu_item (GtkMenuToolButton *menu_tool_button)
if (!item)
continue;
- action = gtk_activatable_get_related_action (GTK_ACTIVATABLE (item));
+ action = gtk_activatable_get_related_action (
+ GTK_ACTIVATABLE (item));
if (action && g_strcmp0 (gtk_action_get_name (action), prefer_item) == 0)
break;
else if (!action && g_strcmp0 (gtk_widget_get_name (GTK_WIDGET (item)), prefer_item) == 0)
@@ -227,8 +232,7 @@ e_menu_tool_button_class_init (EMenuToolButtonClass *class)
static void
e_menu_tool_button_init (EMenuToolButton *button)
{
- button->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- button, E_TYPE_MENU_TOOL_BUTTON, EMenuToolButtonPrivate);
+ button->priv = E_MENU_TOOL_BUTTON_GET_PRIVATE (button);
button->priv->prefer_item = NULL;
@@ -245,7 +249,7 @@ e_menu_tool_button_new (const gchar *label)
void
e_menu_tool_button_set_prefer_item (EMenuToolButton *button,
- const gchar *prefer_item)
+ const gchar *prefer_item)
{
g_return_if_fail (button != NULL);
g_return_if_fail (E_IS_MENU_TOOL_BUTTON (button));
diff --git a/widgets/misc/e-online-button.c b/widgets/misc/e-online-button.c
index 351413e954..07ff998dc3 100644
--- a/widgets/misc/e-online-button.c
+++ b/widgets/misc/e-online-button.c
@@ -23,6 +23,10 @@
#include <glib/gi18n.h>
+#define E_ONLINE_BUTTON_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_ONLINE_BUTTON, EOnlineButtonPrivate))
+
#define ONLINE_TOOLTIP \
_("Evolution is currently online. Click this button to work offline.")
@@ -101,7 +105,7 @@ online_button_dispose (GObject *object)
{
EOnlineButtonPrivate *priv;
- priv = E_ONLINE_BUTTON (object)->priv;
+ priv = E_ONLINE_BUTTON_GET_PRIVATE (object);
if (priv->image != NULL) {
g_object_unref (priv->image);
@@ -141,8 +145,7 @@ e_online_button_init (EOnlineButton *button)
{
GtkWidget *widget;
- button->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- button, E_TYPE_ONLINE_BUTTON, EOnlineButtonPrivate);
+ button->priv = E_ONLINE_BUTTON_GET_PRIVATE (button);
gtk_widget_set_can_focus (GTK_WIDGET (button), FALSE);
gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
diff --git a/widgets/misc/e-paned.c b/widgets/misc/e-paned.c
index c90d40c140..3b8f16bbec 100644
--- a/widgets/misc/e-paned.c
+++ b/widgets/misc/e-paned.c
@@ -27,6 +27,10 @@
#include <glib/gi18n-lib.h>
+#define E_PANED_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_PANED, EPanedPrivate))
+
#define SYNC_REQUEST_NONE 0
#define SYNC_REQUEST_POSITION 1
#define SYNC_REQUEST_PROPORTION 2
@@ -224,7 +228,7 @@ paned_realize (GtkWidget *widget)
GdkWindowState state;
GdkWindow *window;
- priv = E_PANED (widget)->priv;
+ priv = E_PANED_GET_PRIVATE (widget);
/* Chain up to parent's realize() method. */
GTK_WIDGET_CLASS (e_paned_parent_class)->realize (widget);
@@ -367,8 +371,7 @@ e_paned_class_init (EPanedClass *class)
static void
e_paned_init (EPaned *paned)
{
- paned->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- paned, E_TYPE_PANED, EPanedPrivate);
+ paned->priv = E_PANED_GET_PRIVATE (paned);
paned->priv->proportion = 0.5;
paned->priv->fixed_resize = TRUE;
diff --git a/widgets/misc/e-picture-gallery.c b/widgets/misc/e-picture-gallery.c
index a742a5e37c..372e70146c 100644
--- a/widgets/misc/e-picture-gallery.c
+++ b/widgets/misc/e-picture-gallery.c
@@ -27,6 +27,10 @@
#include "e-picture-gallery.h"
+#define E_PICTURE_GALLERY_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_PICTURE_GALLERY, EPictureGalleryPrivate))
+
struct _EPictureGalleryPrivate {
gboolean initialized;
gchar *path;
@@ -262,7 +266,10 @@ picture_gallery_start_loading_cb (EPictureGallery *gallery)
g_object_unref (file);
if (gallery->priv->monitor)
- g_signal_connect (gallery->priv->monitor, "changed", G_CALLBACK (picture_gallery_dir_changed_cb), gallery);
+ g_signal_connect (
+ gallery->priv->monitor, "changed",
+ G_CALLBACK (picture_gallery_dir_changed_cb),
+ gallery);
}
g_object_unref (icon_view);
@@ -414,8 +421,7 @@ e_picture_gallery_class_init (EPictureGalleryClass *class)
static void
e_picture_gallery_init (EPictureGallery *gallery)
{
- gallery->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- gallery, E_TYPE_PICTURE_GALLERY, EPictureGalleryPrivate);
+ gallery->priv = E_PICTURE_GALLERY_GET_PRIVATE (gallery);
gallery->priv->initialized = FALSE;
gallery->priv->monitor = NULL;
picture_gallery_set_path (gallery, NULL);
diff --git a/widgets/misc/e-popup-action.c b/widgets/misc/e-popup-action.c
index 52813c570d..2fd000ccad 100644
--- a/widgets/misc/e-popup-action.c
+++ b/widgets/misc/e-popup-action.c
@@ -27,6 +27,10 @@
#include <glib/gi18n.h>
+#define E_POPUP_ACTION_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_POPUP_ACTION, EPopupActionPrivate))
+
enum {
PROP_0,
PROP_RELATED_ACTION,
@@ -197,7 +201,7 @@ popup_action_dispose (GObject *object)
{
EPopupActionPrivate *priv;
- priv = E_POPUP_ACTION (object)->priv;
+ priv = E_POPUP_ACTION_GET_PRIVATE (object);
if (priv->related_action != NULL) {
g_signal_handler_disconnect (
@@ -334,8 +338,7 @@ e_popup_action_class_init (EPopupActionClass *class)
static void
e_popup_action_init (EPopupAction *popup_action)
{
- popup_action->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- popup_action, E_TYPE_POPUP_ACTION, EPopupActionPrivate);
+ popup_action->priv = E_POPUP_ACTION_GET_PRIVATE (popup_action);
popup_action->priv->use_action_appearance = TRUE;
/* Remain invisible until we have a related action. */
diff --git a/widgets/misc/e-preferences-window.c b/widgets/misc/e-preferences-window.c
index 4d90640796..3bce24371e 100644
--- a/widgets/misc/e-preferences-window.c
+++ b/widgets/misc/e-preferences-window.c
@@ -31,6 +31,10 @@
#define SWITCH_PAGE_INTERVAL 250
+#define E_PREFERENCES_WINDOW_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_PREFERENCES_WINDOW, EPreferencesWindowPrivate))
+
struct _EPreferencesWindowPrivate {
gboolean setup;
gpointer shell;
@@ -138,19 +142,25 @@ preferences_window_help_clicked_cb (EPreferencesWindow *window)
g_return_if_fail (window != NULL);
model = GTK_TREE_MODEL (window->priv->filter);
- list = gtk_icon_view_get_selected_items (GTK_ICON_VIEW (window->priv->icon_view));
+ list = gtk_icon_view_get_selected_items (
+ GTK_ICON_VIEW (window->priv->icon_view));
+
if (list != NULL) {
gtk_tree_model_get_iter (model, &iter, list->data);
gtk_tree_model_get (model, &iter, COLUMN_HELP, &help, -1);
+
} else if (gtk_tree_model_get_iter_first (model, &iter)) {
gint page_index, current_index;
- current_index = gtk_notebook_get_current_page (GTK_NOTEBOOK (window->priv->notebook));
+ current_index = gtk_notebook_get_current_page (
+ GTK_NOTEBOOK (window->priv->notebook));
do {
- gtk_tree_model_get (model, &iter, COLUMN_PAGE, &page_index, -1);
+ gtk_tree_model_get (
+ model, &iter, COLUMN_PAGE, &page_index, -1);
if (page_index == current_index) {
- gtk_tree_model_get (model, &iter, COLUMN_HELP, &help, -1);
+ gtk_tree_model_get (
+ model, &iter, COLUMN_HELP, &help, -1);
break;
}
} while (gtk_tree_model_iter_next (model, &iter));
@@ -194,7 +204,7 @@ preferences_window_dispose (GObject *object)
{
EPreferencesWindowPrivate *priv;
- priv = E_PREFERENCES_WINDOW (object)->priv;
+ priv = E_PREFERENCES_WINDOW_GET_PRIVATE (object);
if (priv->icon_view != NULL) {
g_object_unref (priv->icon_view);
@@ -222,7 +232,7 @@ preferences_window_finalize (GObject *object)
{
EPreferencesWindowPrivate *priv;
- priv = E_PREFERENCES_WINDOW (object)->priv;
+ priv = E_PREFERENCES_WINDOW_GET_PRIVATE (object);
g_hash_table_destroy (priv->index);
@@ -237,7 +247,7 @@ preferences_window_show (GtkWidget *widget)
GtkIconView *icon_view;
GtkTreePath *path;
- priv = E_PREFERENCES_WINDOW (widget)->priv;
+ priv = E_PREFERENCES_WINDOW_GET_PRIVATE (widget);
if (!priv->setup)
g_warning ("Preferences window has not been setup correctly");
@@ -287,8 +297,7 @@ e_preferences_window_init (EPreferencesWindow *window)
(GDestroyNotify) g_free,
(GDestroyNotify) gtk_tree_row_reference_free);
- window->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- window, E_TYPE_PREFERENCES_WINDOW, EPreferencesWindowPrivate);
+ window->priv = E_PREFERENCES_WINDOW_GET_PRIVATE (window);
window->priv->index = index;
window->priv->filter_view = NULL;
@@ -419,7 +428,7 @@ e_preferences_window_add_page (EPreferencesWindow *window,
const gchar *page_name,
const gchar *icon_name,
const gchar *caption,
- const gchar *help_target,
+ const gchar *help_target,
EPreferencesWindowCreatePageFn create_fn,
gint sort_order)
{
@@ -546,7 +555,7 @@ e_preferences_window_setup (EPreferencesWindow *window)
g_return_if_fail (E_IS_PREFERENCES_WINDOW (window));
- priv = window->priv;
+ priv = E_PREFERENCES_WINDOW_GET_PRIVATE (window);
notebook = GTK_NOTEBOOK (priv->notebook);
num = gtk_notebook_get_n_pages (notebook);
diff --git a/widgets/misc/e-preview-pane.c b/widgets/misc/e-preview-pane.c
index 42f338c75b..f9750c5885 100644
--- a/widgets/misc/e-preview-pane.c
+++ b/widgets/misc/e-preview-pane.c
@@ -32,6 +32,10 @@
#include "e-alert-bar.h"
+#define E_PREVIEW_PANE_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_PREVIEW_PANE, EPreviewPanePrivate))
+
struct _EPreviewPanePrivate {
GtkWidget *alert_bar;
GtkWidget *web_view;
@@ -118,7 +122,7 @@ preview_pane_dispose (GObject *object)
{
EPreviewPanePrivate *priv;
- priv = E_PREVIEW_PANE (object)->priv;
+ priv = E_PREVIEW_PANE_GET_PRIVATE (object);
if (priv->alert_bar != NULL) {
g_object_unref (priv->alert_bar);
@@ -145,7 +149,7 @@ preview_pane_constructed (GObject *object)
EPreviewPanePrivate *priv;
GtkWidget *widget;
- priv = E_PREVIEW_PANE (object)->priv;
+ priv = E_PREVIEW_PANE_GET_PRIVATE (object);
widget = e_alert_bar_new ();
gtk_box_pack_start (GTK_BOX (object), widget, FALSE, FALSE, 0);
@@ -273,8 +277,7 @@ e_preview_pane_alert_sink_init (EAlertSinkInterface *interface)
static void
e_preview_pane_init (EPreviewPane *preview_pane)
{
- preview_pane->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- preview_pane, E_TYPE_PREVIEW_PANE, EPreviewPanePrivate);
+ preview_pane->priv = E_PREVIEW_PANE_GET_PRIVATE (preview_pane);
gtk_box_set_spacing (GTK_BOX (preview_pane), 1);
}
diff --git a/widgets/misc/e-printable.c b/widgets/misc/e-printable.c
index ada5398523..29c85c5b29 100644
--- a/widgets/misc/e-printable.c
+++ b/widgets/misc/e-printable.c
@@ -30,7 +30,7 @@
#include "e-printable.h"
-#define EP_CLASS(e) ((EPrintableClass *)((GObject *)e)->klass)
+#define EP_CLASS(e) ((EPrintableClass *)((GObject *)e)->class)
G_DEFINE_TYPE (
EPrintable,
@@ -49,9 +49,9 @@ enum {
static guint e_printable_signals[LAST_SIGNAL] = { 0, };
static void
-e_printable_class_init (EPrintableClass *klass)
+e_printable_class_init (EPrintableClass *class)
{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ GObjectClass *object_class = G_OBJECT_CLASS (class);
e_printable_signals[PRINT_PAGE] =
g_signal_new ("print_page",
@@ -101,11 +101,11 @@ e_printable_class_init (EPrintableClass *klass)
G_TYPE_BOOLEAN, 4, G_TYPE_OBJECT, G_TYPE_DOUBLE,
G_TYPE_DOUBLE, G_TYPE_BOOLEAN);
- klass->print_page = NULL;
- klass->data_left = NULL;
- klass->reset = NULL;
- klass->height = NULL;
- klass->will_fit = NULL;
+ class->print_page = NULL;
+ class->data_left = NULL;
+ class->reset = NULL;
+ class->height = NULL;
+ class->will_fit = NULL;
}
static void
diff --git a/widgets/misc/e-search-bar.c b/widgets/misc/e-search-bar.c
index d70106e060..eafb1b6ad4 100644
--- a/widgets/misc/e-search-bar.c
+++ b/widgets/misc/e-search-bar.c
@@ -29,6 +29,10 @@
#include <gdk/gdkkeysyms.h>
#include <gtkhtml/gtkhtml-search.h>
+#define E_SEARCH_BAR_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_SEARCH_BAR, ESearchBarPrivate))
+
struct _ESearchBarPrivate {
EWebView *web_view;
GtkWidget *entry;
@@ -316,7 +320,7 @@ search_bar_dispose (GObject *object)
{
ESearchBarPrivate *priv;
- priv = E_SEARCH_BAR (object)->priv;
+ priv = E_SEARCH_BAR_GET_PRIVATE (object);
if (priv->web_view != NULL) {
g_object_unref (priv->web_view);
@@ -362,7 +366,7 @@ search_bar_finalize (GObject *object)
{
ESearchBarPrivate *priv;
- priv = E_SEARCH_BAR (object)->priv;
+ priv = E_SEARCH_BAR_GET_PRIVATE (object);
g_free (priv->active_search);
@@ -375,7 +379,7 @@ search_bar_constructed (GObject *object)
{
ESearchBarPrivate *priv;
- priv = E_SEARCH_BAR (object)->priv;
+ priv = E_SEARCH_BAR_GET_PRIVATE (object);
g_object_bind_property (
object, "case-sensitive",
@@ -537,8 +541,7 @@ e_search_bar_init (ESearchBar *search_bar)
GtkWidget *widget;
GtkWidget *container;
- search_bar->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- search_bar, E_TYPE_SEARCH_BAR, ESearchBarPrivate);
+ search_bar->priv = E_SEARCH_BAR_GET_PRIVATE (search_bar);
search_bar->priv->tokenizer = e_searching_tokenizer_new ();
g_signal_connect_swapped (
diff --git a/widgets/misc/e-searching-tokenizer.c b/widgets/misc/e-searching-tokenizer.c
index c3a7dfff2e..878efa1654 100644
--- a/widgets/misc/e-searching-tokenizer.c
+++ b/widgets/misc/e-searching-tokenizer.c
@@ -37,6 +37,10 @@
#define d(x)
+#define E_SEARCHING_TOKENIZER_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_SEARCHING_TOKENIZER, ESearchingTokenizerPrivate))
+
enum {
MATCH_SIGNAL,
LAST_SIGNAL
@@ -969,7 +973,7 @@ searching_tokenizer_finalize (GObject *object)
{
ESearchingTokenizerPrivate *priv;
- priv = E_SEARCHING_TOKENIZER (object)->priv;
+ priv = E_SEARCHING_TOKENIZER_GET_PRIVATE (object);
search_info_free (priv->primary);
search_info_free (priv->secondary);
@@ -987,7 +991,7 @@ searching_tokenizer_begin (HTMLTokenizer *tokenizer,
{
ESearchingTokenizerPrivate *priv;
- priv = E_SEARCHING_TOKENIZER (tokenizer)->priv;
+ priv = E_SEARCHING_TOKENIZER_GET_PRIVATE (tokenizer);
/* reset search */
if (priv->engine != NULL) {
@@ -1011,7 +1015,7 @@ searching_tokenizer_peek_token (HTMLTokenizer *tokenizer)
{
ESearchingTokenizerPrivate *priv;
- priv = E_SEARCHING_TOKENIZER (tokenizer)->priv;
+ priv = E_SEARCHING_TOKENIZER_GET_PRIVATE (tokenizer);
if (priv->engine != NULL)
return searcher_peek_token (priv->engine);
@@ -1028,7 +1032,7 @@ searching_tokenizer_next_token (HTMLTokenizer *tokenizer)
gint oldmatched;
gchar *token;
- priv = E_SEARCHING_TOKENIZER (tokenizer)->priv;
+ priv = E_SEARCHING_TOKENIZER_GET_PRIVATE (tokenizer);
/* If no search is active, just use the default method. */
if (priv->engine == NULL)
@@ -1054,7 +1058,7 @@ searching_tokenizer_has_more (HTMLTokenizer *tokenizer)
{
ESearchingTokenizerPrivate *priv;
- priv = E_SEARCHING_TOKENIZER (tokenizer)->priv;
+ priv = E_SEARCHING_TOKENIZER_GET_PRIVATE (tokenizer);
return (priv->engine != NULL && searcher_pending (priv->engine)) ||
HTML_TOKENIZER_CLASS (e_searching_tokenizer_parent_class)->
@@ -1112,9 +1116,7 @@ e_searching_tokenizer_class_init (ESearchingTokenizerClass *class)
static void
e_searching_tokenizer_init (ESearchingTokenizer *tokenizer)
{
- tokenizer->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- tokenizer, E_TYPE_SEARCHING_TOKENIZER,
- ESearchingTokenizerPrivate);
+ tokenizer->priv = E_SEARCHING_TOKENIZER_GET_PRIVATE (tokenizer);
tokenizer->priv->primary = search_info_new ();
search_info_set_flags (
diff --git a/widgets/misc/e-selection-model-array.c b/widgets/misc/e-selection-model-array.c
index d744111bb4..71990f1bd3 100644
--- a/widgets/misc/e-selection-model-array.c
+++ b/widgets/misc/e-selection-model-array.c
@@ -588,13 +588,13 @@ e_selection_model_array_init (ESelectionModelArray *esma)
}
static void
-e_selection_model_array_class_init (ESelectionModelArrayClass *klass)
+e_selection_model_array_class_init (ESelectionModelArrayClass *class)
{
GObjectClass *object_class;
ESelectionModelClass *esm_class;
- object_class = G_OBJECT_CLASS (klass);
- esm_class = E_SELECTION_MODEL_CLASS (klass);
+ object_class = G_OBJECT_CLASS (class);
+ esm_class = E_SELECTION_MODEL_CLASS (class);
object_class->dispose = esma_dispose;
object_class->get_property = esma_get_property;
@@ -618,7 +618,7 @@ e_selection_model_array_class_init (ESelectionModelArrayClass *klass)
esm_class->move_selection_end = esma_move_selection_end;
esm_class->set_selection_end = esma_set_selection_end;
- klass->get_row_count = NULL;
+ class->get_row_count = NULL;
g_object_class_install_property (object_class, PROP_CURSOR_ROW,
g_param_spec_int ("cursor_row",
diff --git a/widgets/misc/e-send-options.c b/widgets/misc/e-send-options.c
index 2af95a4080..54507d22e5 100644
--- a/widgets/misc/e-send-options.c
+++ b/widgets/misc/e-send-options.c
@@ -36,6 +36,10 @@
#include "e-dateedit.h"
#include "e-send-options.h"
+#define E_SEND_OPTIONS_DIALOG_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_SEND_OPTIONS_DIALOG, ESendOptionsDialogPrivate))
+
struct _ESendOptionsDialogPrivate {
GtkBuilder *builder;
@@ -404,16 +408,30 @@ init_widgets (ESendOptionsDialog *sod)
priv = sod->priv;
- g_signal_connect (priv->expiration, "toggled", G_CALLBACK (expiration_toggled_cb), sod);
- g_signal_connect (priv->reply_request, "toggled", G_CALLBACK (reply_request_toggled_cb), sod);
- g_signal_connect (priv->delay_delivery, "toggled", G_CALLBACK (delay_delivery_toggled_cb), sod);
- g_signal_connect (priv->create_sent, "toggled", G_CALLBACK (sent_item_toggled_cb), sod);
-
- g_signal_connect (GTK_DIALOG (priv->main), "response", G_CALLBACK(e_send_options_cb), sod);
- g_signal_connect (priv->delay_until, "changed", G_CALLBACK (delay_until_date_changed_cb), sod);
+ g_signal_connect (
+ priv->expiration, "toggled",
+ G_CALLBACK (expiration_toggled_cb), sod);
+ g_signal_connect (
+ priv->reply_request, "toggled",
+ G_CALLBACK (reply_request_toggled_cb), sod);
+ g_signal_connect (
+ priv->delay_delivery, "toggled",
+ G_CALLBACK (delay_delivery_toggled_cb), sod);
+ g_signal_connect (
+ priv->create_sent, "toggled",
+ G_CALLBACK (sent_item_toggled_cb), sod);
+
+ g_signal_connect (
+ priv->main, "response",
+ G_CALLBACK (e_send_options_cb), sod);
+ g_signal_connect (
+ priv->delay_until, "changed",
+ G_CALLBACK (delay_until_date_changed_cb), sod);
if (priv->global)
- g_signal_connect (priv->notebook, "switch-page", G_CALLBACK (page_changed_cb), sod);
+ g_signal_connect (
+ priv->notebook, "switch-page",
+ G_CALLBACK (page_changed_cb), sod);
}
@@ -571,7 +589,7 @@ e_send_options_dialog_new (void)
{
ESendOptionsDialog *sod;
- sod = g_object_new (E_TYPE_SENDOPTIONS_DIALOG, NULL);
+ sod = g_object_new (E_TYPE_SEND_OPTIONS_DIALOG, NULL);
return sod;
}
@@ -580,7 +598,7 @@ void
e_send_options_set_need_general_options (ESendOptionsDialog *sod,
gboolean needed)
{
- g_return_if_fail (E_IS_SENDOPTIONS_DIALOG (sod));
+ g_return_if_fail (E_IS_SEND_OPTIONS_DIALOG (sod));
sod->priv->gopts_needed = needed;
}
@@ -588,7 +606,7 @@ e_send_options_set_need_general_options (ESendOptionsDialog *sod,
gboolean
e_send_options_get_need_general_options (ESendOptionsDialog *sod)
{
- g_return_val_if_fail (E_IS_SENDOPTIONS_DIALOG (sod), FALSE);
+ g_return_val_if_fail (E_IS_SEND_OPTIONS_DIALOG (sod), FALSE);
return sod->priv->gopts_needed;
}
@@ -597,7 +615,7 @@ gboolean
e_send_options_set_global (ESendOptionsDialog *sod,
gboolean set)
{
- g_return_val_if_fail (E_IS_SENDOPTIONS_DIALOG (sod), FALSE);
+ g_return_val_if_fail (E_IS_SEND_OPTIONS_DIALOG (sod), FALSE);
sod->priv->global = set;
@@ -641,7 +659,7 @@ e_send_options_dialog_run (ESendOptionsDialog *sod,
ESendOptionsDialogPrivate *priv;
GtkWidget *toplevel;
- g_return_val_if_fail (sod != NULL || E_IS_SENDOPTIONS_DIALOG (sod), FALSE);
+ g_return_val_if_fail (sod != NULL || E_IS_SEND_OPTIONS_DIALOG (sod), FALSE);
priv = sod->priv;
@@ -683,59 +701,30 @@ e_send_options_dialog_run (ESendOptionsDialog *sod,
static void
e_send_options_dialog_finalize (GObject *object)
{
- ESendOptionsDialog *sod = (ESendOptionsDialog *) object;
- ESendOptionsDialogPrivate *priv;
+ ESendOptionsDialog *sod;
- g_return_if_fail (E_IS_SENDOPTIONS_DIALOG (sod));
- priv = sod->priv;
+ sod = E_SEND_OPTIONS_DIALOG (object);
- g_free (priv->help_section);
+ g_free (sod->priv->help_section);
- if (sod->data->gopts) {
- g_free (sod->data->gopts);
- sod->data->gopts = NULL;
- }
+ g_free (sod->data->gopts);
- if (!priv->global && sod->data->sopts) {
+ if (!sod->priv->global)
g_free (sod->data->sopts);
- sod->data->sopts = NULL;
- }
- if (sod->data->mopts) {
- g_free (sod->data->mopts);
- sod->data->mopts = NULL;
- }
-
- if (sod->data->copts) {
- g_free (sod->data->copts);
- sod->data->copts = NULL;
- }
-
- if (sod->data->topts) {
- g_free (sod->data->topts);
- sod->data->topts = NULL;
- }
-
- if (sod->data) {
- g_free (sod->data);
- sod->data = NULL;
- }
-
- if (sod->priv) {
- g_free (sod->priv);
- sod->priv = NULL;
- }
+ g_free (sod->data->mopts);
+ g_free (sod->data->copts);
+ g_free (sod->data->topts);
+ g_free (sod->data);
/* Chain up to parent's finalize() method. */
G_OBJECT_CLASS (e_send_options_dialog_parent_class)->finalize (object);
-
}
/* Object initialization function for the task page */
static void
e_send_options_dialog_init (ESendOptionsDialog *sod)
{
- ESendOptionsDialogPrivate *priv;
ESendOptionsData *new;
new = g_new0 (ESendOptionsData, 1);
@@ -744,45 +733,14 @@ e_send_options_dialog_init (ESendOptionsDialog *sod)
new->mopts = g_new0 (ESendOptionsStatusTracking, 1);
new->copts = g_new0 (ESendOptionsStatusTracking, 1);
new->topts = g_new0 (ESendOptionsStatusTracking, 1);
- priv = g_new0 (ESendOptionsDialogPrivate, 1);
- sod->priv = priv;
+ sod->priv = E_SEND_OPTIONS_DIALOG_GET_PRIVATE (sod);
+
sod->data = new;
sod->data->initialized = FALSE;
sod->data->gopts->security = 0;
- priv->gopts_needed = TRUE;
- priv->builder = NULL;
-
- priv->main = NULL;
- priv->notebook = NULL;
- priv->priority = NULL;
- priv->status = NULL;
- priv->security = NULL;
- priv->reply_request = NULL;
- priv->reply_convenient = NULL;
- priv->within_days = NULL;
- priv->delay_delivery = NULL;
- priv->delay_until = NULL;
- priv->expiration = NULL;
- priv->expire_after = NULL;
- priv->create_sent = NULL;
- priv->delivered =NULL;
- priv->delivered_opened = NULL;
- priv->global = FALSE;
- priv->all_info = NULL;
- priv->when_opened = NULL;
- priv->when_declined = NULL;
- priv->when_accepted = NULL;
- priv->when_completed = NULL;
- priv->security_label = NULL;
- priv->priority_label = NULL;
- priv->opened_label = NULL;
- priv->gopts_label = NULL;
- priv-> declined_label = NULL;
- priv->accepted_label = NULL;
- priv->completed_label = NULL;
-
+ sod->priv->gopts_needed = TRUE;
}
/* Class initialization function for the Send Options */
@@ -791,16 +749,19 @@ e_send_options_dialog_class_init (ESendOptionsDialogClass *class)
{
GObjectClass *object_class;
+ g_type_class_add_private (class, sizeof (ESendOptionsDialogPrivate));
+
object_class = G_OBJECT_CLASS (class);
object_class->finalize = e_send_options_dialog_finalize;
- signals[SOD_RESPONSE] = g_signal_new ("sod_response",
- G_TYPE_FROM_CLASS (class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (ESendOptionsDialogClass, sod_response),
- NULL, NULL,
- g_cclosure_marshal_VOID__INT,
- G_TYPE_NONE, 1,
- G_TYPE_INT);
+ signals[SOD_RESPONSE] = g_signal_new (
+ "sod_response",
+ G_TYPE_FROM_CLASS (class),
+ G_SIGNAL_RUN_FIRST,
+ G_STRUCT_OFFSET (ESendOptionsDialogClass, sod_response),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__INT,
+ G_TYPE_NONE, 1,
+ G_TYPE_INT);
}
diff --git a/widgets/misc/e-send-options.h b/widgets/misc/e-send-options.h
index 2e25974dc3..2e8ef1d381 100644
--- a/widgets/misc/e-send-options.h
+++ b/widgets/misc/e-send-options.h
@@ -21,17 +21,17 @@
*
*/
-#ifndef __E_SENDOPTIONS_DIALOG_H__
-#define __E_SENDOPTIONS_DIALOG_H__
+#ifndef __E_SEND_OPTIONS_DIALOG_H__
+#define __E_SEND_OPTIONS_DIALOG_H__
#include <gtk/gtk.h>
#include <time.h>
-#define E_TYPE_SENDOPTIONS_DIALOG (e_send_options_dialog_get_type ())
-#define E_SENDOPTIONS_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_SENDOPTIONS_DIALOG, ESendOptionsDialog))
-#define E_SENDOPTIONS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_SENDOPTIONS_DIALOG, ESendOptionsDialogClass))
-#define E_IS_SENDOPTIONS_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_SENDOPTIONS_DIALOG))
-#define E_IS_SENDOPTIONS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), E_TYPE_SENDOPTIONS_DIALOG))
+#define E_TYPE_SEND_OPTIONS_DIALOG (e_send_options_dialog_get_type ())
+#define E_SEND_OPTIONS_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_SEND_OPTIONS_DIALOG, ESendOptionsDialog))
+#define E_SEND_OPTIONS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_SEND_OPTIONS_DIALOG, ESendOptionsDialogClass))
+#define E_IS_SEND_OPTIONS_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_SEND_OPTIONS_DIALOG))
+#define E_IS_SEND_OPTIONS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), E_TYPE_SEND_OPTIONS_DIALOG))
typedef struct _ESendOptionsDialog ESendOptionsDialog;
typedef struct _ESendOptionsDialogClass ESendOptionsDialogClass;
diff --git a/widgets/misc/e-signature-combo-box.c b/widgets/misc/e-signature-combo-box.c
index 9f3b6d9f99..e24cb14b7a 100644
--- a/widgets/misc/e-signature-combo-box.c
+++ b/widgets/misc/e-signature-combo-box.c
@@ -27,6 +27,10 @@
#include <glib/gi18n-lib.h>
+#define E_SIGNATURE_COMBO_BOX_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_SIGNATURE_COMBO_BOX, ESignatureComboBoxPrivate))
+
enum {
COLUMN_STRING,
COLUMN_SIGNATURE
@@ -158,7 +162,7 @@ signature_combo_box_dispose (GObject *object)
{
ESignatureComboBoxPrivate *priv;
- priv = E_SIGNATURE_COMBO_BOX (object)->priv;
+ priv = E_SIGNATURE_COMBO_BOX_GET_PRIVATE (object);
if (priv->signature_list != NULL) {
g_signal_handlers_disconnect_by_func (
@@ -179,7 +183,7 @@ signature_combo_box_finalize (GObject *object)
{
ESignatureComboBoxPrivate *priv;
- priv = E_SIGNATURE_COMBO_BOX (object)->priv;
+ priv = E_SIGNATURE_COMBO_BOX_GET_PRIVATE (object);
g_hash_table_destroy (priv->index);
@@ -219,9 +223,7 @@ e_signature_combo_box_init (ESignatureComboBox *combo_box)
(GDestroyNotify) g_object_unref,
(GDestroyNotify) gtk_tree_row_reference_free);
- combo_box->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- combo_box, E_TYPE_SIGNATURE_COMBO_BOX,
- ESignatureComboBoxPrivate);
+ combo_box->priv = E_SIGNATURE_COMBO_BOX_GET_PRIVATE (combo_box);
combo_box->priv->index = index;
}
@@ -250,7 +252,7 @@ e_signature_combo_box_set_signature_list (ESignatureComboBox *combo_box,
if (signature_list != NULL)
g_return_if_fail (E_IS_SIGNATURE_LIST (signature_list));
- priv = combo_box->priv;
+ priv = E_SIGNATURE_COMBO_BOX_GET_PRIVATE (combo_box);
if (priv->signature_list != NULL) {
g_signal_handlers_disconnect_by_func (
diff --git a/widgets/misc/e-signature-editor.c b/widgets/misc/e-signature-editor.c
index d968debe8f..ef5466d1d1 100644
--- a/widgets/misc/e-signature-editor.c
+++ b/widgets/misc/e-signature-editor.c
@@ -33,6 +33,10 @@
#include <libemail-utils/e-signature-utils.h>
#include <misc/e-web-view.h>
+#define E_SIGNATURE_EDITOR_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_SIGNATURE_EDITOR, ESignatureEditorPrivate))
+
enum {
PROP_0,
PROP_FOCUS_TRACKER,
@@ -283,7 +287,7 @@ signature_editor_dispose (GObject *object)
{
ESignatureEditorPrivate *priv;
- priv = E_SIGNATURE_EDITOR (object)->priv;
+ priv = E_SIGNATURE_EDITOR_GET_PRIVATE (object);
if (priv->action_group != NULL) {
g_object_unref (priv->action_group);
@@ -314,7 +318,7 @@ signature_editor_finalize (GObject *object)
{
ESignatureEditorPrivate *priv;
- priv = E_SIGNATURE_EDITOR (object)->priv;
+ priv = E_SIGNATURE_EDITOR_GET_PRIVATE (object);
g_free (priv->original_name);
@@ -400,8 +404,7 @@ e_signature_editor_init (ESignatureEditor *editor)
GtkWidget *vbox;
GError *error = NULL;
- editor->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- editor, E_TYPE_SIGNATURE_EDITOR, ESignatureEditorPrivate);
+ editor->priv = E_SIGNATURE_EDITOR_GET_PRIVATE (editor);
vbox = GTKHTML_EDITOR (editor)->vbox;
gtkhtml_editor = GTKHTML_EDITOR (editor);
diff --git a/widgets/misc/e-signature-manager.c b/widgets/misc/e-signature-manager.c
index 9e62c02d6c..eb68dd251d 100644
--- a/widgets/misc/e-signature-manager.c
+++ b/widgets/misc/e-signature-manager.c
@@ -31,6 +31,10 @@
#include "e-signature-tree-view.h"
#include "e-signature-script-dialog.h"
+#define E_SIGNATURE_MANAGER_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_SIGNATURE_MANAGER, ESignatureManagerPrivate))
+
struct _ESignatureManagerPrivate {
ESignatureList *signature_list;
@@ -234,7 +238,7 @@ signature_manager_dispose (GObject *object)
{
ESignatureManagerPrivate *priv;
- priv = E_SIGNATURE_MANAGER (object)->priv;
+ priv = E_SIGNATURE_MANAGER_GET_PRIVATE (object);
if (priv->signature_list != NULL) {
g_object_unref (priv->signature_list);
@@ -526,8 +530,7 @@ e_signature_manager_init (ESignatureManager *manager)
GtkWidget *container;
GtkWidget *widget;
- manager->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- manager, E_TYPE_SIGNATURE_MANAGER, ESignatureManagerPrivate);
+ manager->priv = E_SIGNATURE_MANAGER_GET_PRIVATE (manager);
gtk_table_resize (GTK_TABLE (manager), 1, 2);
gtk_table_set_col_spacings (GTK_TABLE (manager), 6);
diff --git a/widgets/misc/e-signature-preview.c b/widgets/misc/e-signature-preview.c
index 6de03c0881..75b19328c0 100644
--- a/widgets/misc/e-signature-preview.c
+++ b/widgets/misc/e-signature-preview.c
@@ -32,6 +32,10 @@
#include <libemail-utils/e-signature-utils.h>
+#define E_SIGNATURE_PREVIEW_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_SIGNATURE_PREVIEW, ESignaturePreviewPrivate))
+
enum {
PROP_0,
PROP_DISABLE_COMMAND_LINE,
@@ -108,7 +112,7 @@ signature_preview_dispose (GObject *object)
{
ESignaturePreviewPrivate *priv;
- priv = E_SIGNATURE_PREVIEW (object)->priv;
+ priv = E_SIGNATURE_PREVIEW_GET_PRIVATE (object);
if (priv->signature != NULL) {
g_object_unref (priv->signature);
@@ -239,8 +243,7 @@ e_signature_preview_class_init (ESignaturePreviewClass *class)
static void
e_signature_preview_init (ESignaturePreview *preview)
{
- preview->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- preview, E_TYPE_SIGNATURE_PREVIEW, ESignaturePreviewPrivate);
+ preview->priv = E_SIGNATURE_PREVIEW_GET_PRIVATE (preview);
}
GtkWidget *
diff --git a/widgets/misc/e-signature-script-dialog.c b/widgets/misc/e-signature-script-dialog.c
index f864f823c6..20eef7ec15 100644
--- a/widgets/misc/e-signature-script-dialog.c
+++ b/widgets/misc/e-signature-script-dialog.c
@@ -27,6 +27,10 @@
#include <glib/gi18n.h>
+#define E_SIGNATURE_SCRIPT_DIALOG_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_SIGNATURE_SCRIPT_DIALOG, ESignatureScriptDialogPrivate))
+
struct _ESignatureScriptDialogPrivate {
GtkWidget *entry;
GtkWidget *file_chooser;
@@ -144,7 +148,7 @@ signature_script_dialog_dispose (GObject *object)
{
ESignatureScriptDialogPrivate *priv;
- priv = E_SIGNATURE_SCRIPT_DIALOG (object)->priv;
+ priv = E_SIGNATURE_SCRIPT_DIALOG_GET_PRIVATE (object);
if (priv->entry != NULL) {
g_object_unref (priv->entry);
@@ -230,9 +234,7 @@ e_signature_script_dialog_init (ESignatureScriptDialog *dialog)
GtkWidget *widget;
gchar *markup;
- dialog->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- dialog, E_TYPE_SIGNATURE_SCRIPT_DIALOG,
- ESignatureScriptDialogPrivate);
+ dialog->priv = E_SIGNATURE_SCRIPT_DIALOG_GET_PRIVATE (dialog);
content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
diff --git a/widgets/misc/e-signature-tree-view.c b/widgets/misc/e-signature-tree-view.c
index 62a923d8b9..5631c62949 100644
--- a/widgets/misc/e-signature-tree-view.c
+++ b/widgets/misc/e-signature-tree-view.c
@@ -25,6 +25,10 @@
#include "e-signature-tree-view.h"
+#define E_SIGNATURE_TREE_VIEW_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_SIGNATURE_TREE_VIEW, ESignatureTreeViewPrivate))
+
enum {
COLUMN_STRING,
COLUMN_SIGNATURE
@@ -217,7 +221,7 @@ signature_tree_view_dispose (GObject *object)
{
ESignatureTreeViewPrivate *priv;
- priv = E_SIGNATURE_TREE_VIEW (object)->priv;
+ priv = E_SIGNATURE_TREE_VIEW_GET_PRIVATE (object);
if (priv->signature_list != NULL) {
g_signal_handlers_disconnect_by_func (
@@ -238,7 +242,7 @@ signature_tree_view_finalize (GObject *object)
{
ESignatureTreeViewPrivate *priv;
- priv = E_SIGNATURE_TREE_VIEW (object)->priv;
+ priv = E_SIGNATURE_TREE_VIEW_GET_PRIVATE (object);
g_hash_table_destroy (priv->index);
@@ -302,9 +306,7 @@ e_signature_tree_view_init (ESignatureTreeView *tree_view)
(GDestroyNotify) g_object_unref,
(GDestroyNotify) gtk_tree_row_reference_free);
- tree_view->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- tree_view, E_TYPE_SIGNATURE_TREE_VIEW,
- ESignatureTreeViewPrivate);
+ tree_view->priv = E_SIGNATURE_TREE_VIEW_GET_PRIVATE (tree_view);
tree_view->priv->index = index;
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_view));
@@ -340,7 +342,7 @@ e_signature_tree_view_set_signature_list (ESignatureTreeView *tree_view,
if (signature_list != NULL)
g_return_if_fail (E_IS_SIGNATURE_LIST (signature_list));
- priv = tree_view->priv;
+ priv = E_SIGNATURE_TREE_VIEW_GET_PRIVATE (tree_view);
if (priv->signature_list != NULL) {
g_signal_handlers_disconnect_by_func (
diff --git a/widgets/misc/e-url-entry.c b/widgets/misc/e-url-entry.c
index c59cf0739c..68b8a8fac0 100644
--- a/widgets/misc/e-url-entry.c
+++ b/widgets/misc/e-url-entry.c
@@ -29,13 +29,15 @@
#include "e-url-entry.h"
#include "e-util/e-util.h"
+#define E_URL_ENTRY_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_URL_ENTRY, EUrlEntryPrivate))
+
struct _EUrlEntryPrivate {
GtkWidget *entry;
GtkWidget *button;
};
-static void finalize (GObject *object);
-
static void button_clicked_cb (GtkWidget *widget, gpointer data);
static void entry_changed_cb (GtkEditable *editable, gpointer data);
@@ -49,11 +51,9 @@ G_DEFINE_TYPE (
static void
e_url_entry_class_init (EUrlEntryClass *class)
{
- GObjectClass *object_class;
GtkWidgetClass *widget_class;
- object_class = G_OBJECT_CLASS (class);
- object_class->finalize = finalize;
+ g_type_class_add_private (class, sizeof (EUrlEntryPrivate));
widget_class = GTK_WIDGET_CLASS (class);
widget_class->mnemonic_activate = mnemonic_activate;
@@ -62,46 +62,33 @@ e_url_entry_class_init (EUrlEntryClass *class)
static void
e_url_entry_init (EUrlEntry *url_entry)
{
- EUrlEntryPrivate *priv;
GtkWidget *pixmap;
- priv = g_new0 (EUrlEntryPrivate, 1);
- url_entry->priv = priv;
+ url_entry->priv = E_URL_ENTRY_GET_PRIVATE (url_entry);
- priv->entry = gtk_entry_new ();
- gtk_box_pack_start (GTK_BOX (url_entry), priv->entry, TRUE, TRUE, 0);
- priv->button = gtk_button_new ();
- gtk_widget_set_sensitive (priv->button, FALSE);
- gtk_box_pack_start (GTK_BOX (url_entry), priv->button, FALSE, FALSE, 0);
+ url_entry->priv->entry = gtk_entry_new ();
+ gtk_box_pack_start (
+ GTK_BOX (url_entry), url_entry->priv->entry, TRUE, TRUE, 0);
+ url_entry->priv->button = gtk_button_new ();
+ gtk_widget_set_sensitive (url_entry->priv->button, FALSE);
+ gtk_box_pack_start (
+ GTK_BOX (url_entry), url_entry->priv->button, FALSE, FALSE, 0);
atk_object_set_name (
- gtk_widget_get_accessible (priv->button),
+ gtk_widget_get_accessible (url_entry->priv->button),
_("Click here to go to URL"));
pixmap = gtk_image_new_from_icon_name ("go-jump", GTK_ICON_SIZE_BUTTON);
- gtk_container_add (GTK_CONTAINER (priv->button), pixmap);
+ gtk_container_add (GTK_CONTAINER (url_entry->priv->button), pixmap);
gtk_widget_show (pixmap);
- gtk_widget_show (priv->button);
- gtk_widget_show (priv->entry);
-
- g_signal_connect (priv->button, "clicked",
- G_CALLBACK (button_clicked_cb), url_entry);
- g_signal_connect (priv->entry, "changed",
- G_CALLBACK (entry_changed_cb), url_entry);
-}
-
-static void
-finalize (GObject *object)
-{
- EUrlEntry *url_entry;
-
- url_entry = E_URL_ENTRY (object);
- if (url_entry->priv) {
- g_free (url_entry->priv);
- url_entry->priv = NULL;
- }
+ gtk_widget_show (url_entry->priv->button);
+ gtk_widget_show (url_entry->priv->entry);
- /* Chain up to parent's finalize() method. */
- G_OBJECT_CLASS (e_url_entry_parent_class)->finalize (object);
+ g_signal_connect (
+ url_entry->priv->button, "clicked",
+ G_CALLBACK (button_clicked_cb), url_entry);
+ g_signal_connect (
+ url_entry->priv->entry, "changed",
+ G_CALLBACK (entry_changed_cb), url_entry);
}
/* GtkWidget::mnemonic_activate() handler for the EUrlEntry */
diff --git a/widgets/misc/e-web-view-preview.c b/widgets/misc/e-web-view-preview.c
index 12270da0b7..b75814fa83 100644
--- a/widgets/misc/e-web-view-preview.c
+++ b/widgets/misc/e-web-view-preview.c
@@ -28,6 +28,10 @@
#include <string.h>
#include <glib/gi18n-lib.h>
+#define E_WEB_VIEW_PREVIEW_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_WEB_VIEW_PREVIEW, EWebViewPreviewPrivate))
+
struct _EWebViewPreviewPrivate {
gboolean escape_values;
GString *updating_content; /* is NULL when not between begin_update/end_update */
@@ -96,7 +100,7 @@ web_view_preview_dispose (GObject *object)
{
EWebViewPreviewPrivate *priv;
- priv = E_WEB_VIEW_PREVIEW (object)->priv;
+ priv = E_WEB_VIEW_PREVIEW_GET_PRIVATE (object);
if (priv->updating_content != NULL) {
g_string_free (priv->updating_content, TRUE);
@@ -172,8 +176,7 @@ e_web_view_preview_init (EWebViewPreview *preview)
{
GtkWidget *tree_view_sw, *web_view_sw;
- preview->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- preview, E_TYPE_WEB_VIEW_PREVIEW, EWebViewPreviewPrivate);
+ preview->priv = E_WEB_VIEW_PREVIEW_GET_PRIVATE (preview);
preview->priv->escape_values = TRUE;
tree_view_sw = in_scrolled_window (gtk_tree_view_new ());
diff --git a/widgets/misc/ea-calendar-item.c b/widgets/misc/ea-calendar-item.c
index 98a715eacf..a483460226 100644
--- a/widgets/misc/ea-calendar-item.c
+++ b/widgets/misc/ea-calendar-item.c
@@ -38,7 +38,7 @@
#define EA_CALENDAR_COLUMN_NUM E_CALENDAR_COLS_PER_MONTH
/* EaCalendarItem */
-static void ea_calendar_item_class_init (EaCalendarItemClass *klass);
+static void ea_calendar_item_class_init (EaCalendarItemClass *class);
static void ea_calendar_item_finalize (GObject *object);
static const gchar * ea_calendar_item_get_name (AtkObject *accessible);
@@ -240,12 +240,12 @@ ea_calendar_item_new (GObject *obj)
n_ea_calendar_item_created);
#endif
/* connect signal handlers */
- g_signal_connect (obj, "selection_preview_changed",
- G_CALLBACK (selection_preview_change_cb),
- atk_object);
- g_signal_connect (obj, "date_range_changed",
- G_CALLBACK (date_range_changed_cb),
- atk_object);
+ g_signal_connect (
+ obj, "selection_preview_changed",
+ G_CALLBACK (selection_preview_change_cb), atk_object);
+ g_signal_connect (
+ obj, "date_range_changed",
+ G_CALLBACK (date_range_changed_cb), atk_object);
return atk_object;
}
diff --git a/widgets/misc/test-calendar.c b/widgets/misc/test-calendar.c
index 7a4d2f8954..c6d1a8eee6 100644
--- a/widgets/misc/test-calendar.c
+++ b/widgets/misc/test-calendar.c
@@ -69,18 +69,21 @@ main (gint argc,
gtk_window_set_resizable (GTK_WINDOW (window), TRUE);
gtk_container_set_border_width (GTK_CONTAINER (window), 8);
- g_signal_connect (window, "delete_event",
- G_CALLBACK (delete_event_cb), NULL);
+ g_signal_connect (
+ window, "delete_event",
+ G_CALLBACK (delete_event_cb), NULL);
cal = e_calendar_new ();
e_calendar_set_minimum_size (E_CALENDAR (cal), 1, 1);
calitem = E_CALENDAR (cal)->calitem;
gtk_widget_show (cal);
- g_signal_connect (calitem, "date_range_changed",
- G_CALLBACK (on_date_range_changed), NULL);
- g_signal_connect (calitem, "selection_changed",
- G_CALLBACK (on_selection_changed), NULL);
+ g_signal_connect (
+ calitem, "date_range_changed",
+ G_CALLBACK (on_date_range_changed), NULL);
+ g_signal_connect (
+ calitem, "selection_changed",
+ G_CALLBACK (on_selection_changed), NULL);
gtk_drag_dest_set (cal,
GTK_DEST_DEFAULT_ALL,
diff --git a/widgets/misc/test-dateedit.c b/widgets/misc/test-dateedit.c
index 2629fad4e0..46c853cea6 100644
--- a/widgets/misc/test-dateedit.c
+++ b/widgets/misc/test-dateedit.c
@@ -65,8 +65,9 @@ main (gint argc,
gtk_window_set_resizable (GTK_WINDOW (window), TRUE);
gtk_container_set_border_width (GTK_CONTAINER (window), 8);
- g_signal_connect (window, "delete_event",
- G_CALLBACK (delete_event_cb), window);
+ g_signal_connect (
+ window, "delete_event",
+ G_CALLBACK (delete_event_cb), window);
table = gtk_table_new (3, 3, FALSE);
gtk_table_set_row_spacings (GTK_TABLE (table), 4);
@@ -82,21 +83,25 @@ main (gint argc,
gtk_widget_show (GTK_WIDGET (dedit));
#if 0
- g_signal_connect (dedit, "date_changed",
- G_CALLBACK (on_date_changed), (gpointer) "1");
- g_signal_connect (dedit, "time_changed",
- G_CALLBACK (on_time_changed), (gpointer) "1");
+ g_signal_connect (
+ dedit, "date_changed",
+ G_CALLBACK (on_date_changed), (gpointer) "1");
+ g_signal_connect (
+ dedit, "time_changed",
+ G_CALLBACK (on_time_changed), (gpointer) "1");
#else
- g_signal_connect (dedit, "changed",
- G_CALLBACK (on_changed), (gpointer) "1");
+ g_signal_connect (
+ dedit, "changed",
+ G_CALLBACK (on_changed), (gpointer) "1");
#endif
button = gtk_button_new_with_label ("Print Date");
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_CALLBACK (on_get_date_clicked), dedit);
+ g_signal_connect (
+ button, "clicked",
+ G_CALLBACK (on_get_date_clicked), dedit);
/* EDateEdit 2. */
dedit = E_DATE_EDIT (e_date_edit_new ());
@@ -110,21 +115,25 @@ main (gint argc,
e_date_edit_set_show_time (dedit, FALSE);
#if 0
- g_signal_connect (dedit, "date_changed",
- G_CALLBACK (on_date_changed), (gpointer) "2");
- g_signal_connect (dedit, "time_changed",
- G_CALLBACK (on_time_changed), (gpointer) "2");
+ g_signal_connect (
+ dedit, "date_changed",
+ G_CALLBACK (on_date_changed), (gpointer) "2");
+ g_signal_connect (
+ dedit, "time_changed",
+ G_CALLBACK (on_time_changed), (gpointer) "2");
#else
- g_signal_connect (dedit, "changed",
- G_CALLBACK (on_changed), (gpointer) "2");
+ g_signal_connect (
+ dedit, "changed",
+ G_CALLBACK (on_changed), (gpointer) "2");
#endif
button = gtk_button_new_with_label ("Print Date");
gtk_table_attach (GTK_TABLE (table), button,
1, 2, 1, 2, 0, 0, 0, 0);
gtk_widget_show (button);
- g_signal_connect (button, "clicked",
- G_CALLBACK (on_get_date_clicked), dedit);
+ g_signal_connect (
+ button, "clicked",
+ G_CALLBACK (on_get_date_clicked), dedit);
/* EDateEdit 3. */
dedit = E_DATE_EDIT (e_date_edit_new ());
@@ -138,28 +147,33 @@ main (gint argc,
e_date_edit_set_allow_no_date_set (dedit, TRUE);
#if 0
- g_signal_connect (dedit, "date_changed",
- G_CALLBACK (on_date_changed), (gpointer) "3");
- g_signal_connect (dedit, "time_changed",
- G_CALLBACK (on_time_changed), (gpointer) "3");
+ g_signal_connect (
+ dedit, "date_changed",
+ G_CALLBACK (on_date_changed), (gpointer) "3");
+ g_signal_connect (
+ dedit, "time_changed",
+ G_CALLBACK (on_time_changed), (gpointer) "3");
#else
- g_signal_connect (dedit, "changed",
- G_CALLBACK (on_changed), (gpointer) "3");
+ g_signal_connect (
+ dedit, "changed",
+ G_CALLBACK (on_changed), (gpointer) "3");
#endif
button = gtk_button_new_with_label ("Print Date");
gtk_table_attach (GTK_TABLE (table), button,
1, 2, 2, 3, 0, 0, 0, 0);
gtk_widget_show (button);
- g_signal_connect (button, "clicked",
- G_CALLBACK (on_get_date_clicked), dedit);
+ g_signal_connect (
+ button, "clicked",
+ G_CALLBACK (on_get_date_clicked), dedit);
button = gtk_button_new_with_label ("Toggle 24-hour");
gtk_table_attach (GTK_TABLE (table), button,
2, 3, 2, 3, 0, 0, 0, 0);
gtk_widget_show (button);
- g_signal_connect (button, "clicked",
- G_CALLBACK (on_toggle_24_hour_clicked), dedit);
+ g_signal_connect (
+ button, "clicked",
+ G_CALLBACK (on_toggle_24_hour_clicked), dedit);
gtk_widget_show (window);
diff --git a/widgets/table/e-cell-combo.c b/widgets/table/e-cell-combo.c
index 2617cfafdf..20a19165be 100644
--- a/widgets/table/e-cell-combo.c
+++ b/widgets/table/e-cell-combo.c
@@ -259,34 +259,44 @@ e_cell_combo_do_popup (ECellPopup *ecp,
gint view_col)
{
ECellCombo *ecc = E_CELL_COMBO (ecp);
+ GtkTreeSelection *selection;
+ GdkWindow *window;
guint32 time;
gint error_code;
- GtkTreeSelection *selection;
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (ecc->popup_tree_view));
+ selection = gtk_tree_view_get_selection (
+ GTK_TREE_VIEW (ecc->popup_tree_view));
+
+ g_signal_handlers_block_by_func (
+ selection, e_cell_combo_selection_changed, ecc);
- g_signal_handlers_block_by_func (selection, e_cell_combo_selection_changed, ecc);
e_cell_combo_show_popup (ecc, row, view_col);
e_cell_combo_select_matching_item (ecc);
- g_signal_handlers_unblock_by_func (selection, e_cell_combo_selection_changed, ecc);
- if (event->type == GDK_BUTTON_PRESS) {
+ g_signal_handlers_unblock_by_func (
+ selection, e_cell_combo_selection_changed, ecc);
+
+ if (event->type == GDK_BUTTON_PRESS)
time = event->button.time;
- } else {
+ else
time = event->key.time;
- }
- error_code = gdk_pointer_grab (gtk_widget_get_window (ecc->popup_tree_view), TRUE,
- GDK_ENTER_NOTIFY_MASK |
- GDK_BUTTON_PRESS_MASK |
- GDK_BUTTON_RELEASE_MASK |
- GDK_POINTER_MOTION_HINT_MASK |
- GDK_BUTTON1_MOTION_MASK,
- NULL, NULL, time);
+ window = gtk_widget_get_window (ecc->popup_tree_view);
+
+ error_code = gdk_pointer_grab (
+ window, TRUE,
+ GDK_ENTER_NOTIFY_MASK |
+ GDK_BUTTON_PRESS_MASK |
+ GDK_BUTTON_RELEASE_MASK |
+ GDK_POINTER_MOTION_HINT_MASK |
+ GDK_BUTTON1_MOTION_MASK,
+ NULL, NULL, time);
+
if (error_code != 0)
g_warning ("Failed to get pointer grab (%i)", error_code);
+
gtk_grab_add (ecc->popup_window);
- gdk_keyboard_grab (gtk_widget_get_window (ecc->popup_tree_view), TRUE, time);
+ gdk_keyboard_grab (window, TRUE, time);
return TRUE;
}
@@ -297,7 +307,7 @@ e_cell_combo_select_matching_item (ECellCombo *ecc)
ECellPopup *ecp = E_CELL_POPUP (ecc);
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);
+ ETableItem *eti;
ETableCol *ecol;
gboolean found = FALSE;
gchar *cell_text;
@@ -306,6 +316,8 @@ e_cell_combo_select_matching_item (ECellCombo *ecc)
GtkTreeIter iter;
GtkTreeModel *model;
+ eti = E_TABLE_ITEM (ecp->popup_cell_view->cell_view.e_table_item_view);
+
ecol = e_table_header_get_column (eti->header, ecp->popup_view_col);
cell_text = e_cell_text_get_text (ecell_text, ecv->e_table_model,
ecol->col_idx, ecp->popup_row);
@@ -390,8 +402,8 @@ e_cell_combo_get_popup_pos (ECellCombo *ecc,
gint *width)
{
ECellPopup *ecp = E_CELL_POPUP (ecc);
- ETableItem *eti = E_TABLE_ITEM (ecp->popup_cell_view->cell_view.e_table_item_view);
- GtkWidget *canvas = GTK_WIDGET (GNOME_CANVAS_ITEM (eti)->canvas);
+ ETableItem *eti;
+ GtkWidget *canvas;
GtkWidget *widget;
GtkWidget *popwin_child;
GtkWidget *popup_child;
@@ -408,6 +420,9 @@ e_cell_combo_get_popup_pos (ECellCombo *ecc,
gdouble x1, y1;
gdouble wx, wy;
+ eti = E_TABLE_ITEM (ecp->popup_cell_view->cell_view.e_table_item_view);
+ canvas = GTK_WIDGET (GNOME_CANVAS_ITEM (eti)->canvas);
+
/* This code is practically copied from GtkCombo. */
popup = GTK_SCROLLED_WINDOW (ecc->popup_scrolled_window);
popwin = GTK_BIN (ecc->popup_window);
@@ -503,7 +518,7 @@ e_cell_combo_get_popup_pos (ECellCombo *ecc,
if (show_hscroll)
work_height +=
requisition.height +
- GTK_SCROLLED_WINDOW_CLASS (G_OBJECT_GET_CLASS (popup))->scrollbar_spacing;
+ GTK_SCROLLED_WINDOW_GET_CLASS (popup)->scrollbar_spacing;
/* Check if it fits in the available height. */
if (work_height + list_requisition.height > avail_height) {
diff --git a/widgets/table/e-cell-date-edit.c b/widgets/table/e-cell-date-edit.c
index 3035652116..bee042cb2a 100644
--- a/widgets/table/e-cell-date-edit.c
+++ b/widgets/table/e-cell-date-edit.c
@@ -299,43 +299,42 @@ 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_CALLBACK (e_cell_date_edit_on_now_clicked),
- ecde);
+ g_signal_connect (
+ now_button, "clicked",
+ G_CALLBACK (e_cell_date_edit_on_now_clicked), ecde);
ecde->now_button = now_button;
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_CALLBACK (e_cell_date_edit_on_today_clicked),
- ecde);
+ g_signal_connect (
+ today_button, "clicked",
+ G_CALLBACK (e_cell_date_edit_on_today_clicked), ecde);
ecde->today_button = today_button;
- /* Translators: "None" as a label of a button to unset date in a date table cell */
+ /* Translators: "None" as a label of a button to unset date in a
+ * date table cell. */
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_CALLBACK (e_cell_date_edit_on_none_clicked),
- ecde);
+ g_signal_connect (
+ none_button, "clicked",
+ G_CALLBACK (e_cell_date_edit_on_none_clicked), ecde);
ecde->none_button = none_button;
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_CALLBACK (e_cell_date_edit_on_ok_clicked),
- ecde);
-
- g_signal_connect ((ecde->popup_window),
- "key_press_event",
- G_CALLBACK (e_cell_date_edit_key_press),
- ecde);
- g_signal_connect ((ecde->popup_window),
- "button_press_event",
- G_CALLBACK (e_cell_date_edit_button_press),
- ecde);
+ g_signal_connect (
+ ok_button, "clicked",
+ G_CALLBACK (e_cell_date_edit_on_ok_clicked), ecde);
+
+ g_signal_connect (
+ ecde->popup_window, "key_press_event",
+ G_CALLBACK (e_cell_date_edit_key_press), ecde);
+ g_signal_connect (
+ ecde->popup_window, "button_press_event",
+ G_CALLBACK (e_cell_date_edit_button_press), ecde);
}
/**
@@ -504,7 +503,7 @@ 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;
- ETableItem *eti = E_TABLE_ITEM (ecp->popup_cell_view->cell_view.e_table_item_view);
+ ETableItem *eti;
ETableCol *ecol;
gchar *cell_text;
ETimeParseStatus status;
@@ -514,9 +513,12 @@ e_cell_date_edit_set_popup_values (ECellDateEdit *ecde)
gchar buffer[64];
gboolean is_date = TRUE;
+ eti = E_TABLE_ITEM (ecp->popup_cell_view->cell_view.e_table_item_view);
ecol = e_table_header_get_column (eti->header, ecp->popup_view_col);
- cell_text = e_cell_text_get_text (ecell_text, ecv->e_table_model,
- ecol->col_idx, ecp->popup_row);
+
+ cell_text = e_cell_text_get_text (
+ ecell_text, ecv->e_table_model,
+ 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. */
@@ -640,8 +642,8 @@ e_cell_date_edit_get_popup_pos (ECellDateEdit *ecde,
gint *width)
{
ECellPopup *ecp = E_CELL_POPUP (ecde);
- ETableItem *eti = E_TABLE_ITEM (ecp->popup_cell_view->cell_view.e_table_item_view);
- GtkWidget *canvas = GTK_WIDGET (GNOME_CANVAS_ITEM (eti)->canvas);
+ ETableItem *eti;
+ GtkWidget *canvas;
GtkRequisition popup_requisition;
GtkAdjustment *adjustment;
GtkScrollable *scrollable;
@@ -650,6 +652,9 @@ e_cell_date_edit_get_popup_pos (ECellDateEdit *ecde,
gdouble x1, y1, wx, wy;
gint value;
+ eti = E_TABLE_ITEM (ecp->popup_cell_view->cell_view.e_table_item_view);
+ canvas = GTK_WIDGET (GNOME_CANVAS_ITEM (eti)->canvas);
+
window = gtk_widget_get_window (canvas);
gdk_window_get_origin (window, x, y);
diff --git a/widgets/table/e-cell-text.c b/widgets/table/e-cell-text.c
index 7e391c3ba9..54998bc8b9 100644
--- a/widgets/table/e-cell-text.c
+++ b/widgets/table/e-cell-text.c
@@ -1148,10 +1148,22 @@ ect_enter_edit (ECellView *ecell_view,
if (edit->im_context) {
gtk_im_context_reset (edit->im_context);
if (!edit->im_context_signals_registered) {
- g_signal_connect (edit->im_context, "preedit_changed", G_CALLBACK (e_cell_text_preedit_changed_cb), text_view);
- g_signal_connect (edit->im_context, "commit", G_CALLBACK (e_cell_text_commit_cb), text_view);
- g_signal_connect (edit->im_context, "retrieve_surrounding", G_CALLBACK (e_cell_text_retrieve_surrounding_cb), text_view);
- g_signal_connect (edit->im_context, "delete_surrounding", G_CALLBACK (e_cell_text_delete_surrounding_cb), text_view);
+ g_signal_connect (
+ edit->im_context, "preedit_changed",
+ G_CALLBACK (e_cell_text_preedit_changed_cb),
+ text_view);
+ g_signal_connect (
+ edit->im_context, "commit",
+ G_CALLBACK (e_cell_text_commit_cb),
+ text_view);
+ g_signal_connect (
+ edit->im_context, "retrieve_surrounding",
+ G_CALLBACK (e_cell_text_retrieve_surrounding_cb),
+ text_view);
+ g_signal_connect (
+ edit->im_context, "delete_surrounding",
+ G_CALLBACK (e_cell_text_delete_surrounding_cb),
+ text_view);
edit->im_context_signals_registered = TRUE;
}
@@ -2519,10 +2531,9 @@ _get_tep (CellEdit *edit)
{
if (!edit->tep) {
edit->tep = e_text_event_processor_emacs_like_new ();
- g_signal_connect (edit->tep,
- "command",
- G_CALLBACK (e_cell_text_view_command),
- (gpointer) edit);
+ g_signal_connect (
+ edit->tep, "command",
+ G_CALLBACK (e_cell_text_view_command), edit);
}
}
diff --git a/widgets/table/e-cell-toggle.c b/widgets/table/e-cell-toggle.c
index bec9f5d005..cf5db5858a 100644
--- a/widgets/table/e-cell-toggle.c
+++ b/widgets/table/e-cell-toggle.c
@@ -39,6 +39,10 @@
#include "e-cell-toggle.h"
#include "e-table-item.h"
+#define E_CELL_TOGGLE_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_CELL_TOGGLE, ECellTogglePrivate))
+
struct _ECellTogglePrivate {
gchar **icon_names;
guint n_icon_names;
@@ -97,7 +101,7 @@ cell_toggle_dispose (GObject *object)
{
ECellTogglePrivate *priv;
- priv = E_CELL_TOGGLE (object)->priv;
+ priv = E_CELL_TOGGLE_GET_PRIVATE (object);
if (priv->empty != NULL) {
g_object_unref (priv->empty);
@@ -117,7 +121,7 @@ cell_toggle_finalize (GObject *object)
ECellTogglePrivate *priv;
guint ii;
- priv = E_CELL_TOGGLE (object)->priv;
+ priv = E_CELL_TOGGLE_GET_PRIVATE (object);
/* The array is not NULL-terminated,
* so g_strfreev() will not work. */
@@ -184,7 +188,7 @@ cell_toggle_draw (ECellView *ecell_view,
const gint value = GPOINTER_TO_INT (
e_table_model_value_at (ecell_view->e_table_model, model_col, row));
- priv = E_CELL_TOGGLE (ecell_view->ecell)->priv;
+ priv = E_CELL_TOGGLE_GET_PRIVATE (ecell_view->ecell);
if (value < 0 || value >= priv->pixbufs->len)
return;
@@ -216,7 +220,7 @@ etog_set_value (ECellToggleView *toggle_view,
{
ECellTogglePrivate *priv;
- priv = E_CELL_TOGGLE (toggle_view->cell_view.ecell)->priv;
+ priv = E_CELL_TOGGLE_GET_PRIVATE (toggle_view->cell_view.ecell);
if (value >= priv->pixbufs->len)
value = 0;
@@ -268,7 +272,7 @@ cell_toggle_height (ECellView *ecell_view,
{
ECellTogglePrivate *priv;
- priv = E_CELL_TOGGLE (ecell_view->ecell)->priv;
+ priv = E_CELL_TOGGLE_GET_PRIVATE (ecell_view->ecell);
return priv->height;
}
@@ -290,7 +294,7 @@ cell_toggle_print (ECellView *ecell_view,
cairo_t *cr;
- priv = E_CELL_TOGGLE (ecell_view->ecell)->priv;
+ priv = E_CELL_TOGGLE_GET_PRIVATE (ecell_view->ecell);
if (value >= priv->pixbufs->len)
return;
@@ -323,7 +327,7 @@ cell_toggle_print_height (ECellView *ecell_view,
{
ECellTogglePrivate *priv;
- priv = E_CELL_TOGGLE (ecell_view->ecell)->priv;
+ priv = E_CELL_TOGGLE_GET_PRIVATE (ecell_view->ecell);
return priv->height;
}
@@ -338,7 +342,7 @@ cell_toggle_max_width (ECellView *ecell_view,
gint number_of_rows;
gint row;
- priv = E_CELL_TOGGLE (ecell_view->ecell)->priv;
+ priv = E_CELL_TOGGLE_GET_PRIVATE (ecell_view->ecell);
number_of_rows = e_table_model_row_count (ecell_view->e_table_model);
for (row = 0; row < number_of_rows; row++) {
@@ -385,8 +389,7 @@ e_cell_toggle_class_init (ECellToggleClass *class)
static void
e_cell_toggle_init (ECellToggle *cell_toggle)
{
- cell_toggle->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- cell_toggle, E_TYPE_CELL_TOGGLE, ECellTogglePrivate);
+ cell_toggle->priv = E_CELL_TOGGLE_GET_PRIVATE (cell_toggle);
cell_toggle->priv->empty =
gdk_pixbuf_new_from_xpm_data (empty_xpm);
diff --git a/widgets/table/e-cell.c b/widgets/table/e-cell.c
index 88762f6a7a..b9b96eecb0 100644
--- a/widgets/table/e-cell.c
+++ b/widgets/table/e-cell.c
@@ -33,8 +33,6 @@
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,
@@ -210,7 +208,8 @@ e_cell_init (ECell *cell)
* @view_col: the column in the view
* @row: the row
* @flags: flags about the current state
- * @actions: A second return value in case the cell wants to take some action (specifically grabbing & ungrabbing)
+ * @actions: a second return value in case the cell wants to take some action
+ * (specifically grabbing & ungrabbing)
*
* Dispatches the event @event to the @ecell_view for.
*
@@ -225,24 +224,31 @@ e_cell_event (ECellView *ecell_view,
ECellFlags flags,
ECellActions *actions)
{
- return ECVIEW_EC_CLASS (ecell_view)->event (
- ecell_view, event, model_col, view_col, row, flags, actions);
+ ECellClass *class;
+
+ class = E_CELL_GET_CLASS (ecell_view->ecell);
+
+ return class->event (
+ ecell_view, event, model_col,
+ view_col, row, flags, actions);
}
/**
* e_cell_new_view:
* @ecell: the Ecell that will create the new view
* @table_model: the table model the ecell is bound to
- * @e_table_item_view: An ETableItem object (the CanvasItem that reprensents the view of the table)
+ * @e_table_item_view: an ETableItem object (the CanvasItem that
+ * reprensents the view of the table)
*
* ECell renderers new to be bound to a table_model and to the actual view
* during their life time to actually render the data. This method is invoked
* by the ETableItem canvas item to instatiate a new view of the ECell.
*
- * This is invoked when the ETableModel is attached to the ETableItem (a CanvasItem
- * that can render ETableModels in the screen).
+ * This is invoked when the ETableModel is attached to the ETableItem
+ * (a CanvasItem that can render ETableModels in the screen).
*
- * Returns: a new ECellView for this @ecell on the @table_model displayed on the @e_table_item_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,
@@ -264,7 +270,12 @@ e_cell_new_view (ECell *ecell,
void
e_cell_realize (ECellView *ecell_view)
{
- ECVIEW_EC_CLASS (ecell_view)->realize (ecell_view);
+ ECellClass *class;
+
+ class = E_CELL_GET_CLASS (ecell_view->ecell);
+ g_return_if_fail (class->realize != NULL);
+
+ class->realize (ecell_view);
}
/**
@@ -276,7 +287,12 @@ e_cell_realize (ECellView *ecell_view)
void
e_cell_kill_view (ECellView *ecell_view)
{
- ECVIEW_EC_CLASS (ecell_view)->kill_view (ecell_view);
+ ECellClass *class;
+
+ class = E_CELL_GET_CLASS (ecell_view->ecell);
+ g_return_if_fail (class->kill_view != NULL);
+
+ class->kill_view (ecell_view);
}
/**
@@ -290,7 +306,12 @@ e_cell_kill_view (ECellView *ecell_view)
void
e_cell_unrealize (ECellView *ecell_view)
{
- ECVIEW_EC_CLASS (ecell_view)->unrealize (ecell_view);
+ ECellClass *class;
+
+ class = E_CELL_GET_CLASS (ecell_view->ecell);
+ g_return_if_fail (class->unrealize != NULL);
+
+ class->unrealize (ecell_view);
}
/**
@@ -324,13 +345,21 @@ e_cell_draw (ECellView *ecell_view,
gint x2,
gint y2)
{
+ ECellClass *class;
+
g_return_if_fail (ecell_view != NULL);
g_return_if_fail (row >= 0);
g_return_if_fail (row < e_table_model_row_count (ecell_view->e_table_model));
+ class = E_CELL_GET_CLASS (ecell_view->ecell);
+ g_return_if_fail (class->draw != NULL);
+
cairo_save (cr);
- ECVIEW_EC_CLASS (ecell_view)->draw (ecell_view, cr, model_col, view_col, row, flags, x1, y1, x2, y2);
+ class->draw (
+ ecell_view, cr,
+ model_col, view_col,
+ row, flags, x1, y1, x2, y2);
cairo_restore (cr);
}
@@ -356,8 +385,15 @@ e_cell_print (ECellView *ecell_view,
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);
+ ECellClass *class;
+
+ class = E_CELL_GET_CLASS (ecell_view->ecell);
+
+ if (class->print != NULL)
+ class->print (
+ ecell_view, context,
+ model_col, view_col,
+ row, width, height);
}
/**
@@ -373,11 +409,17 @@ e_cell_print_height (ECellView *ecell_view,
gint row,
gdouble width)
{
- if (ECVIEW_EC_CLASS (ecell_view)->print_height)
- return ECVIEW_EC_CLASS (ecell_view)->print_height
- (ecell_view, context, model_col, view_col, row, width);
- else
+ ECellClass *class;
+
+ class = E_CELL_GET_CLASS (ecell_view->ecell);
+
+ if (class->print_height == NULL)
return 0.0;
+
+ return class->print_height (
+ ecell_view, context,
+ model_col, view_col,
+ row, width);
}
/**
@@ -396,7 +438,12 @@ e_cell_height (ECellView *ecell_view,
gint view_col,
gint row)
{
- return ECVIEW_EC_CLASS (ecell_view)->height (ecell_view, model_col, view_col, row);
+ ECellClass *class;
+
+ class = E_CELL_GET_CLASS (ecell_view->ecell);
+ g_return_val_if_fail (class->height != NULL, 0);
+
+ return class->height (ecell_view, model_col, view_col, row);
}
/**
@@ -415,7 +462,12 @@ e_cell_enter_edit (ECellView *ecell_view,
gint view_col,
gint row)
{
- return ECVIEW_EC_CLASS (ecell_view)->enter_edit (ecell_view, model_col, view_col, row);
+ ECellClass *class;
+
+ class = E_CELL_GET_CLASS (ecell_view->ecell);
+ g_return_val_if_fail (class->enter_edit != NULL, NULL);
+
+ return class->enter_edit (ecell_view, model_col, view_col, row);
}
/**
@@ -436,7 +488,12 @@ e_cell_leave_edit (ECellView *ecell_view,
gint row,
gpointer edit_context)
{
- ECVIEW_EC_CLASS (ecell_view)->leave_edit (ecell_view, model_col, view_col, row, edit_context);
+ ECellClass *class;
+
+ class = E_CELL_GET_CLASS (ecell_view->ecell);
+ g_return_if_fail (class->leave_edit != NULL);
+
+ class->leave_edit (ecell_view, model_col, view_col, row, edit_context);
}
/**
@@ -460,10 +517,15 @@ e_cell_save_state (ECellView *ecell_view,
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);
- else
+ ECellClass *class;
+
+ class = E_CELL_GET_CLASS (ecell_view->ecell);
+
+ if (class->save_state == NULL)
return NULL;
+
+ return class->save_state (
+ ecell_view, model_col, view_col, row, edit_context);
}
/**
@@ -485,12 +547,18 @@ e_cell_load_state (ECellView *ecell_view,
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);
+ ECellClass *class;
+
+ class = E_CELL_GET_CLASS (ecell_view->ecell);
+
+ if (class->load_state != NULL)
+ class->load_state (
+ ecell_view, model_col, view_col,
+ row, edit_context, save_state);
}
/**
- * e_cell_load_state:
+ * e_cell_free_state:
* @ecell_view: the ECellView
* @model_col: the column in the model
* @view_col: the column in the view
@@ -507,8 +575,13 @@ e_cell_free_state (ECellView *ecell_view,
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);
+ ECellClass *class;
+
+ class = E_CELL_GET_CLASS (ecell_view->ecell);
+
+ if (class->free_state != NULL)
+ class->free_state (
+ ecell_view, model_col, view_col, row, save_state);
}
/**
@@ -525,8 +598,12 @@ 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);
+ ECellClass *class;
+
+ class = E_CELL_GET_CLASS (ecell_view->ecell);
+ g_return_val_if_fail (class->max_width != NULL, 0);
+
+ return class->max_width (ecell_view, model_col, view_col);
}
/**
@@ -545,11 +622,14 @@ e_cell_max_width_by_row (ECellView *ecell_view,
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
- (ecell_view, model_col, view_col, row);
- else
+ ECellClass *class;
+
+ class = E_CELL_GET_CLASS (ecell_view->ecell);
+
+ if (class->max_width_by_row == NULL)
return e_cell_max_width (ecell_view, model_col, view_col);
+
+ return class->max_width_by_row (ecell_view, model_col, view_col, row);
}
/**
@@ -565,24 +645,36 @@ e_cell_max_width_by_row (ECellView *ecell_view,
gboolean
e_cell_max_width_by_row_implemented (ECellView *ecell_view)
{
- return (ECVIEW_EC_CLASS (ecell_view)->max_width_by_row != NULL);
+ ECellClass *class;
+
+ class = E_CELL_GET_CLASS (ecell_view->ecell);
+
+ return (class->max_width_by_row != NULL);
}
gchar *
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);
- else
+ ECellClass *class;
+
+ class = E_CELL_GET_CLASS (ecell_view->ecell);
+
+ if (class->get_bg_color == NULL)
return NULL;
+
+ return class->get_bg_color (ecell_view, row);
}
void
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);
+ ECellClass *class;
+
+ class = E_CELL_GET_CLASS (ecell_view->ecell);
+
+ if (class->style_set != NULL)
+ class->style_set (ecell_view, previous_style);
}
diff --git a/widgets/table/e-popup-menu.c b/widgets/table/e-popup-menu.c
index a4cfec07e9..faffd9d1a0 100644
--- a/widgets/table/e-popup-menu.c
+++ b/widgets/table/e-popup-menu.c
@@ -94,9 +94,10 @@ e_popup_menu_create_with_domain (EPopupMenu *menu_list,
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
if (menu_list[i].fn)
- g_signal_connect (item, "activate",
- G_CALLBACK (menu_list[i].fn),
- default_closure);
+ g_signal_connect (
+ item, "activate",
+ G_CALLBACK (menu_list[i].fn),
+ default_closure);
if (menu_list[i].disable_mask & disable_mask)
gtk_widget_set_sensitive (item, FALSE);
diff --git a/widgets/table/e-table-click-to-add.c b/widgets/table/e-table-click-to-add.c
index 8defc2c479..8cb7d060a9 100644
--- a/widgets/table/e-table-click-to-add.c
+++ b/widgets/table/e-table-click-to-add.c
@@ -387,8 +387,9 @@ finish_editing (ETableClickToAdd *etcta)
"cursor_mode", E_CURSOR_SPREADSHEET,
NULL);
- g_signal_connect (etcta->row, "key_press",
- G_CALLBACK (item_key_press), etcta);
+ g_signal_connect (
+ etcta->row, "key_press",
+ G_CALLBACK (item_key_press), etcta);
set_initial_selection (etcta);
}
@@ -436,8 +437,9 @@ etcta_event (GnomeCanvasItem *item,
"cursor_mode", E_CURSOR_SPREADSHEET,
NULL);
- g_signal_connect (etcta->row, "key_press",
- G_CALLBACK (item_key_press), etcta);
+ g_signal_connect (
+ etcta->row, "key_press",
+ G_CALLBACK (item_key_press), etcta);
e_canvas_item_grab_focus (GNOME_CANVAS_ITEM (etcta->row), TRUE);
@@ -596,8 +598,9 @@ etcta_init (ETableClickToAdd *etcta)
etcta->height = 6;
etcta->selection = e_table_selection_model_new ();
- g_signal_connect (etcta->selection, "cursor_changed",
- G_CALLBACK (etcta_cursor_change), etcta);
+ 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-config.c b/widgets/table/e-table-config.c
index 4e9fe81117..728616db3b 100644
--- a/widgets/table/e-table-config.c
+++ b/widgets/table/e-table-config.c
@@ -1197,13 +1197,15 @@ config_button_down (GtkWidget *widget,
if (columns == NULL)
return;
- new_shown = g_new (int, config->temp_state->col_count);
- new_expansions = g_new (double, config->temp_state->col_count);
+ new_shown = g_new (gint, config->temp_state->col_count);
+ new_expansions = g_new (gdouble, config->temp_state->col_count);
column = columns;
- next_col = config->temp_state->columns[config->temp_state->col_count - 1];
- next_expansion = config->temp_state->expansions[config->temp_state->col_count - 1];
+ next_col =
+ config->temp_state->columns[config->temp_state->col_count - 1];
+ next_expansion =
+ config->temp_state->expansions[config->temp_state->col_count - 1];
for (i = config->temp_state->col_count - 1; i > 0; i--) {
if (column && (GPOINTER_TO_INT (column->data) == i - 1)) {
@@ -1352,8 +1354,9 @@ setup_gui (ETableConfig *config)
g_object_weak_ref (G_OBJECT (config->dialog_toplevel),
dialog_destroyed, config);
- g_signal_connect (config->dialog_toplevel, "response",
- G_CALLBACK (dialog_response), config);
+ g_signal_connect (
+ config->dialog_toplevel, "response",
+ G_CALLBACK (dialog_response), config);
g_object_unref (builder);
}
diff --git a/widgets/table/e-table-extras.c b/widgets/table/e-table-extras.c
index f3e55cf8cf..d39677bbc8 100644
--- a/widgets/table/e-table-extras.c
+++ b/widgets/table/e-table-extras.c
@@ -43,6 +43,10 @@
#include "e-table-extras.h"
#include "e-table-sorting-utils.h"
+#define E_TABLE_EXTRAS_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_TABLE_EXTRAS, ETableExtrasPrivate))
+
struct _ETableExtrasPrivate {
GHashTable *cells;
GHashTable *compares;
@@ -59,7 +63,7 @@ ete_finalize (GObject *object)
{
ETableExtrasPrivate *priv;
- priv = E_TABLE_EXTRAS (object)->priv;
+ priv = E_TABLE_EXTRAS_GET_PRIVATE (object);
if (priv->cells) {
g_hash_table_destroy (priv->cells);
@@ -237,8 +241,7 @@ ete_init (ETableExtras *extras)
{
ECell *cell, *sub_cell;
- extras->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- extras, E_TYPE_TABLE_EXTRAS, ETableExtrasPrivate);
+ extras->priv = E_TABLE_EXTRAS_GET_PRIVATE (extras);
extras->priv->cells = g_hash_table_new_full (
g_str_hash, g_str_equal,
diff --git a/widgets/table/e-table-field-chooser-dialog.c b/widgets/table/e-table-field-chooser-dialog.c
index 354095b0c8..5b99c3a79f 100644
--- a/widgets/table/e-table-field-chooser-dialog.c
+++ b/widgets/table/e-table-field-chooser-dialog.c
@@ -32,12 +32,6 @@
#include "e-table-field-chooser-dialog.h"
-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);
-
-/* The arguments we take */
enum {
PROP_0,
PROP_DND_CODE,
@@ -45,105 +39,10 @@ enum {
PROP_HEADER
};
-G_DEFINE_TYPE (ETableFieldChooserDialog, e_table_field_chooser_dialog, GTK_TYPE_DIALOG)
-
-static void
-e_table_field_chooser_dialog_class_init (ETableFieldChooserDialogClass *class)
-{
- GObjectClass *object_class;
- GtkDialogClass *dialog_class;
-
- object_class = (GObjectClass *) class;
- dialog_class = GTK_DIALOG_CLASS (class);
-
- object_class->dispose = e_table_field_chooser_dialog_dispose;
- object_class->set_property = e_table_field_chooser_dialog_set_property;
- object_class->get_property = e_table_field_chooser_dialog_get_property;
-
- dialog_class->response = e_table_field_chooser_dialog_response;
-
- g_object_class_install_property (object_class, PROP_DND_CODE,
- g_param_spec_string ("dnd_code",
- "DnD code",
- NULL,
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_FULL_HEADER,
- g_param_spec_object ("full_header",
- "Full Header",
- NULL,
- E_TYPE_TABLE_HEADER,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_HEADER,
- g_param_spec_object ("header",
- "Header",
- NULL,
- E_TYPE_TABLE_HEADER,
- G_PARAM_READWRITE));
-}
-
-static void
-e_table_field_chooser_dialog_init (ETableFieldChooserDialog *e_table_field_chooser_dialog)
-{
- GtkDialog *dialog;
- GtkWidget *content_area;
- GtkWidget *widget;
-
- dialog = GTK_DIALOG (e_table_field_chooser_dialog);
-
- e_table_field_chooser_dialog->etfc = NULL;
- e_table_field_chooser_dialog->dnd_code = g_strdup("");
- e_table_field_chooser_dialog->full_header = NULL;
- e_table_field_chooser_dialog->header = NULL;
-
- gtk_dialog_add_button (dialog, GTK_STOCK_CLOSE, GTK_RESPONSE_OK);
-
- gtk_window_set_resizable (GTK_WINDOW (dialog), TRUE);
-
- widget = e_table_field_chooser_new ();
- e_table_field_chooser_dialog->etfc = E_TABLE_FIELD_CHOOSER (widget);
-
- g_object_set (widget,
- "dnd_code", e_table_field_chooser_dialog->dnd_code,
- "full_header", e_table_field_chooser_dialog->full_header,
- "header", e_table_field_chooser_dialog->header,
- NULL);
-
- content_area = gtk_dialog_get_content_area (dialog);
- gtk_box_pack_start (GTK_BOX (content_area), widget, TRUE, TRUE, 0);
-
- gtk_widget_show (GTK_WIDGET (widget));
-
- gtk_window_set_title (GTK_WINDOW (dialog), _("Add a Column"));
-}
-
-GtkWidget *
-e_table_field_chooser_dialog_new (void)
-{
- return g_object_new (E_TYPE_TABLE_FIELD_CHOOSER_DIALOG, NULL);
-}
-
-static void
-e_table_field_chooser_dialog_dispose (GObject *object)
-{
- ETableFieldChooserDialog *etfcd = E_TABLE_FIELD_CHOOSER_DIALOG (object);
-
- if (etfcd->dnd_code)
- g_free (etfcd->dnd_code);
- etfcd->dnd_code = NULL;
-
- if (etfcd->full_header)
- g_object_unref (etfcd->full_header);
- etfcd->full_header = NULL;
-
- if (etfcd->header)
- g_object_unref (etfcd->header);
- etfcd->header = NULL;
-
- G_OBJECT_CLASS (e_table_field_chooser_dialog_parent_class)->dispose (object);
-}
+G_DEFINE_TYPE (
+ ETableFieldChooserDialog,
+ e_table_field_chooser_dialog,
+ GTK_TYPE_DIALOG)
static void
e_table_field_chooser_dialog_set_property (GObject *object,
@@ -218,9 +117,116 @@ e_table_field_chooser_dialog_get_property (GObject *object,
}
static void
+e_table_field_chooser_dialog_dispose (GObject *object)
+{
+ ETableFieldChooserDialog *etfcd = E_TABLE_FIELD_CHOOSER_DIALOG (object);
+
+ if (etfcd->dnd_code)
+ g_free (etfcd->dnd_code);
+ etfcd->dnd_code = NULL;
+
+ if (etfcd->full_header)
+ g_object_unref (etfcd->full_header);
+ etfcd->full_header = NULL;
+
+ if (etfcd->header)
+ g_object_unref (etfcd->header);
+ etfcd->header = NULL;
+
+ G_OBJECT_CLASS (e_table_field_chooser_dialog_parent_class)->dispose (object);
+}
+
+static void
e_table_field_chooser_dialog_response (GtkDialog *dialog,
gint id)
{
if (id == GTK_RESPONSE_OK)
gtk_widget_destroy (GTK_WIDGET (dialog));
}
+
+static void
+e_table_field_chooser_dialog_class_init (ETableFieldChooserDialogClass *class)
+{
+ GObjectClass *object_class;
+ GtkDialogClass *dialog_class;
+
+ object_class = G_OBJECT_CLASS (class);
+ object_class->set_property = e_table_field_chooser_dialog_set_property;
+ object_class->get_property = e_table_field_chooser_dialog_get_property;
+ object_class->dispose = e_table_field_chooser_dialog_dispose;
+
+ dialog_class = GTK_DIALOG_CLASS (class);
+ dialog_class->response = e_table_field_chooser_dialog_response;
+
+ g_object_class_install_property (
+ object_class,
+ PROP_DND_CODE,
+ g_param_spec_string (
+ "dnd_code",
+ "DnD code",
+ NULL,
+ NULL,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_FULL_HEADER,
+ g_param_spec_object (
+ "full_header",
+ "Full Header",
+ NULL,
+ E_TYPE_TABLE_HEADER,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_HEADER,
+ g_param_spec_object (
+ "header",
+ "Header",
+ NULL,
+ E_TYPE_TABLE_HEADER,
+ G_PARAM_READWRITE));
+}
+
+static void
+e_table_field_chooser_dialog_init (ETableFieldChooserDialog *e_table_field_chooser_dialog)
+{
+ GtkDialog *dialog;
+ GtkWidget *content_area;
+ GtkWidget *widget;
+
+ dialog = GTK_DIALOG (e_table_field_chooser_dialog);
+
+ e_table_field_chooser_dialog->etfc = NULL;
+ e_table_field_chooser_dialog->dnd_code = g_strdup("");
+ e_table_field_chooser_dialog->full_header = NULL;
+ e_table_field_chooser_dialog->header = NULL;
+
+ gtk_dialog_add_button (dialog, GTK_STOCK_CLOSE, GTK_RESPONSE_OK);
+
+ gtk_window_set_resizable (GTK_WINDOW (dialog), TRUE);
+
+ widget = e_table_field_chooser_new ();
+ e_table_field_chooser_dialog->etfc = E_TABLE_FIELD_CHOOSER (widget);
+
+ g_object_set (widget,
+ "dnd_code", e_table_field_chooser_dialog->dnd_code,
+ "full_header", e_table_field_chooser_dialog->full_header,
+ "header", e_table_field_chooser_dialog->header,
+ NULL);
+
+ content_area = gtk_dialog_get_content_area (dialog);
+ gtk_box_pack_start (GTK_BOX (content_area), widget, TRUE, TRUE, 0);
+
+ gtk_widget_show (GTK_WIDGET (widget));
+
+ gtk_window_set_title (GTK_WINDOW (dialog), _("Add a Column"));
+}
+
+GtkWidget *
+e_table_field_chooser_dialog_new (void)
+{
+ return g_object_new (E_TYPE_TABLE_FIELD_CHOOSER_DIALOG, NULL);
+}
+
diff --git a/widgets/table/e-table-field-chooser-item.c b/widgets/table/e-table-field-chooser-item.c
index 4dd1caab07..45881d4c03 100644
--- a/widgets/table/e-table-field-chooser-item.c
+++ b/widgets/table/e-table-field-chooser-item.c
@@ -301,9 +301,11 @@ etfci_drop_table_header (ETableFieldChooserItem *etfci)
header = G_OBJECT (etfci->header);
if (etfci->table_header_structure_change_id)
- g_signal_handler_disconnect (header, etfci->table_header_structure_change_id);
+ g_signal_handler_disconnect (
+ header, etfci->table_header_structure_change_id);
if (etfci->table_header_dimension_change_id)
- g_signal_handler_disconnect (header, etfci->table_header_dimension_change_id);
+ g_signal_handler_disconnect (
+ header, etfci->table_header_dimension_change_id);
etfci->table_header_structure_change_id = 0;
etfci->table_header_dimension_change_id = 0;
diff --git a/widgets/table/e-table-field-chooser.c b/widgets/table/e-table-field-chooser.c
index 5e2cb13880..6c1a9ab365 100644
--- a/widgets/table/e-table-field-chooser.c
+++ b/widgets/table/e-table-field-chooser.c
@@ -202,18 +202,18 @@ e_table_field_chooser_init (ETableFieldChooser *etfc)
"dnd_code", etfc->dnd_code,
NULL );
- g_signal_connect ( etfc->canvas, "reflow",
- G_CALLBACK ( resize ),
- etfc);
+ g_signal_connect (
+ etfc->canvas, "reflow",
+ G_CALLBACK (resize), etfc);
- gnome_canvas_set_scroll_region ( GNOME_CANVAS ( etfc->canvas ),
- 0, 0,
- 100, 100 );
+ gnome_canvas_set_scroll_region (
+ GNOME_CANVAS (etfc->canvas),
+ 0, 0, 100, 100 );
/* Connect the signals */
- g_signal_connect (etfc->canvas, "size_allocate",
- G_CALLBACK (allocate_callback),
- etfc);
+ g_signal_connect (
+ etfc->canvas, "size_allocate",
+ G_CALLBACK (allocate_callback), etfc);
gtk_widget_show_all (widget);
}
diff --git a/widgets/table/e-table-group-container.c b/widgets/table/e-table-group-container.c
index 7d04eda9d9..2649f9bf79 100644
--- a/widgets/table/e-table-group-container.c
+++ b/widgets/table/e-table-group-container.c
@@ -481,20 +481,27 @@ create_child_node (ETableGroupContainer *etgc,
"minimum_width", etgc->minimum_width - GROUP_INDENT,
NULL);
- g_signal_connect (child, "cursor_change",
- G_CALLBACK (child_cursor_change), etgc);
- g_signal_connect (child, "cursor_activated",
- G_CALLBACK (child_cursor_activated), etgc);
- g_signal_connect (child, "double_click",
- G_CALLBACK (child_double_click), etgc);
- g_signal_connect (child, "right_click",
- G_CALLBACK (child_right_click), etgc);
- g_signal_connect (child, "click",
- G_CALLBACK (child_click), etgc);
- g_signal_connect (child, "key_press",
- G_CALLBACK (child_key_press), etgc);
- g_signal_connect (child, "start_drag",
- G_CALLBACK (child_start_drag), etgc);
+ g_signal_connect (
+ child, "cursor_change",
+ G_CALLBACK (child_cursor_change), etgc);
+ g_signal_connect (
+ child, "cursor_activated",
+ G_CALLBACK (child_cursor_activated), etgc);
+ g_signal_connect (
+ child, "double_click",
+ G_CALLBACK (child_double_click), etgc);
+ g_signal_connect (
+ child, "right_click",
+ G_CALLBACK (child_right_click), etgc);
+ g_signal_connect (
+ child, "click",
+ G_CALLBACK (child_click), etgc);
+ g_signal_connect (
+ child, "key_press",
+ G_CALLBACK (child_key_press), etgc);
+ g_signal_connect (
+ child, "start_drag",
+ G_CALLBACK (child_start_drag), etgc);
child_node->child = child;
child_node->key = e_table_model_duplicate_value (etg->model, etgc->ecol->col_idx, val);
child_node->string = e_table_model_value_to_string (etg->model, etgc->ecol->col_idx, val);
@@ -1560,29 +1567,30 @@ etgc_get_printable (ETableGroup *etg)
groupcontext->child = etgc->children;
groupcontext->child_printable = NULL;
- g_signal_connect (printable,
- "print_page",
- G_CALLBACK (e_table_group_container_print_page),
- groupcontext);
- g_signal_connect (printable,
- "data_left",
- G_CALLBACK (e_table_group_container_data_left),
- groupcontext);
- g_signal_connect (printable,
- "reset",
- G_CALLBACK (e_table_group_container_reset),
- groupcontext);
- g_signal_connect (printable,
- "height",
- G_CALLBACK (e_table_group_container_height),
- groupcontext);
- g_signal_connect (printable,
- "will_fit",
- G_CALLBACK (e_table_group_container_will_fit),
- groupcontext);
- g_object_weak_ref (G_OBJECT (printable),
- e_table_group_container_printable_destroy,
- groupcontext);
+ g_signal_connect (
+ printable, "print_page",
+ G_CALLBACK (e_table_group_container_print_page),
+ groupcontext);
+ g_signal_connect (
+ printable, "data_left",
+ G_CALLBACK (e_table_group_container_data_left),
+ groupcontext);
+ g_signal_connect (
+ printable, "reset",
+ G_CALLBACK (e_table_group_container_reset),
+ groupcontext);
+ g_signal_connect (
+ printable, "height",
+ G_CALLBACK (e_table_group_container_height),
+ groupcontext);
+ g_signal_connect (
+ printable, "will_fit",
+ G_CALLBACK (e_table_group_container_will_fit),
+ groupcontext);
+ g_object_weak_ref (
+ G_OBJECT (printable),
+ e_table_group_container_printable_destroy,
+ groupcontext);
return printable;
}
diff --git a/widgets/table/e-table-group-leaf.c b/widgets/table/e-table-group-leaf.c
index 27a62bbb16..aface8e697 100644
--- a/widgets/table/e-table-group-leaf.c
+++ b/widgets/table/e-table-group-leaf.c
@@ -297,35 +297,33 @@ etgl_realize (GnomeCanvasItem *item)
"uniform_row_height", etgl->uniform_row_height,
NULL));
- etgl->etgl_cursor_change_id = g_signal_connect (etgl->item,
- "cursor_change",
- G_CALLBACK (etgl_cursor_change),
- etgl);
- etgl->etgl_cursor_activated_id = g_signal_connect (etgl->item,
- "cursor_activated",
- G_CALLBACK (etgl_cursor_activated),
- etgl);
- etgl->etgl_double_click_id = g_signal_connect (etgl->item,
- "double_click",
- G_CALLBACK (etgl_double_click),
- etgl);
-
- etgl->etgl_right_click_id = g_signal_connect (etgl->item,
- "right_click",
- G_CALLBACK (etgl_right_click),
- etgl);
- etgl->etgl_click_id = g_signal_connect (etgl->item,
- "click",
- G_CALLBACK (etgl_click),
- etgl);
- etgl->etgl_key_press_id = g_signal_connect (etgl->item,
- "key_press",
- G_CALLBACK (etgl_key_press),
- etgl);
- etgl->etgl_start_drag_id = g_signal_connect (etgl->item,
- "start_drag",
- G_CALLBACK (etgl_start_drag),
- etgl);
+ etgl->etgl_cursor_change_id = g_signal_connect (
+ etgl->item, "cursor_change",
+ G_CALLBACK (etgl_cursor_change), etgl);
+
+ etgl->etgl_cursor_activated_id = g_signal_connect (
+ etgl->item, "cursor_activated",
+ G_CALLBACK (etgl_cursor_activated), etgl);
+
+ etgl->etgl_double_click_id = g_signal_connect (
+ etgl->item, "double_click",
+ G_CALLBACK (etgl_double_click), etgl);
+
+ etgl->etgl_right_click_id = g_signal_connect (
+ etgl->item, "right_click",
+ G_CALLBACK (etgl_right_click), etgl);
+
+ etgl->etgl_click_id = g_signal_connect (
+ etgl->item, "click",
+ G_CALLBACK (etgl_click), etgl);
+
+ etgl->etgl_key_press_id = g_signal_connect (
+ etgl->item, "key_press",
+ G_CALLBACK (etgl_key_press), etgl);
+
+ etgl->etgl_start_drag_id = g_signal_connect (
+ etgl->item, "start_drag",
+ G_CALLBACK (etgl_start_drag), etgl);
e_canvas_item_request_reflow (item);
}
@@ -647,89 +645,127 @@ etgl_class_init (ETableGroupLeafClass *class)
e_group_class->get_mouse_over = etgl_get_mouse_over;
e_group_class->get_cell_geometry = etgl_get_cell_geometry;
- g_object_class_install_property (object_class, PROP_TABLE_ALTERNATING_ROW_COLORS,
- g_param_spec_boolean ("alternating_row_colors",
- "Alternating Row Colors",
- "Alternating Row Colors",
- FALSE,
- G_PARAM_WRITABLE));
-
- g_object_class_install_property (object_class, PROP_TABLE_HORIZONTAL_DRAW_GRID,
- g_param_spec_boolean ("horizontal_draw_grid",
- "Horizontal Draw Grid",
- "Horizontal Draw Grid",
- FALSE,
- G_PARAM_WRITABLE));
-
- g_object_class_install_property (object_class, PROP_TABLE_VERTICAL_DRAW_GRID,
- g_param_spec_boolean ("vertical_draw_grid",
- "Vertical Draw Grid",
- "Vertical Draw Grid",
- FALSE,
- G_PARAM_WRITABLE));
-
- g_object_class_install_property (object_class, PROP_TABLE_DRAW_FOCUS,
- g_param_spec_boolean ("drawfocus",
- "Draw focus",
- "Draw focus",
- FALSE,
- G_PARAM_WRITABLE));
-
- g_object_class_install_property (object_class, PROP_CURSOR_MODE,
- g_param_spec_int ("cursor_mode",
- "Cursor mode",
- "Cursor mode",
- E_CURSOR_LINE, E_CURSOR_SPREADSHEET, E_CURSOR_LINE,
- G_PARAM_WRITABLE));
-
- g_object_class_install_property (object_class, PROP_LENGTH_THRESHOLD,
- g_param_spec_int ("length_threshold",
- "Length Threshold",
- "Length Threshold",
- -1, G_MAXINT, 0,
- G_PARAM_WRITABLE));
-
- g_object_class_install_property (object_class, PROP_SELECTION_MODEL,
- g_param_spec_object ("selection_model",
- "Selection model",
- "Selection model",
- E_TYPE_SELECTION_MODEL,
- G_PARAM_WRITABLE));
-
- g_object_class_install_property (object_class, PROP_HEIGHT,
- g_param_spec_double ("height",
- "Height",
- "Height",
- 0.0, G_MAXDOUBLE, 0.0,
- G_PARAM_READABLE));
-
- g_object_class_install_property (object_class, PROP_WIDTH,
- g_param_spec_double ("width",
- "Width",
- "Width",
- 0.0, G_MAXDOUBLE, 0.0,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_MINIMUM_WIDTH,
- g_param_spec_double ("minimum_width",
- "Minimum width",
- "Minimum Width",
- 0.0, G_MAXDOUBLE, 0.0,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_FROZEN,
- g_param_spec_boolean ("frozen",
- "Frozen",
- "Frozen",
- FALSE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_UNIFORM_ROW_HEIGHT,
- g_param_spec_boolean ("uniform_row_height",
- "Uniform row height",
- "Uniform row height",
- FALSE,
- G_PARAM_READWRITE));
+ g_object_class_install_property (
+ object_class,
+ PROP_TABLE_ALTERNATING_ROW_COLORS,
+ g_param_spec_boolean (
+ "alternating_row_colors",
+ "Alternating Row Colors",
+ "Alternating Row Colors",
+ FALSE,
+ G_PARAM_WRITABLE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_TABLE_HORIZONTAL_DRAW_GRID,
+ g_param_spec_boolean (
+ "horizontal_draw_grid",
+ "Horizontal Draw Grid",
+ "Horizontal Draw Grid",
+ FALSE,
+ G_PARAM_WRITABLE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_TABLE_VERTICAL_DRAW_GRID,
+ g_param_spec_boolean (
+ "vertical_draw_grid",
+ "Vertical Draw Grid",
+ "Vertical Draw Grid",
+ FALSE,
+ G_PARAM_WRITABLE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_TABLE_DRAW_FOCUS,
+ g_param_spec_boolean (
+ "drawfocus",
+ "Draw focus",
+ "Draw focus",
+ FALSE,
+ G_PARAM_WRITABLE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_CURSOR_MODE,
+ g_param_spec_int (
+ "cursor_mode",
+ "Cursor mode",
+ "Cursor mode",
+ E_CURSOR_LINE,
+ E_CURSOR_SPREADSHEET,
+ E_CURSOR_LINE,
+ G_PARAM_WRITABLE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_LENGTH_THRESHOLD,
+ g_param_spec_int (
+ "length_threshold",
+ "Length Threshold",
+ "Length Threshold",
+ -1, G_MAXINT, 0,
+ G_PARAM_WRITABLE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_SELECTION_MODEL,
+ g_param_spec_object (
+ "selection_model",
+ "Selection model",
+ "Selection model",
+ E_TYPE_SELECTION_MODEL,
+ G_PARAM_WRITABLE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_HEIGHT,
+ g_param_spec_double (
+ "height",
+ "Height",
+ "Height",
+ 0.0, G_MAXDOUBLE, 0.0,
+ G_PARAM_READABLE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_WIDTH,
+ g_param_spec_double (
+ "width",
+ "Width",
+ "Width",
+ 0.0, G_MAXDOUBLE, 0.0,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_MINIMUM_WIDTH,
+ g_param_spec_double (
+ "minimum_width",
+ "Minimum width",
+ "Minimum Width",
+ 0.0, G_MAXDOUBLE, 0.0,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_FROZEN,
+ g_param_spec_boolean (
+ "frozen",
+ "Frozen",
+ "Frozen",
+ FALSE,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_UNIFORM_ROW_HEIGHT,
+ g_param_spec_boolean (
+ "uniform_row_height",
+ "Uniform row height",
+ "Uniform row height",
+ FALSE,
+ G_PARAM_READWRITE));
}
static void
diff --git a/widgets/table/e-table-header-item.c b/widgets/table/e-table-header-item.c
index 43871a278a..780720e1aa 100644
--- a/widgets/table/e-table-header-item.c
+++ b/widgets/table/e-table-header-item.c
@@ -121,9 +121,11 @@ ethi_dispose (GObject *object)
if (ethi->sort_info) {
if (ethi->sort_info_changed_id)
- g_signal_handler_disconnect (ethi->sort_info, ethi->sort_info_changed_id);
+ g_signal_handler_disconnect (
+ ethi->sort_info, ethi->sort_info_changed_id);
if (ethi->group_info_changed_id)
- g_signal_handler_disconnect (ethi->sort_info, ethi->group_info_changed_id);
+ g_signal_handler_disconnect (
+ ethi->sort_info, ethi->group_info_changed_id);
g_object_unref (ethi->sort_info);
ethi->sort_info = NULL;
}
@@ -205,22 +207,18 @@ ethi_update (GnomeCanvasItem *item,
if (item->x1 != x1 ||
item->y1 != y1 ||
item->x2 != x2 ||
- item->y2 != y2)
- {
- gnome_canvas_request_redraw (
- item->canvas,
- item->x1, item->y1,
- item->x2, item->y2);
- item->x1 = x1;
- item->y1 = y1;
- item->x2 = x2;
- item->y2 = y2;
-/* FIXME: Group Child bounds !? (FOO BAA) */
-#if 0
- gnome_canvas_group_child_bounds (GNOME_CANVAS_GROUP (item->parent), item);
-#endif
- }
- gnome_canvas_request_redraw (item->canvas, item->x1, item->y1, item->x2, item->y2);
+ item->y2 != y2) {
+ gnome_canvas_request_redraw (
+ item->canvas,
+ item->x1, item->y1,
+ item->x2, item->y2);
+ item->x1 = x1;
+ item->y1 = y1;
+ item->x2 = x2;
+ item->y2 = y2;
+ }
+ gnome_canvas_request_redraw (
+ item->canvas, item->x1, item->y1, item->x2, item->y2);
}
static void
@@ -835,9 +833,15 @@ ethi_drag_data_received (GtkWidget *canvas,
if (!found) {
count = e_table_header_count (ethi->full_header);
for (i = 0; i < count; i++) {
- ETableCol *ecol = e_table_header_get_column (ethi->full_header, i);
+ ETableCol *ecol;
+
+ ecol = e_table_header_get_column (
+ ethi->full_header, i);
+
if (ecol->col_idx == column) {
- e_table_header_add_column (ethi->eth, ecol, drop_col);
+ e_table_header_add_column (
+ ethi->eth, ecol,
+ drop_col);
break;
}
}
@@ -893,7 +897,10 @@ ethi_drag_drop (GtkWidget *canvas,
gchar *target = g_strdup_printf (
"%s-%s", TARGET_ETABLE_COL_TYPE, ethi->dnd_code);
d(g_print ("ethi - %s\n", target));
- gtk_drag_get_data (canvas, context, gdk_atom_intern (target, FALSE), time);
+ gtk_drag_get_data (
+ canvas, context,
+ gdk_atom_intern (target, FALSE),
+ time);
g_free (target);
}
}
@@ -941,20 +948,26 @@ ethi_realize (GnomeCanvasItem *item)
g_free ((gpointer) ethi_drop_types[0].target);
/* Drop signals */
- ethi->drag_motion_id = g_signal_connect (item->canvas, "drag_motion",
- G_CALLBACK (ethi_drag_motion), ethi);
- ethi->drag_leave_id = g_signal_connect (item->canvas, "drag_leave",
- G_CALLBACK (ethi_drag_leave), ethi);
- ethi->drag_drop_id = g_signal_connect (item->canvas, "drag_drop",
- G_CALLBACK (ethi_drag_drop), ethi);
- ethi->drag_data_received_id = g_signal_connect (item->canvas, "drag_data_received",
- G_CALLBACK (ethi_drag_data_received), ethi);
+ ethi->drag_motion_id = g_signal_connect (
+ item->canvas, "drag_motion",
+ G_CALLBACK (ethi_drag_motion), ethi);
+ ethi->drag_leave_id = g_signal_connect (
+ item->canvas, "drag_leave",
+ G_CALLBACK (ethi_drag_leave), ethi);
+ ethi->drag_drop_id = g_signal_connect (
+ item->canvas, "drag_drop",
+ G_CALLBACK (ethi_drag_drop), ethi);
+ ethi->drag_data_received_id = g_signal_connect (
+ item->canvas, "drag_data_received",
+ G_CALLBACK (ethi_drag_data_received), ethi);
/* Drag signals */
- ethi->drag_end_id = g_signal_connect (item->canvas, "drag_end",
- G_CALLBACK (ethi_drag_end), ethi);
- ethi->drag_data_get_id = g_signal_connect (item->canvas, "drag_data_get",
- G_CALLBACK (ethi_drag_data_get), ethi);
+ ethi->drag_end_id = g_signal_connect (
+ item->canvas, "drag_end",
+ G_CALLBACK (ethi_drag_end), ethi);
+ ethi->drag_data_get_id = g_signal_connect (
+ item->canvas, "drag_data_get",
+ G_CALLBACK (ethi_drag_data_get), ethi);
}
@@ -1699,7 +1712,9 @@ ethi_header_context_menu (ETableHeaderItem *ethi,
if (sort_col == -1)
gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menu_item), TRUE);
gtk_check_menu_item_set_draw_as_radio (GTK_CHECK_MENU_ITEM (menu_item), TRUE);
- g_signal_connect (menu_item, "activate", G_CALLBACK (popup_custom), info);
+ g_signal_connect (
+ menu_item, "activate",
+ G_CALLBACK (popup_custom), info);
/* Show a seperator */
menu_item = gtk_separator_menu_item_new ();
@@ -1729,15 +1744,22 @@ ethi_header_context_menu (ETableHeaderItem *ethi,
gtk_menu_shell_prepend (GTK_MENU_SHELL (sub_menu), menu_item);
if (ncol == sort_col)
- gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menu_item), TRUE);
- gtk_check_menu_item_set_draw_as_radio (GTK_CHECK_MENU_ITEM (menu_item), TRUE);
- g_object_set_data (G_OBJECT (menu_item), "col-number", GINT_TO_POINTER (ncol));
- g_signal_connect (menu_item, "activate", G_CALLBACK (sort_by_id), ethi);
+ gtk_check_menu_item_set_active (
+ GTK_CHECK_MENU_ITEM (menu_item), TRUE);
+ gtk_check_menu_item_set_draw_as_radio (
+ GTK_CHECK_MENU_ITEM (menu_item), TRUE);
+ g_object_set_data (
+ G_OBJECT (menu_item), "col-number",
+ GINT_TO_POINTER (ncol));
+ g_signal_connect (
+ menu_item, "activate",
+ G_CALLBACK (sort_by_id), ethi);
}
g_object_ref_sink (popup);
- g_signal_connect (popup, "selection-done",
- G_CALLBACK (free_popup_info), info);
+ g_signal_connect (
+ popup, "selection-done",
+ G_CALLBACK (free_popup_info), info);
gtk_menu_popup (
GTK_MENU (popup),
@@ -1806,15 +1828,18 @@ ethi_change_sort_state (ETableHeaderItem *ethi,
for (j = i + 1; j < length; j++)
e_table_sort_info_sorting_set_nth (
ethi->sort_info, j - 1,
- e_table_sort_info_sorting_get_nth (ethi->sort_info, j));
+ e_table_sort_info_sorting_get_nth (
+ ethi->sort_info, j));
- e_table_sort_info_sorting_truncate (ethi->sort_info, length - 1);
+ e_table_sort_info_sorting_truncate (
+ ethi->sort_info, length - 1);
length--;
i--;
} else {
ascending = !ascending;
column.ascending = ascending;
- e_table_sort_info_sorting_set_nth (ethi->sort_info, i, column);
+ e_table_sort_info_sorting_set_nth (
+ ethi->sort_info, i, column);
}
found = TRUE;
if (model_col != -1)
@@ -1891,7 +1916,8 @@ ethi_event (GnomeCanvasItem *item,
convert (canvas, e->button.x, e->button.y, &x, &y);
- if (is_pointer_on_division (ethi, x, &start, &col) && e->button.button == 1) {
+ if (is_pointer_on_division (ethi, x, &start, &col) &&
+ e->button.button == 1) {
ETableCol *ecol;
/*
@@ -1991,8 +2017,9 @@ ethi_event (GnomeCanvasItem *item,
ethi->sort_info)) ? 0 : 16) +
128, info, GETTEXT_PACKAGE);
g_object_ref_sink (popup);
- g_signal_connect (popup, "selection-done",
- G_CALLBACK (free_popup_info), info);
+ g_signal_connect (
+ popup, "selection-done",
+ G_CALLBACK (free_popup_info), info);
gtk_menu_popup (
GTK_MENU (popup),
NULL, NULL, NULL, NULL,
diff --git a/widgets/table/e-table-header-utils.c b/widgets/table/e-table-header-utils.c
index df5ee66b56..038a44a938 100644
--- a/widgets/table/e-table-header-utils.c
+++ b/widgets/table/e-table-header-utils.c
@@ -162,8 +162,12 @@ e_table_header_draw_button (cairo_t *cr,
/* Inside area */
- inner_width = button_width - (padding.left + padding.right + 2 * HEADER_PADDING);
- inner_height = button_height - (padding.top + padding.bottom + 2 * HEADER_PADDING);
+ inner_width =
+ button_width -
+ (padding.left + padding.right + 2 * HEADER_PADDING);
+ inner_height =
+ button_height -
+ (padding.top + padding.bottom + 2 * HEADER_PADDING);
if (inner_width < 1 || inner_height < 1) {
return; /* nothing fits */
diff --git a/widgets/table/e-table-header.c b/widgets/table/e-table-header.c
index aab0971518..2045896532 100644
--- a/widgets/table/e-table-header.c
+++ b/widgets/table/e-table-header.c
@@ -902,7 +902,8 @@ eth_calc_widths (ETableHeader *eth)
widths[i] = eth->columns[i]->min_width + eth->width_extras;
}
if (eth->sort_info)
- extra -= e_table_sort_info_grouping_get_count (eth->sort_info) * GROUP_INDENT;
+ extra -= e_table_sort_info_grouping_get_count (eth->sort_info)
+ * GROUP_INDENT;
if (expansion != 0 && extra > 0) {
for (i = 0; i < last_resizable; i++) {
next_position +=
diff --git a/widgets/table/e-table-item.c b/widgets/table/e-table-item.c
index 25ea433a66..7fb6bec9e1 100644
--- a/widgets/table/e-table-item.c
+++ b/widgets/table/e-table-item.c
@@ -1760,7 +1760,9 @@ eti_realize (GnomeCanvasItem *item)
eti->rows = e_table_model_row_count (eti->table_model);
- g_signal_connect (GTK_LAYOUT(item->canvas), "scroll_event", G_CALLBACK (eti_tree_unfreeze), eti);
+ g_signal_connect (
+ item->canvas, "scroll_event",
+ G_CALLBACK (eti_tree_unfreeze), eti);
if (eti->cell_views == NULL)
eti_attach_cell_views (eti);
@@ -3780,29 +3782,25 @@ e_table_item_get_printable (ETableItem *item)
g_object_ref (item);
itemcontext->rows_printed = 0;
- g_signal_connect (printable,
- "print_page",
- G_CALLBACK (e_table_item_print_page),
- itemcontext);
- g_signal_connect (printable,
- "data_left",
- G_CALLBACK (e_table_item_data_left),
- itemcontext);
- g_signal_connect (printable,
- "reset",
- G_CALLBACK (e_table_item_reset),
- itemcontext);
- g_signal_connect (printable,
- "height",
- G_CALLBACK (e_table_item_height),
- itemcontext);
- g_signal_connect (printable,
- "will_fit",
- G_CALLBACK (e_table_item_will_fit),
- itemcontext);
- g_object_weak_ref (G_OBJECT (printable),
- e_table_item_printable_destroy,
- itemcontext);
+ g_signal_connect (
+ printable, "print_page",
+ G_CALLBACK (e_table_item_print_page), itemcontext);
+ g_signal_connect (
+ printable, "data_left",
+ G_CALLBACK (e_table_item_data_left), itemcontext);
+ g_signal_connect (
+ printable, "reset",
+ G_CALLBACK (e_table_item_reset), itemcontext);
+ g_signal_connect (
+ printable, "height",
+ G_CALLBACK (e_table_item_height), itemcontext);
+ g_signal_connect (
+ printable, "will_fit",
+ G_CALLBACK (e_table_item_will_fit), itemcontext);
+
+ g_object_weak_ref (
+ G_OBJECT (printable),
+ e_table_item_printable_destroy, itemcontext);
return printable;
}
diff --git a/widgets/table/e-table-memory-store.c b/widgets/table/e-table-memory-store.c
index 55f96f5862..56c1dee33b 100644
--- a/widgets/table/e-table-memory-store.c
+++ b/widgets/table/e-table-memory-store.c
@@ -30,6 +30,10 @@
#include "e-table-memory-store.h"
+#define E_TABLE_MEMORY_STORE_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_TABLE_MEMORY_STORE, ETableMemoryStorePrivate))
+
#define STORE_LOCATOR(etms, col, row) (*((etms)->priv->store + (row) * (etms)->priv->col_count + (col)))
struct _ETableMemoryStorePrivate {
@@ -250,7 +254,7 @@ etms_finalize (GObject *object)
{
ETableMemoryStorePrivate *priv;
- priv = E_TABLE_MEMORY_STORE (object)->priv;
+ priv = E_TABLE_MEMORY_STORE_GET_PRIVATE (object);
e_table_memory_store_clear (E_TABLE_MEMORY_STORE (object));
@@ -264,8 +268,7 @@ etms_finalize (GObject *object)
static void
e_table_memory_store_init (ETableMemoryStore *etms)
{
- etms->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- etms, E_TYPE_TABLE_MEMORY_STORE, ETableMemoryStorePrivate);
+ etms->priv = E_TABLE_MEMORY_STORE_GET_PRIVATE (etms);
}
static void
diff --git a/widgets/table/e-table-memory.c b/widgets/table/e-table-memory.c
index 6fe853e6bb..e14997c92b 100644
--- a/widgets/table/e-table-memory.c
+++ b/widgets/table/e-table-memory.c
@@ -39,6 +39,10 @@
#include "e-table-memory.h"
+#define E_TABLE_MEMORY_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_TABLE_MEMORY, ETableMemoryPrivate))
+
G_DEFINE_TYPE (ETableMemory, e_table_memory, E_TYPE_TABLE_MODEL)
struct _ETableMemoryPrivate {
@@ -52,7 +56,7 @@ etmm_finalize (GObject *object)
{
ETableMemoryPrivate *priv;
- priv = E_TABLE_MEMORY (object)->priv;
+ priv = E_TABLE_MEMORY_GET_PRIVATE (object);
g_free (priv->data);
@@ -86,8 +90,7 @@ e_table_memory_class_init (ETableMemoryClass *class)
static void
e_table_memory_init (ETableMemory *etmm)
{
- etmm->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- etmm, E_TYPE_TABLE_MEMORY, ETableMemoryPrivate);
+ etmm->priv = E_TABLE_MEMORY_GET_PRIVATE (etmm);
}
/**
diff --git a/widgets/table/e-table-model.c b/widgets/table/e-table-model.c
index 6f44379858..15b5286eb7 100644
--- a/widgets/table/e-table-model.c
+++ b/widgets/table/e-table-model.c
@@ -29,8 +29,8 @@
#include "e-table-model.h"
-#define ETM_CLASS(e) (E_TABLE_MODEL_GET_CLASS (e))
-#define ETM_FROZEN(e) (GPOINTER_TO_INT (g_object_get_data (G_OBJECT(e), "frozen")) != 0)
+#define ETM_FROZEN(e) \
+ (GPOINTER_TO_INT (g_object_get_data (G_OBJECT(e), "frozen")) != 0)
#define d(x)
@@ -50,7 +50,7 @@ enum {
LAST_SIGNAL
};
-static guint e_table_model_signals[LAST_SIGNAL] = { 0, };
+static guint signals[LAST_SIGNAL] = { 0, };
/**
* e_table_model_column_count:
@@ -61,10 +61,14 @@ static guint e_table_model_signals[LAST_SIGNAL] = { 0, };
gint
e_table_model_column_count (ETableModel *e_table_model)
{
- g_return_val_if_fail (e_table_model != NULL, 0);
+ ETableModelClass *class;
+
g_return_val_if_fail (E_IS_TABLE_MODEL (e_table_model), 0);
- return ETM_CLASS (e_table_model)->column_count (e_table_model);
+ class = E_TABLE_MODEL_GET_CLASS (e_table_model);
+ g_return_val_if_fail (class->column_count != NULL, 0);
+
+ return class->column_count (e_table_model);
}
/**
@@ -76,10 +80,14 @@ e_table_model_column_count (ETableModel *e_table_model)
gint
e_table_model_row_count (ETableModel *e_table_model)
{
- g_return_val_if_fail (e_table_model != NULL, 0);
+ ETableModelClass *class;
+
g_return_val_if_fail (E_IS_TABLE_MODEL (e_table_model), 0);
- return ETM_CLASS (e_table_model)->row_count (e_table_model);
+ class = E_TABLE_MODEL_GET_CLASS (e_table_model);
+ g_return_val_if_fail (class->row_count != NULL, 0);
+
+ return class->row_count (e_table_model);
}
/**
@@ -94,11 +102,14 @@ e_table_model_append_row (ETableModel *e_table_model,
ETableModel *source,
gint row)
{
- g_return_if_fail (e_table_model != NULL);
+ ETableModelClass *class;
+
g_return_if_fail (E_IS_TABLE_MODEL (e_table_model));
- if (ETM_CLASS (e_table_model)->append_row)
- ETM_CLASS (e_table_model)->append_row (e_table_model, source, row);
+ class = E_TABLE_MODEL_GET_CLASS (e_table_model);
+
+ if (class->append_row != NULL)
+ class->append_row (e_table_model, source, row);
}
/**
@@ -125,10 +136,14 @@ e_table_model_value_at (ETableModel *e_table_model,
gint col,
gint row)
{
- g_return_val_if_fail (e_table_model != NULL, NULL);
+ ETableModelClass *class;
+
g_return_val_if_fail (E_IS_TABLE_MODEL (e_table_model), NULL);
- return ETM_CLASS (e_table_model)->value_at (e_table_model, col, row);
+ class = E_TABLE_MODEL_GET_CLASS (e_table_model);
+ g_return_val_if_fail (class->value_at != NULL, NULL);
+
+ return class->value_at (e_table_model, col, row);
}
/**
@@ -152,10 +167,14 @@ e_table_model_set_value_at (ETableModel *e_table_model,
gint row,
gconstpointer value)
{
- g_return_if_fail (e_table_model != NULL);
+ ETableModelClass *class;
+
g_return_if_fail (E_IS_TABLE_MODEL (e_table_model));
- ETM_CLASS (e_table_model)->set_value_at (e_table_model, col, row, value);
+ class = E_TABLE_MODEL_GET_CLASS (e_table_model);
+ g_return_if_fail (class->set_value_at != NULL);
+
+ class->set_value_at (e_table_model, col, row, value);
}
/**
@@ -172,10 +191,14 @@ e_table_model_is_cell_editable (ETableModel *e_table_model,
gint col,
gint row)
{
- g_return_val_if_fail (e_table_model != NULL, FALSE);
+ ETableModelClass *class;
+
g_return_val_if_fail (E_IS_TABLE_MODEL (e_table_model), FALSE);
- return ETM_CLASS (e_table_model)->is_cell_editable (e_table_model, col, row);
+ class = E_TABLE_MODEL_GET_CLASS (e_table_model);
+ g_return_val_if_fail (class->is_cell_editable != NULL, FALSE);
+
+ return class->is_cell_editable (e_table_model, col, row);
}
gpointer
@@ -183,13 +206,16 @@ e_table_model_duplicate_value (ETableModel *e_table_model,
gint col,
gconstpointer value)
{
- g_return_val_if_fail (e_table_model != NULL, NULL);
+ ETableModelClass *class;
+
g_return_val_if_fail (E_IS_TABLE_MODEL (e_table_model), NULL);
- if (ETM_CLASS (e_table_model)->duplicate_value)
- return ETM_CLASS (e_table_model)->duplicate_value (e_table_model, col, value);
- else
+ class = E_TABLE_MODEL_GET_CLASS (e_table_model);
+
+ if (class->duplicate_value == NULL)
return NULL;
+
+ return class->duplicate_value (e_table_model, col, value);
}
void
@@ -197,61 +223,76 @@ e_table_model_free_value (ETableModel *e_table_model,
gint col,
gpointer value)
{
- g_return_if_fail (e_table_model != NULL);
+ ETableModelClass *class;
+
g_return_if_fail (E_IS_TABLE_MODEL (e_table_model));
- if (ETM_CLASS (e_table_model)->free_value)
- ETM_CLASS (e_table_model)->free_value (e_table_model, col, value);
+ class = E_TABLE_MODEL_GET_CLASS (e_table_model);
+
+ if (class->free_value != NULL)
+ class->free_value (e_table_model, col, value);
}
gboolean
e_table_model_has_save_id (ETableModel *e_table_model)
{
- g_return_val_if_fail (e_table_model != NULL, FALSE);
+ ETableModelClass *class;
+
g_return_val_if_fail (E_IS_TABLE_MODEL (e_table_model), FALSE);
- if (ETM_CLASS (e_table_model)->has_save_id)
- return ETM_CLASS (e_table_model)->has_save_id (e_table_model);
- else
+ class = E_TABLE_MODEL_GET_CLASS (e_table_model);
+
+ if (class->has_save_id == NULL)
return FALSE;
+
+ return class->has_save_id (e_table_model);
}
gchar *
e_table_model_get_save_id (ETableModel *e_table_model,
gint row)
{
- g_return_val_if_fail (e_table_model != NULL, NULL);
+ ETableModelClass *class;
+
g_return_val_if_fail (E_IS_TABLE_MODEL (e_table_model), NULL);
- if (ETM_CLASS (e_table_model)->get_save_id)
- return ETM_CLASS (e_table_model)->get_save_id (e_table_model, row);
- else
+ class = E_TABLE_MODEL_GET_CLASS (e_table_model);
+
+ if (class->get_save_id == NULL)
return NULL;
+
+ return class->get_save_id (e_table_model, row);
}
gboolean
e_table_model_has_change_pending (ETableModel *e_table_model)
{
- g_return_val_if_fail (e_table_model != NULL, FALSE);
+ ETableModelClass *class;
+
g_return_val_if_fail (E_IS_TABLE_MODEL (e_table_model), FALSE);
- if (ETM_CLASS (e_table_model)->has_change_pending)
- return ETM_CLASS (e_table_model)->has_change_pending (e_table_model);
- else
+ class = E_TABLE_MODEL_GET_CLASS (e_table_model);
+
+ if (class->has_change_pending == NULL)
return FALSE;
+
+ return class->has_change_pending (e_table_model);
}
gpointer
e_table_model_initialize_value (ETableModel *e_table_model,
gint col)
{
- g_return_val_if_fail (e_table_model != NULL, NULL);
+ ETableModelClass *class;
+
g_return_val_if_fail (E_IS_TABLE_MODEL (e_table_model), NULL);
- if (ETM_CLASS (e_table_model)->initialize_value)
- return ETM_CLASS (e_table_model)->initialize_value (e_table_model, col);
- else
+ class = E_TABLE_MODEL_GET_CLASS (e_table_model);
+
+ if (class->initialize_value == NULL)
return NULL;
+
+ return class->initialize_value (e_table_model, col);
}
gboolean
@@ -259,13 +300,16 @@ e_table_model_value_is_empty (ETableModel *e_table_model,
gint col,
gconstpointer value)
{
- g_return_val_if_fail (e_table_model != NULL, FALSE);
+ ETableModelClass *class;
+
g_return_val_if_fail (E_IS_TABLE_MODEL (e_table_model), FALSE);
- if (ETM_CLASS (e_table_model)->value_is_empty)
- return ETM_CLASS (e_table_model)->value_is_empty (e_table_model, col, value);
- else
+ class = E_TABLE_MODEL_GET_CLASS (e_table_model);
+
+ if (class->value_is_empty == NULL)
return FALSE;
+
+ return class->value_is_empty (e_table_model, col, value);
}
gchar *
@@ -273,13 +317,16 @@ e_table_model_value_to_string (ETableModel *e_table_model,
gint col,
gconstpointer value)
{
- g_return_val_if_fail (e_table_model != NULL, NULL);
+ ETableModelClass *class;
+
g_return_val_if_fail (E_IS_TABLE_MODEL (e_table_model), NULL);
- if (ETM_CLASS (e_table_model)->value_to_string)
- return ETM_CLASS (e_table_model)->value_to_string (e_table_model, col, value);
- else
- return g_strdup("");
+ class = E_TABLE_MODEL_GET_CLASS (e_table_model);
+
+ if (class->value_to_string == NULL)
+ return g_strdup ("");
+
+ return class->value_to_string (e_table_model, col, value);
}
static void
@@ -287,68 +334,75 @@ e_table_model_class_init (ETableModelClass *class)
{
GObjectClass *object_class = G_OBJECT_CLASS (class);
- e_table_model_signals[MODEL_NO_CHANGE] =
- g_signal_new ("model_no_change",
- G_TYPE_FROM_CLASS (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableModelClass, model_no_change),
- (GSignalAccumulator) NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
- e_table_model_signals[MODEL_CHANGED] =
- g_signal_new ("model_changed",
- G_TYPE_FROM_CLASS (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableModelClass, model_changed),
- (GSignalAccumulator) NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
- e_table_model_signals[MODEL_PRE_CHANGE] =
- g_signal_new ("model_pre_change",
- G_TYPE_FROM_CLASS (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableModelClass, model_pre_change),
- (GSignalAccumulator) NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
- e_table_model_signals[MODEL_ROW_CHANGED] =
- g_signal_new ("model_row_changed",
- G_TYPE_FROM_CLASS (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableModelClass, model_row_changed),
- (GSignalAccumulator) NULL, NULL,
- g_cclosure_marshal_VOID__INT,
- G_TYPE_NONE, 1, G_TYPE_INT);
-
- e_table_model_signals[MODEL_CELL_CHANGED] =
- g_signal_new ("model_cell_changed",
- G_TYPE_FROM_CLASS (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableModelClass, model_cell_changed),
- (GSignalAccumulator) NULL, NULL,
- e_marshal_VOID__INT_INT,
- G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_INT);
-
- e_table_model_signals[MODEL_ROWS_INSERTED] =
- g_signal_new ("model_rows_inserted",
- G_TYPE_FROM_CLASS (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableModelClass, model_rows_inserted),
- (GSignalAccumulator) NULL, NULL,
- e_marshal_VOID__INT_INT,
- G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_INT);
-
- e_table_model_signals[MODEL_ROWS_DELETED] =
- g_signal_new ("model_rows_deleted",
- G_TYPE_FROM_CLASS (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableModelClass, model_rows_deleted),
- (GSignalAccumulator) NULL, NULL,
- e_marshal_VOID__INT_INT,
- G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_INT);
+ signals[MODEL_NO_CHANGE] = g_signal_new (
+ "model_no_change",
+ G_TYPE_FROM_CLASS (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETableModelClass, model_no_change),
+ (GSignalAccumulator) NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
+ signals[MODEL_CHANGED] = g_signal_new (
+ "model_changed",
+ G_TYPE_FROM_CLASS (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETableModelClass, model_changed),
+ (GSignalAccumulator) NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
+ signals[MODEL_PRE_CHANGE] = g_signal_new (
+ "model_pre_change",
+ G_TYPE_FROM_CLASS (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETableModelClass, model_pre_change),
+ (GSignalAccumulator) NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
+ signals[MODEL_ROW_CHANGED] = g_signal_new (
+ "model_row_changed",
+ G_TYPE_FROM_CLASS (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETableModelClass, model_row_changed),
+ (GSignalAccumulator) NULL, NULL,
+ g_cclosure_marshal_VOID__INT,
+ G_TYPE_NONE, 1,
+ G_TYPE_INT);
+
+ signals[MODEL_CELL_CHANGED] = g_signal_new (
+ "model_cell_changed",
+ G_TYPE_FROM_CLASS (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETableModelClass, model_cell_changed),
+ (GSignalAccumulator) NULL, NULL,
+ e_marshal_VOID__INT_INT,
+ G_TYPE_NONE, 2,
+ G_TYPE_INT,
+ G_TYPE_INT);
+
+ signals[MODEL_ROWS_INSERTED] = g_signal_new (
+ "model_rows_inserted",
+ G_TYPE_FROM_CLASS (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETableModelClass, model_rows_inserted),
+ (GSignalAccumulator) NULL, NULL,
+ e_marshal_VOID__INT_INT,
+ G_TYPE_NONE, 2,
+ G_TYPE_INT,
+ G_TYPE_INT);
+
+ signals[MODEL_ROWS_DELETED] = g_signal_new (
+ "model_rows_deleted",
+ G_TYPE_FROM_CLASS (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETableModelClass, model_rows_deleted),
+ (GSignalAccumulator) NULL, NULL,
+ e_marshal_VOID__INT_INT,
+ G_TYPE_NONE, 2,
+ G_TYPE_INT,
+ G_TYPE_INT);
class->column_count = NULL;
class->row_count = NULL;
@@ -396,17 +450,15 @@ print_tabs (void)
void
e_table_model_pre_change (ETableModel *e_table_model)
{
- g_return_if_fail (e_table_model != NULL);
g_return_if_fail (E_IS_TABLE_MODEL (e_table_model));
if (ETM_FROZEN (e_table_model))
return;
d (print_tabs ());
- d(g_print("Emitting pre_change on model 0x%p, a %s.\n", e_table_model, g_type_name (G_OBJECT(e_table_model)->class->type)));
d (depth++);
g_signal_emit (G_OBJECT (e_table_model),
- e_table_model_signals[MODEL_PRE_CHANGE], 0);
+ signals[MODEL_PRE_CHANGE], 0);
d (depth--);
}
@@ -426,17 +478,15 @@ e_table_model_pre_change (ETableModel *e_table_model)
void
e_table_model_no_change (ETableModel *e_table_model)
{
- g_return_if_fail (e_table_model != NULL);
g_return_if_fail (E_IS_TABLE_MODEL (e_table_model));
if (ETM_FROZEN (e_table_model))
return;
d (print_tabs ());
- d(g_print("Emitting model_no_change on model 0x%p, a %s.\n", e_table_model, g_type_name (G_OBJECT(e_table_model)->class->type)));
d (depth++);
g_signal_emit (G_OBJECT (e_table_model),
- e_table_model_signals[MODEL_NO_CHANGE], 0);
+ signals[MODEL_NO_CHANGE], 0);
d (depth--);
}
@@ -456,17 +506,15 @@ e_table_model_no_change (ETableModel *e_table_model)
void
e_table_model_changed (ETableModel *e_table_model)
{
- g_return_if_fail (e_table_model != NULL);
g_return_if_fail (E_IS_TABLE_MODEL (e_table_model));
if (ETM_FROZEN (e_table_model))
return;
d (print_tabs ());
- d(g_print("Emitting model_changed on model 0x%p, a %s.\n", e_table_model, g_type_name (G_OBJECT(e_table_model)->class->type)));
d (depth++);
g_signal_emit (G_OBJECT (e_table_model),
- e_table_model_signals[MODEL_CHANGED], 0);
+ signals[MODEL_CHANGED], 0);
d (depth--);
}
@@ -484,17 +532,15 @@ void
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));
if (ETM_FROZEN (e_table_model))
return;
d (print_tabs ());
- d(g_print("Emitting row_changed on model 0x%p, a %s, row %d.\n", e_table_model, g_type_name (G_OBJECT(e_table_model)->class->type), row));
d (depth++);
g_signal_emit (G_OBJECT (e_table_model),
- e_table_model_signals[MODEL_ROW_CHANGED], 0, row);
+ signals[MODEL_ROW_CHANGED], 0, row);
d (depth--);
}
@@ -514,17 +560,15 @@ 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));
if (ETM_FROZEN (e_table_model))
return;
d (print_tabs ());
- d(g_print("Emitting cell_changed on model 0x%p, a %s, row %d, col %d.\n", e_table_model, g_type_name (G_OBJECT(e_table_model)->class->type), row, col));
d (depth++);
g_signal_emit (G_OBJECT (e_table_model),
- e_table_model_signals[MODEL_CELL_CHANGED], 0, col, row);
+ signals[MODEL_CELL_CHANGED], 0, col, row);
d (depth--);
}
@@ -544,17 +588,15 @@ 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));
if (ETM_FROZEN (e_table_model))
return;
d (print_tabs ());
- d(g_print("Emitting row_inserted on model 0x%p, a %s, row %d.\n", e_table_model, g_type_name (G_OBJECT(e_table_model)->class->type), row));
d (depth++);
g_signal_emit (G_OBJECT (e_table_model),
- e_table_model_signals[MODEL_ROWS_INSERTED], 0, row, count);
+ signals[MODEL_ROWS_INSERTED], 0, row, count);
d (depth--);
}
@@ -590,17 +632,15 @@ 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));
if (ETM_FROZEN (e_table_model))
return;
d (print_tabs ());
- d(g_print("Emitting row_deleted on model 0x%p, a %s, row %d.\n", e_table_model, g_type_name (G_OBJECT(e_table_model)->class->type), row));
d (depth++);
- g_signal_emit (G_OBJECT (e_table_model),
- e_table_model_signals[MODEL_ROWS_DELETED], 0, row, count);
+ g_signal_emit (
+ e_table_model, signals[MODEL_ROWS_DELETED], 0, row, count);
d (depth--);
}
@@ -624,13 +664,23 @@ void
e_table_model_freeze (ETableModel *e_table_model)
{
e_table_model_pre_change (e_table_model);
- g_object_set_data (G_OBJECT (e_table_model), "frozen", GINT_TO_POINTER (GPOINTER_TO_INT (g_object_get_data (G_OBJECT (e_table_model), "frozen")) + 1));
+
+ /* FIXME This expression is awesome! */
+ g_object_set_data (
+ G_OBJECT (e_table_model), "frozen",
+ GINT_TO_POINTER (GPOINTER_TO_INT (
+ g_object_get_data (G_OBJECT (e_table_model), "frozen")) + 1));
}
void
e_table_model_thaw (ETableModel *e_table_model)
{
- g_object_set_data (G_OBJECT (e_table_model), "frozen", GINT_TO_POINTER (GPOINTER_TO_INT (g_object_get_data (G_OBJECT (e_table_model), "frozen")) - 1));
+ /* FIXME This expression is awesome! */
+ g_object_set_data (
+ G_OBJECT (e_table_model), "frozen",
+ GINT_TO_POINTER (GPOINTER_TO_INT (
+ g_object_get_data (G_OBJECT (e_table_model), "frozen")) - 1));
+
e_table_model_changed (e_table_model);
}
diff --git a/widgets/table/e-table-search.c b/widgets/table/e-table-search.c
index 99f282c76f..99a0d7b9ab 100644
--- a/widgets/table/e-table-search.c
+++ b/widgets/table/e-table-search.c
@@ -47,6 +47,10 @@ enum {
LAST_SIGNAL
};
+#define E_TABLE_SEARCH_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_TABLE_SEARCH, ETableSearchPrivate))
+
d (static gint depth = 0)
static guint e_table_search_signals[LAST_SIGNAL] = { 0, };
@@ -110,7 +114,7 @@ e_table_search_finalize (GObject *object)
{
ETableSearchPrivate *priv;
- priv = E_TABLE_SEARCH (object)->priv;
+ priv = E_TABLE_SEARCH_GET_PRIVATE (object);
drop_timeout (E_TABLE_SEARCH (object));
@@ -155,8 +159,7 @@ e_table_search_class_init (ETableSearchClass *class)
static void
e_table_search_init (ETableSearch *ets)
{
- ets->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- ets, E_TYPE_TABLE_SEARCH, ETableSearchPrivate);
+ ets->priv = E_TABLE_SEARCH_GET_PRIVATE (ets);
ets->priv->search_string = g_strdup ("");
}
diff --git a/widgets/table/e-table-sorter.c b/widgets/table/e-table-sorter.c
index 418ce3a5e8..0e6b4623a3 100644
--- a/widgets/table/e-table-sorter.c
+++ b/widgets/table/e-table-sorter.c
@@ -134,10 +134,12 @@ ets_set_property (GObject *object,
ets->sort_info = E_TABLE_SORT_INFO (g_value_get_object (value));
g_object_ref (ets->sort_info);
- ets->sort_info_changed_id = g_signal_connect (ets->sort_info, "sort_info_changed",
- G_CALLBACK (ets_sort_info_changed), ets);
- ets->group_info_changed_id = g_signal_connect (ets->sort_info, "group_info_changed",
- G_CALLBACK (ets_sort_info_changed), ets);
+ ets->sort_info_changed_id = g_signal_connect (
+ ets->sort_info, "sort_info_changed",
+ G_CALLBACK (ets_sort_info_changed), ets);
+ ets->group_info_changed_id = g_signal_connect (
+ ets->sort_info, "group_info_changed",
+ G_CALLBACK (ets_sort_info_changed), ets);
ets_clean (ets);
break;
@@ -216,20 +218,33 @@ e_table_sorter_new (ETableModel *source,
ets->source = source;
g_object_ref (ets->source);
- ets->table_model_changed_id = g_signal_connect (source, "model_changed",
- G_CALLBACK (ets_model_changed), ets);
- ets->table_model_row_changed_id = g_signal_connect (source, "model_row_changed",
- G_CALLBACK (ets_model_row_changed), ets);
- ets->table_model_cell_changed_id = g_signal_connect (source, "model_cell_changed",
- G_CALLBACK (ets_model_cell_changed), ets);
- ets->table_model_rows_inserted_id = g_signal_connect (source, "model_rows_inserted",
- G_CALLBACK (ets_model_rows_inserted), ets);
- ets->table_model_rows_deleted_id = g_signal_connect (source, "model_rows_deleted",
- G_CALLBACK (ets_model_rows_deleted), ets);
- ets->sort_info_changed_id = g_signal_connect (sort_info, "sort_info_changed",
- G_CALLBACK (ets_sort_info_changed), ets);
- ets->group_info_changed_id = g_signal_connect (sort_info, "group_info_changed",
- G_CALLBACK (ets_sort_info_changed), ets);
+ ets->table_model_changed_id = g_signal_connect (
+ source, "model_changed",
+ G_CALLBACK (ets_model_changed), ets);
+
+ ets->table_model_row_changed_id = g_signal_connect (
+ source, "model_row_changed",
+ G_CALLBACK (ets_model_row_changed), ets);
+
+ ets->table_model_cell_changed_id = g_signal_connect (
+ source, "model_cell_changed",
+ G_CALLBACK (ets_model_cell_changed), ets);
+
+ ets->table_model_rows_inserted_id = g_signal_connect (
+ source, "model_rows_inserted",
+ G_CALLBACK (ets_model_rows_inserted), ets);
+
+ ets->table_model_rows_deleted_id = g_signal_connect (
+ source, "model_rows_deleted",
+ G_CALLBACK (ets_model_rows_deleted), ets);
+
+ ets->sort_info_changed_id = g_signal_connect (
+ sort_info, "sort_info_changed",
+ G_CALLBACK (ets_sort_info_changed), ets);
+
+ ets->group_info_changed_id = g_signal_connect (
+ sort_info, "group_info_changed",
+ G_CALLBACK (ets_sort_info_changed), ets);
return ets;
}
diff --git a/widgets/table/e-table-subset.c b/widgets/table/e-table-subset.c
index 9a26020296..0d5cd1ae63 100644
--- a/widgets/table/e-table-subset.c
+++ b/widgets/table/e-table-subset.c
@@ -32,13 +32,32 @@
#include "e-table-subset.h"
-static void etss_proxy_model_pre_change_real (ETableSubset *etss, ETableModel *etm);
-static void etss_proxy_model_no_change_real (ETableSubset *etss, ETableModel *etm);
-static void etss_proxy_model_changed_real (ETableSubset *etss, ETableModel *etm);
-static void etss_proxy_model_row_changed_real (ETableSubset *etss, ETableModel *etm, gint row);
-static void etss_proxy_model_cell_changed_real (ETableSubset *etss, ETableModel *etm, gint col, gint row);
-static void etss_proxy_model_rows_inserted_real (ETableSubset *etss, ETableModel *etm, gint row, gint count);
-static void etss_proxy_model_rows_deleted_real (ETableSubset *etss, ETableModel *etm, gint row, gint count);
+static void etss_proxy_model_pre_change_real
+ (ETableSubset *etss,
+ ETableModel *etm);
+static void etss_proxy_model_no_change_real (ETableSubset *etss,
+ ETableModel *etm);
+static void etss_proxy_model_changed_real (ETableSubset *etss,
+ ETableModel *etm);
+static void etss_proxy_model_row_changed_real
+ (ETableSubset *etss,
+ ETableModel *etm,
+ gint row);
+static void etss_proxy_model_cell_changed_real
+ (ETableSubset *etss,
+ ETableModel *etm,
+ gint col,
+ gint row);
+static void etss_proxy_model_rows_inserted_real
+ (ETableSubset *etss,
+ ETableModel *etm,
+ gint row,
+ gint count);
+static void etss_proxy_model_rows_deleted_real
+ (ETableSubset *etss,
+ ETableModel *etm,
+ gint row,
+ gint count);
#define d(x)
diff --git a/widgets/table/e-table-utils.c b/widgets/table/e-table-utils.c
index a534f22f07..da886295b6 100644
--- a/widgets/table/e-table-utils.c
+++ b/widgets/table/e-table-utils.c
@@ -182,9 +182,13 @@ e_table_util_calculate_current_search_col (ETableHeader *header,
gint i;
gint count;
ETableCol *col = NULL;
+
count = e_table_sort_info_grouping_get_count (sort_info);
+
for (i = 0; i < count; i++) {
- ETableSortColumn column = e_table_sort_info_grouping_get_nth (sort_info, i);
+ ETableSortColumn column;
+
+ column = e_table_sort_info_grouping_get_nth (sort_info, i);
col = e_table_header_get_column (full_header, column.column);
@@ -197,7 +201,9 @@ e_table_util_calculate_current_search_col (ETableHeader *header,
if (col == NULL) {
count = e_table_sort_info_sorting_get_count (sort_info);
for (i = 0; i < count; i++) {
- ETableSortColumn column = e_table_sort_info_sorting_get_nth (sort_info, i);
+ ETableSortColumn column;
+
+ column = e_table_sort_info_sorting_get_nth (sort_info, i);
col = e_table_header_get_column (full_header, column.column);
diff --git a/widgets/table/e-table-without.c b/widgets/table/e-table-without.c
index 785feb456b..6fba6cbe12 100644
--- a/widgets/table/e-table-without.c
+++ b/widgets/table/e-table-without.c
@@ -32,6 +32,10 @@
#include "e-table-without.h"
+#define E_TABLE_WITHOUT_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_TABLE_WITHOUT, ETableWithoutPrivate))
+
/* workaround for avoiding API breakage */
#define etw_get_type e_table_without_get_type
G_DEFINE_TYPE (ETableWithout, etw, E_TYPE_TABLE_SUBSET)
@@ -145,7 +149,7 @@ etw_dispose (GObject *object)
{
ETableWithoutPrivate *priv;
- priv = E_TABLE_WITHOUT (object)->priv;
+ priv = E_TABLE_WITHOUT_GET_PRIVATE (object);
if (priv->hash != NULL) {
g_hash_table_foreach (priv->hash, delete_hash_element, object);
@@ -258,8 +262,7 @@ etw_class_init (ETableWithoutClass *class)
static void
etw_init (ETableWithout *etw)
{
- etw->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- etw, E_TYPE_TABLE_WITHOUT, ETableWithoutPrivate);
+ etw->priv = E_TABLE_WITHOUT_GET_PRIVATE (etw);
}
ETableModel *
@@ -285,7 +288,8 @@ e_table_without_construct (ETableWithout *etw,
etw->priv->free_duplicated_key_func = free_duplicated_key_func;
etw->priv->closure = closure;
- etw->priv->hash = g_hash_table_new (etw->priv->hash_func, etw->priv->compare_func);
+ etw->priv->hash = g_hash_table_new (
+ etw->priv->hash_func, etw->priv->compare_func);
return E_TABLE_MODEL (etw);
}
@@ -394,7 +398,8 @@ e_table_without_show_all (ETableWithout *etw)
g_hash_table_destroy (etw->priv->hash);
etw->priv->hash = NULL;
}
- etw->priv->hash = g_hash_table_new (etw->priv->hash_func, etw->priv->compare_func);
+ etw->priv->hash = g_hash_table_new (
+ etw->priv->hash_func, etw->priv->compare_func);
row_count = e_table_model_row_count (E_TABLE_MODEL (etss->source));
g_free (etss->map_table);
diff --git a/widgets/table/e-table.c b/widgets/table/e-table.c
index e81dc6b23c..50751c8889 100644
--- a/widgets/table/e-table.c
+++ b/widgets/table/e-table.c
@@ -178,20 +178,20 @@ et_disconnect_model (ETable *et)
return;
if (et->table_model_change_id != 0)
- g_signal_handler_disconnect (G_OBJECT (et->model),
- et->table_model_change_id);
+ g_signal_handler_disconnect (
+ et->model, et->table_model_change_id);
if (et->table_row_change_id != 0)
- g_signal_handler_disconnect (G_OBJECT (et->model),
- et->table_row_change_id);
+ g_signal_handler_disconnect (
+ et->model, et->table_row_change_id);
if (et->table_cell_change_id != 0)
- g_signal_handler_disconnect (G_OBJECT (et->model),
- et->table_cell_change_id);
+ g_signal_handler_disconnect (
+ et->model, et->table_cell_change_id);
if (et->table_rows_inserted_id != 0)
- g_signal_handler_disconnect (G_OBJECT (et->model),
- et->table_rows_inserted_id);
+ g_signal_handler_disconnect (
+ et->model, et->table_rows_inserted_id);
if (et->table_rows_deleted_id != 0)
- g_signal_handler_disconnect (G_OBJECT (et->model),
- et->table_rows_deleted_id);
+ g_signal_handler_disconnect (
+ et->model, et->table_rows_deleted_id);
et->table_model_change_id = 0;
et->table_row_change_id = 0;
@@ -206,7 +206,7 @@ e_table_state_change (ETable *et)
if (et->state_change_freeze)
et->state_changed = TRUE;
else
- g_signal_emit (G_OBJECT (et), et_signals[STATE_CHANGE], 0);
+ g_signal_emit (et, et_signals[STATE_CHANGE], 0);
}
#define CHECK_HORIZONTAL(et) \
@@ -300,14 +300,14 @@ disconnect_header (ETable *e_table)
return;
if (e_table->structure_change_id)
- g_signal_handler_disconnect (G_OBJECT (e_table->header),
- e_table->structure_change_id);
+ g_signal_handler_disconnect (
+ e_table->header, e_table->structure_change_id);
if (e_table->expansion_change_id)
- g_signal_handler_disconnect (G_OBJECT (e_table->header),
- e_table->expansion_change_id);
+ g_signal_handler_disconnect (
+ e_table->header, e_table->expansion_change_id);
if (e_table->dimension_change_id)
- g_signal_handler_disconnect (G_OBJECT (e_table->header),
- e_table->dimension_change_id);
+ g_signal_handler_disconnect (
+ e_table->header, e_table->dimension_change_id);
g_object_unref (e_table->header);
e_table->header = NULL;
@@ -343,24 +343,24 @@ et_dispose (GObject *object)
if (et->search) {
if (et->search_search_id)
- g_signal_handler_disconnect (G_OBJECT (et->search),
- et->search_search_id);
+ g_signal_handler_disconnect (
+ et->search, et->search_search_id);
if (et->search_accept_id)
- g_signal_handler_disconnect (G_OBJECT (et->search),
- et->search_accept_id);
+ g_signal_handler_disconnect (
+ et->search, et->search_accept_id);
g_object_unref (et->search);
et->search = NULL;
}
if (et->group_info_change_id) {
- g_signal_handler_disconnect (G_OBJECT (et->sort_info),
- et->group_info_change_id);
+ g_signal_handler_disconnect (
+ et->sort_info, et->group_info_change_id);
et->group_info_change_id = 0;
}
if (et->sort_info_change_id) {
- g_signal_handler_disconnect (G_OBJECT (et->sort_info),
- et->sort_info_change_id);
+ g_signal_handler_disconnect (
+ et->sort_info, et->sort_info_change_id);
et->sort_info_change_id = 0;
}
@@ -429,7 +429,7 @@ et_dispose (GObject *object)
g_free (et->domain);
et->domain = NULL;
- (*G_OBJECT_CLASS (e_table_parent_class)->dispose)(object);
+ G_OBJECT_CLASS (e_table_parent_class)->dispose (object);
}
static void
@@ -552,6 +552,7 @@ et_finalize (GObject *object)
g_free (et->domain);
et->domain = NULL;
+
G_OBJECT_CLASS (e_table_parent_class)->finalize (object);
}
@@ -734,7 +735,7 @@ e_table_setup_header (ETable *e_table)
g_free (pointer);
g_signal_connect (
- G_OBJECT (e_table->header_canvas), "size_allocate",
+ e_table->header_canvas, "size_allocate",
G_CALLBACK (header_canvas_size_allocate), e_table);
g_object_set (
@@ -835,7 +836,7 @@ group_cursor_change (ETableGroup *etg,
old_cursor_loc = et->cursor_loc;
et->cursor_loc = E_TABLE_CURSOR_LOC_TABLE;
- g_signal_emit (G_OBJECT (et), et_signals[CURSOR_CHANGE], 0, row);
+ g_signal_emit (et, et_signals[CURSOR_CHANGE], 0, row);
if (old_cursor_loc == E_TABLE_CURSOR_LOC_ETCTA && et->click_to_add)
e_table_click_to_add_commit (E_TABLE_CLICK_TO_ADD (et->click_to_add));
@@ -846,7 +847,7 @@ group_cursor_activated (ETableGroup *etg,
gint row,
ETable *et)
{
- g_signal_emit (G_OBJECT (et), et_signals[CURSOR_ACTIVATED], 0, row);
+ g_signal_emit (et, et_signals[CURSOR_ACTIVATED], 0, row);
}
static void
@@ -856,7 +857,7 @@ group_double_click (ETableGroup *etg,
GdkEvent *event,
ETable *et)
{
- g_signal_emit (G_OBJECT (et), et_signals[DOUBLE_CLICK], 0, row, col, event);
+ g_signal_emit (et, et_signals[DOUBLE_CLICK], 0, row, col, event);
}
static gboolean
@@ -883,7 +884,11 @@ group_click (ETableGroup *etg,
ETable *et)
{
gboolean return_val = 0;
- g_signal_emit (G_OBJECT (et), et_signals[CLICK], 0, row, col, event, &return_val);
+
+ g_signal_emit (
+ et, et_signals[CLICK], 0,
+ row, col, event, &return_val);
+
return return_val;
}
@@ -961,8 +966,9 @@ group_key_press (ETableGroup *etg,
(key->keyval >= GDK_KEY_A && key->keyval <= GDK_KEY_Z) ||
(key->keyval >= GDK_KEY_0 && key->keyval <= GDK_KEY_9)))
e_table_search_input_character (et->search, key->keyval);
- g_signal_emit (G_OBJECT (et), et_signals[KEY_PRESS], 0,
- row, col, event, &return_val);
+ g_signal_emit (
+ et, et_signals[KEY_PRESS], 0,
+ row, col, event, &return_val);
break;
}
return return_val;
@@ -976,8 +982,11 @@ group_start_drag (ETableGroup *etg,
ETable *et)
{
gboolean return_val = TRUE;
- g_signal_emit (G_OBJECT (et), et_signals[START_DRAG], 0,
- row, col, event, &return_val);
+
+ g_signal_emit (
+ et, et_signals[START_DRAG], 0,
+ row, col, event, &return_val);
+
return return_val;
}
@@ -1195,8 +1204,11 @@ white_item_event (GnomeCanvasItem *white_item,
ETable *e_table)
{
gboolean return_val = 0;
- g_signal_emit (G_OBJECT (e_table), et_signals[WHITE_SPACE_EVENT], 0,
- event, &return_val);
+
+ g_signal_emit (
+ e_table, et_signals[WHITE_SPACE_EVENT], 0,
+ event, &return_val);
+
return return_val;
}
@@ -1442,7 +1454,7 @@ e_table_setup_table (ETable *e_table,
NULL);
g_signal_connect (
- G_OBJECT (e_table->canvas_vbox), "event",
+ e_table->canvas_vbox, "event",
G_CALLBACK (canvas_vbox_event), e_table);
et_build_groups (e_table);
@@ -1466,10 +1478,10 @@ e_table_setup_table (ETable *e_table,
e_table->click_to_add);
g_signal_connect (
- G_OBJECT (e_table->click_to_add), "event",
+ e_table->click_to_add, "event",
G_CALLBACK (click_to_add_event), e_table);
g_signal_connect (
- G_OBJECT (e_table->click_to_add), "cursor_change",
+ e_table->click_to_add, "cursor_change",
G_CALLBACK (click_to_add_cursor_change), e_table);
}
}
@@ -1512,16 +1524,19 @@ e_table_set_state_object (ETable *e_table,
if (e_table->sort_info) {
if (e_table->group_info_change_id)
- g_signal_handler_disconnect (G_OBJECT (e_table->sort_info),
- e_table->group_info_change_id);
+ g_signal_handler_disconnect (
+ e_table->sort_info,
+ e_table->group_info_change_id);
if (e_table->sort_info_change_id)
- g_signal_handler_disconnect (G_OBJECT (e_table->sort_info),
- e_table->sort_info_change_id);
+ g_signal_handler_disconnect (
+ e_table->sort_info,
+ e_table->sort_info_change_id);
g_object_unref (e_table->sort_info);
}
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_sort_info_set_can_group (
+ e_table->sort_info, e_table->allow_grouping);
e_table->group_info_change_id = g_signal_connect (
e_table->sort_info, "group_info_changed",
G_CALLBACK (group_info_changed), e_table);
@@ -1568,7 +1583,6 @@ e_table_set_state (ETable *e_table,
{
ETableState *state;
- g_return_if_fail (e_table != NULL);
g_return_if_fail (E_IS_TABLE (e_table));
g_return_if_fail (state_str != NULL);
@@ -1595,7 +1609,6 @@ e_table_load_state (ETable *e_table,
{
ETableState *state;
- g_return_if_fail (e_table != NULL);
g_return_if_fail (E_IS_TABLE (e_table));
g_return_if_fail (filename != NULL);
@@ -1695,7 +1708,7 @@ static void
et_selection_model_selection_changed (ETableGroup *etg,
ETable *et)
{
- g_signal_emit (G_OBJECT (et), et_signals[SELECTION_CHANGE], 0);
+ g_signal_emit (et, et_signals[SELECTION_CHANGE], 0);
}
static void
@@ -1703,7 +1716,7 @@ et_selection_model_selection_row_changed (ETableGroup *etg,
gint row,
ETable *et)
{
- g_signal_emit (G_OBJECT (et), et_signals[SELECTION_CHANGE], 0);
+ g_signal_emit (et, et_signals[SELECTION_CHANGE], 0);
}
static ETable *
@@ -1855,9 +1868,7 @@ e_table_construct (ETable *e_table,
ETableSpecification *specification;
ETableState *state;
- g_return_val_if_fail (e_table != NULL, NULL);
g_return_val_if_fail (E_IS_TABLE (e_table), NULL);
- g_return_val_if_fail (etm != NULL, NULL);
g_return_val_if_fail (E_IS_TABLE_MODEL (etm), NULL);
g_return_val_if_fail (ete == NULL || E_IS_TABLE_EXTRAS (ete), NULL);
g_return_val_if_fail (spec_str != NULL, NULL);
@@ -1918,9 +1929,7 @@ e_table_construct_from_spec_file (ETable *e_table,
ETableSpecification *specification;
ETableState *state;
- g_return_val_if_fail (e_table != NULL, NULL);
g_return_val_if_fail (E_IS_TABLE (e_table), NULL);
- g_return_val_if_fail (etm != NULL, NULL);
g_return_val_if_fail (E_IS_TABLE_MODEL (etm), NULL);
g_return_val_if_fail (ete == NULL || E_IS_TABLE_EXTRAS (ete), NULL);
g_return_val_if_fail (spec_fn != NULL, NULL);
@@ -1985,7 +1994,6 @@ e_table_new (ETableModel *etm,
{
ETable *e_table;
- g_return_val_if_fail (etm != NULL, NULL);
g_return_val_if_fail (E_IS_TABLE_MODEL (etm), NULL);
g_return_val_if_fail (ete == NULL || E_IS_TABLE_EXTRAS (ete), NULL);
g_return_val_if_fail (spec != NULL, NULL);
@@ -2025,7 +2033,6 @@ e_table_new_from_spec_file (ETableModel *etm,
{
ETable *e_table;
- g_return_val_if_fail (etm != NULL, NULL);
g_return_val_if_fail (E_IS_TABLE_MODEL (etm), NULL);
g_return_val_if_fail (ete == NULL || E_IS_TABLE_EXTRAS (ete), NULL);
g_return_val_if_fail (spec_fn != NULL, NULL);
@@ -2037,158 +2044,6 @@ e_table_new_from_spec_file (ETableModel *etm,
return GTK_WIDGET (e_table);
}
-#if 0
-static xmlNode *
-et_build_column_spec (ETable *e_table)
-{
- xmlNode *columns_shown;
- gint i;
- gint col_count;
-
- columns_shown = xmlNewNode (NULL, "columns-shown");
-
- col_count = e_table_header_count (e_table->header);
- for (i = 0; i < col_count; i++) {
- gchar *text = g_strdup_printf ("%d", e_table_header_index(e_table->header, i));
- xmlNewChild (columns_shown, NULL, "column", text);
- g_free (text);
- }
-
- return columns_shown;
-}
-
-static xmlNode *
-et_build_grouping_spec (ETable *e_table)
-{
- xmlNode *node;
- xmlNode *grouping;
- gint i;
- const gint sort_count = e_table_sort_info_sorting_get_count (e_table->sort_info);
- const gint group_count = e_table_sort_info_grouping_get_count (e_table->sort_info);
-
- grouping = xmlNewNode (NULL, "grouping");
- node = grouping;
-
- for (i = 0; i < group_count; i++) {
- ETableSortColumn column =
- e_table_sort_info_grouping_get_nth (e_table->sort_info, i);
- xmlNode *new_node = xmlNewChild(node, NULL, "group", NULL);
-
- e_xml_set_integer_prop_by_name (new_node, "column", column.column);
- e_xml_set_integer_prop_by_name (new_node, "ascending", column.ascending);
- node = new_node;
- }
-
- for (i = 0; i < sort_count; i++) {
- ETableSortColumn column =
- e_table_sort_info_sorting_get_nth (e_table->sort_info, i);
- xmlNode *new_node = xmlNewChild(node, NULL, "leaf", NULL);
-
- e_xml_set_integer_prop_by_name (new_node, "column", column.column);
- e_xml_set_integer_prop_by_name (new_node, "ascending", column.ascending);
- node = new_node;
- }
-
- return grouping;
-}
-
-static xmlDoc *
-et_build_tree (ETable *e_table)
-{
- xmlDoc *doc;
- xmlNode *root;
-
- doc = xmlNewDoc ("1.0");
- if (doc == NULL)
- return NULL;
-
- root = xmlNewDocNode (doc, NULL, "ETableSpecification", NULL);
- xmlDocSetRootElement (doc, root);
- xmlAddChild (root, et_build_column_spec (e_table));
- xmlAddChild (root, et_build_grouping_spec (e_table));
-
- return doc;
-}
-
-gchar *
-e_table_get_specification (ETable *e_table)
-{
- xmlDoc *doc;
- xmlChar *buffer;
- gint size;
-
- g_return_val_if_fail (e_table != NULL, NULL);
- g_return_val_if_fail (E_IS_TABLE (e_table), NULL);
-
- doc = et_build_tree (e_table);
- xmlDocDumpMemory (doc, &buffer, &size);
- xmlFreeDoc (doc);
-
- return buffer;
-}
-
-gint
-e_table_set_specification (ETable *e_table,
- const gchar *spec)
-{
- xmlDoc *xmlSpec;
- gint ret;
-
- g_return_val_if_fail (e_table != NULL, -1);
- g_return_val_if_fail (E_IS_TABLE (e_table), -1);
- g_return_val_if_fail (spec != NULL, -1);
-
- /* doesn't work yet, sigh */
- xmlSpec = xmlParseMemory ((gchar *) spec, strlen (spec));
- ret = et_real_set_specification (e_table, xmlSpec);
- xmlFreeDoc (xmlSpec);
-
- return ret;
-}
-
-void
-e_table_save_specification (ETable *e_table,
- const gchar *filename)
-{
- xmlDoc *doc = et_build_tree (e_table);
-
- g_return_if_fail (e_table != NULL);
- g_return_if_fail (E_IS_TABLE (e_table));
- g_return_if_fail (filename != NULL);
-
- e_xml_save_file (filename, doc);
-
- xmlFreeDoc (doc);
-}
-
-gint
-e_table_load_specification (ETable *e_table,
- gchar *filename)
-{
- xmlDoc *xmlSpec;
- gint ret;
-
- g_return_val_if_fail (e_table != NULL, -1);
- g_return_val_if_fail (E_IS_TABLE (e_table), -1);
- g_return_val_if_fail (filename != NULL, -1);
-
- /* doesn't work yet, yay */
-#ifdef G_OS_WIN32
- {
- gchar *locale_filename = g_win32_locale_filename_from_utf8 (filename);
- xmlSpec = xmlParseFile (locale_filename);
- g_free (locale_filename);
- }
-#else
- xmlSpec = xmlParseFile (filename);
-#endif
- ret = et_real_set_specification (e_table, xmlSpec);
- xmlFreeDoc (xmlSpec);
-
- return ret;
-}
-#endif
-
/**
* e_table_set_cursor_row:
* @e_table: The #ETable to set the cursor row of
@@ -2200,7 +2055,6 @@ void
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));
g_return_if_fail (row >= 0);
@@ -2222,7 +2076,6 @@ gint
e_table_get_cursor_row (ETable *e_table)
{
gint row;
- g_return_val_if_fail (e_table != NULL, -1);
g_return_val_if_fail (E_IS_TABLE (e_table), -1);
g_object_get (e_table->selection,
@@ -2249,7 +2102,6 @@ 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));
e_selection_model_foreach (E_SELECTION_MODEL (e_table->selection),
@@ -2269,7 +2121,6 @@ e_table_selected_row_foreach (ETable *e_table,
gint
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);
return e_selection_model_selected_count (E_SELECTION_MODEL (e_table->selection));
@@ -2284,7 +2135,6 @@ e_table_selected_count (ETable *e_table)
void
e_table_select_all (ETable *table)
{
- g_return_if_fail (table != NULL);
g_return_if_fail (E_IS_TABLE (table));
e_selection_model_select_all (E_SELECTION_MODEL (table->selection));
@@ -2299,7 +2149,6 @@ e_table_select_all (ETable *table)
void
e_table_invert_selection (ETable *table)
{
- g_return_if_fail (table != NULL);
g_return_if_fail (E_IS_TABLE (table));
e_selection_model_invert_selection (E_SELECTION_MODEL (table->selection));
@@ -2317,7 +2166,6 @@ e_table_invert_selection (ETable *table)
EPrintable *
e_table_get_printable (ETable *e_table)
{
- g_return_val_if_fail (e_table != NULL, NULL);
g_return_val_if_fail (E_IS_TABLE (e_table), NULL);
return e_table_group_get_printable (e_table->group);
@@ -2526,7 +2374,6 @@ gint
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);
if (e_table->sorter) {
@@ -2560,7 +2407,6 @@ gint
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);
if (e_table->sorter) {
@@ -2589,7 +2435,6 @@ gint
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);
if (e_table->sorter)
@@ -2612,7 +2457,6 @@ gint
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);
if (e_table->sorter)
@@ -2728,7 +2572,6 @@ 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));
if (!table->group)
@@ -2750,7 +2593,6 @@ e_table_get_mouse_over_cell (ETable *table,
ESelectionModel *
e_table_get_selection_model (ETable *table)
{
- g_return_val_if_fail (table != NULL, NULL);
g_return_val_if_fail (E_IS_TABLE (table), NULL);
return E_SELECTION_MODEL (table->selection);
@@ -2843,7 +2685,6 @@ e_table_drag_get_data (ETable *table,
GdkAtom target,
guint32 time)
{
- g_return_if_fail (table != NULL);
g_return_if_fail (E_IS_TABLE (table));
gtk_drag_get_data (GTK_WIDGET (table),
@@ -2923,7 +2764,6 @@ e_table_drag_highlight (ETable *table,
void
e_table_drag_unhighlight (ETable *table)
{
- g_return_if_fail (table != NULL);
g_return_if_fail (E_IS_TABLE (table));
if (table->drop_highlight) {
@@ -2932,34 +2772,29 @@ e_table_drag_unhighlight (ETable *table)
}
}
-void e_table_drag_dest_set (ETable *table,
- GtkDestDefaults flags,
- const GtkTargetEntry *targets,
- gint n_targets,
- GdkDragAction actions)
+void
+e_table_drag_dest_set (ETable *table,
+ GtkDestDefaults flags,
+ const GtkTargetEntry *targets,
+ gint n_targets,
+ GdkDragAction actions)
{
- g_return_if_fail (table != NULL);
g_return_if_fail (E_IS_TABLE (table));
- gtk_drag_dest_set (GTK_WIDGET (table),
- flags,
- targets,
- n_targets,
- actions);
+ gtk_drag_dest_set (
+ GTK_WIDGET (table), flags, targets, n_targets, actions);
}
-void e_table_drag_dest_set_proxy (ETable *table,
- GdkWindow *proxy_window,
- GdkDragProtocol protocol,
- gboolean use_coordinates)
+void
+e_table_drag_dest_set_proxy (ETable *table,
+ GdkWindow *proxy_window,
+ GdkDragProtocol protocol,
+ gboolean use_coordinates)
{
- g_return_if_fail (table != NULL);
g_return_if_fail (E_IS_TABLE (table));
- gtk_drag_dest_set_proxy (GTK_WIDGET (table),
- proxy_window,
- protocol,
- use_coordinates);
+ gtk_drag_dest_set_proxy (
+ GTK_WIDGET (table), proxy_window, protocol, use_coordinates);
}
/*
@@ -2970,7 +2805,6 @@ void e_table_drag_dest_set_proxy (ETable *table,
void
e_table_drag_dest_unset (GtkWidget *widget)
{
- g_return_if_fail (widget != NULL);
g_return_if_fail (E_IS_TABLE (widget));
gtk_drag_dest_unset (widget);
@@ -3034,7 +2868,6 @@ e_table_drag_source_set (ETable *table,
ETableDragSourceSite *site;
GtkWidget *canvas;
- g_return_if_fail (table != NULL);
g_return_if_fail (E_IS_TABLE (table));
canvas = GTK_WIDGET (table->table_canvas);
@@ -3076,7 +2909,6 @@ e_table_drag_source_unset (ETable *table)
{
ETableDragSourceSite *site;
- g_return_if_fail (table != NULL);
g_return_if_fail (E_IS_TABLE (table));
site = table->site;
@@ -3118,17 +2950,13 @@ e_table_drag_begin (ETable *table,
gint button,
GdkEvent *event)
{
- g_return_val_if_fail (table != NULL, NULL);
g_return_val_if_fail (E_IS_TABLE (table), NULL);
table->drag_row = row;
table->drag_col = col;
- return gtk_drag_begin (GTK_WIDGET (table),
- targets,
- actions,
- button,
- event);
+ return gtk_drag_begin (
+ GTK_WIDGET (table), targets, actions, button, event);
}
static void
@@ -3136,8 +2964,9 @@ et_drag_begin (GtkWidget *widget,
GdkDragContext *context,
ETable *et)
{
- g_signal_emit (G_OBJECT (et), et_signals[TABLE_DRAG_BEGIN], 0,
- et->drag_row, et->drag_col, context);
+ g_signal_emit (
+ et, et_signals[TABLE_DRAG_BEGIN], 0,
+ et->drag_row, et->drag_col, context);
}
static void
@@ -3145,8 +2974,9 @@ et_drag_end (GtkWidget *widget,
GdkDragContext *context,
ETable *et)
{
- g_signal_emit (G_OBJECT (et), et_signals[TABLE_DRAG_END], 0,
- et->drag_row, et->drag_col, context);
+ g_signal_emit (
+ et, et_signals[TABLE_DRAG_END], 0,
+ et->drag_row, et->drag_col, context);
}
static void
@@ -3157,9 +2987,10 @@ et_drag_data_get (GtkWidget *widget,
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,
- info, time);
+ g_signal_emit (
+ et, et_signals[TABLE_DRAG_DATA_GET], 0,
+ et->drag_row, et->drag_col, context, selection_data,
+ info, time);
}
static void
@@ -3167,8 +2998,9 @@ et_drag_data_delete (GtkWidget *widget,
GdkDragContext *context,
ETable *et)
{
- g_signal_emit (G_OBJECT (et), et_signals[TABLE_DRAG_DATA_DELETE], 0,
- et->drag_row, et->drag_col, context);
+ g_signal_emit (
+ et, et_signals[TABLE_DRAG_DATA_DELETE], 0,
+ et->drag_row, et->drag_col, context);
}
static gboolean
@@ -3184,13 +3016,17 @@ do_drag_motion (ETable *et,
e_table_get_cell_at (et, x, y, &row, &col);
if (row != et->drop_row && col != et->drop_row) {
- g_signal_emit (G_OBJECT (et), et_signals[TABLE_DRAG_LEAVE], 0,
- et->drop_row, et->drop_col, context, time);
+ g_signal_emit (
+ et, et_signals[TABLE_DRAG_LEAVE], 0,
+ et->drop_row, et->drop_col, context, time);
}
+
et->drop_row = row;
et->drop_col = col;
- g_signal_emit (G_OBJECT (et), et_signals[TABLE_DRAG_MOTION], 0,
- et->drop_row, et->drop_col, context, x, y, time, &ret_val);
+
+ g_signal_emit (
+ et, et_signals[TABLE_DRAG_MOTION], 0,
+ et->drop_row, et->drop_col, context, x, y, time, &ret_val);
return ret_val;
}
@@ -3308,8 +3144,10 @@ et_drag_leave (GtkWidget *widget,
guint time,
ETable *et)
{
- g_signal_emit (G_OBJECT (et), et_signals[TABLE_DRAG_LEAVE], 0,
- et->drop_row, et->drop_col, context, time);
+ g_signal_emit (
+ et, et_signals[TABLE_DRAG_LEAVE], 0,
+ et->drop_row, et->drop_col, context, time);
+
et->drop_row = -1;
et->drop_col = -1;
@@ -3369,15 +3207,18 @@ et_drag_drop (GtkWidget *widget,
e_table_get_cell_at (et, x, y, &row, &col);
if (row != et->drop_row && col != et->drop_row) {
- g_signal_emit (G_OBJECT (et), et_signals[TABLE_DRAG_LEAVE], 0,
- et->drop_row, et->drop_col, context, time);
- g_signal_emit (G_OBJECT (et), et_signals[TABLE_DRAG_MOTION], 0,
- row, col, context, x, y, time, &ret_val);
+ g_signal_emit (
+ et, et_signals[TABLE_DRAG_LEAVE], 0,
+ et->drop_row, et->drop_col, context, time);
+ g_signal_emit (
+ et, et_signals[TABLE_DRAG_MOTION], 0,
+ row, col, context, x, y, time, &ret_val);
}
et->drop_row = row;
et->drop_col = col;
- g_signal_emit (G_OBJECT (et), et_signals[TABLE_DRAG_DROP], 0,
- et->drop_row, et->drop_col, context, x, y, time, &ret_val);
+ g_signal_emit (
+ et, et_signals[TABLE_DRAG_DROP], 0,
+ et->drop_row, et->drop_col, context, x, y, time, &ret_val);
et->drop_row = -1;
et->drop_col = -1;
@@ -3400,8 +3241,9 @@ et_drag_data_received (GtkWidget *widget,
e_table_get_cell_at (et, x, y, &row, &col);
- g_signal_emit (G_OBJECT (et), et_signals[TABLE_DRAG_DATA_RECEIVED], 0,
- row, col, context, x, y, selection_data, info, time);
+ g_signal_emit (
+ et, et_signals[TABLE_DRAG_DATA_RECEIVED], 0,
+ row, col, context, x, y, selection_data, info, time);
}
static void
@@ -3446,251 +3288,272 @@ e_table_class_init (ETableClass *class)
class->table_drag_drop = NULL;
class->table_drag_data_received = NULL;
- et_signals[CURSOR_CHANGE] =
- g_signal_new ("cursor_change",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableClass, cursor_change),
- NULL, NULL,
- g_cclosure_marshal_VOID__INT,
- G_TYPE_NONE, 1, G_TYPE_INT);
-
- et_signals[CURSOR_ACTIVATED] =
- g_signal_new ("cursor_activated",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableClass, cursor_activated),
- NULL, NULL,
- g_cclosure_marshal_VOID__INT,
- G_TYPE_NONE, 1, G_TYPE_INT);
-
- et_signals[SELECTION_CHANGE] =
- g_signal_new ("selection_change",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableClass, selection_change),
- NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
- et_signals[DOUBLE_CLICK] =
- g_signal_new ("double_click",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableClass, double_click),
- NULL, NULL,
- e_marshal_NONE__INT_INT_BOXED,
- G_TYPE_NONE, 3,
- G_TYPE_INT,
- G_TYPE_INT,
- GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
-
- et_signals[RIGHT_CLICK] =
- g_signal_new ("right_click",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableClass, right_click),
- g_signal_accumulator_true_handled, NULL,
- e_marshal_BOOLEAN__INT_INT_BOXED,
- G_TYPE_BOOLEAN, 3,
- G_TYPE_INT,
- G_TYPE_INT,
- GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
-
- et_signals[CLICK] =
- g_signal_new ("click",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableClass, click),
- g_signal_accumulator_true_handled, NULL,
- e_marshal_BOOLEAN__INT_INT_BOXED,
- G_TYPE_BOOLEAN, 3,
- G_TYPE_INT,
- G_TYPE_INT,
- GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
-
- et_signals[KEY_PRESS] =
- g_signal_new ("key_press",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableClass, key_press),
- g_signal_accumulator_true_handled, NULL,
- e_marshal_BOOLEAN__INT_INT_BOXED,
- G_TYPE_BOOLEAN, 3,
- G_TYPE_INT,
- G_TYPE_INT,
- GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
-
- et_signals[START_DRAG] =
- g_signal_new ("start_drag",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableClass, start_drag),
- g_signal_accumulator_true_handled, NULL,
- e_marshal_BOOLEAN__INT_INT_BOXED,
- G_TYPE_BOOLEAN, 3,
- G_TYPE_INT,
- G_TYPE_INT,
- GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
-
- et_signals[STATE_CHANGE] =
- g_signal_new ("state_change",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableClass, state_change),
- NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
- et_signals[WHITE_SPACE_EVENT] =
- g_signal_new ("white_space_event",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableClass, white_space_event),
- g_signal_accumulator_true_handled, NULL,
- e_marshal_BOOLEAN__BOXED,
- G_TYPE_BOOLEAN, 1,
- GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
-
- et_signals[TABLE_DRAG_BEGIN] =
- g_signal_new ("table_drag_begin",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableClass, table_drag_begin),
- NULL, NULL,
- e_marshal_NONE__INT_INT_OBJECT,
- G_TYPE_NONE, 3,
- G_TYPE_INT,
- G_TYPE_INT,
- GDK_TYPE_DRAG_CONTEXT);
- et_signals[TABLE_DRAG_END] =
- g_signal_new ("table_drag_end",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableClass, table_drag_end),
- NULL, NULL,
- e_marshal_NONE__INT_INT_OBJECT,
- G_TYPE_NONE, 3,
- G_TYPE_INT,
- G_TYPE_INT,
- GDK_TYPE_DRAG_CONTEXT);
- et_signals[TABLE_DRAG_DATA_GET] =
- g_signal_new ("table_drag_data_get",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableClass, table_drag_data_get),
- NULL, NULL,
- e_marshal_NONE__INT_INT_OBJECT_BOXED_UINT_UINT,
- G_TYPE_NONE, 6,
- G_TYPE_INT,
- G_TYPE_INT,
- GDK_TYPE_DRAG_CONTEXT,
- GTK_TYPE_SELECTION_DATA | G_SIGNAL_TYPE_STATIC_SCOPE,
- G_TYPE_UINT,
- G_TYPE_UINT);
- et_signals[TABLE_DRAG_DATA_DELETE] =
- g_signal_new ("table_drag_data_delete",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableClass, table_drag_data_delete),
- NULL, NULL,
- e_marshal_NONE__INT_INT_OBJECT,
- G_TYPE_NONE, 3,
- G_TYPE_INT,
- G_TYPE_INT,
- GDK_TYPE_DRAG_CONTEXT);
-
- et_signals[TABLE_DRAG_LEAVE] =
- g_signal_new ("table_drag_leave",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableClass, table_drag_leave),
- NULL, NULL,
- e_marshal_NONE__INT_INT_OBJECT_UINT,
- G_TYPE_NONE, 4,
- G_TYPE_INT,
- G_TYPE_INT,
- GDK_TYPE_DRAG_CONTEXT,
- G_TYPE_UINT);
- et_signals[TABLE_DRAG_MOTION] =
- g_signal_new ("table_drag_motion",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableClass, table_drag_motion),
- NULL, NULL,
- e_marshal_BOOLEAN__INT_INT_OBJECT_INT_INT_UINT,
- G_TYPE_BOOLEAN, 6,
- G_TYPE_INT,
- G_TYPE_INT,
- GDK_TYPE_DRAG_CONTEXT,
- G_TYPE_INT,
- G_TYPE_INT,
- G_TYPE_UINT);
- et_signals[TABLE_DRAG_DROP] =
- g_signal_new ("table_drag_drop",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableClass, table_drag_drop),
- NULL, NULL,
- e_marshal_BOOLEAN__INT_INT_OBJECT_INT_INT_UINT,
- G_TYPE_BOOLEAN, 6,
- G_TYPE_INT,
- G_TYPE_INT,
- GDK_TYPE_DRAG_CONTEXT,
- G_TYPE_INT,
- G_TYPE_INT,
- G_TYPE_UINT);
- et_signals[TABLE_DRAG_DATA_RECEIVED] =
- g_signal_new ("table_drag_data_received",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableClass, table_drag_data_received),
- NULL, NULL,
- e_marshal_NONE__INT_INT_OBJECT_INT_INT_BOXED_UINT_UINT,
- G_TYPE_NONE, 8,
- G_TYPE_INT,
- G_TYPE_INT,
- GDK_TYPE_DRAG_CONTEXT,
- G_TYPE_INT,
- G_TYPE_INT,
- GTK_TYPE_SELECTION_DATA | G_SIGNAL_TYPE_STATIC_SCOPE,
- G_TYPE_UINT,
- G_TYPE_UINT);
-
- g_object_class_install_property (object_class, PROP_LENGTH_THRESHOLD,
- g_param_spec_int ("length_threshold",
- "Length Threshold",
- NULL,
- 0, G_MAXINT, 0,
- G_PARAM_WRITABLE));
-
- g_object_class_install_property (object_class, PROP_UNIFORM_ROW_HEIGHT,
- g_param_spec_boolean ("uniform_row_height",
- "Uniform row height",
- NULL,
- FALSE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_ALWAYS_SEARCH,
- g_param_spec_boolean ("always_search",
- "Always search",
- NULL,
- FALSE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_USE_CLICK_TO_ADD,
- g_param_spec_boolean ("use_click_to_add",
- "Use click to add",
- NULL,
- FALSE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_MODEL,
- g_param_spec_object ("model",
- "Model",
- NULL,
- E_TYPE_TABLE_MODEL,
- G_PARAM_READABLE));
+ et_signals[CURSOR_CHANGE] = g_signal_new (
+ "cursor_change",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETableClass, cursor_change),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__INT,
+ G_TYPE_NONE, 1, G_TYPE_INT);
+
+ et_signals[CURSOR_ACTIVATED] = g_signal_new (
+ "cursor_activated",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETableClass, cursor_activated),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__INT,
+ G_TYPE_NONE, 1, G_TYPE_INT);
+
+ et_signals[SELECTION_CHANGE] = g_signal_new (
+ "selection_change",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETableClass, selection_change),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
+ et_signals[DOUBLE_CLICK] = g_signal_new (
+ "double_click",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETableClass, double_click),
+ NULL, NULL,
+ e_marshal_NONE__INT_INT_BOXED,
+ G_TYPE_NONE, 3,
+ G_TYPE_INT,
+ G_TYPE_INT,
+ GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
+
+ et_signals[RIGHT_CLICK] = g_signal_new (
+ "right_click",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETableClass, right_click),
+ g_signal_accumulator_true_handled, NULL,
+ e_marshal_BOOLEAN__INT_INT_BOXED,
+ G_TYPE_BOOLEAN, 3,
+ G_TYPE_INT,
+ G_TYPE_INT,
+ GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
+
+ et_signals[CLICK] = g_signal_new (
+ "click",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETableClass, click),
+ g_signal_accumulator_true_handled, NULL,
+ e_marshal_BOOLEAN__INT_INT_BOXED,
+ G_TYPE_BOOLEAN, 3,
+ G_TYPE_INT,
+ G_TYPE_INT,
+ GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
+
+ et_signals[KEY_PRESS] = g_signal_new (
+ "key_press",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETableClass, key_press),
+ g_signal_accumulator_true_handled, NULL,
+ e_marshal_BOOLEAN__INT_INT_BOXED,
+ G_TYPE_BOOLEAN, 3,
+ G_TYPE_INT,
+ G_TYPE_INT,
+ GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
+
+ et_signals[START_DRAG] = g_signal_new (
+ "start_drag",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETableClass, start_drag),
+ g_signal_accumulator_true_handled, NULL,
+ e_marshal_BOOLEAN__INT_INT_BOXED,
+ G_TYPE_BOOLEAN, 3,
+ G_TYPE_INT,
+ G_TYPE_INT,
+ GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
+
+ et_signals[STATE_CHANGE] = g_signal_new (
+ "state_change",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETableClass, state_change),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
+ et_signals[WHITE_SPACE_EVENT] = g_signal_new (
+ "white_space_event",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETableClass, white_space_event),
+ g_signal_accumulator_true_handled, NULL,
+ e_marshal_BOOLEAN__BOXED,
+ G_TYPE_BOOLEAN, 1,
+ GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
+
+ et_signals[TABLE_DRAG_BEGIN] = g_signal_new (
+ "table_drag_begin",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETableClass, table_drag_begin),
+ NULL, NULL,
+ e_marshal_NONE__INT_INT_OBJECT,
+ G_TYPE_NONE, 3,
+ G_TYPE_INT,
+ G_TYPE_INT,
+ GDK_TYPE_DRAG_CONTEXT);
+
+ et_signals[TABLE_DRAG_END] = g_signal_new (
+ "table_drag_end",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETableClass, table_drag_end),
+ NULL, NULL,
+ e_marshal_NONE__INT_INT_OBJECT,
+ G_TYPE_NONE, 3,
+ G_TYPE_INT,
+ G_TYPE_INT,
+ GDK_TYPE_DRAG_CONTEXT);
+
+ et_signals[TABLE_DRAG_DATA_GET] = g_signal_new (
+ "table_drag_data_get",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETableClass, table_drag_data_get),
+ NULL, NULL,
+ e_marshal_NONE__INT_INT_OBJECT_BOXED_UINT_UINT,
+ G_TYPE_NONE, 6,
+ G_TYPE_INT,
+ G_TYPE_INT,
+ GDK_TYPE_DRAG_CONTEXT,
+ GTK_TYPE_SELECTION_DATA | G_SIGNAL_TYPE_STATIC_SCOPE,
+ G_TYPE_UINT,
+ G_TYPE_UINT);
+
+ et_signals[TABLE_DRAG_DATA_DELETE] = g_signal_new (
+ "table_drag_data_delete",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETableClass, table_drag_data_delete),
+ NULL, NULL,
+ e_marshal_NONE__INT_INT_OBJECT,
+ G_TYPE_NONE, 3,
+ G_TYPE_INT,
+ G_TYPE_INT,
+ GDK_TYPE_DRAG_CONTEXT);
+
+ et_signals[TABLE_DRAG_LEAVE] = g_signal_new (
+ "table_drag_leave",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETableClass, table_drag_leave),
+ NULL, NULL,
+ e_marshal_NONE__INT_INT_OBJECT_UINT,
+ G_TYPE_NONE, 4,
+ G_TYPE_INT,
+ G_TYPE_INT,
+ GDK_TYPE_DRAG_CONTEXT,
+ G_TYPE_UINT);
+
+ et_signals[TABLE_DRAG_MOTION] = g_signal_new (
+ "table_drag_motion",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETableClass, table_drag_motion),
+ NULL, NULL,
+ e_marshal_BOOLEAN__INT_INT_OBJECT_INT_INT_UINT,
+ G_TYPE_BOOLEAN, 6,
+ G_TYPE_INT,
+ G_TYPE_INT,
+ GDK_TYPE_DRAG_CONTEXT,
+ G_TYPE_INT,
+ G_TYPE_INT,
+ G_TYPE_UINT);
+
+ et_signals[TABLE_DRAG_DROP] = g_signal_new (
+ "table_drag_drop",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETableClass, table_drag_drop),
+ NULL, NULL,
+ e_marshal_BOOLEAN__INT_INT_OBJECT_INT_INT_UINT,
+ G_TYPE_BOOLEAN, 6,
+ G_TYPE_INT,
+ G_TYPE_INT,
+ GDK_TYPE_DRAG_CONTEXT,
+ G_TYPE_INT,
+ G_TYPE_INT,
+ G_TYPE_UINT);
+
+ et_signals[TABLE_DRAG_DATA_RECEIVED] = g_signal_new (
+ "table_drag_data_received",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETableClass, table_drag_data_received),
+ NULL, NULL,
+ e_marshal_NONE__INT_INT_OBJECT_INT_INT_BOXED_UINT_UINT,
+ G_TYPE_NONE, 8,
+ G_TYPE_INT,
+ G_TYPE_INT,
+ GDK_TYPE_DRAG_CONTEXT,
+ G_TYPE_INT,
+ G_TYPE_INT,
+ GTK_TYPE_SELECTION_DATA | G_SIGNAL_TYPE_STATIC_SCOPE,
+ G_TYPE_UINT,
+ G_TYPE_UINT);
+
+ g_object_class_install_property (
+ object_class,
+ PROP_LENGTH_THRESHOLD,
+ g_param_spec_int (
+ "length_threshold",
+ "Length Threshold",
+ NULL,
+ 0, G_MAXINT, 0,
+ G_PARAM_WRITABLE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_UNIFORM_ROW_HEIGHT,
+ g_param_spec_boolean (
+ "uniform_row_height",
+ "Uniform row height",
+ NULL,
+ FALSE,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_ALWAYS_SEARCH,
+ g_param_spec_boolean (
+ "always_search",
+ "Always search",
+ NULL,
+ FALSE,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_USE_CLICK_TO_ADD,
+ g_param_spec_boolean (
+ "use_click_to_add",
+ "Use click to add",
+ NULL,
+ FALSE,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_MODEL,
+ g_param_spec_object (
+ "model",
+ "Model",
+ NULL,
+ E_TYPE_TABLE_MODEL,
+ G_PARAM_READABLE));
gtk_widget_class_install_style_property (
widget_class,
diff --git a/widgets/table/e-tree-memory.c b/widgets/table/e-tree-memory.c
index 4f279aabb9..1b1bb9b2ba 100644
--- a/widgets/table/e-tree-memory.c
+++ b/widgets/table/e-tree-memory.c
@@ -39,6 +39,10 @@
#include "e-tree-memory.h"
+#define E_TREE_MEMORY_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_TREE_MEMORY, ETreeMemoryPrivate))
+
G_DEFINE_TYPE (ETreeMemory, e_tree_memory, E_TYPE_TREE_MODEL)
enum {
@@ -216,7 +220,7 @@ etmm_dispose (GObject *object)
{
ETreeMemoryPrivate *priv;
- priv = E_TREE_MEMORY (object)->priv;
+ priv = E_TREE_MEMORY_GET_PRIVATE (object);
if (priv->root)
e_tree_memory_node_remove (
@@ -401,8 +405,7 @@ e_tree_memory_class_init (ETreeMemoryClass *class)
static void
e_tree_memory_init (ETreeMemory *etmm)
{
- etmm->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- etmm, E_TYPE_TREE_MEMORY, ETreeMemoryPrivate);
+ etmm->priv = E_TREE_MEMORY_GET_PRIVATE (etmm);
}
/**
diff --git a/widgets/table/e-tree-model.c b/widgets/table/e-tree-model.c
index 24221418c0..9bed842a35 100644
--- a/widgets/table/e-tree-model.c
+++ b/widgets/table/e-tree-model.c
@@ -59,14 +59,14 @@ enum {
LAST_SIGNAL
};
-static guint e_tree_model_signals[LAST_SIGNAL] = {0, };
+static guint signals[LAST_SIGNAL] = {0, };
static void
e_tree_model_class_init (ETreeModelClass *class)
{
GObjectClass *object_class = G_OBJECT_CLASS (class);
- e_tree_model_signals[PRE_CHANGE] =
+ signals[PRE_CHANGE] =
g_signal_new ("pre_change",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
@@ -75,7 +75,7 @@ e_tree_model_class_init (ETreeModelClass *class)
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
- e_tree_model_signals[NO_CHANGE] =
+ signals[NO_CHANGE] =
g_signal_new ("no_change",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
@@ -84,7 +84,7 @@ e_tree_model_class_init (ETreeModelClass *class)
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
- e_tree_model_signals[REBUILT] =
+ signals[REBUILT] =
g_signal_new ("rebuilt",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
@@ -93,7 +93,7 @@ e_tree_model_class_init (ETreeModelClass *class)
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
- e_tree_model_signals[NODE_CHANGED] =
+ signals[NODE_CHANGED] =
g_signal_new ("node_changed",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
@@ -102,7 +102,7 @@ e_tree_model_class_init (ETreeModelClass *class)
g_cclosure_marshal_VOID__POINTER,
G_TYPE_NONE, 1, G_TYPE_POINTER);
- e_tree_model_signals[NODE_DATA_CHANGED] =
+ signals[NODE_DATA_CHANGED] =
g_signal_new ("node_data_changed",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
@@ -111,7 +111,7 @@ e_tree_model_class_init (ETreeModelClass *class)
g_cclosure_marshal_VOID__POINTER,
G_TYPE_NONE, 1, G_TYPE_POINTER);
- e_tree_model_signals[NODE_COL_CHANGED] =
+ signals[NODE_COL_CHANGED] =
g_signal_new ("node_col_changed",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
@@ -120,7 +120,7 @@ e_tree_model_class_init (ETreeModelClass *class)
e_marshal_VOID__POINTER_INT,
G_TYPE_NONE, 2, G_TYPE_POINTER, G_TYPE_INT);
- e_tree_model_signals[NODE_INSERTED] =
+ signals[NODE_INSERTED] =
g_signal_new ("node_inserted",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
@@ -129,7 +129,7 @@ e_tree_model_class_init (ETreeModelClass *class)
e_marshal_VOID__POINTER_POINTER,
G_TYPE_NONE, 2, G_TYPE_POINTER, G_TYPE_POINTER);
- e_tree_model_signals[NODE_REMOVED] =
+ signals[NODE_REMOVED] =
g_signal_new ("node_removed",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
@@ -138,7 +138,7 @@ e_tree_model_class_init (ETreeModelClass *class)
e_marshal_VOID__POINTER_POINTER_INT,
G_TYPE_NONE, 3, G_TYPE_POINTER, G_TYPE_POINTER, G_TYPE_INT);
- e_tree_model_signals[NODE_DELETED] =
+ signals[NODE_DELETED] =
g_signal_new ("node_deleted",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
@@ -147,7 +147,7 @@ e_tree_model_class_init (ETreeModelClass *class)
g_cclosure_marshal_VOID__POINTER,
G_TYPE_NONE, 1, G_TYPE_POINTER);
- e_tree_model_signals[NODE_REQUEST_COLLAPSE] =
+ signals[NODE_REQUEST_COLLAPSE] =
g_signal_new ("node_request_collapse",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
@@ -224,12 +224,9 @@ e_tree_model_init (ETreeModel *tree_model)
void
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));
- d(g_print("Emitting pre_change on model 0x%p, a %s.\n", tree_model, g_type_name (G_OBJECT(tree_model)->class->type)));
-
- g_signal_emit (G_OBJECT (tree_model), e_tree_model_signals[PRE_CHANGE], 0);
+ g_signal_emit (tree_model, signals[PRE_CHANGE], 0);
}
/**
@@ -244,12 +241,9 @@ e_tree_model_pre_change (ETreeModel *tree_model)
void
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));
- d(g_print("Emitting no_change on model 0x%p, a %s.\n", tree_model, g_type_name (G_OBJECT(tree_model)->class->type)));
-
- g_signal_emit (G_OBJECT (tree_model), e_tree_model_signals[NO_CHANGE], 0);
+ g_signal_emit (tree_model, signals[NO_CHANGE], 0);
}
/**
@@ -264,12 +258,9 @@ e_tree_model_no_change (ETreeModel *tree_model)
void
e_tree_model_rebuilt (ETreeModel *tree_model)
{
- g_return_if_fail (tree_model != NULL);
g_return_if_fail (E_IS_TREE_MODEL (tree_model));
- d(g_print("Emitting rebuilt on model 0x%p, a %s.\n", tree_model, g_type_name (G_OBJECT(tree_model)->class->type)));
-
- g_signal_emit (G_OBJECT (tree_model), e_tree_model_signals[REBUILT], 0);
+ g_signal_emit (tree_model, signals[REBUILT], 0);
}
/**
* e_tree_model_node_changed:
@@ -284,12 +275,9 @@ void
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));
- d(g_print("Emitting node_changed on model 0x%p, a %s.\n", tree_model, g_type_name (G_OBJECT(tree_model)->class->type)));
-
- g_signal_emit (G_OBJECT (tree_model), e_tree_model_signals[NODE_CHANGED], 0, node);
+ g_signal_emit (tree_model, signals[NODE_CHANGED], 0, node);
}
/**
@@ -305,12 +293,9 @@ void
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));
- d(g_print("Emitting node_data_changed on model 0x%p, a %s.\n", tree_model, g_type_name (G_OBJECT(tree_model)->class->type)));
-
- g_signal_emit (G_OBJECT (tree_model), e_tree_model_signals[NODE_DATA_CHANGED], 0, node);
+ g_signal_emit (tree_model, signals[NODE_DATA_CHANGED], 0, node);
}
/**
@@ -327,12 +312,9 @@ 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));
- d(g_print("Emitting node_col_changed on model 0x%p, a %s.\n", tree_model, g_type_name (G_OBJECT(tree_model)->class->type)));
-
- g_signal_emit (G_OBJECT (tree_model), e_tree_model_signals[NODE_COL_CHANGED], 0, node, col);
+ g_signal_emit (tree_model, signals[NODE_COL_CHANGED], 0, node, col);
}
/**
@@ -348,13 +330,11 @@ e_tree_model_node_inserted (ETreeModel *tree_model,
ETreePath parent_node,
ETreePath inserted_node)
{
- g_return_if_fail (tree_model != NULL);
g_return_if_fail (E_IS_TREE_MODEL (tree_model));
- d(g_print("Emitting node_inserted on model 0x%p, a %s.\n", tree_model, g_type_name (G_OBJECT(tree_model)->class->type)));
-
- g_signal_emit (G_OBJECT (tree_model), e_tree_model_signals[NODE_INSERTED], 0,
- parent_node, inserted_node);
+ g_signal_emit (
+ tree_model, signals[NODE_INSERTED], 0,
+ parent_node, inserted_node);
}
/**
@@ -371,13 +351,11 @@ e_tree_model_node_removed (ETreeModel *tree_model,
ETreePath removed_node,
gint old_position)
{
- g_return_if_fail (tree_model != NULL);
g_return_if_fail (E_IS_TREE_MODEL (tree_model));
- d(g_print("Emitting node_removed on model 0x%p, a %s.\n", tree_model, g_type_name (G_OBJECT(tree_model)->class->type)));
-
- g_signal_emit (G_OBJECT (tree_model), e_tree_model_signals[NODE_REMOVED], 0,
- parent_node, removed_node, old_position);
+ g_signal_emit (
+ tree_model, signals[NODE_REMOVED], 0,
+ parent_node, removed_node, old_position);
}
/**
@@ -391,12 +369,9 @@ void
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));
- d(g_print("Emitting node_deleted on model 0x%p, a %s.\n", tree_model, g_type_name (G_OBJECT(tree_model)->class->type)));
-
- g_signal_emit (G_OBJECT (tree_model), e_tree_model_signals[NODE_DELETED], 0, deleted_node);
+ g_signal_emit (tree_model, signals[NODE_DELETED], 0, deleted_node);
}
/**
@@ -410,12 +385,9 @@ void
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));
- d(g_print("Emitting node_request_collapse on model 0x%p, a %s.\n", tree_model, g_type_name (G_OBJECT(tree_model)->class->type)));
-
- g_signal_emit (G_OBJECT (tree_model), e_tree_model_signals[NODE_REQUEST_COLLAPSE], 0, collapsed_node);
+ g_signal_emit (tree_model, signals[NODE_REQUEST_COLLAPSE], 0, collapsed_node);
}
/**
@@ -442,7 +414,6 @@ e_tree_model_new (void)
ETreePath
e_tree_model_get_root (ETreeModel *etree)
{
- g_return_val_if_fail (etree != NULL, NULL);
g_return_val_if_fail (E_IS_TREE_MODEL (etree), NULL);
if (ETM_CLASS (etree)->get_root)
@@ -464,7 +435,8 @@ ETreePath
e_tree_model_node_get_parent (ETreeModel *etree,
ETreePath node)
{
- g_return_val_if_fail (etree != NULL, NULL);
+ g_return_val_if_fail (E_IS_TREE_MODEL (etree), NULL);
+
if (ETM_CLASS (etree)->get_parent)
return ETM_CLASS (etree)->get_parent (etree, node);
else
@@ -484,7 +456,6 @@ ETreePath
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);
if (ETM_CLASS (etree)->get_first_child)
@@ -506,7 +477,6 @@ ETreePath
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);
if (ETM_CLASS (etree)->get_last_child)
@@ -528,7 +498,6 @@ ETreePath
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);
if (ETM_CLASS (etree)->get_next)
@@ -550,7 +519,6 @@ ETreePath
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);
if (ETM_CLASS (etree)->get_prev)
@@ -627,7 +595,6 @@ guint
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);
if (ETM_CLASS (etree)->depth)
@@ -649,7 +616,6 @@ GdkPixbuf *
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);
if (ETM_CLASS (etree)->icon_at)
@@ -669,7 +635,6 @@ e_tree_model_icon_at (ETreeModel *etree,
gboolean
e_tree_model_get_expanded_default (ETreeModel *etree)
{
- g_return_val_if_fail (etree != NULL, FALSE);
g_return_val_if_fail (E_IS_TREE_MODEL (etree), FALSE);
if (ETM_CLASS (etree)->get_expanded_default)
@@ -689,7 +654,6 @@ e_tree_model_get_expanded_default (ETreeModel *etree)
gint
e_tree_model_column_count (ETreeModel *etree)
{
- g_return_val_if_fail (etree != NULL, 0);
g_return_val_if_fail (E_IS_TREE_MODEL (etree), 0);
if (ETM_CLASS (etree)->column_count)
@@ -709,7 +673,6 @@ e_tree_model_column_count (ETreeModel *etree)
gboolean
e_tree_model_has_save_id (ETreeModel *etree)
{
- g_return_val_if_fail (etree != NULL, FALSE);
g_return_val_if_fail (E_IS_TREE_MODEL (etree), FALSE);
if (ETM_CLASS (etree)->has_save_id)
@@ -731,7 +694,6 @@ gchar *
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);
if (ETM_CLASS (etree)->get_save_id)
@@ -751,7 +713,6 @@ e_tree_model_get_save_id (ETreeModel *etree,
gboolean
e_tree_model_has_get_node_by_id (ETreeModel *etree)
{
- g_return_val_if_fail (etree != NULL, FALSE);
g_return_val_if_fail (E_IS_TREE_MODEL (etree), FALSE);
if (ETM_CLASS (etree)->has_get_node_by_id)
@@ -776,7 +737,6 @@ ETreePath
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);
if (ETM_CLASS (etree)->get_node_by_id)
@@ -796,7 +756,6 @@ e_tree_model_get_node_by_id (ETreeModel *etree,
gboolean
e_tree_model_has_change_pending (ETreeModel *etree)
{
- g_return_val_if_fail (etree != NULL, FALSE);
g_return_val_if_fail (E_IS_TREE_MODEL (etree), FALSE);
if (ETM_CLASS (etree)->has_change_pending)
@@ -830,7 +789,6 @@ 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);
if (ETM_CLASS (etree)->sort_value_at)
@@ -863,7 +821,6 @@ 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);
if (ETM_CLASS (etree)->value_at)
@@ -878,7 +835,6 @@ e_tree_model_set_value_at (ETreeModel *etree,
gint col,
gconstpointer val)
{
- g_return_if_fail (etree != NULL);
g_return_if_fail (E_IS_TREE_MODEL (etree));
if (ETM_CLASS (etree)->set_value_at)
@@ -1031,7 +987,6 @@ e_tree_model_node_traverse (ETreeModel *model,
{
ETreePath child;
- g_return_if_fail (model != NULL);
g_return_if_fail (E_IS_TREE_MODEL (model));
g_return_if_fail (path != NULL);
@@ -1066,7 +1021,6 @@ e_tree_model_node_traverse_preorder (ETreeModel *model,
{
ETreePath child;
- g_return_if_fail (model != NULL);
g_return_if_fail (E_IS_TREE_MODEL (model));
g_return_if_fail (path != NULL);
@@ -1104,7 +1058,6 @@ e_tree_model_node_real_traverse (ETreeModel *model,
{
ETreePath child;
- g_return_val_if_fail (model != NULL, NULL);
g_return_val_if_fail (E_IS_TREE_MODEL (model), NULL);
g_return_val_if_fail (path != NULL, NULL);
@@ -1119,7 +1072,9 @@ e_tree_model_node_real_traverse (ETreeModel *model,
if (forward_direction && (child == end_path || func (model, child, data)))
return child;
- if ((result = e_tree_model_node_real_traverse (model, child, end_path, forward_direction, func, data)))
+ if ((result = e_tree_model_node_real_traverse (
+ model, child, end_path,
+ forward_direction, func, data)))
return result;
if (!forward_direction && (child == end_path || func (model, child, data)))
@@ -1153,7 +1108,6 @@ e_tree_model_node_find (ETreeModel *model,
ETreePath result;
ETreePath next;
- g_return_val_if_fail (model != NULL, NULL);
g_return_val_if_fail (E_IS_TREE_MODEL (model), NULL);
/* Just search the whole tree in this case. */
@@ -1164,7 +1118,9 @@ e_tree_model_node_find (ETreeModel *model,
if (forward_direction && (end_path == root || func (model, root, data)))
return root;
- if ((result = e_tree_model_node_real_traverse (model, root, end_path, forward_direction, func, data)))
+ result = e_tree_model_node_real_traverse (
+ model, root, end_path, forward_direction, func, data);
+ if (result)
return result;
if (!forward_direction && (end_path == root || func (model, root, data)))
@@ -1176,12 +1132,16 @@ e_tree_model_node_find (ETreeModel *model,
while (1) {
if (forward_direction) {
- if ((result = e_tree_model_node_real_traverse (model, path, end_path, forward_direction, func, data)))
+ if ((result = e_tree_model_node_real_traverse (
+ model, path, end_path,
+ forward_direction, func, data)))
return result;
next = e_tree_model_node_get_next (model, path);
} else {
next = e_tree_model_node_get_prev (model, path);
- if (next && (result = e_tree_model_node_real_traverse (model, next, end_path, forward_direction, func, data)))
+ if (next && (result = e_tree_model_node_real_traverse (
+ model, next, end_path,
+ forward_direction, func, data)))
return result;
}
diff --git a/widgets/table/e-tree-selection-model.c b/widgets/table/e-tree-selection-model.c
index 9d04086b2f..33e4ab0780 100644
--- a/widgets/table/e-tree-selection-model.c
+++ b/widgets/table/e-tree-selection-model.c
@@ -31,6 +31,10 @@
#include "e-tree-selection-model.h"
+#define E_TREE_SELECTION_MODEL_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_TREE_SELECTION_MODEL, ETreeSelectionModelPrivate))
+
G_DEFINE_TYPE (
ETreeSelectionModel, e_tree_selection_model, E_TYPE_SELECTION_MODEL)
@@ -66,7 +70,8 @@ static gint
get_cursor_row (ETreeSelectionModel *etsm)
{
if (etsm->priv->cursor_path)
- return e_tree_table_adapter_row_of_node (etsm->priv->etta, etsm->priv->cursor_path);
+ return e_tree_table_adapter_row_of_node (
+ etsm->priv->etta, etsm->priv->cursor_path);
return -1;
}
@@ -137,7 +142,8 @@ restore_cursor (ETreeSelectionModel *etsm,
etsm->priv->cursor_path = NULL;
if (etsm->priv->cursor_save_id) {
- etsm->priv->cursor_path = e_tree_model_get_node_by_id (etm, etsm->priv->cursor_save_id);
+ etsm->priv->cursor_path = e_tree_model_get_node_by_id (
+ etm, etsm->priv->cursor_save_id);
if (etsm->priv->cursor_path != NULL && etsm->priv->cursor_col == -1)
etsm->priv->cursor_col = 0;
@@ -148,10 +154,14 @@ restore_cursor (ETreeSelectionModel *etsm,
if (etsm->priv->cursor_path) {
gint cursor_row = get_cursor_row (etsm);
- e_selection_model_cursor_changed (E_SELECTION_MODEL (etsm), cursor_row, etsm->priv->cursor_col);
+ e_selection_model_cursor_changed (
+ E_SELECTION_MODEL (etsm),
+ cursor_row, etsm->priv->cursor_col);
} else {
- e_selection_model_cursor_changed (E_SELECTION_MODEL (etsm), -1, -1);
- e_selection_model_cursor_activated (E_SELECTION_MODEL (etsm), -1, -1);
+ e_selection_model_cursor_changed (
+ E_SELECTION_MODEL (etsm), -1, -1);
+ e_selection_model_cursor_activated (
+ E_SELECTION_MODEL (etsm), -1, -1);
}
@@ -165,8 +175,11 @@ etsm_pre_change (ETreeModel *etm,
g_free (etsm->priv->cursor_save_id);
etsm->priv->cursor_save_id = NULL;
- if (e_tree_model_has_get_node_by_id (etm) && e_tree_model_has_save_id (etm) && etsm->priv->cursor_path) {
- etsm->priv->cursor_save_id = e_tree_model_get_save_id (etm, etsm->priv->cursor_path);
+ if (e_tree_model_has_get_node_by_id (etm) &&
+ e_tree_model_has_save_id (etm) &&
+ etsm->priv->cursor_path) {
+ etsm->priv->cursor_save_id = e_tree_model_get_save_id (
+ etm, etsm->priv->cursor_path);
}
}
@@ -241,22 +254,38 @@ add_model (ETreeSelectionModel *etsm,
return;
g_object_ref (priv->model);
- priv->tree_model_pre_change_id = g_signal_connect_after (G_OBJECT (priv->model), "pre_change",
- G_CALLBACK (etsm_pre_change), etsm);
- priv->tree_model_no_change_id = g_signal_connect_after (G_OBJECT (priv->model), "no_change",
- G_CALLBACK (etsm_no_change), etsm);
- priv->tree_model_node_changed_id = g_signal_connect_after (G_OBJECT (priv->model), "node_changed",
- G_CALLBACK (etsm_node_changed), etsm);
- priv->tree_model_node_data_changed_id = g_signal_connect_after (G_OBJECT (priv->model), "node_data_changed",
- G_CALLBACK (etsm_node_data_changed), etsm);
- priv->tree_model_node_col_changed_id = g_signal_connect_after (G_OBJECT (priv->model), "node_col_changed",
- G_CALLBACK (etsm_node_col_changed), etsm);
- priv->tree_model_node_inserted_id = g_signal_connect_after (G_OBJECT (priv->model), "node_inserted",
- G_CALLBACK (etsm_node_inserted), etsm);
- priv->tree_model_node_removed_id = g_signal_connect_after (G_OBJECT (priv->model), "node_removed",
- G_CALLBACK (etsm_node_removed), etsm);
- priv->tree_model_node_deleted_id = g_signal_connect_after (G_OBJECT (priv->model), "node_deleted",
- G_CALLBACK (etsm_node_deleted), etsm);
+
+ priv->tree_model_pre_change_id = g_signal_connect_after (
+ priv->model, "pre_change",
+ G_CALLBACK (etsm_pre_change), etsm);
+
+ priv->tree_model_no_change_id = g_signal_connect_after (
+ priv->model, "no_change",
+ G_CALLBACK (etsm_no_change), etsm);
+
+ priv->tree_model_node_changed_id = g_signal_connect_after (
+ priv->model, "node_changed",
+ G_CALLBACK (etsm_node_changed), etsm);
+
+ priv->tree_model_node_data_changed_id = g_signal_connect_after (
+ priv->model, "node_data_changed",
+ G_CALLBACK (etsm_node_data_changed), etsm);
+
+ priv->tree_model_node_col_changed_id = g_signal_connect_after (
+ priv->model, "node_col_changed",
+ G_CALLBACK (etsm_node_col_changed), etsm);
+
+ priv->tree_model_node_inserted_id = g_signal_connect_after (
+ priv->model, "node_inserted",
+ G_CALLBACK (etsm_node_inserted), etsm);
+
+ priv->tree_model_node_removed_id = g_signal_connect_after (
+ priv->model, "node_removed",
+ G_CALLBACK (etsm_node_removed), etsm);
+
+ priv->tree_model_node_deleted_id = g_signal_connect_after (
+ priv->model, "node_deleted",
+ G_CALLBACK (etsm_node_deleted), etsm);
}
static void
@@ -267,22 +296,22 @@ drop_model (ETreeSelectionModel *etsm)
if (!priv->model)
return;
- g_signal_handler_disconnect (G_OBJECT (priv->model),
- priv->tree_model_pre_change_id);
- g_signal_handler_disconnect (G_OBJECT (priv->model),
- priv->tree_model_no_change_id);
- g_signal_handler_disconnect (G_OBJECT (priv->model),
- priv->tree_model_node_changed_id);
- g_signal_handler_disconnect (G_OBJECT (priv->model),
- priv->tree_model_node_data_changed_id);
- g_signal_handler_disconnect (G_OBJECT (priv->model),
- priv->tree_model_node_col_changed_id);
- g_signal_handler_disconnect (G_OBJECT (priv->model),
- priv->tree_model_node_inserted_id);
- g_signal_handler_disconnect (G_OBJECT (priv->model),
- priv->tree_model_node_removed_id);
- g_signal_handler_disconnect (G_OBJECT (priv->model),
- priv->tree_model_node_deleted_id);
+ g_signal_handler_disconnect (
+ priv->model, priv->tree_model_pre_change_id);
+ g_signal_handler_disconnect (
+ priv->model, priv->tree_model_no_change_id);
+ g_signal_handler_disconnect (
+ priv->model, priv->tree_model_node_changed_id);
+ g_signal_handler_disconnect (
+ priv->model, priv->tree_model_node_data_changed_id);
+ g_signal_handler_disconnect (
+ priv->model, priv->tree_model_node_col_changed_id);
+ g_signal_handler_disconnect (
+ priv->model, priv->tree_model_node_inserted_id);
+ g_signal_handler_disconnect (
+ priv->model, priv->tree_model_node_removed_id);
+ g_signal_handler_disconnect (
+ priv->model, priv->tree_model_node_deleted_id);
g_object_unref (priv->model);
priv->model = NULL;
@@ -313,7 +342,7 @@ etsm_finalize (GObject *object)
{
ETreeSelectionModelPrivate *priv;
- priv = E_TREE_SELECTION_MODEL (object)->priv;
+ priv = E_TREE_SELECTION_MODEL_GET_PRIVATE (object);
clear_selection (E_TREE_SELECTION_MODEL (object));
g_hash_table_destroy (priv->paths);
@@ -360,11 +389,15 @@ etsm_set_property (GObject *object,
switch (property_id) {
case PROP_CURSOR_ROW:
- e_selection_model_do_something (esm, g_value_get_int (value), etsm->priv->cursor_col, 0);
+ e_selection_model_do_something (
+ esm, g_value_get_int (value),
+ etsm->priv->cursor_col, 0);
break;
case PROP_CURSOR_COL:
- e_selection_model_do_something (esm, get_cursor_row (etsm), g_value_get_int (value), 0);
+ e_selection_model_do_something (
+ esm, get_cursor_row (etsm),
+ g_value_get_int (value), 0);
break;
case PROP_MODEL:
@@ -373,7 +406,8 @@ etsm_set_property (GObject *object,
break;
case PROP_ETTA:
- etsm->priv->etta = E_TREE_TABLE_ADAPTER (g_value_get_object (value));
+ etsm->priv->etta =
+ E_TREE_TABLE_ADAPTER (g_value_get_object (value));
break;
}
}
@@ -404,7 +438,9 @@ etsm_is_row_selected (ESelectionModel *selection,
ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL (selection);
ETreePath path;
- g_return_val_if_fail (row < e_table_model_row_count (E_TABLE_MODEL (etsm->priv->etta)), FALSE);
+ g_return_val_if_fail (
+ row < e_table_model_row_count (
+ E_TABLE_MODEL (etsm->priv->etta)), FALSE);
g_return_val_if_fail (row >= 0, FALSE);
g_return_val_if_fail (etsm != NULL, FALSE);
@@ -425,7 +461,8 @@ etsm_row_foreach_cb (gpointer key,
{
ETreePath path = key;
ModelAndCallback *mac = user_data;
- gint row = e_tree_table_adapter_row_of_node (mac->etsm->priv->etta, path);
+ gint row = e_tree_table_adapter_row_of_node (
+ mac->etsm->priv->etta, path);
if (row >= 0)
mac->callback (row, mac->closure);
}
@@ -516,10 +553,14 @@ etsm_select_all (ESelectionModel *selection)
select_range (etsm, 0, etsm_row_count (selection) - 1);
if (etsm->priv->cursor_path == NULL)
- etsm->priv->cursor_path = e_tree_table_adapter_node_at_row (etsm->priv->etta, 0);
+ etsm->priv->cursor_path = e_tree_table_adapter_node_at_row (
+ etsm->priv->etta, 0);
e_selection_model_selection_changed (E_SELECTION_MODEL (etsm));
- e_selection_model_cursor_changed (E_SELECTION_MODEL (etsm), get_cursor_row (etsm), etsm->priv->cursor_col);
+
+ e_selection_model_cursor_changed (
+ E_SELECTION_MODEL (etsm),
+ get_cursor_row (etsm), etsm->priv->cursor_col);
}
/**
@@ -537,7 +578,9 @@ etsm_invert_selection (ESelectionModel *selection)
gint i;
for (i = 0; i < count; i++) {
- ETreePath path = e_tree_table_adapter_node_at_row (etsm->priv->etta, i);
+ ETreePath path;
+
+ path = e_tree_table_adapter_node_at_row (etsm->priv->etta, i);
if (!path)
continue;
if (g_hash_table_lookup (etsm->priv->paths, path))
@@ -561,7 +604,9 @@ etsm_change_one_row (ESelectionModel *selection,
ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL (selection);
ETreePath path;
- g_return_if_fail (row < e_table_model_row_count (E_TABLE_MODEL (etsm->priv->etta)));
+ g_return_if_fail (
+ row < e_table_model_row_count (
+ E_TABLE_MODEL (etsm->priv->etta)));
g_return_if_fail (row >= 0);
g_return_if_fail (selection != NULL);
@@ -588,7 +633,9 @@ etsm_change_cursor (ESelectionModel *selection,
if (row == -1) {
etsm->priv->cursor_path = NULL;
} else {
- etsm->priv->cursor_path = e_tree_table_adapter_node_at_row (etsm->priv->etta, row);
+ etsm->priv->cursor_path =
+ e_tree_table_adapter_node_at_row (
+ etsm->priv->etta, row);
}
etsm->priv->cursor_col = col;
}
@@ -621,9 +668,10 @@ 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);
+ ETreePath path;
gint rows[5], *rowp = NULL, size;
+ path = e_tree_table_adapter_node_at_row (etsm->priv->etta, row);
g_return_if_fail (path != NULL);
/* we really only care about the size=1 case (cursor changed),
@@ -643,9 +691,11 @@ etsm_select_single_row (ESelectionModel *selection,
gint *p = rows;
while (p < rowp)
- e_selection_model_selection_row_changed ((ESelectionModel *) etsm, *p++);
+ e_selection_model_selection_row_changed (
+ (ESelectionModel *) etsm, *p++);
}
- e_selection_model_selection_row_changed ((ESelectionModel *) etsm, row);
+ e_selection_model_selection_row_changed (
+ (ESelectionModel *) etsm, row);
}
}
@@ -654,8 +704,9 @@ etsm_toggle_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);
+ ETreePath path;
+ path = e_tree_table_adapter_node_at_row (etsm->priv->etta, row);
g_return_if_fail (path);
if (g_hash_table_lookup (etsm->priv->paths, path))
@@ -672,12 +723,14 @@ static void
etsm_real_move_selection_end (ETreeSelectionModel *etsm,
gint row)
{
- ETreePath end_path = e_tree_table_adapter_node_at_row (etsm->priv->etta, row);
+ ETreePath end_path;
gint start;
+ end_path = e_tree_table_adapter_node_at_row (etsm->priv->etta, row);
g_return_if_fail (end_path);
- start = e_tree_table_adapter_row_of_node (etsm->priv->etta, etsm->priv->start_path);
+ start = e_tree_table_adapter_row_of_node (
+ etsm->priv->etta, etsm->priv->start_path);
clear_selection (etsm);
select_range (etsm, start, row);
}
@@ -782,8 +835,10 @@ e_tree_selection_model_change_cursor (ETreeSelectionModel *etsm,
E_SELECTION_MODEL (etsm)->old_selection = -1;
- e_selection_model_cursor_changed (E_SELECTION_MODEL (etsm), row, etsm->priv->cursor_col);
- e_selection_model_cursor_activated (E_SELECTION_MODEL (etsm), row, etsm->priv->cursor_col);
+ e_selection_model_cursor_changed (
+ E_SELECTION_MODEL (etsm), row, etsm->priv->cursor_col);
+ e_selection_model_cursor_activated (
+ E_SELECTION_MODEL (etsm), row, etsm->priv->cursor_col);
}
ETreePath
@@ -795,8 +850,7 @@ e_tree_selection_model_get_cursor (ETreeSelectionModel *etsm)
static void
e_tree_selection_model_init (ETreeSelectionModel *etsm)
{
- etsm->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- etsm, E_TYPE_TREE_SELECTION_MODEL, ETreeSelectionModelPrivate);
+ etsm->priv = E_TREE_SELECTION_MODEL_GET_PRIVATE (etsm);
etsm->priv->paths = g_hash_table_new (NULL, NULL);
etsm->priv->cursor_col = -1;
@@ -835,33 +889,45 @@ e_tree_selection_model_class_init (ETreeSelectionModelClass *class)
esm_class->move_selection_end = etsm_move_selection_end;
esm_class->set_selection_end = etsm_set_selection_end;
- g_object_class_install_property (object_class, PROP_CURSOR_ROW,
- g_param_spec_int ("cursor_row",
- "Cursor Row",
- NULL,
- 0, G_MAXINT, 0,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_CURSOR_COL,
- g_param_spec_int ("cursor_col",
- "Cursor Column",
- NULL,
- 0, G_MAXINT, 0,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_MODEL,
- g_param_spec_object ("model",
- "Model",
- NULL,
- E_TYPE_TREE_MODEL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_ETTA,
- g_param_spec_object ("etta",
- "ETTA",
- NULL,
- E_TYPE_TREE_TABLE_ADAPTER,
- G_PARAM_READWRITE));
+ g_object_class_install_property (
+ object_class,
+ PROP_CURSOR_ROW,
+ g_param_spec_int (
+ "cursor_row",
+ "Cursor Row",
+ NULL,
+ 0, G_MAXINT, 0,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_CURSOR_COL,
+ g_param_spec_int (
+ "cursor_col",
+ "Cursor Column",
+ NULL,
+ 0, G_MAXINT, 0,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_MODEL,
+ g_param_spec_object (
+ "model",
+ "Model",
+ NULL,
+ E_TYPE_TREE_MODEL,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_ETTA,
+ g_param_spec_object (
+ "etta",
+ "ETTA",
+ NULL,
+ E_TYPE_TREE_TABLE_ADAPTER,
+ G_PARAM_READWRITE));
}
diff --git a/widgets/table/e-tree-sorted.c b/widgets/table/e-tree-sorted.c
index 4d95fcc74b..eee9414d2a 100644
--- a/widgets/table/e-tree-sorted.c
+++ b/widgets/table/e-tree-sorted.c
@@ -50,6 +50,10 @@
#define d(x)
+#define E_TREE_SORTED_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_TREE_SORTED, ETreeSortedPrivate))
+
G_DEFINE_TYPE (ETreeSorted, e_tree_sorted, E_TYPE_TREE_MODEL)
enum {
@@ -600,7 +604,7 @@ ets_dispose (GObject *object)
{
ETreeSortedPrivate *priv;
- priv = E_TREE_SORTED (object)->priv;
+ priv = E_TREE_SORTED_GET_PRIVATE (object);
if (priv->source) {
g_signal_handler_disconnect (
@@ -666,7 +670,7 @@ ets_finalize (GObject *object)
{
ETreeSortedPrivate *priv;
- priv = E_TREE_SORTED (object)->priv;
+ priv = E_TREE_SORTED_GET_PRIVATE (object);
if (priv->root)
free_path (priv->root);
@@ -1267,8 +1271,7 @@ e_tree_sorted_class_init (ETreeSortedClass *class)
static void
e_tree_sorted_init (ETreeSorted *ets)
{
- ets->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- ets, E_TYPE_TREE_SORTED, ETreeSortedPrivate);
+ ets->priv = E_TREE_SORTED_GET_PRIVATE (ets);
}
/**
diff --git a/widgets/table/e-tree-table-adapter.c b/widgets/table/e-tree-table-adapter.c
index 1b87211c7b..dd7c1e7705 100644
--- a/widgets/table/e-tree-table-adapter.c
+++ b/widgets/table/e-tree-table-adapter.c
@@ -39,6 +39,10 @@
#include "e-table-sorting-utils.h"
#include "e-tree-table-adapter.h"
+#define E_TREE_TABLE_ADAPTER_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_TREE_TABLE_ADAPTER, ETreeTableAdapterPrivate))
+
/* workaround for avoiding API breakage */
#define etta_get_type e_tree_table_adapter_get_type
G_DEFINE_TYPE (ETreeTableAdapter, etta, E_TYPE_TABLE_MODEL)
@@ -535,7 +539,7 @@ etta_finalize (GObject *object)
{
ETreeTableAdapterPrivate *priv;
- priv = E_TREE_TABLE_ADAPTER (object)->priv;
+ priv = E_TREE_TABLE_ADAPTER_GET_PRIVATE (object);
if (priv->resort_idle_id) {
g_source_remove (priv->resort_idle_id);
@@ -560,7 +564,7 @@ etta_dispose (GObject *object)
{
ETreeTableAdapterPrivate *priv;
- priv = E_TREE_TABLE_ADAPTER (object)->priv;
+ priv = E_TREE_TABLE_ADAPTER_GET_PRIVATE (object);
if (priv->sort_info) {
g_signal_handler_disconnect (
@@ -787,8 +791,7 @@ etta_class_init (ETreeTableAdapterClass *class)
static void
etta_init (ETreeTableAdapter *etta)
{
- etta->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- etta, E_TYPE_TREE_TABLE_ADAPTER, ETreeTableAdapterPrivate);
+ etta->priv = E_TREE_TABLE_ADAPTER_GET_PRIVATE (etta);
etta->priv->root_visible = TRUE;
etta->priv->remap_needed = TRUE;
diff --git a/widgets/table/e-tree.c b/widgets/table/e-tree.c
index ffcca22457..f78a477643 100644
--- a/widgets/table/e-tree.c
+++ b/widgets/table/e-tree.c
@@ -58,6 +58,10 @@
#define d(x)
+#define E_TREE_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_TREE, ETreePrivate))
+
enum {
CURSOR_CHANGE,
CURSOR_ACTIVATED,
@@ -396,7 +400,7 @@ et_dispose (GObject *object)
{
ETreePrivate *priv;
- priv = E_TREE (object)->priv;
+ priv = E_TREE_GET_PRIVATE (object);
if (priv->search != NULL) {
g_signal_handler_disconnect (
@@ -602,8 +606,7 @@ e_tree_init (ETree *e_tree)
gtk_table_set_homogeneous (GTK_TABLE (e_tree), FALSE);
- e_tree->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- e_tree, E_TYPE_TREE, ETreePrivate);
+ e_tree->priv = E_TREE_GET_PRIVATE (e_tree);
e_tree->priv->alternating_row_colors = 1;
e_tree->priv->horizontal_draw_grid = 1;
@@ -669,7 +672,8 @@ et_focus (GtkWidget *container,
return FALSE;
}
- return gtk_widget_child_focus (GTK_WIDGET (e_tree->priv->table_canvas), direction);
+ return gtk_widget_child_focus (
+ GTK_WIDGET (e_tree->priv->table_canvas), direction);
}
static void
@@ -681,17 +685,19 @@ set_header_canvas_width (ETree *e_tree)
e_tree->priv->header_canvas && e_tree->priv->table_canvas))
return;
- gnome_canvas_get_scroll_region (GNOME_CANVAS (e_tree->priv->table_canvas),
- NULL, NULL, &width, NULL);
- gnome_canvas_get_scroll_region (GNOME_CANVAS (e_tree->priv->header_canvas),
- NULL, NULL, &oldwidth, &oldheight);
+ gnome_canvas_get_scroll_region (
+ GNOME_CANVAS (e_tree->priv->table_canvas),
+ NULL, NULL, &width, NULL);
+ gnome_canvas_get_scroll_region (
+ GNOME_CANVAS (e_tree->priv->header_canvas),
+ NULL, NULL, &oldwidth, &oldheight);
if (oldwidth != width ||
oldheight != E_TABLE_HEADER_ITEM (e_tree->priv->header_item)->height - 1)
gnome_canvas_set_scroll_region (
- GNOME_CANVAS (e_tree->priv->header_canvas),
- 0, 0, width, /* COLUMN_HEADER_HEIGHT - 1 */
- E_TABLE_HEADER_ITEM (e_tree->priv->header_item)->height - 1);
+ GNOME_CANVAS (e_tree->priv->header_canvas),
+ 0, 0, width, /* COLUMN_HEADER_HEIGHT - 1 */
+ E_TABLE_HEADER_ITEM (e_tree->priv->header_item)->height - 1);
}
@@ -966,7 +972,8 @@ item_key_press (ETableItem *eti,
e_tree_get_cell_at (et, 30, y, &row_local, &col_local);
if (row_local == -1)
- row_local = e_table_model_row_count (E_TABLE_MODEL (et->priv->etta)) - 1;
+ row_local = e_table_model_row_count (
+ E_TABLE_MODEL (et->priv->etta)) - 1;
row_local = e_tree_view_to_model_row (et, row_local);
col_local = e_selection_model_cursor_col (
@@ -984,7 +991,8 @@ item_key_press (ETableItem *eti,
e_tree_get_cell_at (et, 30, y, &row_local, &col_local);
if (row_local == -1)
- row_local = e_table_model_row_count (E_TABLE_MODEL (et->priv->etta)) - 1;
+ row_local = e_table_model_row_count (
+ E_TABLE_MODEL (et->priv->etta)) - 1;
row_local = e_tree_view_to_model_row (et, row_local);
col_local = e_selection_model_cursor_col (
@@ -1005,9 +1013,11 @@ item_key_press (ETableItem *eti,
GDK_MOD1_MASK)) != GDK_SHIFT_MASK)
break;
if (row != -1) {
- path = e_tree_table_adapter_node_at_row (et->priv->etta, row);
+ path = e_tree_table_adapter_node_at_row (
+ et->priv->etta, row);
if (path)
- e_tree_table_adapter_node_set_expanded (et->priv->etta, path, TRUE);
+ e_tree_table_adapter_node_set_expanded (
+ et->priv->etta, path, TRUE);
}
return_val = 1;
break;
@@ -1021,9 +1031,11 @@ item_key_press (ETableItem *eti,
GDK_MOD1_MASK)) != GDK_SHIFT_MASK)
break;
if (row != -1) {
- path = e_tree_table_adapter_node_at_row (et->priv->etta, row);
+ path = e_tree_table_adapter_node_at_row (
+ et->priv->etta, row);
if (path)
- e_tree_table_adapter_node_set_expanded (et->priv->etta, path, FALSE);
+ e_tree_table_adapter_node_set_expanded (
+ et->priv->etta, path, FALSE);
}
return_val = 1;
break;
@@ -1102,20 +1114,27 @@ et_build_item (ETree *et)
"uniform_row_height", et->priv->uniform_row_height,
NULL);
- g_signal_connect (et->priv->item, "cursor_change",
- G_CALLBACK (item_cursor_change), et);
- g_signal_connect (et->priv->item, "cursor_activated",
- G_CALLBACK (item_cursor_activated), et);
- g_signal_connect (et->priv->item, "double_click",
- G_CALLBACK (item_double_click), et);
- g_signal_connect (et->priv->item, "right_click",
- G_CALLBACK (item_right_click), et);
- g_signal_connect (et->priv->item, "click",
- G_CALLBACK (item_click), et);
- g_signal_connect (et->priv->item, "key_press",
- G_CALLBACK (item_key_press), et);
- g_signal_connect (et->priv->item, "start_drag",
- G_CALLBACK (item_start_drag), et);
+ g_signal_connect (
+ et->priv->item, "cursor_change",
+ G_CALLBACK (item_cursor_change), et);
+ g_signal_connect (
+ et->priv->item, "cursor_activated",
+ G_CALLBACK (item_cursor_activated), et);
+ g_signal_connect (
+ et->priv->item, "double_click",
+ G_CALLBACK (item_double_click), et);
+ g_signal_connect (
+ et->priv->item, "right_click",
+ G_CALLBACK (item_right_click), et);
+ g_signal_connect (
+ et->priv->item, "click",
+ G_CALLBACK (item_click), et);
+ g_signal_connect (
+ et->priv->item, "key_press",
+ G_CALLBACK (item_key_press), et);
+ g_signal_connect (
+ et->priv->item, "start_drag",
+ G_CALLBACK (item_start_drag), et);
}
static void
@@ -1241,8 +1260,9 @@ e_tree_setup_table (ETree *e_tree)
e_tree, "drag_data_received",
G_CALLBACK (et_drag_data_received), e_tree);
- g_signal_connect (e_tree->priv->table_canvas, "reflow",
- G_CALLBACK (tree_canvas_reflow), e_tree);
+ g_signal_connect (
+ e_tree->priv->table_canvas, "reflow",
+ G_CALLBACK (tree_canvas_reflow), e_tree);
widget = GTK_WIDGET (e_tree->priv->table_canvas);
style = gtk_widget_get_style (widget);
@@ -1601,10 +1621,12 @@ et_real_construct (ETree *e_tree,
"cursor_mode", specification->cursor_mode,
NULL);
- 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_CALLBACK (et_selection_model_selection_row_changed), e_tree);
+ 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_CALLBACK (et_selection_model_selection_row_changed), e_tree);
if (!specification->no_headers) {
e_tree_setup_header (e_tree);
@@ -1623,17 +1645,22 @@ et_real_construct (ETree *e_tree,
/*
* The header
*/
- gtk_table_attach (GTK_TABLE (e_tree), GTK_WIDGET (e_tree->priv->header_canvas),
- 0, 1, 0 + row, 1 + row,
- GTK_FILL | GTK_EXPAND,
- GTK_FILL, 0, 0);
+ gtk_table_attach (
+ GTK_TABLE (e_tree),
+ GTK_WIDGET (e_tree->priv->header_canvas),
+ 0, 1, 0 + row, 1 + row,
+ GTK_FILL | GTK_EXPAND,
+ GTK_FILL, 0, 0);
row++;
}
- gtk_table_attach (GTK_TABLE (e_tree), GTK_WIDGET (e_tree->priv->table_canvas),
- 0, 1, 0 + row, 1 + row,
- GTK_FILL | GTK_EXPAND,
- GTK_FILL | GTK_EXPAND,
- 0, 0);
+
+ gtk_table_attach (
+ GTK_TABLE (e_tree),
+ GTK_WIDGET (e_tree->priv->table_canvas),
+ 0, 1, 0 + row, 1 + row,
+ GTK_FILL | GTK_EXPAND,
+ GTK_FILL | GTK_EXPAND,
+ 0, 0);
g_object_unref (ete);
@@ -2001,12 +2028,15 @@ et_get_property (GObject *object,
case PROP_ETTA:
g_value_set_object (value, etree->priv->etta);
break;
+
case PROP_UNIFORM_ROW_HEIGHT:
g_value_set_boolean (value, etree->priv->uniform_row_height);
break;
+
case PROP_ALWAYS_SEARCH:
g_value_set_boolean (value, etree->priv->always_search);
break;
+
case PROP_HADJUSTMENT:
if (etree->priv->table_canvas)
g_object_get_property (
@@ -2015,6 +2045,7 @@ et_get_property (GObject *object,
else
g_value_set_object (value, NULL);
break;
+
case PROP_VADJUSTMENT:
if (etree->priv->table_canvas)
g_object_get_property (
@@ -2023,6 +2054,7 @@ et_get_property (GObject *object,
else
g_value_set_object (value, NULL);
break;
+
case PROP_HSCROLL_POLICY:
if (etree->priv->table_canvas)
g_object_get_property (
@@ -2031,6 +2063,7 @@ et_get_property (GObject *object,
else
g_value_set_enum (value, 0);
break;
+
case PROP_VSCROLL_POLICY:
if (etree->priv->table_canvas)
g_object_get_property (
@@ -2039,6 +2072,7 @@ et_get_property (GObject *object,
else
g_value_set_enum (value, 0);
break;
+
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
@@ -2062,45 +2096,55 @@ et_set_property (GObject *object,
case PROP_LENGTH_THRESHOLD:
etree->priv->length_threshold = g_value_get_int (value);
if (etree->priv->item) {
- gnome_canvas_item_set (GNOME_CANVAS_ITEM (etree->priv->item),
- "length_threshold", etree->priv->length_threshold,
- NULL);
+ gnome_canvas_item_set (
+ GNOME_CANVAS_ITEM (etree->priv->item),
+ "length_threshold",
+ etree->priv->length_threshold,
+ NULL);
}
break;
case PROP_HORIZONTAL_DRAW_GRID:
etree->priv->horizontal_draw_grid = g_value_get_boolean (value);
if (etree->priv->item) {
- gnome_canvas_item_set (GNOME_CANVAS_ITEM (etree->priv->item),
- "horizontal_draw_grid", etree->priv->horizontal_draw_grid,
- NULL);
+ gnome_canvas_item_set (
+ GNOME_CANVAS_ITEM (etree->priv->item),
+ "horizontal_draw_grid",
+ etree->priv->horizontal_draw_grid,
+ NULL);
}
break;
case PROP_VERTICAL_DRAW_GRID:
etree->priv->vertical_draw_grid = g_value_get_boolean (value);
if (etree->priv->item) {
- gnome_canvas_item_set (GNOME_CANVAS_ITEM (etree->priv->item),
- "vertical_draw_grid", etree->priv->vertical_draw_grid,
- NULL);
+ gnome_canvas_item_set (
+ GNOME_CANVAS_ITEM (etree->priv->item),
+ "vertical_draw_grid",
+ etree->priv->vertical_draw_grid,
+ NULL);
}
break;
case PROP_DRAW_FOCUS:
etree->priv->draw_focus = g_value_get_boolean (value);
if (etree->priv->item) {
- gnome_canvas_item_set (GNOME_CANVAS_ITEM (etree->priv->item),
- "drawfocus", etree->priv->draw_focus,
- NULL);
+ gnome_canvas_item_set (
+ GNOME_CANVAS_ITEM (etree->priv->item),
+ "drawfocus",
+ etree->priv->draw_focus,
+ NULL);
}
break;
case PROP_UNIFORM_ROW_HEIGHT:
etree->priv->uniform_row_height = g_value_get_boolean (value);
if (etree->priv->item) {
- gnome_canvas_item_set (GNOME_CANVAS_ITEM (etree->priv->item),
- "uniform_row_height", etree->priv->uniform_row_height,
- NULL);
+ gnome_canvas_item_set (
+ GNOME_CANVAS_ITEM (etree->priv->item),
+ "uniform_row_height",
+ etree->priv->uniform_row_height,
+ NULL);
}
break;
@@ -2117,18 +2161,21 @@ et_set_property (GObject *object,
G_OBJECT (etree->priv->table_canvas),
"hadjustment", value);
break;
+
case PROP_VADJUSTMENT:
if (etree->priv->table_canvas)
g_object_set_property (
G_OBJECT (etree->priv->table_canvas),
"vadjustment", value);
break;
+
case PROP_HSCROLL_POLICY:
if (etree->priv->table_canvas)
g_object_set_property (
G_OBJECT (etree->priv->table_canvas),
"hscroll-policy", value);
break;
+
case PROP_VSCROLL_POLICY:
if (etree->priv->table_canvas)
g_object_set_property (
diff --git a/widgets/table/gal-a11y-e-cell-registry.c b/widgets/table/gal-a11y-e-cell-registry.c
index ce533882ab..db05ac05c1 100644
--- a/widgets/table/gal-a11y-e-cell-registry.c
+++ b/widgets/table/gal-a11y-e-cell-registry.c
@@ -93,7 +93,8 @@ gal_a11y_e_cell_registry_get_type (void)
NULL /* value_cell */
};
- type = g_type_register_static (PARENT_TYPE, "GalA11yECellRegistry", &info, 0);
+ type = g_type_register_static (
+ PARENT_TYPE, "GalA11yECellRegistry", &info, 0);
}
return type;
@@ -130,10 +131,10 @@ gal_a11y_e_cell_registry_get_object (GalA11yECellRegistry *registry,
type = g_type_parent (type);
}
- if (func)
- return func (item, cell_view, parent, model_col, view_col, row);
- else
- return gal_a11y_e_cell_new (item, cell_view, parent, model_col, view_col, row);
+ if (func == NULL)
+ func = gal_a11y_e_cell_new;
+
+ return func (item, cell_view, parent, model_col, view_col, row);
}
void
diff --git a/widgets/table/gal-a11y-e-cell-toggle.c b/widgets/table/gal-a11y-e-cell-toggle.c
index 991d3c0721..ca6fdfc14d 100644
--- a/widgets/table/gal-a11y-e-cell-toggle.c
+++ b/widgets/table/gal-a11y-e-cell-toggle.c
@@ -179,10 +179,9 @@ gal_a11y_e_cell_toggle_new (ETableItem *item,
NULL, /* action keybinding */
toggle_cell_action);
- toggle_cell->model_id = g_signal_connect (item->table_model,
- "model_cell_changed",
- (GCallback) model_change_cb,
- a11y);
+ toggle_cell->model_id = g_signal_connect (
+ item->table_model, "model_cell_changed",
+ (GCallback) model_change_cb, a11y);
value = GPOINTER_TO_INT (
e_table_model_value_at (cell->cell_view->e_table_model,
diff --git a/widgets/table/gal-a11y-e-cell-tree.c b/widgets/table/gal-a11y-e-cell-tree.c
index 148731d4b8..a1653698a2 100644
--- a/widgets/table/gal-a11y-e-cell-tree.c
+++ b/widgets/table/gal-a11y-e-cell-tree.c
@@ -246,10 +246,9 @@ gal_a11y_e_cell_tree_new (ETableItem *item,
model_col,
view_col,
row);
- a11y->model_row_changed_id =
- g_signal_connect (item->table_model, "model_row_changed",
- G_CALLBACK (ectr_model_row_changed_cb),
- subcell_a11y);
+ a11y->model_row_changed_id = g_signal_connect (
+ item->table_model, "model_row_changed",
+ G_CALLBACK (ectr_model_row_changed_cb), subcell_a11y);
if (subcell_a11y && subcell_view)
{
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 e4b5255e4c..1f116ee6b3 100644
--- a/widgets/table/gal-a11y-e-table-click-to-add.c
+++ b/widgets/table/gal-a11y-e-table-click-to-add.c
@@ -335,11 +335,13 @@ gal_a11y_e_table_click_to_add_new (GObject *widget)
priv->rect = etcta->rect;
priv->row = etcta->row;
- g_signal_connect_after (G_OBJECT(widget), "event",
- G_CALLBACK (etcta_event), a11y);
+ g_signal_connect_after (
+ widget, "event",
+ G_CALLBACK (etcta_event), a11y);
- g_signal_connect (etcta->selection, "cursor_changed",
- G_CALLBACK (etcta_selection_cursor_changed), a11y);
+ g_signal_connect (
+ etcta->selection, "cursor_changed",
+ G_CALLBACK (etcta_selection_cursor_changed), a11y);
return ATK_OBJECT (a11y);
}
@@ -348,9 +350,9 @@ void
gal_a11y_e_table_click_to_add_init (void)
{
if (atk_get_root ())
- atk_registry_set_factory_type (atk_get_default_registry (),
- E_TYPE_TABLE_CLICK_TO_ADD,
- gal_a11y_e_table_click_to_add_factory_get_type ());
-
+ atk_registry_set_factory_type (
+ atk_get_default_registry (),
+ E_TYPE_TABLE_CLICK_TO_ADD,
+ gal_a11y_e_table_click_to_add_factory_get_type ());
}
diff --git a/widgets/table/gal-a11y-e-table-column-header.c b/widgets/table/gal-a11y-e-table-column-header.c
index 8e13fd6865..05a99e381b 100644
--- a/widgets/table/gal-a11y-e-table-column-header.c
+++ b/widgets/table/gal-a11y-e-table-column-header.c
@@ -123,14 +123,17 @@ gal_a11y_e_table_column_header_do_action (AtkAction *action,
switch (i) {
case 0:
a11y = GAL_A11Y_E_TABLE_COLUMN_HEADER (action);
- col = E_TABLE_COL (etch_a11y_get_gobject (ATK_GOBJECT_ACCESSIBLE (a11y)));
+ col = E_TABLE_COL (etch_a11y_get_gobject (
+ ATK_GOBJECT_ACCESSIBLE (a11y)));
item = GET_PRIVATE (a11y)->item;
widget = gtk_widget_get_parent (GTK_WIDGET (item->parent.canvas));
if (E_IS_TREE (widget)) {
- ethi = E_TABLE_HEADER_ITEM (e_tree_get_header_item (E_TREE (widget)));
+ ethi = E_TABLE_HEADER_ITEM (
+ e_tree_get_header_item (E_TREE (widget)));
}
else if (E_IS_TABLE (widget))
- ethi = E_TABLE_HEADER_ITEM (E_TABLE (widget)->header_item);
+ ethi = E_TABLE_HEADER_ITEM (
+ E_TABLE (widget)->header_item);
else
break;
ethi_change_sort_state (ethi, col);
diff --git a/widgets/table/gal-a11y-e-table-factory.c b/widgets/table/gal-a11y-e-table-factory.c
index 2270cbaa5b..a3905ab393 100644
--- a/widgets/table/gal-a11y-e-table-factory.c
+++ b/widgets/table/gal-a11y-e-table-factory.c
@@ -93,7 +93,8 @@ gal_a11y_e_table_factory_get_type (void)
NULL /* value_table */
};
- type = g_type_register_static (PARENT_TYPE, "GalA11yETableFactory", &info, 0);
+ type = g_type_register_static (
+ PARENT_TYPE, "GalA11yETableFactory", &info, 0);
}
return type;
diff --git a/widgets/text/e-reflow-model.c b/widgets/text/e-reflow-model.c
index 05457d0145..35d0eaf9da 100644
--- a/widgets/text/e-reflow-model.c
+++ b/widgets/text/e-reflow-model.c
@@ -44,7 +44,7 @@ enum {
LAST_SIGNAL
};
-static guint e_reflow_model_signals[LAST_SIGNAL] = { 0, };
+static guint signals[LAST_SIGNAL] = { 0, };
/**
* e_reflow_model_set_width:
@@ -55,10 +55,14 @@ void
e_reflow_model_set_width (EReflowModel *e_reflow_model,
gint width)
{
- g_return_if_fail (e_reflow_model != NULL);
+ EReflowModelClass *class;
+
g_return_if_fail (E_IS_REFLOW_MODEL (e_reflow_model));
- E_REFLOW_MODEL_GET_CLASS (e_reflow_model)->set_width (e_reflow_model, width);
+ class = E_REFLOW_MODEL_GET_CLASS (e_reflow_model);
+ g_return_if_fail (class->set_width != NULL);
+
+ class->set_width (e_reflow_model, width);
}
/**
@@ -70,10 +74,14 @@ e_reflow_model_set_width (EReflowModel *e_reflow_model,
gint
e_reflow_model_count (EReflowModel *e_reflow_model)
{
- g_return_val_if_fail (e_reflow_model != NULL, 0);
+ EReflowModelClass *class;
+
g_return_val_if_fail (E_IS_REFLOW_MODEL (e_reflow_model), 0);
- return E_REFLOW_MODEL_GET_CLASS (e_reflow_model)->count (e_reflow_model);
+ class = E_REFLOW_MODEL_GET_CLASS (e_reflow_model);
+ g_return_val_if_fail (class->count != NULL, 0);
+
+ return class->count (e_reflow_model);
}
/**
@@ -89,10 +97,14 @@ e_reflow_model_height (EReflowModel *e_reflow_model,
gint n,
GnomeCanvasGroup *parent)
{
- g_return_val_if_fail (e_reflow_model != NULL, 0);
+ EReflowModelClass *class;
+
g_return_val_if_fail (E_IS_REFLOW_MODEL (e_reflow_model), 0);
- return E_REFLOW_MODEL_GET_CLASS (e_reflow_model)->height (e_reflow_model, n, parent);
+ class = E_REFLOW_MODEL_GET_CLASS (e_reflow_model);
+ g_return_val_if_fail (class->height != NULL, 0);
+
+ return class->height (e_reflow_model, n, parent);
}
/**
@@ -110,10 +122,14 @@ e_reflow_model_incarnate (EReflowModel *e_reflow_model,
gint n,
GnomeCanvasGroup *parent)
{
- g_return_val_if_fail (e_reflow_model != NULL, NULL);
+ EReflowModelClass *class;
+
g_return_val_if_fail (E_IS_REFLOW_MODEL (e_reflow_model), NULL);
- return E_REFLOW_MODEL_GET_CLASS (e_reflow_model)->incarnate (e_reflow_model, n, parent);
+ class = E_REFLOW_MODEL_GET_CLASS (e_reflow_model);
+ g_return_val_if_fail (class->incarnate != NULL, NULL);
+
+ return class->incarnate (e_reflow_model, n, parent);
}
/**
@@ -129,13 +145,16 @@ e_reflow_model_incarnate (EReflowModel *e_reflow_model,
GHashTable *
e_reflow_model_create_cmp_cache (EReflowModel *e_reflow_model)
{
- g_return_val_if_fail (e_reflow_model != NULL, NULL);
+ EReflowModelClass *class;
+
g_return_val_if_fail (E_IS_REFLOW_MODEL (e_reflow_model), NULL);
- if (!E_REFLOW_MODEL_GET_CLASS (e_reflow_model)->create_cmp_cache)
+ class = E_REFLOW_MODEL_GET_CLASS (e_reflow_model);
+
+ if (class->create_cmp_cache == NULL)
return NULL;
- return E_REFLOW_MODEL_GET_CLASS (e_reflow_model)->create_cmp_cache (e_reflow_model);
+ return class->create_cmp_cache (e_reflow_model);
}
/**
@@ -158,12 +177,14 @@ e_reflow_model_compare (EReflowModel *e_reflow_model,
gint n2,
GHashTable *cmp_cache)
{
-#if 0
- g_return_val_if_fail (e_reflow_model != NULL, 0);
+ EReflowModelClass *class;
+
g_return_val_if_fail (E_IS_REFLOW_MODEL (e_reflow_model), 0);
-#endif
- return E_REFLOW_MODEL_GET_CLASS (e_reflow_model)->compare (e_reflow_model, n1, n2, cmp_cache);
+ class = E_REFLOW_MODEL_GET_CLASS (e_reflow_model);
+ g_return_val_if_fail (class->compare != NULL, 0);
+
+ return class->compare (e_reflow_model, n1, n2, cmp_cache);
}
/**
@@ -179,73 +200,77 @@ e_reflow_model_reincarnate (EReflowModel *e_reflow_model,
gint n,
GnomeCanvasItem *item)
{
- g_return_if_fail (e_reflow_model != NULL);
+ EReflowModelClass *class;
+
g_return_if_fail (E_IS_REFLOW_MODEL (e_reflow_model));
- E_REFLOW_MODEL_GET_CLASS (e_reflow_model)->reincarnate (e_reflow_model, n, item);
+ class = E_REFLOW_MODEL_GET_CLASS (e_reflow_model);
+ g_return_if_fail (class->reincarnate != NULL);
+
+ class->reincarnate (e_reflow_model, n, item);
}
static void
-e_reflow_model_class_init (EReflowModelClass *klass)
+e_reflow_model_class_init (EReflowModelClass *class)
{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
- e_reflow_model_signals[MODEL_CHANGED] =
- g_signal_new ("model_changed",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EReflowModelClass, model_changed),
- NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
- e_reflow_model_signals[COMPARISON_CHANGED] =
- g_signal_new ("comparison_changed",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EReflowModelClass, comparison_changed),
- NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
- e_reflow_model_signals[MODEL_ITEMS_INSERTED] =
- g_signal_new ("model_items_inserted",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EReflowModelClass, model_items_inserted),
- NULL, NULL,
- e_marshal_NONE__INT_INT,
- G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_INT);
-
- e_reflow_model_signals[MODEL_ITEM_CHANGED] =
- g_signal_new ("model_item_changed",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EReflowModelClass, model_item_changed),
- NULL, NULL,
- g_cclosure_marshal_VOID__INT,
- G_TYPE_NONE, 1, G_TYPE_INT);
-
- e_reflow_model_signals[MODEL_ITEM_REMOVED] =
- g_signal_new ("model_item_removed",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EReflowModelClass, model_item_removed),
- NULL, NULL,
- g_cclosure_marshal_VOID__INT,
- G_TYPE_NONE, 1, G_TYPE_INT);
-
- klass->set_width = NULL;
- klass->count = NULL;
- klass->height = NULL;
- klass->incarnate = NULL;
- klass->reincarnate = NULL;
-
- klass->model_changed = NULL;
- klass->comparison_changed = NULL;
- klass->model_items_inserted = NULL;
- klass->model_item_removed = NULL;
- klass->model_item_changed = NULL;
+ GObjectClass *object_class = G_OBJECT_CLASS (class);
+
+ class->set_width = NULL;
+ class->count = NULL;
+ class->height = NULL;
+ class->incarnate = NULL;
+ class->reincarnate = NULL;
+
+ class->model_changed = NULL;
+ class->comparison_changed = NULL;
+ class->model_items_inserted = NULL;
+ class->model_item_removed = NULL;
+ class->model_item_changed = NULL;
+
+ signals[MODEL_CHANGED] = g_signal_new (
+ "model_changed",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EReflowModelClass, model_changed),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
+ signals[COMPARISON_CHANGED] = g_signal_new (
+ "comparison_changed",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EReflowModelClass, comparison_changed),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
+ signals[MODEL_ITEMS_INSERTED] = g_signal_new (
+ "model_items_inserted",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EReflowModelClass, model_items_inserted),
+ NULL, NULL,
+ e_marshal_NONE__INT_INT,
+ G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_INT);
+
+ signals[MODEL_ITEM_CHANGED] = g_signal_new (
+ "model_item_changed",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EReflowModelClass, model_item_changed),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__INT,
+ G_TYPE_NONE, 1, G_TYPE_INT);
+
+ signals[MODEL_ITEM_REMOVED] = g_signal_new (
+ "model_item_removed",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EReflowModelClass, model_item_removed),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__INT,
+ G_TYPE_NONE, 1, G_TYPE_INT);
}
static void
@@ -285,8 +310,7 @@ e_reflow_model_changed (EReflowModel *e_reflow_model)
d (print_tabs ());
d(g_print("Emitting model_changed on model 0x%p.\n", e_reflow_model));
d (depth++);
- g_signal_emit (e_reflow_model,
- e_reflow_model_signals[MODEL_CHANGED], 0);
+ g_signal_emit (e_reflow_model, signals[MODEL_CHANGED], 0);
d (depth--);
}
@@ -306,10 +330,11 @@ e_reflow_model_comparison_changed (EReflowModel *e_reflow_model)
g_return_if_fail (E_IS_REFLOW_MODEL (e_reflow_model));
d (print_tabs ());
- d(g_print("Emitting comparison_changed on model 0x%p.\n", e_reflow_model));
+ d (g_print (
+ "Emitting comparison_changed on model 0x%p.\n",
+ e_reflow_model));
d (depth++);
- g_signal_emit (e_reflow_model,
- e_reflow_model_signals[COMPARISON_CHANGED], 0);
+ g_signal_emit (e_reflow_model, signals[COMPARISON_CHANGED], 0);
d (depth--);
}
@@ -319,7 +344,8 @@ e_reflow_model_comparison_changed (EReflowModel *e_reflow_model)
* @position: The position the items were insert in.
* @count: The number of items inserted.
*
- * Use this function to notify any views of the reflow model that a number of items have been inserted.
+ * 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,
@@ -330,11 +356,11 @@ e_reflow_model_items_inserted (EReflowModel *e_reflow_model,
g_return_if_fail (E_IS_REFLOW_MODEL (e_reflow_model));
d (print_tabs ());
- d(g_print("Emitting items_inserted on model 0x%p, position=%d, count=%d.\n", e_reflow_model, position, count));
d (depth++);
- g_signal_emit (e_reflow_model,
- e_reflow_model_signals[MODEL_ITEMS_INSERTED], 0,
- position, count);
+ g_signal_emit (
+ e_reflow_model,
+ signals[MODEL_ITEMS_INSERTED], 0,
+ position, count);
d (depth--);
}
@@ -354,11 +380,8 @@ e_reflow_model_item_removed (EReflowModel *e_reflow_model,
g_return_if_fail (E_IS_REFLOW_MODEL (e_reflow_model));
d (print_tabs ());
- d(g_print("Emitting item_removed on model 0x%p, n=%d.\n", e_reflow_model, n));
d (depth++);
- g_signal_emit (e_reflow_model,
- e_reflow_model_signals[MODEL_ITEM_REMOVED], 0,
- n);
+ g_signal_emit (e_reflow_model, signals[MODEL_ITEM_REMOVED], 0, n);
d (depth--);
}
@@ -383,8 +406,6 @@ e_reflow_model_item_changed (EReflowModel *e_reflow_model,
d (print_tabs ());
d(g_print("Emitting item_changed on model 0x%p, n=%d.\n", e_reflow_model, n));
d (depth++);
- g_signal_emit (e_reflow_model,
- e_reflow_model_signals[MODEL_ITEM_CHANGED], 0,
- n);
+ g_signal_emit (e_reflow_model, signals[MODEL_ITEM_CHANGED], 0, n);
d (depth--);
}
diff --git a/widgets/text/e-reflow-model.h b/widgets/text/e-reflow-model.h
index 224a6ab4e3..33cad68da0 100644
--- a/widgets/text/e-reflow-model.h
+++ b/widgets/text/e-reflow-model.h
@@ -26,20 +26,35 @@
#include <libgnomecanvas/libgnomecanvas.h>
+/* Standard GObject macros */
+#define E_TYPE_REFLOW_MODEL \
+ (e_reflow_model_get_type ())
+#define E_REFLOW_MODEL(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), E_TYPE_REFLOW_MODEL, EReflowModel))
+#define E_REFLOW_MODEL_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), E_TYPE_REFLOW_MODEL, EReflowModelClass))
+#define E_IS_REFLOW_MODEL(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), E_TYPE_REFLOW_MODEL))
+#define E_IS_REFLOW_MODEL_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), E_TYPE_REFLOW_MODEL))
+#define E_REFLOW_MODEL_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), E_TYPE_REFLOW_MODEL, EReflowModelClass))
+
G_BEGIN_DECLS
-#define E_REFLOW_MODEL_TYPE (e_reflow_model_get_type ())
-#define E_REFLOW_MODEL(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_REFLOW_MODEL_TYPE, EReflowModel))
-#define E_REFLOW_MODEL_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_REFLOW_MODEL_TYPE, EReflowModelClass))
-#define E_IS_REFLOW_MODEL(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_REFLOW_MODEL_TYPE))
-#define E_IS_REFLOW_MODEL_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_REFLOW_MODEL_TYPE))
-#define E_REFLOW_MODEL_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), E_REFLOW_MODEL_TYPE, EReflowModelClass))
+typedef struct _EReflowModel EReflowModel;
+typedef struct _EReflowModelClass EReflowModelClass;
-typedef struct {
- GObject base;
-} EReflowModel;
+struct _EReflowModel {
+ GObject parent;
+};
-typedef struct {
+struct _EReflowModelClass {
GObjectClass parent_class;
/*
@@ -69,7 +84,7 @@ typedef struct {
void (*model_items_inserted) (EReflowModel *etm, gint position, gint count);
void (*model_item_removed) (EReflowModel *etm, gint position);
void (*model_item_changed) (EReflowModel *etm, gint n);
-} EReflowModelClass;
+};
GType e_reflow_model_get_type (void);
diff --git a/widgets/text/e-reflow.c b/widgets/text/e-reflow.c
index 296d732590..dba051e2cc 100644
--- a/widgets/text/e-reflow.c
+++ b/widgets/text/e-reflow.c
@@ -645,23 +645,28 @@ connect_model (EReflow *reflow,
if (model == NULL)
return;
- reflow->model = model;
- g_object_ref (reflow->model);
- reflow->model_changed_id =
- g_signal_connect (reflow->model, "model_changed",
- G_CALLBACK (model_changed), reflow);
- reflow->comparison_changed_id =
- g_signal_connect (reflow->model, "comparison_changed",
- G_CALLBACK (comparison_changed), reflow);
- reflow->model_items_inserted_id =
- g_signal_connect (reflow->model, "model_items_inserted",
- G_CALLBACK (items_inserted), reflow);
- reflow->model_item_removed_id =
- g_signal_connect (reflow->model, "model_item_removed",
- G_CALLBACK (item_removed), reflow);
- reflow->model_item_changed_id =
- g_signal_connect (reflow->model, "model_item_changed",
- G_CALLBACK (item_changed), reflow);
+ reflow->model = g_object_ref (model);
+
+ reflow->model_changed_id = g_signal_connect (
+ reflow->model, "model_changed",
+ G_CALLBACK (model_changed), reflow);
+
+ reflow->comparison_changed_id = g_signal_connect (
+ reflow->model, "comparison_changed",
+ G_CALLBACK (comparison_changed), reflow);
+
+ reflow->model_items_inserted_id = g_signal_connect (
+ reflow->model, "model_items_inserted",
+ G_CALLBACK (items_inserted), reflow);
+
+ reflow->model_item_removed_id = g_signal_connect (
+ reflow->model, "model_item_removed",
+ G_CALLBACK (item_removed), reflow);
+
+ reflow->model_item_changed_id = g_signal_connect (
+ reflow->model, "model_item_changed",
+ G_CALLBACK (item_changed), reflow);
+
model_changed (model, reflow);
}
@@ -700,14 +705,15 @@ connect_adjustment (EReflow *reflow,
if (adjustment == NULL)
return;
- reflow->adjustment = adjustment;
- reflow->adjustment_changed_id =
- g_signal_connect (adjustment, "changed",
- G_CALLBACK (adjustment_changed), reflow);
- reflow->adjustment_value_changed_id =
- g_signal_connect (adjustment, "value_changed",
- G_CALLBACK (adjustment_changed), reflow);
- g_object_ref (adjustment);
+ reflow->adjustment = g_object_ref (adjustment);
+
+ reflow->adjustment_changed_id = g_signal_connect (
+ adjustment, "changed",
+ G_CALLBACK (adjustment_changed), reflow);
+
+ reflow->adjustment_value_changed_id = g_signal_connect (
+ adjustment, "value_changed",
+ G_CALLBACK (adjustment_changed), reflow);
}
#if 0
@@ -723,10 +729,9 @@ set_scroll_adjustments (GtkLayout *layout,
static void
connect_set_adjustment (EReflow *reflow)
{
- reflow->set_scroll_adjustments_id =
- g_signal_connect (GNOME_CANVAS_ITEM (reflow)->canvas,
- "set_scroll_adjustments",
- G_CALLBACK (set_scroll_adjustments), reflow);
+ reflow->set_scroll_adjustments_id = g_signal_connect (
+ GNOME_CANVAS_ITEM (reflow)->canvas, "set_scroll_adjustments",
+ G_CALLBACK (set_scroll_adjustments), reflow);
}
#endif
@@ -1519,13 +1524,13 @@ e_reflow_selection_event_real (EReflow *reflow,
}
static void
-e_reflow_class_init (EReflowClass *klass)
+e_reflow_class_init (EReflowClass *class)
{
GObjectClass *object_class;
GnomeCanvasItemClass *item_class;
- object_class = (GObjectClass *) klass;
- item_class = (GnomeCanvasItemClass *) klass;
+ object_class = (GObjectClass *) class;
+ item_class = (GnomeCanvasItemClass *) class;
object_class->set_property = e_reflow_set_property;
object_class->get_property = e_reflow_get_property;
@@ -1539,8 +1544,8 @@ e_reflow_class_init (EReflowClass *klass)
item_class->update = e_reflow_update;
item_class->point = e_reflow_point;
- klass->selection_event = e_reflow_selection_event_real;
- klass->column_width_changed = NULL;
+ class->selection_event = e_reflow_selection_event_real;
+ class->column_width_changed = NULL;
g_object_class_install_property (object_class, PROP_MINIMUM_WIDTH,
g_param_spec_double ("minimum_width",
@@ -1574,7 +1579,7 @@ e_reflow_class_init (EReflowClass *klass)
g_param_spec_object ("model",
"Reflow model",
"Reflow model",
- E_REFLOW_MODEL_TYPE,
+ E_TYPE_REFLOW_MODEL,
G_PARAM_READWRITE));
g_object_class_install_property (object_class, PROP_COLUMN_WIDTH,
@@ -1651,15 +1656,17 @@ e_reflow_init (EReflow *reflow)
"sorter", reflow->sorter,
NULL);
- reflow->selection_changed_id =
- 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_CALLBACK (selection_row_changed), reflow);
- reflow->cursor_changed_id =
- g_signal_connect (reflow->selection, "cursor_changed",
- G_CALLBACK (cursor_changed), reflow);
+ reflow->selection_changed_id = 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_CALLBACK (selection_row_changed), reflow);
+
+ reflow->cursor_changed_id = 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-reflow.h b/widgets/text/e-reflow.h
index d6b49064eb..979857ea5c 100644
--- a/widgets/text/e-reflow.h
+++ b/widgets/text/e-reflow.h
@@ -20,40 +20,40 @@
*
*/
-#ifndef __E_REFLOW_H__
-#define __E_REFLOW_H__
+#ifndef E_REFLOW_H
+#define E_REFLOW_H
#include <libgnomecanvas/libgnomecanvas.h>
#include <text/e-reflow-model.h>
#include <misc/e-selection-model.h>
#include <e-util/e-sorter-array.h>
-G_BEGIN_DECLS
-
-/* EReflow - A canvas item container.
- *
- * The following arguments are available:
- *
- * name type read/write description
- * --------------------------------------------------------------------------------
- * minimum_width gdouble RW minimum width of the reflow. width >= minimum_width
- * width gdouble R width of the reflow
- * height gdouble RW height of the reflow
- */
-
-#define E_REFLOW_TYPE (e_reflow_get_type ())
-#define E_REFLOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_REFLOW_TYPE, EReflow))
-#define E_REFLOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_REFLOW_TYPE, EReflowClass))
-#define E_IS_REFLOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_REFLOW_TYPE))
-#define E_IS_REFLOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), E_REFLOW_TYPE))
+/* Standard GObject macros */
+#define E_TYPE_REFLOW \
+ (e_reflow_get_type ())
+#define E_REFLOW(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), E_TYPE_REFLOW, EReflow))
+#define E_REFLOW_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), E_TYPE_REFLOW, EReflowClass))
+#define E_IS_REFLOW(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), E_TYPE_REFLOW))
+#define E_IS_REFLOW_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), E_TYPE_REFLOW))
+#define E_REFLOW_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), E_TYPE_REFLOW, EReflowClass))
-typedef struct EReflowPriv EReflowPriv;
+G_BEGIN_DECLS
-typedef struct _EReflow EReflow;
-typedef struct _EReflowClass EReflowClass;
+typedef struct _EReflow EReflow;
+typedef struct _EReflowClass EReflowClass;
+typedef struct _EReflowPrivate EReflowPrivate;
-struct _EReflow
-{
+struct _EReflow {
GnomeCanvasGroup parent;
/* item specific fields */
@@ -137,4 +137,4 @@ GType e_reflow_get_type (void);
G_END_DECLS
-#endif /* __E_REFLOW_H__ */
+#endif /* E_REFLOW_H */
diff --git a/widgets/text/e-text-model.c b/widgets/text/e-text-model.c
index a2c34a7a84..b9b2a09154 100644
--- a/widgets/text/e-text-model.c
+++ b/widgets/text/e-text-model.c
@@ -36,6 +36,10 @@
#include "e-text-model.h"
#include "e-text-model-repos.h"
+#define E_TEXT_MODEL_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_TEXT_MODEL, ETextModelPrivate))
+
enum {
E_TEXT_MODEL_CHANGED,
E_TEXT_MODEL_REPOSITION,
@@ -44,14 +48,12 @@ enum {
E_TEXT_MODEL_LAST_SIGNAL
};
-static guint e_text_model_signals[E_TEXT_MODEL_LAST_SIGNAL] = { 0 };
+static guint signals[E_TEXT_MODEL_LAST_SIGNAL] = { 0 };
struct _ETextModelPrivate {
GString *text;
};
-static void e_text_model_dispose (GObject *object);
-
static gint e_text_model_real_validate_position
(ETextModel *, gint pos);
static const gchar *
@@ -73,15 +75,30 @@ static void e_text_model_real_delete (ETextModel *model,
G_DEFINE_TYPE (ETextModel, e_text_model, G_TYPE_OBJECT)
-/* Class initialization function for the text item */
static void
-e_text_model_class_init (ETextModelClass *klass)
+e_text_model_finalize (GObject *object)
+{
+ ETextModelPrivate *priv;
+
+ priv = E_TEXT_MODEL_GET_PRIVATE (object);
+
+ g_string_free (priv->text, TRUE);
+
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (e_text_model_parent_class)->finalize (object);
+}
+
+static void
+e_text_model_class_init (ETextModelClass *class)
{
GObjectClass *object_class;
- object_class = (GObjectClass *) klass;
+ g_type_class_add_private (class, sizeof (ETextModelPrivate));
- e_text_model_signals[E_TEXT_MODEL_CHANGED] =
+ object_class = G_OBJECT_CLASS (class);
+ object_class->finalize = e_text_model_finalize;
+
+ signals[E_TEXT_MODEL_CHANGED] =
g_signal_new ("changed",
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_LAST,
@@ -90,7 +107,7 @@ e_text_model_class_init (ETextModelClass *klass)
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
- e_text_model_signals[E_TEXT_MODEL_REPOSITION] =
+ signals[E_TEXT_MODEL_REPOSITION] =
g_signal_new ("reposition",
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_LAST,
@@ -100,7 +117,7 @@ e_text_model_class_init (ETextModelClass *klass)
G_TYPE_NONE, 2,
G_TYPE_POINTER, G_TYPE_POINTER);
- e_text_model_signals[E_TEXT_MODEL_OBJECT_ACTIVATED] =
+ signals[E_TEXT_MODEL_OBJECT_ACTIVATED] =
g_signal_new ("object_activated",
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_LAST,
@@ -110,7 +127,7 @@ e_text_model_class_init (ETextModelClass *klass)
G_TYPE_NONE, 1,
G_TYPE_INT);
- e_text_model_signals[E_TEXT_MODEL_CANCEL_COMPLETION] =
+ signals[E_TEXT_MODEL_CANCEL_COMPLETION] =
g_signal_new ("cancel_completion",
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_LAST,
@@ -120,56 +137,32 @@ e_text_model_class_init (ETextModelClass *klass)
G_TYPE_NONE, 0);
/* No default signal handlers. */
- klass->changed = NULL;
- klass->reposition = NULL;
- klass->object_activated = NULL;
+ class->changed = NULL;
+ class->reposition = NULL;
+ class->object_activated = NULL;
- klass->validate_pos = e_text_model_real_validate_position;
+ class->validate_pos = e_text_model_real_validate_position;
- klass->get_text = e_text_model_real_get_text;
- klass->get_text_len = e_text_model_real_get_text_length;
- klass->set_text = e_text_model_real_set_text;
- klass->insert = e_text_model_real_insert;
- klass->insert_length = e_text_model_real_insert_length;
- klass->delete = e_text_model_real_delete;
+ class->get_text = e_text_model_real_get_text;
+ class->get_text_len = e_text_model_real_get_text_length;
+ class->set_text = e_text_model_real_set_text;
+ class->insert = e_text_model_real_insert;
+ class->insert_length = e_text_model_real_insert_length;
+ class->delete = e_text_model_real_delete;
/* We explicitly don't define default handlers for these. */
- klass->objectify = NULL;
- klass->obj_count = NULL;
- klass->get_nth_obj = NULL;
-
- object_class->dispose = e_text_model_dispose;
+ class->objectify = NULL;
+ class->obj_count = NULL;
+ class->get_nth_obj = NULL;
}
-/* Object initialization function for the text item */
static void
e_text_model_init (ETextModel *model)
{
- model->priv = g_new0 (struct _ETextModelPrivate, 1);
+ model->priv = E_TEXT_MODEL_GET_PRIVATE (model);
model->priv->text = g_string_new ("");
}
-/* Dispose handler for the text item */
-static void
-e_text_model_dispose (GObject *object)
-{
- ETextModel *model;
-
- g_return_if_fail (E_IS_TEXT_MODEL (object));
-
- model = E_TEXT_MODEL (object);
-
- if (model->priv) {
- g_string_free (model->priv->text, TRUE);
-
- g_free (model->priv);
- model->priv = NULL;
- }
-
- /* Chain up to parent's dispose() method. */
- G_OBJECT_CLASS (e_text_model_parent_class)->dispose (object);
-}
-
static gint
e_text_model_real_validate_position (ETextModel *model,
gint pos)
@@ -305,18 +298,21 @@ e_text_model_real_delete (ETextModel *model,
void
e_text_model_changed (ETextModel *model)
{
+ ETextModelClass *class;
+
g_return_if_fail (E_IS_TEXT_MODEL (model));
+ class = E_TEXT_MODEL_GET_CLASS (model);
+
/*
Objectify before emitting any signal.
While this method could, in theory, do pretty much anything, it is meant
for scanning objects and converting substrings into embedded objects.
*/
- if (E_TEXT_MODEL_GET_CLASS (model)->objectify)
- E_TEXT_MODEL_GET_CLASS (model)->objectify (model);
+ if (class->objectify != NULL)
+ class->objectify (model);
- g_signal_emit (model,
- e_text_model_signals[E_TEXT_MODEL_CHANGED], 0);
+ g_signal_emit (model, signals[E_TEXT_MODEL_CHANGED], 0);
}
void
@@ -324,7 +320,7 @@ e_text_model_cancel_completion (ETextModel *model)
{
g_return_if_fail (E_IS_TEXT_MODEL (model));
- g_signal_emit (model, e_text_model_signals[E_TEXT_MODEL_CANCEL_COMPLETION], 0);
+ g_signal_emit (model, signals[E_TEXT_MODEL_CANCEL_COMPLETION], 0);
}
void
@@ -335,19 +331,22 @@ e_text_model_reposition (ETextModel *model,
g_return_if_fail (E_IS_TEXT_MODEL (model));
g_return_if_fail (fn != NULL);
- g_signal_emit (model,
- e_text_model_signals[E_TEXT_MODEL_REPOSITION], 0,
- fn, repos_data);
+ g_signal_emit (
+ model, signals[E_TEXT_MODEL_REPOSITION], 0, fn, repos_data);
}
gint
e_text_model_validate_position (ETextModel *model,
gint pos)
{
+ ETextModelClass *class;
+
g_return_val_if_fail (E_IS_TEXT_MODEL (model), 0);
- if (E_TEXT_MODEL_GET_CLASS (model)->validate_pos)
- pos = E_TEXT_MODEL_GET_CLASS (model)->validate_pos (model, pos);
+ class = E_TEXT_MODEL_GET_CLASS (model);
+
+ if (class->validate_pos != NULL)
+ pos = class->validate_pos (model, pos);
return pos;
}
@@ -355,22 +354,30 @@ e_text_model_validate_position (ETextModel *model,
const gchar *
e_text_model_get_text (ETextModel *model)
{
+ ETextModelClass *class;
+
g_return_val_if_fail (E_IS_TEXT_MODEL (model), NULL);
- if (E_TEXT_MODEL_GET_CLASS (model)->get_text)
- return E_TEXT_MODEL_GET_CLASS (model)->get_text (model);
+ class = E_TEXT_MODEL_GET_CLASS (model);
- return "";
+ if (class->get_text == NULL)
+ return "";
+
+ return class->get_text (model);
}
gint
e_text_model_get_text_length (ETextModel *model)
{
+ ETextModelClass *class;
+
g_return_val_if_fail (E_IS_TEXT_MODEL (model), 0);
- if (E_TEXT_MODEL_GET_CLASS (model)->get_text_len (model)) {
+ class = E_TEXT_MODEL_GET_CLASS (model);
- gint len = E_TEXT_MODEL_GET_CLASS (model)->get_text_len (model);
+ if (class->get_text_len (model)) {
+
+ gint len = class->get_text_len (model);
#ifdef PARANOID_DEBUGGING
const gchar *str = e_text_model_get_text (model);
@@ -392,10 +399,14 @@ void
e_text_model_set_text (ETextModel *model,
const gchar *text)
{
+ ETextModelClass *class;
+
g_return_if_fail (E_IS_TEXT_MODEL (model));
- if (E_TEXT_MODEL_GET_CLASS (model)->set_text)
- E_TEXT_MODEL_GET_CLASS (model)->set_text (model, text);
+ class = E_TEXT_MODEL_GET_CLASS (model);
+
+ if (class->set_text != NULL)
+ class->set_text (model, text);
}
void
@@ -403,13 +414,17 @@ e_text_model_insert (ETextModel *model,
gint position,
const gchar *text)
{
+ ETextModelClass *class;
+
g_return_if_fail (E_IS_TEXT_MODEL (model));
if (text == NULL)
return;
- if (E_TEXT_MODEL_GET_CLASS (model)->insert)
- E_TEXT_MODEL_GET_CLASS (model)->insert (model, position, text);
+ class = E_TEXT_MODEL_GET_CLASS (model);
+
+ if (class->insert != NULL)
+ class->insert (model, position, text);
}
void
@@ -418,14 +433,18 @@ e_text_model_insert_length (ETextModel *model,
const gchar *text,
gint length)
{
+ ETextModelClass *class;
+
g_return_if_fail (E_IS_TEXT_MODEL (model));
g_return_if_fail (length >= 0);
if (text == NULL || length == 0)
return;
- if (E_TEXT_MODEL_GET_CLASS (model)->insert_length)
- E_TEXT_MODEL_GET_CLASS (model)->insert_length (model, position, text, length);
+ class = E_TEXT_MODEL_GET_CLASS (model);
+
+ if (class->insert_length != NULL)
+ class->insert_length (model, position, text, length);
}
void
@@ -457,6 +476,7 @@ e_text_model_delete (ETextModel *model,
gint position,
gint length)
{
+ ETextModelClass *class;
gint txt_len;
g_return_if_fail (E_IS_TEXT_MODEL (model));
@@ -469,19 +489,25 @@ e_text_model_delete (ETextModel *model,
if (length <= 0)
return;
- if (E_TEXT_MODEL_GET_CLASS (model)->delete)
- E_TEXT_MODEL_GET_CLASS (model)->delete (model, position, length);
+ class = E_TEXT_MODEL_GET_CLASS (model);
+
+ if (class->delete != NULL)
+ class->delete (model, position, length);
}
gint
e_text_model_object_count (ETextModel *model)
{
+ ETextModelClass *class;
+
g_return_val_if_fail (E_IS_TEXT_MODEL (model), 0);
- if (E_TEXT_MODEL_GET_CLASS (model)->obj_count)
- return E_TEXT_MODEL_GET_CLASS (model)->obj_count (model);
+ class = E_TEXT_MODEL_GET_CLASS (model);
+
+ if (class->obj_count == NULL)
+ return 0;
- return 0;
+ return class->obj_count (model);
}
const gchar *
@@ -489,15 +515,19 @@ e_text_model_get_nth_object (ETextModel *model,
gint n,
gint *len)
{
+ ETextModelClass *class;
+
g_return_val_if_fail (E_IS_TEXT_MODEL (model), NULL);
if (n < 0 || n >= e_text_model_object_count (model))
return NULL;
- if (E_TEXT_MODEL_GET_CLASS (model)->get_nth_obj)
- return E_TEXT_MODEL_GET_CLASS (model)->get_nth_obj (model, n, len);
+ class = E_TEXT_MODEL_GET_CLASS (model);
- return NULL;
+ if (class->get_nth_obj == NULL)
+ return NULL;
+
+ return class->get_nth_obj (model, n, len);
}
gchar *
@@ -547,15 +577,18 @@ gint
e_text_model_get_object_at_offset (ETextModel *model,
gint offset)
{
+ ETextModelClass *class;
+
g_return_val_if_fail (E_IS_TEXT_MODEL (model), -1);
if (offset < 0 || offset >= e_text_model_get_text_length (model))
return -1;
- /* If an optimized version has been provided, we use it. */
- if (E_TEXT_MODEL_GET_CLASS (model)->obj_at_offset) {
+ class = E_TEXT_MODEL_GET_CLASS (model);
- return E_TEXT_MODEL_GET_CLASS (model)->obj_at_offset (model, offset);
+ /* If an optimized version has been provided, we use it. */
+ if (class->obj_at_offset != NULL) {
+ return class->obj_at_offset (model, offset);
} else {
/* If not, we fake it.*/
@@ -595,7 +628,7 @@ e_text_model_activate_nth_object (ETextModel *model,
g_return_if_fail (n >= 0);
g_return_if_fail (n < e_text_model_object_count (model));
- g_signal_emit (model, e_text_model_signals[E_TEXT_MODEL_OBJECT_ACTIVATED], 0, n);
+ g_signal_emit (model, signals[E_TEXT_MODEL_OBJECT_ACTIVATED], 0, n);
}
ETextModel *
diff --git a/widgets/text/e-text.c b/widgets/text/e-text.c
index 8e2149cd10..d75727fc7c 100644
--- a/widgets/text/e-text.c
+++ b/widgets/text/e-text.c
@@ -356,9 +356,12 @@ reset_layout_attrs (EText *text)
for (i = 0; i < object_count; i++) {
gint start_pos, end_pos;
- PangoAttribute *attr = pango_attr_underline_new (PANGO_UNDERLINE_SINGLE);
+ PangoAttribute *attr;
- e_text_model_get_nth_object_bounds (text->model, i, &start_pos, &end_pos);
+ attr = pango_attr_underline_new (PANGO_UNDERLINE_SINGLE);
+
+ e_text_model_get_nth_object_bounds (
+ text->model, i, &start_pos, &end_pos);
attr->start_index = g_utf8_offset_to_pointer (
text->text, start_pos) - text->text;
@@ -642,17 +645,13 @@ e_text_set_property (GObject *object,
text->model = E_TEXT_MODEL (g_value_get_object (value));
g_object_ref (text->model);
- text->model_changed_signal_id =
- g_signal_connect (text->model,
- "changed",
- G_CALLBACK (e_text_text_model_changed),
- text);
+ text->model_changed_signal_id = g_signal_connect (
+ text->model, "changed",
+ G_CALLBACK (e_text_text_model_changed), text);
- text->model_repos_signal_id =
- g_signal_connect (text->model,
- "reposition",
- G_CALLBACK (e_text_text_model_reposition),
- text);
+ text->model_repos_signal_id = g_signal_connect (
+ text->model, "reposition",
+ G_CALLBACK (e_text_text_model_reposition), text);
text->text = e_text_model_get_text (text->model);
g_signal_emit (text, e_text_signals[E_TEXT_CHANGED], 0);
@@ -670,11 +669,11 @@ e_text_set_property (GObject *object,
}
text->tep = E_TEXT_EVENT_PROCESSOR (g_value_get_object (value));
g_object_ref (text->tep);
- text->tep_command_id =
- g_signal_connect (text->tep,
- "command",
- G_CALLBACK (e_text_command),
- text);
+
+ text->tep_command_id = g_signal_connect (
+ text->tep, "command",
+ G_CALLBACK (e_text_command), text);
+
if (!text->allow_newlines)
g_object_set (text->tep,
"allow_newlines", FALSE,
@@ -1194,11 +1193,10 @@ _get_tep (EText *text)
{
if (!text->tep) {
text->tep = e_text_event_processor_emacs_like_new ();
- text->tep_command_id =
- g_signal_connect (text->tep,
- "command",
- G_CALLBACK (e_text_command),
- text);
+
+ text->tep_command_id = g_signal_connect (
+ text->tep, "command",
+ G_CALLBACK (e_text_command), text);
}
}
@@ -1397,13 +1395,15 @@ e_text_draw (GnomeCanvasItem *item,
thisheight = allocation.height - border_width * 2;
if (gtk_widget_has_default (widget) &&
- relief == GTK_RELIEF_NORMAL)
- {
- gtk_paint_box (style, cr,
- GTK_STATE_NORMAL, GTK_SHADOW_IN,
- widget, "buttondefault",
- thisx + xoff, thisy + yoff, thiswidth, thisheight);
- }
+ relief == GTK_RELIEF_NORMAL) {
+ gtk_paint_box (
+ style, cr,
+ GTK_STATE_NORMAL,
+ GTK_SHADOW_IN,
+ widget, "buttondefault",
+ thisx + xoff, thisy + yoff,
+ thiswidth, thisheight);
+ }
if (gtk_widget_get_can_default (widget)) {
thisx += style->xthickness;
@@ -1429,10 +1429,11 @@ e_text_draw (GnomeCanvasItem *item,
if ((relief != GTK_RELIEF_NONE) ||
((state != GTK_STATE_NORMAL) &&
(state != GTK_STATE_INSENSITIVE)))
- gtk_paint_box (style, cr, state,
- shadow_type, widget, "button",
- thisx + xoff, thisy + yoff,
- thiswidth, thisheight);
+ gtk_paint_box (
+ style, cr, state,
+ shadow_type, widget, "button",
+ thisx + xoff, thisy + yoff,
+ thiswidth, thisheight);
if (gtk_widget_has_focus (widget)) {
thisx -= 1;
@@ -1440,10 +1441,11 @@ e_text_draw (GnomeCanvasItem *item,
thiswidth += 2;
thisheight += 2;
- gtk_paint_focus (style, cr, state,
- widget, "button",
- thisx + xoff, thisy + yoff,
- thiswidth - 1, thisheight - 1);
+ gtk_paint_focus (
+ style, cr, state,
+ widget, "button",
+ thisx + xoff, thisy + yoff,
+ thiswidth - 1, thisheight - 1);
}
}
}
@@ -1472,10 +1474,10 @@ e_text_draw (GnomeCanvasItem *item,
cairo_save (cr);
if (text->clip) {
- cairo_rectangle (cr,
- xpos, ypos,
- text->clip_cwidth - text->xofs,
- text->clip_cheight - text->yofs);
+ cairo_rectangle (
+ cr, xpos, ypos,
+ text->clip_cwidth - text->xofs,
+ text->clip_cheight - text->yofs);
cairo_clip (cr);
}
@@ -1843,14 +1845,18 @@ e_text_event (GnomeCanvasItem *item,
if (focus_event->in) {
if (text->im_context) {
if (!text->im_context_signals_registered) {
- g_signal_connect (text->im_context, "commit",
- G_CALLBACK (e_text_commit_cb), text);
- g_signal_connect (text->im_context, "preedit_changed",
- G_CALLBACK (e_text_preedit_changed_cb), text);
- g_signal_connect (text->im_context, "retrieve_surrounding",
- G_CALLBACK (e_text_retrieve_surrounding_cb), text);
- g_signal_connect (text->im_context, "delete_surrounding",
- G_CALLBACK (e_text_delete_surrounding_cb), text);
+ g_signal_connect (
+ text->im_context, "commit",
+ G_CALLBACK (e_text_commit_cb), text);
+ g_signal_connect (
+ text->im_context, "preedit_changed",
+ G_CALLBACK (e_text_preedit_changed_cb), text);
+ g_signal_connect (
+ text->im_context, "retrieve_surrounding",
+ G_CALLBACK (e_text_retrieve_surrounding_cb), text);
+ g_signal_connect (
+ text->im_context, "delete_surrounding",
+ G_CALLBACK (e_text_delete_surrounding_cb), text);
text->im_context_signals_registered = TRUE;
}
gtk_im_context_focus_in (text->im_context);
@@ -1927,7 +1933,8 @@ e_text_event (GnomeCanvasItem *item,
e_tep_event.key.state = key.state;
e_tep_event.key.keyval = key.keyval;
- /* This is probably ugly hack, but we have to handle UTF-8 input somehow */
+ /* This is probably ugly hack, but we
+ * have to handle UTF-8 input somehow. */
#if 0
e_tep_event.key.length = key.length;
e_tep_event.key.string = key.string;
@@ -2206,11 +2213,11 @@ e_text_update_primary_selection (EText *text)
GDK_SELECTION_PRIMARY);
if (text->selection_start != text->selection_end) {
- if (!gtk_clipboard_set_with_owner (clipboard, targets, G_N_ELEMENTS (targets),
- primary_get_cb, primary_clear_cb, G_OBJECT (text)))
+ if (!gtk_clipboard_set_with_owner (
+ clipboard, targets, G_N_ELEMENTS (targets),
+ primary_get_cb, primary_clear_cb, G_OBJECT (text)))
primary_clear_cb (clipboard, text);
- }
- else {
+ } else {
if (gtk_clipboard_get_owner (clipboard) == G_OBJECT (text))
gtk_clipboard_clear (clipboard);
}
@@ -2301,8 +2308,9 @@ popup_targets_received (GtkClipboard *clipboard,
menuitem = gtk_image_menu_item_new_from_stock (GTK_STOCK_CUT, NULL);
gtk_widget_show (menuitem);
gtk_menu_shell_append (GTK_MENU_SHELL (popup_menu), menuitem);
- g_signal_connect_swapped (menuitem, "activate",
- G_CALLBACK (e_text_cut_clipboard), text);
+ g_signal_connect_swapped (
+ menuitem, "activate",
+ G_CALLBACK (e_text_cut_clipboard), text);
gtk_widget_set_sensitive (
menuitem, text->editable &&
(text->selection_start != text->selection_end));
@@ -2311,16 +2319,18 @@ popup_targets_received (GtkClipboard *clipboard,
menuitem = gtk_image_menu_item_new_from_stock (GTK_STOCK_COPY, NULL);
gtk_widget_show (menuitem);
gtk_menu_shell_append (GTK_MENU_SHELL (popup_menu), menuitem);
- g_signal_connect_swapped (menuitem, "activate",
- G_CALLBACK (e_text_copy_clipboard), text);
+ g_signal_connect_swapped (
+ menuitem, "activate",
+ G_CALLBACK (e_text_copy_clipboard), text);
gtk_widget_set_sensitive (menuitem, text->selection_start != text->selection_end);
/* paste menu item */
menuitem = gtk_image_menu_item_new_from_stock (GTK_STOCK_PASTE, NULL);
gtk_widget_show (menuitem);
gtk_menu_shell_append (GTK_MENU_SHELL (popup_menu), menuitem);
- g_signal_connect_swapped (menuitem, "activate",
- G_CALLBACK (e_text_paste_clipboard), text);
+ g_signal_connect_swapped (
+ menuitem, "activate",
+ G_CALLBACK (e_text_paste_clipboard), text);
gtk_widget_set_sensitive (
menuitem, text->editable &&
gtk_selection_data_targets_include_text (data));
@@ -2328,8 +2338,9 @@ popup_targets_received (GtkClipboard *clipboard,
menuitem = gtk_menu_item_new_with_label (_("Select All"));
gtk_widget_show (menuitem);
gtk_menu_shell_append (GTK_MENU_SHELL (popup_menu), menuitem);
- g_signal_connect_swapped (menuitem, "activate",
- G_CALLBACK (e_text_select_all), text);
+ g_signal_connect_swapped (
+ menuitem, "activate",
+ G_CALLBACK (e_text_select_all), text);
gtk_widget_set_sensitive (menuitem, strlen (text->text) > 0);
menuitem = gtk_separator_menu_item_new ();
@@ -2451,7 +2462,9 @@ find_offset_into_line (EText *text,
if (*p == '\n') {
if (start_of_line)
*start_of_line = p+1;
- return offset_into_text - g_utf8_pointer_to_offset (text->text, p + 1);
+ return offset_into_text -
+ g_utf8_pointer_to_offset (
+ text->text, p + 1);
}
p = g_utf8_find_prev_char (text->text, p);
}
@@ -2689,7 +2702,10 @@ _get_position (EText *text,
break;
}
case E_TEP_BACKWARD_LINE: {
- gint offset_into_line = find_offset_into_line (text, text->selection_end, &p);
+ gint offset_into_line;
+
+ offset_into_line = find_offset_into_line (
+ text, text->selection_end, &p);
if (offset_into_line == -1)
return text->selection_end;
@@ -3131,13 +3147,13 @@ e_text_command (ETextEventProcessor *tep,
/* Class initialization function for the text item */
static void
-e_text_class_init (ETextClass *klass)
+e_text_class_init (ETextClass *class)
{
GObjectClass *gobject_class;
GnomeCanvasItemClass *item_class;
- gobject_class = (GObjectClass *) klass;
- item_class = (GnomeCanvasItemClass *) klass;
+ gobject_class = (GObjectClass *) class;
+ item_class = (GnomeCanvasItemClass *) class;
gobject_class->dispose = e_text_dispose;
gobject_class->set_property = e_text_set_property;
@@ -3151,8 +3167,8 @@ e_text_class_init (ETextClass *klass)
item_class->bounds = e_text_bounds;
item_class->event = e_text_event;
- klass->changed = NULL;
- klass->activate = NULL;
+ class->changed = NULL;
+ class->activate = NULL;
e_text_signals[E_TEXT_CHANGED] =
g_signal_new ("changed",
@@ -3432,16 +3448,13 @@ e_text_init (EText *text)
text->revert = NULL;
- text->model_changed_signal_id =
- g_signal_connect (text->model,
- "changed",
- G_CALLBACK (e_text_text_model_changed),
- text);
- text->model_repos_signal_id =
- g_signal_connect (text->model,
- "reposition",
- G_CALLBACK (e_text_text_model_reposition),
- text);
+ text->model_changed_signal_id = g_signal_connect (
+ text->model, "changed",
+ G_CALLBACK (e_text_text_model_changed), text);
+
+ text->model_repos_signal_id = g_signal_connect (
+ text->model, "reposition",
+ G_CALLBACK (e_text_text_model_reposition), text);
text->justification = GTK_JUSTIFY_LEFT;
text->clip_width = -1.0;
diff --git a/widgets/text/gal-a11y-e-text-factory.c b/widgets/text/gal-a11y-e-text-factory.c
index 8da12ee294..8e33b38562 100644
--- a/widgets/text/gal-a11y-e-text-factory.c
+++ b/widgets/text/gal-a11y-e-text-factory.c
@@ -53,9 +53,9 @@ gal_a11y_e_text_factory_create_accessible (GObject *obj)
}
static void
-gal_a11y_e_text_factory_class_init (GalA11yETextFactoryClass *klass)
+gal_a11y_e_text_factory_class_init (GalA11yETextFactoryClass *class)
{
- AtkObjectFactoryClass *factory_class = ATK_OBJECT_FACTORY_CLASS (klass);
+ AtkObjectFactoryClass *factory_class = ATK_OBJECT_FACTORY_CLASS (class);
parent_class = g_type_class_ref (PARENT_TYPE);
diff --git a/widgets/text/gal-a11y-e-text.c b/widgets/text/gal-a11y-e-text.c
index 609b23a900..ba7e7dd35f 100644
--- a/widgets/text/gal-a11y-e-text.c
+++ b/widgets/text/gal-a11y-e-text.c
@@ -1024,21 +1024,23 @@ et_real_initialize (AtkObject *obj,
etext = E_TEXT (data);
/* Set up signal callbacks */
- g_signal_connect (etext->model, "reposition",
+ g_signal_connect (
+ etext->model, "reposition",
G_CALLBACK (_et_reposition_cb), obj);
if (etext->tep)
- g_signal_connect_after (etext->tep, "command",
+ g_signal_connect_after (
+ etext->tep, "command",
(GCallback) _et_command_cb, obj);
obj->role = ATK_ROLE_TEXT;
}
static void
-et_class_init (GalA11yETextClass *klass)
+et_class_init (GalA11yETextClass *class)
{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
- AtkObjectClass *atk_class = ATK_OBJECT_CLASS (klass);
+ GObjectClass *object_class = G_OBJECT_CLASS (class);
+ AtkObjectClass *atk_class = ATK_OBJECT_CLASS (class);
quark_accessible_object =
g_quark_from_static_string ("gtk-accessible-object");