diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2012-12-10 21:09:59 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2012-12-13 03:33:43 +0800 |
commit | d09d8de870b6697c8a8b262e7e077b871a69b315 (patch) | |
tree | 3b718882e7a0bb0a996daf2967a033d91714c9b5 | |
parent | b61331ed03ac1c7a9b8614e25510040b9c60ae02 (diff) | |
download | gsoc2013-evolution-d09d8de870b6697c8a8b262e7e077b871a69b315.tar.gz gsoc2013-evolution-d09d8de870b6697c8a8b262e7e077b871a69b315.tar.zst gsoc2013-evolution-d09d8de870b6697c8a8b262e7e077b871a69b315.zip |
Consolidate base utility libraries into libeutil.
Evolution consists of entirely too many small utility libraries, which
increases linking and loading time, places a burden on higher layers of
the application (e.g. modules) which has to remember to link to all the
small in-tree utility libraries, and makes it difficult to generate API
documentation for these utility libraries in one Gtk-Doc module.
Merge the following utility libraries under the umbrella of libeutil,
and enforce a single-include policy on libeutil so we can reorganize
the files as desired without disrupting its pseudo-public API.
libemail-utils/libemail-utils.la
libevolution-utils/libevolution-utils.la
filter/libfilter.la
widgets/e-timezone-dialog/libetimezonedialog.la
widgets/menus/libmenus.la
widgets/misc/libemiscwidgets.la
widgets/table/libetable.la
widgets/text/libetext.la
This also merges libedataserverui from the Evolution-Data-Server module,
since Evolution is its only consumer nowadays, and I'd like to make some
improvements to those APIs without concern for backward-compatibility.
And finally, start a Gtk-Doc module for libeutil. It's going to be a
project just getting all the symbols _listed_ much less _documented_.
But the skeletal structure is in place and I'm off to a good start.
-rw-r--r-- | Makefile.am | 7 | ||||
-rw-r--r-- | a11y/Makefile.am | 23 | ||||
-rw-r--r-- | addressbook/gui/contact-editor/Makefile.am | 12 | ||||
-rw-r--r-- | addressbook/gui/contact-editor/e-contact-editor.c | 11 | ||||
-rw-r--r-- | addressbook/gui/contact-editor/e-contact-quick-add.c | 3 | ||||
-rw-r--r-- | addressbook/gui/contact-list-editor/Makefile.am | 12 | ||||
-rw-r--r-- | addressbook/gui/contact-list-editor/e-contact-list-editor.c | 7 | ||||
-rw-r--r-- | addressbook/gui/contact-list-editor/e-contact-list-editor.h | 2 | ||||
-rw-r--r-- | addressbook/gui/contact-list-editor/e-contact-list-model.c | 1 | ||||
-rw-r--r-- | addressbook/gui/merging/Makefile.am | 2 | ||||
-rw-r--r-- | addressbook/gui/merging/eab-contact-compare.c | 2 | ||||
-rw-r--r-- | addressbook/gui/widgets/Makefile.am | 7 | ||||
-rw-r--r-- | addressbook/gui/widgets/e-addressbook-reflow-adapter.h | 3 | ||||
-rw-r--r-- | addressbook/gui/widgets/e-addressbook-selector.c | 2 | ||||
-rw-r--r-- | addressbook/gui/widgets/e-addressbook-selector.h | 2 | ||||
-rw-r--r-- | addressbook/gui/widgets/e-addressbook-table-adapter.h | 2 | ||||
-rw-r--r-- | addressbook/gui/widgets/e-addressbook-view.c | 29 | ||||
-rw-r--r-- | addressbook/gui/widgets/e-addressbook-view.h | 3 | ||||
-rw-r--r-- | addressbook/gui/widgets/e-minicard-label.c | 9 | ||||
-rw-r--r-- | addressbook/gui/widgets/e-minicard-view-widget.c | 5 | ||||
-rw-r--r-- | addressbook/gui/widgets/e-minicard-view-widget.h | 3 | ||||
-rw-r--r-- | addressbook/gui/widgets/e-minicard-view.c | 13 | ||||
-rw-r--r-- | addressbook/gui/widgets/e-minicard-view.h | 4 | ||||
-rw-r--r-- | addressbook/gui/widgets/e-minicard.c | 15 | ||||
-rw-r--r-- | addressbook/gui/widgets/ea-addressbook.c | 4 | ||||
-rw-r--r-- | addressbook/gui/widgets/eab-config.h | 2 | ||||
-rw-r--r-- | addressbook/gui/widgets/eab-contact-display.c | 20 | ||||
-rw-r--r-- | addressbook/gui/widgets/eab-contact-display.h | 2 | ||||
-rw-r--r-- | addressbook/gui/widgets/eab-contact-formatter.c | 15 | ||||
-rw-r--r-- | addressbook/gui/widgets/eab-gui-util.c | 8 | ||||
-rw-r--r-- | addressbook/gui/widgets/eab-gui-util.h | 2 | ||||
-rw-r--r-- | addressbook/gui/widgets/gal-view-factory-minicard.h | 2 | ||||
-rw-r--r-- | addressbook/gui/widgets/gal-view-minicard.c | 1 | ||||
-rw-r--r-- | addressbook/gui/widgets/gal-view-minicard.h | 2 | ||||
-rw-r--r-- | addressbook/importers/Makefile.am | 8 | ||||
-rw-r--r-- | addressbook/importers/evolution-csv-importer.c | 2 | ||||
-rw-r--r-- | addressbook/importers/evolution-ldif-importer.c | 2 | ||||
-rw-r--r-- | addressbook/importers/evolution-vcard-importer.c | 4 | ||||
-rw-r--r-- | addressbook/printing/Makefile.am | 9 | ||||
-rw-r--r-- | addressbook/printing/e-contact-print.c | 1 | ||||
-rw-r--r-- | addressbook/util/Makefile.am | 2 | ||||
-rw-r--r-- | calendar/alarm-notify/Makefile.am | 9 | ||||
-rw-r--r-- | calendar/alarm-notify/alarm-notify-dialog.c | 6 | ||||
-rw-r--r-- | calendar/alarm-notify/alarm-notify.c | 2 | ||||
-rw-r--r-- | calendar/alarm-notify/alarm-notify.h | 1 | ||||
-rw-r--r-- | calendar/gui/Makefile.am | 10 | ||||
-rw-r--r-- | calendar/gui/calendar-config.c | 3 | ||||
-rw-r--r-- | calendar/gui/calendar-config.h | 2 | ||||
-rw-r--r-- | calendar/gui/calendar-view-factory.h | 1 | ||||
-rw-r--r-- | calendar/gui/calendar-view.h | 1 | ||||
-rw-r--r-- | calendar/gui/comp-util.c | 2 | ||||
-rw-r--r-- | calendar/gui/comp-util.h | 2 | ||||
-rw-r--r-- | calendar/gui/dialogs/Makefile.am | 11 | ||||
-rw-r--r-- | calendar/gui/dialogs/alarm-dialog.c | 7 | ||||
-rw-r--r-- | calendar/gui/dialogs/cancel-comp.c | 6 | ||||
-rw-r--r-- | calendar/gui/dialogs/cancel-comp.h | 1 | ||||
-rw-r--r-- | calendar/gui/dialogs/comp-editor-util.c | 4 | ||||
-rw-r--r-- | calendar/gui/dialogs/comp-editor-util.h | 1 | ||||
-rw-r--r-- | calendar/gui/dialogs/comp-editor.c | 9 | ||||
-rw-r--r-- | calendar/gui/dialogs/comp-editor.h | 4 | ||||
-rw-r--r-- | calendar/gui/dialogs/copy-source-dialog.c | 3 | ||||
-rw-r--r-- | calendar/gui/dialogs/delete-comp.c | 6 | ||||
-rw-r--r-- | calendar/gui/dialogs/e-delegate-dialog.c | 1 | ||||
-rw-r--r-- | calendar/gui/dialogs/e-send-options-utils.h | 2 | ||||
-rw-r--r-- | calendar/gui/dialogs/event-editor.c | 5 | ||||
-rw-r--r-- | calendar/gui/dialogs/event-page.c | 13 | ||||
-rw-r--r-- | calendar/gui/dialogs/memo-editor.c | 3 | ||||
-rw-r--r-- | calendar/gui/dialogs/memo-page.c | 11 | ||||
-rw-r--r-- | calendar/gui/dialogs/recurrence-page.c | 5 | ||||
-rw-r--r-- | calendar/gui/dialogs/save-comp.c | 1 | ||||
-rw-r--r-- | calendar/gui/dialogs/schedule-page.c | 3 | ||||
-rw-r--r-- | calendar/gui/dialogs/schedule-page.h | 1 | ||||
-rw-r--r-- | calendar/gui/dialogs/select-source-dialog.c | 3 | ||||
-rw-r--r-- | calendar/gui/dialogs/send-comp.c | 6 | ||||
-rw-r--r-- | calendar/gui/dialogs/task-details-page.c | 7 | ||||
-rw-r--r-- | calendar/gui/dialogs/task-editor.c | 3 | ||||
-rw-r--r-- | calendar/gui/dialogs/task-page.c | 11 | ||||
-rw-r--r-- | calendar/gui/e-cal-component-preview.c | 3 | ||||
-rw-r--r-- | calendar/gui/e-cal-component-preview.h | 3 | ||||
-rw-r--r-- | calendar/gui/e-cal-config.h | 3 | ||||
-rw-r--r-- | calendar/gui/e-cal-event.h | 3 | ||||
-rw-r--r-- | calendar/gui/e-cal-list-view.c | 10 | ||||
-rw-r--r-- | calendar/gui/e-cal-list-view.h | 3 | ||||
-rw-r--r-- | calendar/gui/e-cal-model.h | 4 | ||||
-rw-r--r-- | calendar/gui/e-calendar-selector.c | 2 | ||||
-rw-r--r-- | calendar/gui/e-calendar-selector.h | 2 | ||||
-rw-r--r-- | calendar/gui/e-calendar-view.c | 10 | ||||
-rw-r--r-- | calendar/gui/e-cell-date-edit-text.c | 3 | ||||
-rw-r--r-- | calendar/gui/e-cell-date-edit-text.h | 2 | ||||
-rw-r--r-- | calendar/gui/e-day-view-layout.c | 1 | ||||
-rw-r--r-- | calendar/gui/e-day-view-main-item.c | 10 | ||||
-rw-r--r-- | calendar/gui/e-day-view-time-item.c | 1 | ||||
-rw-r--r-- | calendar/gui/e-day-view-top-item.c | 1 | ||||
-rw-r--r-- | calendar/gui/e-day-view.c | 24 | ||||
-rw-r--r-- | calendar/gui/e-meeting-list-view.c | 1 | ||||
-rw-r--r-- | calendar/gui/e-meeting-list-view.h | 1 | ||||
-rw-r--r-- | calendar/gui/e-meeting-store.c | 1 | ||||
-rw-r--r-- | calendar/gui/e-meeting-store.h | 3 | ||||
-rw-r--r-- | calendar/gui/e-meeting-time-sel-item.c | 2 | ||||
-rw-r--r-- | calendar/gui/e-meeting-time-sel.c | 7 | ||||
-rw-r--r-- | calendar/gui/e-meeting-time-sel.h | 6 | ||||
-rw-r--r-- | calendar/gui/e-memo-list-selector.c | 1 | ||||
-rw-r--r-- | calendar/gui/e-memo-list-selector.h | 2 | ||||
-rw-r--r-- | calendar/gui/e-memo-table.c | 16 | ||||
-rw-r--r-- | calendar/gui/e-memo-table.h | 3 | ||||
-rw-r--r-- | calendar/gui/e-select-names-editable.h | 2 | ||||
-rw-r--r-- | calendar/gui/e-task-list-selector.c | 1 | ||||
-rw-r--r-- | calendar/gui/e-task-list-selector.h | 2 | ||||
-rw-r--r-- | calendar/gui/e-task-table.c | 17 | ||||
-rw-r--r-- | calendar/gui/e-task-table.h | 3 | ||||
-rw-r--r-- | calendar/gui/e-timezone-entry.c | 6 | ||||
-rw-r--r-- | calendar/gui/e-week-view-event-item.c | 4 | ||||
-rw-r--r-- | calendar/gui/e-week-view.c | 17 | ||||
-rw-r--r-- | calendar/gui/ea-cal-view-event.c | 4 | ||||
-rw-r--r-- | calendar/gui/ea-calendar-helpers.c | 1 | ||||
-rw-r--r-- | calendar/gui/ea-calendar.c | 3 | ||||
-rw-r--r-- | calendar/gui/ea-day-view-cell.c | 1 | ||||
-rw-r--r-- | calendar/gui/ea-day-view-main-item.c | 4 | ||||
-rw-r--r-- | calendar/gui/ea-week-view-cell.c | 1 | ||||
-rw-r--r-- | calendar/gui/ea-week-view-main-item.c | 5 | ||||
-rw-r--r-- | calendar/gui/ea-week-view.c | 5 | ||||
-rw-r--r-- | calendar/gui/gnome-cal.c | 32 | ||||
-rw-r--r-- | calendar/gui/gnome-cal.h | 2 | ||||
-rw-r--r-- | calendar/gui/itip-utils.c | 2 | ||||
-rw-r--r-- | calendar/gui/print.c | 6 | ||||
-rw-r--r-- | calendar/gui/print.h | 3 | ||||
-rw-r--r-- | calendar/gui/tag-calendar.h | 2 | ||||
-rw-r--r-- | calendar/importers/Makefile.am | 4 | ||||
-rw-r--r-- | calendar/importers/icalendar-importer.c | 9 | ||||
-rw-r--r-- | composer/Makefile.am | 9 | ||||
-rw-r--r-- | composer/e-composer-actions.c | 1 | ||||
-rw-r--r-- | composer/e-composer-activity.h | 1 | ||||
-rw-r--r-- | composer/e-composer-common.h | 1 | ||||
-rw-r--r-- | composer/e-composer-from-header.c | 2 | ||||
-rw-r--r-- | composer/e-composer-header-table.c | 2 | ||||
-rw-r--r-- | composer/e-composer-header-table.h | 1 | ||||
-rw-r--r-- | composer/e-composer-name-header.h | 1 | ||||
-rw-r--r-- | composer/e-composer-private.h | 18 | ||||
-rw-r--r-- | composer/e-composer-spell-header.c | 2 | ||||
-rw-r--r-- | composer/e-msg-composer.c | 4 | ||||
-rw-r--r-- | composer/e-msg-composer.h | 3 | ||||
-rw-r--r-- | configure.ac | 16 | ||||
-rw-r--r-- | doc/reference/Makefile.am | 2 | ||||
-rw-r--r-- | doc/reference/libeshell/Makefile.am (renamed from doc/reference/shell/Makefile.am) | 13 | ||||
-rw-r--r-- | doc/reference/libeshell/libeshell-docs.sgml (renamed from doc/reference/shell/eshell-docs.sgml) | 23 | ||||
-rw-r--r-- | doc/reference/libeshell/libeshell-overrides.txt (renamed from doc/reference/shell/eshell-overrides.txt) | 0 | ||||
-rw-r--r-- | doc/reference/libeshell/libeshell-sections.txt | 423 | ||||
-rw-r--r-- | doc/reference/libeshell/libeshell.types (renamed from doc/reference/shell/eshell.types) | 1 | ||||
-rw-r--r-- | doc/reference/libeshell/tmpl/e-mail-account-manager.sgml (renamed from doc/reference/shell/tmpl/e-mail-account-manager.sgml) | 0 | ||||
-rw-r--r-- | doc/reference/libeshell/tmpl/e-mail-account-tree-view.sgml (renamed from doc/reference/shell/tmpl/e-mail-account-tree-view.sgml) | 0 | ||||
-rw-r--r-- | doc/reference/libeshell/tmpl/e-mail-identity-combo-box.sgml (renamed from doc/reference/shell/tmpl/e-mail-identity-combo-box.sgml) | 0 | ||||
-rw-r--r-- | doc/reference/libeutil/Makefile.am | 67 | ||||
-rw-r--r-- | doc/reference/libeutil/libeutil-docs.sgml | 263 | ||||
-rw-r--r-- | doc/reference/libeutil/libeutil-overrides.txt | 0 | ||||
-rw-r--r-- | doc/reference/libeutil/libeutil-sections.txt | 1900 | ||||
-rw-r--r-- | doc/reference/libeutil/libeutil.types | 170 | ||||
-rw-r--r-- | doc/reference/shell/eshell-sections.txt | 1096 | ||||
-rw-r--r-- | e-util/Makefile.am | 755 | ||||
-rw-r--r-- | e-util/arrow-down.xpm (renamed from widgets/table/arrow-down.xpm) | 0 | ||||
-rw-r--r-- | e-util/arrow-up.xpm (renamed from widgets/table/arrow-up.xpm) | 0 | ||||
-rw-r--r-- | e-util/check-empty.xpm (renamed from widgets/table/check-empty.xpm) | 0 | ||||
-rw-r--r-- | e-util/check-filled.xpm (renamed from widgets/table/check-filled.xpm) | 0 | ||||
-rw-r--r-- | e-util/e-action-combo-box.c (renamed from widgets/misc/e-action-combo-box.c) | 0 | ||||
-rw-r--r-- | e-util/e-action-combo-box.h (renamed from widgets/misc/e-action-combo-box.h) | 4 | ||||
-rw-r--r-- | e-util/e-activity-bar.c (renamed from widgets/misc/e-activity-bar.c) | 0 | ||||
-rw-r--r-- | e-util/e-activity-bar.h (renamed from widgets/misc/e-activity-bar.h) | 4 | ||||
-rw-r--r-- | e-util/e-activity-proxy.c (renamed from widgets/misc/e-activity-proxy.c) | 0 | ||||
-rw-r--r-- | e-util/e-activity-proxy.h (renamed from widgets/misc/e-activity-proxy.h) | 4 | ||||
-rw-r--r-- | e-util/e-activity.c | 3 | ||||
-rw-r--r-- | e-util/e-activity.h | 7 | ||||
-rw-r--r-- | e-util/e-alarm-selector.c (renamed from widgets/misc/e-alarm-selector.c) | 0 | ||||
-rw-r--r-- | e-util/e-alarm-selector.h (renamed from widgets/misc/e-alarm-selector.h) | 6 | ||||
-rw-r--r-- | e-util/e-alert-bar.c (renamed from widgets/misc/e-alert-bar.c) | 0 | ||||
-rw-r--r-- | e-util/e-alert-bar.h (renamed from widgets/misc/e-alert-bar.h) | 7 | ||||
-rw-r--r-- | e-util/e-alert-dialog.c (renamed from libevolution-utils/e-alert-dialog.c) | 0 | ||||
-rw-r--r-- | e-util/e-alert-dialog.h (renamed from libevolution-utils/e-alert-dialog.h) | 3 | ||||
-rw-r--r-- | e-util/e-alert-sink.c (renamed from libevolution-utils/e-alert-sink.c) | 2 | ||||
-rw-r--r-- | e-util/e-alert-sink.h (renamed from libevolution-utils/e-alert-sink.h) | 3 | ||||
-rw-r--r-- | e-util/e-alert.c (renamed from libevolution-utils/e-alert.c) | 0 | ||||
-rw-r--r-- | e-util/e-alert.h (renamed from libevolution-utils/e-alert.h) | 0 | ||||
-rw-r--r-- | e-util/e-attachment-bar.c (renamed from widgets/misc/e-attachment-bar.c) | 0 | ||||
-rw-r--r-- | e-util/e-attachment-bar.h (renamed from widgets/misc/e-attachment-bar.h) | 6 | ||||
-rw-r--r-- | e-util/e-attachment-button.c (renamed from widgets/misc/e-attachment-button.c) | 0 | ||||
-rw-r--r-- | e-util/e-attachment-button.h (renamed from widgets/misc/e-attachment-button.h) | 8 | ||||
-rw-r--r-- | e-util/e-attachment-dialog.c (renamed from widgets/misc/e-attachment-dialog.c) | 0 | ||||
-rw-r--r-- | e-util/e-attachment-dialog.h (renamed from widgets/misc/e-attachment-dialog.h) | 6 | ||||
-rw-r--r-- | e-util/e-attachment-handler-image.c (renamed from widgets/misc/e-attachment-handler-image.c) | 2 | ||||
-rw-r--r-- | e-util/e-attachment-handler-image.h (renamed from widgets/misc/e-attachment-handler-image.h) | 6 | ||||
-rw-r--r-- | e-util/e-attachment-handler-sendto.c (renamed from widgets/misc/e-attachment-handler-sendto.c) | 0 | ||||
-rw-r--r-- | e-util/e-attachment-handler-sendto.h (renamed from widgets/misc/e-attachment-handler-sendto.h) | 6 | ||||
-rw-r--r-- | e-util/e-attachment-handler.c (renamed from widgets/misc/e-attachment-handler.c) | 0 | ||||
-rw-r--r-- | e-util/e-attachment-handler.h (renamed from widgets/misc/e-attachment-handler.h) | 6 | ||||
-rw-r--r-- | e-util/e-attachment-icon-view.c (renamed from widgets/misc/e-attachment-icon-view.c) | 0 | ||||
-rw-r--r-- | e-util/e-attachment-icon-view.h (renamed from widgets/misc/e-attachment-icon-view.h) | 4 | ||||
-rw-r--r-- | e-util/e-attachment-paned.c (renamed from widgets/misc/e-attachment-paned.c) | 0 | ||||
-rw-r--r-- | e-util/e-attachment-paned.h (renamed from widgets/misc/e-attachment-paned.h) | 4 | ||||
-rw-r--r-- | e-util/e-attachment-store.c (renamed from widgets/misc/e-attachment-store.c) | 3 | ||||
-rw-r--r-- | e-util/e-attachment-store.h (renamed from widgets/misc/e-attachment-store.h) | 6 | ||||
-rw-r--r-- | e-util/e-attachment-tree-view.c (renamed from widgets/misc/e-attachment-tree-view.c) | 0 | ||||
-rw-r--r-- | e-util/e-attachment-tree-view.h (renamed from widgets/misc/e-attachment-tree-view.h) | 4 | ||||
-rw-r--r-- | e-util/e-attachment-view.c (renamed from widgets/misc/e-attachment-view.c) | 7 | ||||
-rw-r--r-- | e-util/e-attachment-view.h (renamed from widgets/misc/e-attachment-view.h) | 6 | ||||
-rw-r--r-- | e-util/e-attachment.c (renamed from widgets/misc/e-attachment.c) | 5 | ||||
-rw-r--r-- | e-util/e-attachment.h (renamed from widgets/misc/e-attachment.h) | 4 | ||||
-rw-r--r-- | e-util/e-auth-combo-box.c (renamed from widgets/misc/e-auth-combo-box.c) | 0 | ||||
-rw-r--r-- | e-util/e-auth-combo-box.h (renamed from widgets/misc/e-auth-combo-box.h) | 4 | ||||
-rw-r--r-- | e-util/e-autocomplete-selector.c (renamed from widgets/misc/e-autocomplete-selector.c) | 0 | ||||
-rw-r--r-- | e-util/e-autocomplete-selector.h (renamed from widgets/misc/e-autocomplete-selector.h) | 6 | ||||
-rw-r--r-- | e-util/e-bit-array.c | 1 | ||||
-rw-r--r-- | e-util/e-bit-array.h | 4 | ||||
-rw-r--r-- | e-util/e-book-source-config.c (renamed from widgets/misc/e-book-source-config.c) | 0 | ||||
-rw-r--r-- | e-util/e-book-source-config.h (renamed from widgets/misc/e-book-source-config.h) | 6 | ||||
-rw-r--r-- | e-util/e-buffer-tagger.c (renamed from widgets/misc/e-buffer-tagger.c) | 3 | ||||
-rw-r--r-- | e-util/e-buffer-tagger.h (renamed from widgets/misc/e-buffer-tagger.h) | 4 | ||||
-rw-r--r-- | e-util/e-cal-source-config.c (renamed from widgets/misc/e-cal-source-config.c) | 2 | ||||
-rw-r--r-- | e-util/e-cal-source-config.h (renamed from widgets/misc/e-cal-source-config.h) | 6 | ||||
-rw-r--r-- | e-util/e-calendar-item.c (renamed from widgets/misc/e-calendar-item.c) | 5 | ||||
-rw-r--r-- | e-util/e-calendar-item.h (renamed from widgets/misc/e-calendar-item.h) | 10 | ||||
-rw-r--r-- | e-util/e-calendar.c (renamed from widgets/misc/e-calendar.c) | 0 | ||||
-rw-r--r-- | e-util/e-calendar.h (renamed from widgets/misc/e-calendar.h) | 8 | ||||
-rw-r--r-- | e-util/e-canvas-background.c (renamed from widgets/misc/e-canvas-background.c) | 10 | ||||
-rw-r--r-- | e-util/e-canvas-background.h | 75 | ||||
-rw-r--r-- | e-util/e-canvas-utils.c (renamed from widgets/misc/e-canvas-utils.c) | 0 | ||||
-rw-r--r-- | e-util/e-canvas-utils.h (renamed from widgets/misc/e-canvas-utils.h) | 4 | ||||
-rw-r--r-- | e-util/e-canvas-vbox.c (renamed from widgets/misc/e-canvas-vbox.c) | 1 | ||||
-rw-r--r-- | e-util/e-canvas-vbox.h | 92 | ||||
-rw-r--r-- | e-util/e-canvas.c (renamed from widgets/misc/e-canvas.c) | 2 | ||||
-rw-r--r-- | e-util/e-canvas.h (renamed from widgets/misc/e-canvas.h) | 4 | ||||
-rw-r--r-- | e-util/e-categories-config.c | 5 | ||||
-rw-r--r-- | e-util/e-categories-config.h | 4 | ||||
-rw-r--r-- | e-util/e-categories-dialog.c | 155 | ||||
-rw-r--r-- | e-util/e-categories-dialog.h | 73 | ||||
-rw-r--r-- | e-util/e-categories-editor.c | 435 | ||||
-rw-r--r-- | e-util/e-categories-editor.h | 88 | ||||
-rw-r--r-- | e-util/e-categories-selector.c | 587 | ||||
-rw-r--r-- | e-util/e-categories-selector.h | 97 | ||||
-rw-r--r-- | e-util/e-category-completion.c | 505 | ||||
-rw-r--r-- | e-util/e-category-completion.h | 72 | ||||
-rw-r--r-- | e-util/e-category-editor.c | 343 | ||||
-rw-r--r-- | e-util/e-category-editor.h | 81 | ||||
-rw-r--r-- | e-util/e-cell-checkbox.c (renamed from widgets/table/e-cell-checkbox.c) | 2 | ||||
-rw-r--r-- | e-util/e-cell-checkbox.h (renamed from widgets/table/e-cell-checkbox.h) | 6 | ||||
-rw-r--r-- | e-util/e-cell-combo.c (renamed from widgets/table/e-cell-combo.c) | 11 | ||||
-rw-r--r-- | e-util/e-cell-combo.h (renamed from widgets/table/e-cell-combo.h) | 6 | ||||
-rw-r--r-- | e-util/e-cell-date-edit.c (renamed from widgets/table/e-cell-date-edit.c) | 11 | ||||
-rw-r--r-- | e-util/e-cell-date-edit.h (renamed from widgets/table/e-cell-date-edit.h) | 7 | ||||
-rw-r--r-- | e-util/e-cell-date.c (renamed from widgets/table/e-cell-date.c) | 8 | ||||
-rw-r--r-- | e-util/e-cell-date.h (renamed from widgets/table/e-cell-date.h) | 6 | ||||
-rw-r--r-- | e-util/e-cell-hbox.c (renamed from widgets/table/e-cell-hbox.c) | 1 | ||||
-rw-r--r-- | e-util/e-cell-hbox.h (renamed from widgets/table/e-cell-hbox.h) | 7 | ||||
-rw-r--r-- | e-util/e-cell-number.c (renamed from widgets/table/e-cell-number.c) | 5 | ||||
-rw-r--r-- | e-util/e-cell-number.h (renamed from widgets/table/e-cell-number.h) | 6 | ||||
-rw-r--r-- | e-util/e-cell-percent.c (renamed from widgets/table/e-cell-percent.c) | 0 | ||||
-rw-r--r-- | e-util/e-cell-percent.h (renamed from widgets/table/e-cell-percent.h) | 12 | ||||
-rw-r--r-- | e-util/e-cell-pixbuf.c (renamed from widgets/table/e-cell-pixbuf.c) | 0 | ||||
-rw-r--r-- | e-util/e-cell-pixbuf.h (renamed from widgets/table/e-cell-pixbuf.h) | 6 | ||||
-rw-r--r-- | e-util/e-cell-popup.c (renamed from widgets/table/e-cell-popup.c) | 1 | ||||
-rw-r--r-- | e-util/e-cell-popup.h (renamed from widgets/table/e-cell-popup.h) | 7 | ||||
-rw-r--r-- | e-util/e-cell-renderer-color.c | 243 | ||||
-rw-r--r-- | e-util/e-cell-renderer-color.h | 79 | ||||
-rw-r--r-- | e-util/e-cell-size.c (renamed from widgets/table/e-cell-size.c) | 2 | ||||
-rw-r--r-- | e-util/e-cell-size.h (renamed from widgets/table/e-cell-size.h) | 6 | ||||
-rw-r--r-- | e-util/e-cell-text.c (renamed from widgets/table/e-cell-text.c) | 19 | ||||
-rw-r--r-- | e-util/e-cell-text.h (renamed from widgets/table/e-cell-text.h) | 7 | ||||
-rw-r--r-- | e-util/e-cell-toggle.c (renamed from widgets/table/e-cell-toggle.c) | 1 | ||||
-rw-r--r-- | e-util/e-cell-toggle.h (renamed from widgets/table/e-cell-toggle.h) | 7 | ||||
-rw-r--r-- | e-util/e-cell-tree.c (renamed from widgets/table/e-cell-tree.c) | 1 | ||||
-rw-r--r-- | e-util/e-cell-tree.h (renamed from widgets/table/e-cell-tree.h) | 7 | ||||
-rw-r--r-- | e-util/e-cell-vbox.c (renamed from widgets/table/e-cell-vbox.c) | 1 | ||||
-rw-r--r-- | e-util/e-cell-vbox.h (renamed from widgets/table/e-cell-vbox.h) | 7 | ||||
-rw-r--r-- | e-util/e-cell.c (renamed from widgets/table/e-cell.c) | 1 | ||||
-rw-r--r-- | e-util/e-cell.h (renamed from widgets/table/e-cell.h) | 7 | ||||
-rw-r--r-- | e-util/e-charset-combo-box.c (renamed from widgets/misc/e-charset-combo-box.c) | 4 | ||||
-rw-r--r-- | e-util/e-charset-combo-box.h (renamed from widgets/misc/e-charset-combo-box.h) | 6 | ||||
-rw-r--r-- | e-util/e-charset.h | 4 | ||||
-rw-r--r-- | e-util/e-client-utils.c | 445 | ||||
-rw-r--r-- | e-util/e-client-utils.h | 64 | ||||
-rw-r--r-- | e-util/e-config.h | 6 | ||||
-rw-r--r-- | e-util/e-contact-map-window.c (renamed from widgets/misc/e-contact-map-window.c) | 0 | ||||
-rw-r--r-- | e-util/e-contact-map-window.h (renamed from widgets/misc/e-contact-map-window.h) | 12 | ||||
-rw-r--r-- | e-util/e-contact-map.c (renamed from widgets/misc/e-contact-map.c) | 6 | ||||
-rw-r--r-- | e-util/e-contact-map.h (renamed from widgets/misc/e-contact-map.h) | 4 | ||||
-rw-r--r-- | e-util/e-contact-marker.c (renamed from widgets/misc/e-contact-marker.c) | 0 | ||||
-rw-r--r-- | e-util/e-contact-marker.h (renamed from widgets/misc/e-contact-marker.h) | 4 | ||||
-rw-r--r-- | e-util/e-contact-store.c | 1370 | ||||
-rw-r--r-- | e-util/e-contact-store.h | 94 | ||||
-rw-r--r-- | e-util/e-dateedit.c (renamed from widgets/misc/e-dateedit.c) | 1 | ||||
-rw-r--r-- | e-util/e-dateedit.h (renamed from widgets/misc/e-dateedit.h) | 4 | ||||
-rw-r--r-- | e-util/e-datetime-format.c | 5 | ||||
-rw-r--r-- | e-util/e-datetime-format.h | 4 | ||||
-rw-r--r-- | e-util/e-destination-store.c | 751 | ||||
-rw-r--r-- | e-util/e-destination-store.h | 106 | ||||
-rw-r--r-- | e-util/e-dialog-utils.h | 4 | ||||
-rw-r--r-- | e-util/e-dialog-widgets.h | 4 | ||||
-rw-r--r-- | e-util/e-event.h | 6 | ||||
-rw-r--r-- | e-util/e-file-request.c | 2 | ||||
-rw-r--r-- | e-util/e-file-request.h | 4 | ||||
-rw-r--r-- | e-util/e-file-utils.h | 4 | ||||
-rw-r--r-- | e-util/e-filter-code.c (renamed from filter/e-filter-code.c) | 0 | ||||
-rw-r--r-- | e-util/e-filter-code.h (renamed from filter/e-filter-code.h) | 6 | ||||
-rw-r--r-- | e-util/e-filter-color.c (renamed from filter/e-filter-color.c) | 0 | ||||
-rw-r--r-- | e-util/e-filter-color.h (renamed from filter/e-filter-color.h) | 6 | ||||
-rw-r--r-- | e-util/e-filter-datespec.c (renamed from filter/e-filter-datespec.c) | 4 | ||||
-rw-r--r-- | e-util/e-filter-datespec.h (renamed from filter/e-filter-datespec.h) | 6 | ||||
-rw-r--r-- | e-util/e-filter-element.c (renamed from filter/e-filter-element.c) | 0 | ||||
-rw-r--r-- | e-util/e-filter-element.h (renamed from filter/e-filter-element.h) | 9 | ||||
-rw-r--r-- | e-util/e-filter-file.c (renamed from filter/e-filter-file.c) | 3 | ||||
-rw-r--r-- | e-util/e-filter-file.h (renamed from filter/e-filter-file.h) | 6 | ||||
-rw-r--r-- | e-util/e-filter-input.c (renamed from filter/e-filter-input.c) | 3 | ||||
-rw-r--r-- | e-util/e-filter-input.h (renamed from filter/e-filter-input.h) | 6 | ||||
-rw-r--r-- | e-util/e-filter-int.c (renamed from filter/e-filter-int.c) | 0 | ||||
-rw-r--r-- | e-util/e-filter-int.h (renamed from filter/e-filter-int.h) | 6 | ||||
-rw-r--r-- | e-util/e-filter-option.c (renamed from filter/e-filter-option.c) | 0 | ||||
-rw-r--r-- | e-util/e-filter-option.h (renamed from filter/e-filter-option.h) | 6 | ||||
-rw-r--r-- | e-util/e-filter-part.c (renamed from filter/e-filter-part.c) | 0 | ||||
-rw-r--r-- | e-util/e-filter-part.h (renamed from filter/e-filter-part.h) | 9 | ||||
-rw-r--r-- | e-util/e-filter-rule.c (renamed from filter/e-filter-rule.c) | 3 | ||||
-rw-r--r-- | e-util/e-filter-rule.h (renamed from filter/e-filter-rule.h) | 6 | ||||
-rw-r--r-- | e-util/e-focus-tracker.c (renamed from widgets/misc/e-focus-tracker.c) | 2 | ||||
-rw-r--r-- | e-util/e-focus-tracker.h (renamed from widgets/misc/e-focus-tracker.h) | 4 | ||||
-rw-r--r-- | e-util/e-html-utils.h | 4 | ||||
-rw-r--r-- | e-util/e-icon-factory.h | 4 | ||||
-rw-r--r-- | e-util/e-image-chooser.c (renamed from widgets/misc/e-image-chooser.c) | 4 | ||||
-rw-r--r-- | e-util/e-image-chooser.h (renamed from widgets/misc/e-image-chooser.h) | 4 | ||||
-rw-r--r-- | e-util/e-import-assistant.c (renamed from widgets/misc/e-import-assistant.c) | 4 | ||||
-rw-r--r-- | e-util/e-import-assistant.h (renamed from widgets/misc/e-import-assistant.h) | 4 | ||||
-rw-r--r-- | e-util/e-import.h | 6 | ||||
-rw-r--r-- | e-util/e-interval-chooser.c (renamed from widgets/misc/e-interval-chooser.c) | 2 | ||||
-rw-r--r-- | e-util/e-interval-chooser.h (renamed from widgets/misc/e-interval-chooser.h) | 4 | ||||
-rw-r--r-- | e-util/e-mail-identity-combo-box.c (renamed from widgets/misc/e-mail-identity-combo-box.c) | 0 | ||||
-rw-r--r-- | e-util/e-mail-identity-combo-box.h (renamed from widgets/misc/e-mail-identity-combo-box.h) | 4 | ||||
-rw-r--r-- | e-util/e-mail-signature-combo-box.c (renamed from widgets/misc/e-mail-signature-combo-box.c) | 0 | ||||
-rw-r--r-- | e-util/e-mail-signature-combo-box.h (renamed from widgets/misc/e-mail-signature-combo-box.h) | 4 | ||||
-rw-r--r-- | e-util/e-mail-signature-editor.c (renamed from widgets/misc/e-mail-signature-editor.c) | 8 | ||||
-rw-r--r-- | e-util/e-mail-signature-editor.h (renamed from widgets/misc/e-mail-signature-editor.h) | 7 | ||||
-rw-r--r-- | e-util/e-mail-signature-manager.c (renamed from widgets/misc/e-mail-signature-manager.c) | 0 | ||||
-rw-r--r-- | e-util/e-mail-signature-manager.h (renamed from widgets/misc/e-mail-signature-manager.h) | 9 | ||||
-rw-r--r-- | e-util/e-mail-signature-preview.c (renamed from widgets/misc/e-mail-signature-preview.c) | 2 | ||||
-rw-r--r-- | e-util/e-mail-signature-preview.h (renamed from widgets/misc/e-mail-signature-preview.h) | 7 | ||||
-rw-r--r-- | e-util/e-mail-signature-script-dialog.c (renamed from widgets/misc/e-mail-signature-script-dialog.c) | 0 | ||||
-rw-r--r-- | e-util/e-mail-signature-script-dialog.h (renamed from widgets/misc/e-mail-signature-script-dialog.h) | 4 | ||||
-rw-r--r-- | e-util/e-mail-signature-tree-view.c (renamed from widgets/misc/e-mail-signature-tree-view.c) | 0 | ||||
-rw-r--r-- | e-util/e-mail-signature-tree-view.h (renamed from widgets/misc/e-mail-signature-tree-view.h) | 4 | ||||
-rw-r--r-- | e-util/e-map.c (renamed from widgets/misc/e-map.c) | 5 | ||||
-rw-r--r-- | e-util/e-map.h (renamed from widgets/misc/e-map.h) | 4 | ||||
-rw-r--r-- | e-util/e-menu-tool-action.c (renamed from widgets/misc/e-menu-tool-action.c) | 0 | ||||
-rw-r--r-- | e-util/e-menu-tool-action.h (renamed from widgets/misc/e-menu-tool-action.h) | 4 | ||||
-rw-r--r-- | e-util/e-menu-tool-button.c (renamed from widgets/misc/e-menu-tool-button.c) | 0 | ||||
-rw-r--r-- | e-util/e-menu-tool-button.h (renamed from widgets/misc/e-menu-tool-button.h) | 4 | ||||
-rw-r--r-- | e-util/e-misc-utils.c (renamed from e-util/e-util.c) | 306 | ||||
-rw-r--r-- | e-util/e-misc-utils.h | 175 | ||||
-rw-r--r-- | e-util/e-mktemp.c | 3 | ||||
-rw-r--r-- | e-util/e-mktemp.h | 4 | ||||
-rw-r--r-- | e-util/e-name-selector-dialog.c | 1863 | ||||
-rw-r--r-- | e-util/e-name-selector-dialog.h | 100 | ||||
-rw-r--r-- | e-util/e-name-selector-entry.c | 3541 | ||||
-rw-r--r-- | e-util/e-name-selector-entry.h | 124 | ||||
-rw-r--r-- | e-util/e-name-selector-list.c | 790 | ||||
-rw-r--r-- | e-util/e-name-selector-list.h | 82 | ||||
-rw-r--r-- | e-util/e-name-selector-model.c | 663 | ||||
-rw-r--r-- | e-util/e-name-selector-model.h | 108 | ||||
-rw-r--r-- | e-util/e-name-selector.c | 658 | ||||
-rw-r--r-- | e-util/e-name-selector.h | 94 | ||||
-rw-r--r-- | e-util/e-online-button.c (renamed from widgets/misc/e-online-button.c) | 0 | ||||
-rw-r--r-- | e-util/e-online-button.h (renamed from widgets/misc/e-online-button.h) | 4 | ||||
-rw-r--r-- | e-util/e-paned.c (renamed from widgets/misc/e-paned.c) | 0 | ||||
-rw-r--r-- | e-util/e-paned.h (renamed from widgets/misc/e-paned.h) | 4 | ||||
-rw-r--r-- | e-util/e-passwords-win32.c | 1064 | ||||
-rw-r--r-- | e-util/e-passwords.c | 890 | ||||
-rw-r--r-- | e-util/e-passwords.h | 81 | ||||
-rw-r--r-- | e-util/e-picture-gallery.c (renamed from widgets/misc/e-picture-gallery.c) | 4 | ||||
-rw-r--r-- | e-util/e-picture-gallery.h (renamed from widgets/misc/e-picture-gallery.h) | 4 | ||||
-rw-r--r-- | e-util/e-plugin-ui.c | 1 | ||||
-rw-r--r-- | e-util/e-plugin-ui.h | 4 | ||||
-rw-r--r-- | e-util/e-plugin.h | 4 | ||||
-rw-r--r-- | e-util/e-poolv.h | 4 | ||||
-rw-r--r-- | e-util/e-popup-action.c (renamed from widgets/misc/e-popup-action.c) | 0 | ||||
-rw-r--r-- | e-util/e-popup-action.h (renamed from widgets/misc/e-popup-action.h) | 4 | ||||
-rw-r--r-- | e-util/e-popup-menu.c (renamed from widgets/table/e-popup-menu.c) | 0 | ||||
-rw-r--r-- | e-util/e-popup-menu.h (renamed from widgets/table/e-popup-menu.h) | 4 | ||||
-rw-r--r-- | e-util/e-port-entry.c (renamed from widgets/misc/e-port-entry.c) | 0 | ||||
-rw-r--r-- | e-util/e-port-entry.h (renamed from widgets/misc/e-port-entry.h) | 4 | ||||
-rw-r--r-- | e-util/e-preferences-window.c (renamed from widgets/misc/e-preferences-window.c) | 3 | ||||
-rw-r--r-- | e-util/e-preferences-window.h (renamed from widgets/misc/e-preferences-window.h) | 4 | ||||
-rw-r--r-- | e-util/e-preview-pane.c (renamed from widgets/misc/e-preview-pane.c) | 5 | ||||
-rw-r--r-- | e-util/e-preview-pane.h (renamed from widgets/misc/e-preview-pane.h) | 9 | ||||
-rw-r--r-- | e-util/e-print.c | 2 | ||||
-rw-r--r-- | e-util/e-print.h | 4 | ||||
-rw-r--r-- | e-util/e-printable.c (renamed from widgets/misc/e-printable.c) | 4 | ||||
-rw-r--r-- | e-util/e-printable.h (renamed from widgets/misc/e-printable.h) | 4 | ||||
-rw-r--r-- | e-util/e-reflow-model.c (renamed from widgets/text/e-reflow-model.c) | 4 | ||||
-rw-r--r-- | e-util/e-reflow-model.h (renamed from widgets/text/e-reflow-model.h) | 4 | ||||
-rw-r--r-- | e-util/e-reflow.c (renamed from widgets/text/e-reflow.c) | 18 | ||||
-rw-r--r-- | e-util/e-reflow.h (renamed from widgets/text/e-reflow.h) | 9 | ||||
-rw-r--r-- | e-util/e-rule-context.c (renamed from filter/e-rule-context.c) | 5 | ||||
-rw-r--r-- | e-util/e-rule-context.h (renamed from filter/e-rule-context.h) | 8 | ||||
-rw-r--r-- | e-util/e-rule-editor.c (renamed from filter/e-rule-editor.c) | 8 | ||||
-rw-r--r-- | e-util/e-rule-editor.h (renamed from filter/e-rule-editor.h) | 8 | ||||
-rw-r--r-- | e-util/e-search-bar.c (renamed from widgets/misc/e-search-bar.c) | 0 | ||||
-rw-r--r-- | e-util/e-search-bar.h (renamed from widgets/misc/e-search-bar.h) | 7 | ||||
-rw-r--r-- | e-util/e-selectable.c (renamed from widgets/misc/e-selectable.c) | 0 | ||||
-rw-r--r-- | e-util/e-selectable.h (renamed from widgets/misc/e-selectable.h) | 7 | ||||
-rw-r--r-- | e-util/e-selection-model-array.c (renamed from widgets/misc/e-selection-model-array.c) | 1 | ||||
-rw-r--r-- | e-util/e-selection-model-array.h (renamed from widgets/misc/e-selection-model-array.h) | 6 | ||||
-rw-r--r-- | e-util/e-selection-model-simple.c (renamed from widgets/misc/e-selection-model-simple.c) | 2 | ||||
-rw-r--r-- | e-util/e-selection-model-simple.h (renamed from widgets/misc/e-selection-model-simple.h) | 6 | ||||
-rw-r--r-- | e-util/e-selection-model.c (renamed from widgets/misc/e-selection-model.c) | 6 | ||||
-rw-r--r-- | e-util/e-selection-model.h (renamed from widgets/misc/e-selection-model.h) | 4 | ||||
-rw-r--r-- | e-util/e-selection.c | 2 | ||||
-rw-r--r-- | e-util/e-selection.h | 4 | ||||
-rw-r--r-- | e-util/e-send-options.c (renamed from widgets/misc/e-send-options.c) | 8 | ||||
-rw-r--r-- | e-util/e-send-options.h (renamed from widgets/misc/e-send-options.h) | 4 | ||||
-rw-r--r-- | e-util/e-send-options.ui (renamed from widgets/misc/e-send-options.ui) | 0 | ||||
-rw-r--r-- | e-util/e-sorter-array.c | 3 | ||||
-rw-r--r-- | e-util/e-sorter-array.h | 4 | ||||
-rw-r--r-- | e-util/e-sorter.c | 1 | ||||
-rw-r--r-- | e-util/e-sorter.h | 4 | ||||
-rw-r--r-- | e-util/e-source-combo-box.c | 701 | ||||
-rw-r--r-- | e-util/e-source-combo-box.h | 90 | ||||
-rw-r--r-- | e-util/e-source-config-backend.c (renamed from widgets/misc/e-source-config-backend.c) | 0 | ||||
-rw-r--r-- | e-util/e-source-config-backend.h (renamed from widgets/misc/e-source-config-backend.h) | 6 | ||||
-rw-r--r-- | e-util/e-source-config-dialog.c (renamed from widgets/misc/e-source-config-dialog.c) | 6 | ||||
-rw-r--r-- | e-util/e-source-config-dialog.h (renamed from widgets/misc/e-source-config-dialog.h) | 6 | ||||
-rw-r--r-- | e-util/e-source-config.c (renamed from widgets/misc/e-source-config.c) | 5 | ||||
-rw-r--r-- | e-util/e-source-config.h (renamed from widgets/misc/e-source-config.h) | 4 | ||||
-rw-r--r-- | e-util/e-source-selector-dialog.c | 453 | ||||
-rw-r--r-- | e-util/e-source-selector-dialog.h | 85 | ||||
-rw-r--r-- | e-util/e-source-selector.c | 2082 | ||||
-rw-r--r-- | e-util/e-source-selector.h | 141 | ||||
-rw-r--r-- | e-util/e-source-util.h | 6 | ||||
-rw-r--r-- | e-util/e-spell-entry.c (renamed from widgets/misc/e-spell-entry.c) | 0 | ||||
-rw-r--r-- | e-util/e-spell-entry.h (renamed from widgets/misc/e-spell-entry.h) | 4 | ||||
-rw-r--r-- | e-util/e-stock-request.c | 3 | ||||
-rw-r--r-- | e-util/e-stock-request.h | 4 | ||||
-rw-r--r-- | e-util/e-table-click-to-add.c (renamed from widgets/table/e-table-click-to-add.c) | 20 | ||||
-rw-r--r-- | e-util/e-table-click-to-add.h (renamed from widgets/table/e-table-click-to-add.h) | 13 | ||||
-rw-r--r-- | e-util/e-table-col-dnd.h (renamed from widgets/table/e-table-col-dnd.h) | 4 | ||||
-rw-r--r-- | e-util/e-table-col.c (renamed from widgets/table/e-table-col.c) | 1 | ||||
-rw-r--r-- | e-util/e-table-col.h (renamed from widgets/table/e-table-col.h) | 7 | ||||
-rw-r--r-- | e-util/e-table-column-specification.c (renamed from widgets/table/e-table-column-specification.c) | 7 | ||||
-rw-r--r-- | e-util/e-table-column-specification.h (renamed from widgets/table/e-table-column-specification.h) | 4 | ||||
-rw-r--r-- | e-util/e-table-config.c (renamed from widgets/table/e-table-config.c) | 9 | ||||
-rw-r--r-- | e-util/e-table-config.h (renamed from widgets/table/e-table-config.h) | 15 | ||||
-rw-r--r-- | e-util/e-table-config.ui (renamed from widgets/table/e-table-config.ui) | 0 | ||||
-rw-r--r-- | e-util/e-table-defines.h (renamed from widgets/table/e-table-defines.h) | 4 | ||||
-rw-r--r-- | e-util/e-table-extras.c (renamed from widgets/table/e-table-extras.c) | 2 | ||||
-rw-r--r-- | e-util/e-table-extras.h (renamed from widgets/table/e-table-extras.h) | 6 | ||||
-rw-r--r-- | e-util/e-table-field-chooser-dialog.c (renamed from widgets/table/e-table-field-chooser-dialog.c) | 1 | ||||
-rw-r--r-- | e-util/e-table-field-chooser-dialog.h (renamed from widgets/table/e-table-field-chooser-dialog.h) | 9 | ||||
-rw-r--r-- | e-util/e-table-field-chooser-item.c (renamed from widgets/table/e-table-field-chooser-item.c) | 8 | ||||
-rw-r--r-- | e-util/e-table-field-chooser-item.h (renamed from widgets/table/e-table-field-chooser-item.h) | 7 | ||||
-rw-r--r-- | e-util/e-table-field-chooser.c (renamed from widgets/table/e-table-field-chooser.c) | 12 | ||||
-rw-r--r-- | e-util/e-table-field-chooser.h (renamed from widgets/table/e-table-field-chooser.h) | 7 | ||||
-rw-r--r-- | e-util/e-table-group-container.c (renamed from widgets/table/e-table-group-container.c) | 15 | ||||
-rw-r--r-- | e-util/e-table-group-container.h (renamed from widgets/table/e-table-group-container.h) | 13 | ||||
-rw-r--r-- | e-util/e-table-group-leaf.c (renamed from widgets/table/e-table-group-leaf.c) | 10 | ||||
-rw-r--r-- | e-util/e-table-group-leaf.h (renamed from widgets/table/e-table-group-leaf.h) | 11 | ||||
-rw-r--r-- | e-util/e-table-group.c (renamed from widgets/table/e-table-group.c) | 2 | ||||
-rw-r--r-- | e-util/e-table-group.h (renamed from widgets/table/e-table-group.h) | 17 | ||||
-rw-r--r-- | e-util/e-table-header-item.c (renamed from widgets/table/e-table-header-item.c) | 19 | ||||
-rw-r--r-- | e-util/e-table-header-item.h (renamed from widgets/table/e-table-header-item.h) | 15 | ||||
-rw-r--r-- | e-util/e-table-header-utils.c (renamed from widgets/table/e-table-header-utils.c) | 6 | ||||
-rw-r--r-- | e-util/e-table-header-utils.h (renamed from widgets/table/e-table-header-utils.h) | 6 | ||||
-rw-r--r-- | e-util/e-table-header.c (renamed from widgets/table/e-table-header.c) | 3 | ||||
-rw-r--r-- | e-util/e-table-header.h (renamed from widgets/table/e-table-header.h) | 9 | ||||
-rw-r--r-- | e-util/e-table-item.c (renamed from widgets/table/e-table-item.c) | 16 | ||||
-rw-r--r-- | e-util/e-table-item.h (renamed from widgets/table/e-table-item.h) | 15 | ||||
-rw-r--r-- | e-util/e-table-memory-callbacks.c (renamed from widgets/table/e-table-memory-callbacks.c) | 2 | ||||
-rw-r--r-- | e-util/e-table-memory-callbacks.h (renamed from widgets/table/e-table-memory-callbacks.h) | 6 | ||||
-rw-r--r-- | e-util/e-table-memory-store.c (renamed from widgets/table/e-table-memory-store.c) | 2 | ||||
-rw-r--r-- | e-util/e-table-memory-store.h (renamed from widgets/table/e-table-memory-store.h) | 8 | ||||
-rw-r--r-- | e-util/e-table-memory.c (renamed from widgets/table/e-table-memory.c) | 4 | ||||
-rw-r--r-- | e-util/e-table-memory.h (renamed from widgets/table/e-table-memory.h) | 7 | ||||
-rw-r--r-- | e-util/e-table-model.c (renamed from widgets/table/e-table-model.c) | 4 | ||||
-rw-r--r-- | e-util/e-table-model.h (renamed from widgets/table/e-table-model.h) | 4 | ||||
-rw-r--r-- | e-util/e-table-one.c (renamed from widgets/table/e-table-one.c) | 2 | ||||
-rw-r--r-- | e-util/e-table-one.h (renamed from widgets/table/e-table-one.h) | 6 | ||||
-rw-r--r-- | e-util/e-table-search.c (renamed from widgets/table/e-table-search.c) | 6 | ||||
-rw-r--r-- | e-util/e-table-search.h (renamed from widgets/table/e-table-search.h) | 4 | ||||
-rw-r--r-- | e-util/e-table-selection-model.c (renamed from widgets/table/e-table-selection-model.c) | 1 | ||||
-rw-r--r-- | e-util/e-table-selection-model.h (renamed from widgets/table/e-table-selection-model.h) | 10 | ||||
-rw-r--r-- | e-util/e-table-sort-info.c (renamed from widgets/table/e-table-sort-info.c) | 7 | ||||
-rw-r--r-- | e-util/e-table-sort-info.h (renamed from widgets/table/e-table-sort-info.h) | 4 | ||||
-rw-r--r-- | e-util/e-table-sorted-variable.c (renamed from widgets/table/e-table-sorted-variable.c) | 2 | ||||
-rw-r--r-- | e-util/e-table-sorted-variable.h (renamed from widgets/table/e-table-sorted-variable.h) | 12 | ||||
-rw-r--r-- | e-util/e-table-sorted.c (renamed from widgets/table/e-table-sorted.c) | 2 | ||||
-rw-r--r-- | e-util/e-table-sorted.h (renamed from widgets/table/e-table-sorted.h) | 12 | ||||
-rw-r--r-- | e-util/e-table-sorter.c (renamed from widgets/table/e-table-sorter.c) | 1 | ||||
-rw-r--r-- | e-util/e-table-sorter.h (renamed from widgets/table/e-table-sorter.h) | 12 | ||||
-rw-r--r-- | e-util/e-table-sorting-utils.c (renamed from widgets/table/e-table-sorting-utils.c) | 6 | ||||
-rw-r--r-- | e-util/e-table-sorting-utils.h (renamed from widgets/table/e-table-sorting-utils.h) | 14 | ||||
-rw-r--r-- | e-util/e-table-specification.c (renamed from widgets/table/e-table-specification.c) | 7 | ||||
-rw-r--r-- | e-util/e-table-specification.h (renamed from widgets/table/e-table-specification.h) | 13 | ||||
-rw-r--r-- | e-util/e-table-state.c (renamed from widgets/table/e-table-state.c) | 7 | ||||
-rw-r--r-- | e-util/e-table-state.h (renamed from widgets/table/e-table-state.h) | 7 | ||||
-rw-r--r-- | e-util/e-table-subset-variable.c (renamed from widgets/table/e-table-subset-variable.c) | 2 | ||||
-rw-r--r-- | e-util/e-table-subset-variable.h (renamed from widgets/table/e-table-subset-variable.h) | 6 | ||||
-rw-r--r-- | e-util/e-table-subset.c (renamed from widgets/table/e-table-subset.c) | 2 | ||||
-rw-r--r-- | e-util/e-table-subset.h (renamed from widgets/table/e-table-subset.h) | 6 | ||||
-rw-r--r-- | e-util/e-table-utils.c (renamed from widgets/table/e-table-utils.c) | 7 | ||||
-rw-r--r-- | e-util/e-table-utils.h (renamed from widgets/table/e-table-utils.h) | 12 | ||||
-rw-r--r-- | e-util/e-table-without.c (renamed from widgets/table/e-table-without.c) | 2 | ||||
-rw-r--r-- | e-util/e-table-without.h (renamed from widgets/table/e-table-without.h) | 6 | ||||
-rw-r--r-- | e-util/e-table.c (renamed from widgets/table/e-table.c) | 20 | ||||
-rw-r--r-- | e-util/e-table.h (renamed from widgets/table/e-table.h) | 29 | ||||
-rw-r--r-- | e-util/e-text-event-processor-emacs-like.c | 1 | ||||
-rw-r--r-- | e-util/e-text-event-processor-emacs-like.h | 4 | ||||
-rw-r--r-- | e-util/e-text-event-processor-types.h | 4 | ||||
-rw-r--r-- | e-util/e-text-event-processor.c | 1 | ||||
-rw-r--r-- | e-util/e-text-event-processor.h | 4 | ||||
-rw-r--r-- | e-util/e-text-model-repos.c (renamed from widgets/text/e-text-model-repos.c) | 0 | ||||
-rw-r--r-- | e-util/e-text-model-repos.h (renamed from widgets/text/e-text-model-repos.h) | 4 | ||||
-rw-r--r-- | e-util/e-text-model.c (renamed from widgets/text/e-text-model.c) | 6 | ||||
-rw-r--r-- | e-util/e-text-model.h (renamed from widgets/text/e-text-model.h) | 4 | ||||
-rw-r--r-- | e-util/e-text.c (renamed from widgets/text/e-text.c) | 18 | ||||
-rw-r--r-- | e-util/e-text.h (renamed from widgets/text/e-text.h) | 8 | ||||
-rw-r--r-- | e-util/e-timezone-dialog.c (renamed from widgets/e-timezone-dialog/e-timezone-dialog.c) | 10 | ||||
-rw-r--r-- | e-util/e-timezone-dialog.h (renamed from widgets/e-timezone-dialog/e-timezone-dialog.h) | 4 | ||||
-rw-r--r-- | e-util/e-timezone-dialog.ui (renamed from widgets/e-timezone-dialog/e-timezone-dialog.ui) | 0 | ||||
-rw-r--r-- | e-util/e-tree-memory-callbacks.c (renamed from widgets/table/e-tree-memory-callbacks.c) | 2 | ||||
-rw-r--r-- | e-util/e-tree-memory-callbacks.h (renamed from widgets/table/e-tree-memory-callbacks.h) | 6 | ||||
-rw-r--r-- | e-util/e-tree-memory.c (renamed from widgets/table/e-tree-memory.c) | 7 | ||||
-rw-r--r-- | e-util/e-tree-memory.h (renamed from widgets/table/e-tree-memory.h) | 7 | ||||
-rw-r--r-- | e-util/e-tree-model-generator.c | 1345 | ||||
-rw-r--r-- | e-util/e-tree-model-generator.h | 104 | ||||
-rw-r--r-- | e-util/e-tree-model.c (renamed from widgets/table/e-tree-model.c) | 8 | ||||
-rw-r--r-- | e-util/e-tree-model.h (renamed from widgets/table/e-tree-model.h) | 4 | ||||
-rw-r--r-- | e-util/e-tree-selection-model.c (renamed from widgets/table/e-tree-selection-model.c) | 6 | ||||
-rw-r--r-- | e-util/e-tree-selection-model.h (renamed from widgets/table/e-tree-selection-model.h) | 8 | ||||
-rw-r--r-- | e-util/e-tree-sorted.c (renamed from widgets/table/e-tree-sorted.c) | 7 | ||||
-rw-r--r-- | e-util/e-tree-sorted.h (renamed from widgets/table/e-tree-sorted.h) | 11 | ||||
-rw-r--r-- | e-util/e-tree-table-adapter.c (renamed from widgets/table/e-tree-table-adapter.c) | 9 | ||||
-rw-r--r-- | e-util/e-tree-table-adapter.h (renamed from widgets/table/e-tree-table-adapter.h) | 13 | ||||
-rw-r--r-- | e-util/e-tree.c (renamed from widgets/table/e-tree.c) | 22 | ||||
-rw-r--r-- | e-util/e-tree.h (renamed from widgets/table/e-tree.h) | 20 | ||||
-rw-r--r-- | e-util/e-ui-manager.c | 2 | ||||
-rw-r--r-- | e-util/e-ui-manager.h | 4 | ||||
-rw-r--r-- | e-util/e-unicode.h | 4 | ||||
-rw-r--r-- | e-util/e-url-entry.c (renamed from widgets/misc/e-url-entry.c) | 6 | ||||
-rw-r--r-- | e-util/e-url-entry.h (renamed from widgets/misc/e-url-entry.h) | 4 | ||||
-rw-r--r-- | e-util/e-util-enums.h | 4 | ||||
-rw-r--r-- | e-util/e-util.h | 348 | ||||
-rw-r--r-- | e-util/e-web-view-gtkhtml.c (renamed from widgets/misc/e-web-view-gtkhtml.c) | 9 | ||||
-rw-r--r-- | e-util/e-web-view-gtkhtml.h (renamed from widgets/misc/e-web-view-gtkhtml.h) | 4 | ||||
-rw-r--r-- | e-util/e-web-view-preview.c (renamed from widgets/misc/e-web-view-preview.c) | 0 | ||||
-rw-r--r-- | e-util/e-web-view-preview.h (renamed from widgets/misc/e-web-view-preview.h) | 6 | ||||
-rw-r--r-- | e-util/e-web-view.c (renamed from widgets/misc/e-web-view.c) | 15 | ||||
-rw-r--r-- | e-util/e-web-view.h (renamed from widgets/misc/e-web-view.h) | 4 | ||||
-rw-r--r-- | e-util/e-xml-utils.c (renamed from libevolution-utils/e-xml-utils.c) | 5 | ||||
-rw-r--r-- | e-util/e-xml-utils.h (renamed from libevolution-utils/e-xml-utils.h) | 0 | ||||
-rw-r--r-- | e-util/ea-calendar-cell.c (renamed from widgets/misc/ea-calendar-cell.c) | 3 | ||||
-rw-r--r-- | e-util/ea-calendar-cell.h (renamed from widgets/misc/ea-calendar-cell.h) | 6 | ||||
-rw-r--r-- | e-util/ea-calendar-item.c (renamed from widgets/misc/ea-calendar-item.c) | 3 | ||||
-rw-r--r-- | e-util/ea-calendar-item.h (renamed from widgets/misc/ea-calendar-item.h) | 6 | ||||
-rw-r--r-- | e-util/ea-cell-table.c (renamed from widgets/misc/ea-cell-table.c) | 0 | ||||
-rw-r--r-- | e-util/ea-cell-table.h (renamed from widgets/misc/ea-cell-table.h) | 4 | ||||
-rw-r--r-- | e-util/ea-factory.h (renamed from a11y/ea-factory.h) | 4 | ||||
-rw-r--r-- | e-util/ea-widgets.c (renamed from widgets/misc/ea-widgets.c) | 2 | ||||
-rw-r--r-- | e-util/ea-widgets.h (renamed from widgets/misc/ea-widgets.h) | 4 | ||||
-rw-r--r-- | e-util/evolution-source-viewer.c | 1176 | ||||
-rw-r--r-- | e-util/filter.error.xml (renamed from filter/filter.error.xml) | 0 | ||||
-rw-r--r-- | e-util/filter.ui (renamed from filter/filter.ui) | 0 | ||||
-rw-r--r-- | e-util/gal-a11y-e-cell-popup.c (renamed from widgets/table/gal-a11y-e-cell-popup.c) | 10 | ||||
-rw-r--r-- | e-util/gal-a11y-e-cell-popup.h (renamed from widgets/table/gal-a11y-e-cell-popup.h) | 9 | ||||
-rw-r--r-- | e-util/gal-a11y-e-cell-registry.c (renamed from widgets/table/gal-a11y-e-cell-registry.c) | 0 | ||||
-rw-r--r-- | e-util/gal-a11y-e-cell-registry.h (renamed from widgets/table/gal-a11y-e-cell-registry.h) | 9 | ||||
-rw-r--r-- | e-util/gal-a11y-e-cell-toggle.c (renamed from widgets/table/gal-a11y-e-cell-toggle.c) | 8 | ||||
-rw-r--r-- | e-util/gal-a11y-e-cell-toggle.h (renamed from widgets/table/gal-a11y-e-cell-toggle.h) | 4 | ||||
-rw-r--r-- | e-util/gal-a11y-e-cell-tree.c (renamed from widgets/table/gal-a11y-e-cell-tree.c) | 12 | ||||
-rw-r--r-- | e-util/gal-a11y-e-cell-tree.h (renamed from widgets/table/gal-a11y-e-cell-tree.h) | 10 | ||||
-rw-r--r-- | e-util/gal-a11y-e-cell-vbox.c (renamed from widgets/table/gal-a11y-e-cell-vbox.c) | 6 | ||||
-rw-r--r-- | e-util/gal-a11y-e-cell-vbox.h (renamed from widgets/table/gal-a11y-e-cell-vbox.h) | 4 | ||||
-rw-r--r-- | e-util/gal-a11y-e-cell.c (renamed from widgets/table/gal-a11y-e-cell.c) | 10 | ||||
-rw-r--r-- | e-util/gal-a11y-e-cell.h (renamed from widgets/table/gal-a11y-e-cell.h) | 8 | ||||
-rw-r--r-- | e-util/gal-a11y-e-table-click-to-add-factory.c (renamed from widgets/table/gal-a11y-e-table-click-to-add-factory.c) | 10 | ||||
-rw-r--r-- | e-util/gal-a11y-e-table-click-to-add-factory.h (renamed from widgets/table/gal-a11y-e-table-click-to-add-factory.h) | 4 | ||||
-rw-r--r-- | e-util/gal-a11y-e-table-click-to-add.c (renamed from widgets/table/gal-a11y-e-table-click-to-add.c) | 12 | ||||
-rw-r--r-- | e-util/gal-a11y-e-table-click-to-add.h (renamed from widgets/table/gal-a11y-e-table-click-to-add.h) | 6 | ||||
-rw-r--r-- | e-util/gal-a11y-e-table-column-header.c (renamed from widgets/table/gal-a11y-e-table-column-header.c) | 8 | ||||
-rw-r--r-- | e-util/gal-a11y-e-table-column-header.h (renamed from widgets/table/gal-a11y-e-table-column-header.h) | 7 | ||||
-rw-r--r-- | e-util/gal-a11y-e-table-factory.c (renamed from widgets/table/gal-a11y-e-table-factory.c) | 0 | ||||
-rw-r--r-- | e-util/gal-a11y-e-table-factory.h (renamed from widgets/table/gal-a11y-e-table-factory.h) | 4 | ||||
-rw-r--r-- | e-util/gal-a11y-e-table-item-factory.c (renamed from widgets/table/gal-a11y-e-table-item-factory.c) | 10 | ||||
-rw-r--r-- | e-util/gal-a11y-e-table-item-factory.h (renamed from widgets/table/gal-a11y-e-table-item-factory.h) | 4 | ||||
-rw-r--r-- | e-util/gal-a11y-e-table-item.c (renamed from widgets/table/gal-a11y-e-table-item.c) | 22 | ||||
-rw-r--r-- | e-util/gal-a11y-e-table-item.h (renamed from widgets/table/gal-a11y-e-table-item.h) | 7 | ||||
-rw-r--r-- | e-util/gal-a11y-e-table.c (renamed from widgets/table/gal-a11y-e-table.c) | 14 | ||||
-rw-r--r-- | e-util/gal-a11y-e-table.h (renamed from widgets/table/gal-a11y-e-table.h) | 4 | ||||
-rw-r--r-- | e-util/gal-a11y-e-text-factory.c (renamed from widgets/text/gal-a11y-e-text-factory.c) | 2 | ||||
-rw-r--r-- | e-util/gal-a11y-e-text-factory.h (renamed from widgets/text/gal-a11y-e-text-factory.h) | 4 | ||||
-rw-r--r-- | e-util/gal-a11y-e-text.c (renamed from widgets/text/gal-a11y-e-text.c) | 10 | ||||
-rw-r--r-- | e-util/gal-a11y-e-text.h (renamed from widgets/text/gal-a11y-e-text.h) | 6 | ||||
-rw-r--r-- | e-util/gal-a11y-e-tree-factory.c (renamed from widgets/table/gal-a11y-e-tree-factory.c) | 0 | ||||
-rw-r--r-- | e-util/gal-a11y-e-tree-factory.h (renamed from widgets/table/gal-a11y-e-tree-factory.h) | 4 | ||||
-rw-r--r-- | e-util/gal-a11y-e-tree.c (renamed from widgets/table/gal-a11y-e-tree.c) | 8 | ||||
-rw-r--r-- | e-util/gal-a11y-e-tree.h (renamed from widgets/table/gal-a11y-e-tree.h) | 4 | ||||
-rw-r--r-- | e-util/gal-a11y-factory.h (renamed from a11y/gal-a11y-factory.h) | 4 | ||||
-rw-r--r-- | e-util/gal-a11y-util.c (renamed from a11y/gal-a11y-util.c) | 0 | ||||
-rw-r--r-- | e-util/gal-a11y-util.h (renamed from a11y/gal-a11y-util.h) | 4 | ||||
-rw-r--r-- | e-util/gal-define-views-dialog.c (renamed from widgets/menus/gal-define-views-dialog.c) | 4 | ||||
-rw-r--r-- | e-util/gal-define-views-dialog.h (renamed from widgets/menus/gal-define-views-dialog.h) | 6 | ||||
-rw-r--r-- | e-util/gal-define-views-model.c (renamed from widgets/menus/gal-define-views-model.c) | 1 | ||||
-rw-r--r-- | e-util/gal-define-views-model.h (renamed from widgets/menus/gal-define-views-model.h) | 10 | ||||
-rw-r--r-- | e-util/gal-define-views.ui (renamed from widgets/menus/gal-define-views.ui) | 0 | ||||
-rw-r--r-- | e-util/gal-view-collection.c (renamed from widgets/menus/gal-view-collection.c) | 8 | ||||
-rw-r--r-- | e-util/gal-view-collection.h (renamed from widgets/menus/gal-view-collection.h) | 6 | ||||
-rw-r--r-- | e-util/gal-view-etable.c (renamed from widgets/menus/gal-view-etable.c) | 4 | ||||
-rw-r--r-- | e-util/gal-view-etable.h (renamed from widgets/menus/gal-view-etable.h) | 14 | ||||
-rw-r--r-- | e-util/gal-view-factory-etable.c (renamed from widgets/menus/gal-view-factory-etable.c) | 1 | ||||
-rw-r--r-- | e-util/gal-view-factory-etable.h (renamed from widgets/menus/gal-view-factory-etable.h) | 8 | ||||
-rw-r--r-- | e-util/gal-view-factory.c (renamed from widgets/menus/gal-view-factory.c) | 2 | ||||
-rw-r--r-- | e-util/gal-view-factory.h (renamed from widgets/menus/gal-view-factory.h) | 6 | ||||
-rw-r--r-- | e-util/gal-view-instance-save-as-dialog.c (renamed from widgets/menus/gal-view-instance-save-as-dialog.c) | 7 | ||||
-rw-r--r-- | e-util/gal-view-instance-save-as-dialog.h (renamed from widgets/menus/gal-view-instance-save-as-dialog.h) | 8 | ||||
-rw-r--r-- | e-util/gal-view-instance-save-as-dialog.ui (renamed from widgets/menus/gal-view-instance-save-as-dialog.ui) | 0 | ||||
-rw-r--r-- | e-util/gal-view-instance.c (renamed from widgets/menus/gal-view-instance.c) | 9 | ||||
-rw-r--r-- | e-util/gal-view-instance.h (renamed from widgets/menus/gal-view-instance.h) | 6 | ||||
-rw-r--r-- | e-util/gal-view-new-dialog.c (renamed from widgets/menus/gal-view-new-dialog.c) | 9 | ||||
-rw-r--r-- | e-util/gal-view-new-dialog.h (renamed from widgets/menus/gal-view-new-dialog.h) | 6 | ||||
-rw-r--r-- | e-util/gal-view-new-dialog.ui (renamed from widgets/menus/gal-view-new-dialog.ui) | 0 | ||||
-rw-r--r-- | e-util/gal-view.c (renamed from widgets/menus/gal-view.c) | 2 | ||||
-rw-r--r-- | e-util/gal-view.h (renamed from widgets/menus/gal-view.h) | 4 | ||||
-rw-r--r-- | e-util/test-calendar.c (renamed from widgets/misc/test-calendar.c) | 3 | ||||
-rw-r--r-- | e-util/test-category-completion.c | 67 | ||||
-rw-r--r-- | e-util/test-contact-store.c | 145 | ||||
-rw-r--r-- | e-util/test-dateedit.c (renamed from widgets/misc/test-dateedit.c) | 0 | ||||
-rw-r--r-- | e-util/test-mail-signatures.c (renamed from widgets/misc/test-mail-signatures.c) | 6 | ||||
-rw-r--r-- | e-util/test-name-selector.c | 102 | ||||
-rw-r--r-- | e-util/test-preferences-window.c (renamed from widgets/misc/test-preferences-window.c) | 0 | ||||
-rw-r--r-- | e-util/test-source-combo-box.c | 107 | ||||
-rw-r--r-- | e-util/test-source-config.c (renamed from widgets/misc/test-source-config.c) | 0 | ||||
-rw-r--r-- | e-util/test-source-selector.c | 157 | ||||
-rw-r--r-- | e-util/tree-expanded.xpm (renamed from widgets/table/tree-expanded.xpm) | 0 | ||||
-rw-r--r-- | e-util/tree-unexpanded.xpm (renamed from widgets/table/tree-unexpanded.xpm) | 0 | ||||
-rw-r--r-- | e-util/widgets.error.xml (renamed from widgets/misc/widgets.error.xml) | 0 | ||||
-rw-r--r-- | em-format/Makefile.am | 14 | ||||
-rw-r--r-- | em-format/e-mail-extension-registry.c | 13 | ||||
-rw-r--r-- | em-format/e-mail-formatter-attachment-bar.c | 5 | ||||
-rw-r--r-- | em-format/e-mail-formatter-attachment.c | 18 | ||||
-rw-r--r-- | em-format/e-mail-formatter-error.c | 4 | ||||
-rw-r--r-- | em-format/e-mail-formatter-extension.h | 4 | ||||
-rw-r--r-- | em-format/e-mail-formatter-headers.c | 11 | ||||
-rw-r--r-- | em-format/e-mail-formatter-image.c | 14 | ||||
-rw-r--r-- | em-format/e-mail-formatter-message-rfc822.c | 12 | ||||
-rw-r--r-- | em-format/e-mail-formatter-print-headers.c | 14 | ||||
-rw-r--r-- | em-format/e-mail-formatter-print.c | 2 | ||||
-rw-r--r-- | em-format/e-mail-formatter-quote-attachment.c | 11 | ||||
-rw-r--r-- | em-format/e-mail-formatter-quote-headers.c | 14 | ||||
-rw-r--r-- | em-format/e-mail-formatter-quote-message-rfc822.c | 13 | ||||
-rw-r--r-- | em-format/e-mail-formatter-quote-text-enriched.c | 10 | ||||
-rw-r--r-- | em-format/e-mail-formatter-quote-text-html.c | 13 | ||||
-rw-r--r-- | em-format/e-mail-formatter-quote-text-plain.c | 12 | ||||
-rw-r--r-- | em-format/e-mail-formatter-secure-button.c | 4 | ||||
-rw-r--r-- | em-format/e-mail-formatter-source.c | 9 | ||||
-rw-r--r-- | em-format/e-mail-formatter-text-enriched.c | 9 | ||||
-rw-r--r-- | em-format/e-mail-formatter-text-html.c | 16 | ||||
-rw-r--r-- | em-format/e-mail-formatter-text-plain.c | 11 | ||||
-rw-r--r-- | em-format/e-mail-formatter-utils.c | 12 | ||||
-rw-r--r-- | em-format/e-mail-formatter.c | 2 | ||||
-rw-r--r-- | em-format/e-mail-formatter.h | 5 | ||||
-rw-r--r-- | em-format/e-mail-parser-application-mbox.c | 10 | ||||
-rw-r--r-- | em-format/e-mail-parser-application-smime.c | 10 | ||||
-rw-r--r-- | em-format/e-mail-parser-attachment-bar.c | 9 | ||||
-rw-r--r-- | em-format/e-mail-parser-extension.c | 2 | ||||
-rw-r--r-- | em-format/e-mail-parser-extension.h | 2 | ||||
-rw-r--r-- | em-format/e-mail-parser-headers.c | 9 | ||||
-rw-r--r-- | em-format/e-mail-parser-image.c | 9 | ||||
-rw-r--r-- | em-format/e-mail-parser-inlinepgp-encrypted.c | 12 | ||||
-rw-r--r-- | em-format/e-mail-parser-inlinepgp-signed.c | 12 | ||||
-rw-r--r-- | em-format/e-mail-parser-message-deliverystatus.c | 8 | ||||
-rw-r--r-- | em-format/e-mail-parser-message-external.c | 12 | ||||
-rw-r--r-- | em-format/e-mail-parser-message-rfc822.c | 12 | ||||
-rw-r--r-- | em-format/e-mail-parser-message.c | 11 | ||||
-rw-r--r-- | em-format/e-mail-parser-multipart-alternative.c | 10 | ||||
-rw-r--r-- | em-format/e-mail-parser-multipart-appledouble.c | 5 | ||||
-rw-r--r-- | em-format/e-mail-parser-multipart-digest.c | 8 | ||||
-rw-r--r-- | em-format/e-mail-parser-multipart-encrypted.c | 9 | ||||
-rw-r--r-- | em-format/e-mail-parser-multipart-mixed.c | 10 | ||||
-rw-r--r-- | em-format/e-mail-parser-multipart-related.c | 10 | ||||
-rw-r--r-- | em-format/e-mail-parser-multipart-signed.c | 9 | ||||
-rw-r--r-- | em-format/e-mail-parser-secure-button.c | 4 | ||||
-rw-r--r-- | em-format/e-mail-parser-source.c | 7 | ||||
-rw-r--r-- | em-format/e-mail-parser-text-enriched.c | 9 | ||||
-rw-r--r-- | em-format/e-mail-parser-text-html.c | 12 | ||||
-rw-r--r-- | em-format/e-mail-parser-text-plain.c | 13 | ||||
-rw-r--r-- | em-format/e-mail-parser.c | 14 | ||||
-rw-r--r-- | em-format/e-mail-part-attachment-bar.h | 2 | ||||
-rw-r--r-- | em-format/e-mail-part-utils.c | 1 | ||||
-rw-r--r-- | em-format/e-mail-part.h | 3 | ||||
-rw-r--r-- | evolution-shell.pc.in | 4 | ||||
-rwxr-xr-x | evolution-zip.in | 7 | ||||
-rw-r--r-- | filter/Makefile.am | 76 | ||||
-rw-r--r-- | libemail-engine/Makefile.am | 22 | ||||
-rw-r--r-- | libemail-engine/e-mail-session.c | 5 | ||||
-rw-r--r-- | libemail-engine/e-mail-session.h | 2 | ||||
-rw-r--r-- | libemail-engine/e-mail-utils.c | 2 | ||||
-rw-r--r-- | libemail-engine/em-filter-folder-element.c (renamed from libemail-utils/em-filter-folder-element.c) | 6 | ||||
-rw-r--r-- | libemail-engine/em-filter-folder-element.h (renamed from libemail-utils/em-filter-folder-element.h) | 2 | ||||
-rw-r--r-- | libemail-engine/em-vfolder-context.c (renamed from libemail-utils/em-vfolder-context.c) | 8 | ||||
-rw-r--r-- | libemail-engine/em-vfolder-context.h (renamed from libemail-utils/em-vfolder-context.h) | 2 | ||||
-rw-r--r-- | libemail-engine/em-vfolder-rule.c (renamed from libemail-utils/em-vfolder-rule.c) | 2 | ||||
-rw-r--r-- | libemail-engine/em-vfolder-rule.h (renamed from libemail-utils/em-vfolder-rule.h) | 2 | ||||
-rw-r--r-- | libemail-engine/libemail-engine.pc.in | 2 | ||||
-rw-r--r-- | libemail-engine/mail-folder-cache.c | 2 | ||||
-rw-r--r-- | libemail-engine/mail-mt.c (renamed from libemail-utils/mail-mt.c) | 0 | ||||
-rw-r--r-- | libemail-engine/mail-mt.h (renamed from libemail-utils/mail-mt.h) | 3 | ||||
-rw-r--r-- | libemail-engine/mail-ops.c | 2 | ||||
-rw-r--r-- | libemail-engine/mail-ops.h | 2 | ||||
-rw-r--r-- | libemail-engine/mail-vfolder.c | 15 | ||||
-rw-r--r-- | libemail-engine/mail-vfolder.h | 5 | ||||
-rw-r--r-- | libemail-utils/Makefile.am | 44 | ||||
-rw-r--r-- | libemail-utils/libemail-utils.pc.in | 16 | ||||
-rw-r--r-- | libevolution-utils/Makefile.am | 45 | ||||
-rw-r--r-- | libevolution-utils/evolution-util.c | 327 | ||||
-rw-r--r-- | libevolution-utils/evolution-util.h | 47 | ||||
-rw-r--r-- | libevolution-utils/libevolution-utils.pc.in | 16 | ||||
-rw-r--r-- | mail/Makefile.am | 29 | ||||
-rw-r--r-- | mail/e-mail-account-store.c | 3 | ||||
-rw-r--r-- | mail/e-mail-backend.c | 3 | ||||
-rw-r--r-- | mail/e-mail-browser.c | 4 | ||||
-rw-r--r-- | mail/e-mail-browser.h | 2 | ||||
-rw-r--r-- | mail/e-mail-config-activity-page.c | 5 | ||||
-rw-r--r-- | mail/e-mail-config-activity-page.h | 2 | ||||
-rw-r--r-- | mail/e-mail-config-assistant.c | 2 | ||||
-rw-r--r-- | mail/e-mail-config-auth-check.c | 7 | ||||
-rw-r--r-- | mail/e-mail-config-identity-page.c | 4 | ||||
-rw-r--r-- | mail/e-mail-config-provider-page.h | 2 | ||||
-rw-r--r-- | mail/e-mail-config-window.c | 8 | ||||
-rw-r--r-- | mail/e-mail-display.c | 31 | ||||
-rw-r--r-- | mail/e-mail-display.h | 3 | ||||
-rw-r--r-- | mail/e-mail-folder-pane.c | 18 | ||||
-rw-r--r-- | mail/e-mail-migrate.c | 13 | ||||
-rw-r--r-- | mail/e-mail-notebook-view.h | 1 | ||||
-rw-r--r-- | mail/e-mail-paned-view.c | 18 | ||||
-rw-r--r-- | mail/e-mail-printer.c | 9 | ||||
-rw-r--r-- | mail/e-mail-reader-utils.c | 35 | ||||
-rw-r--r-- | mail/e-mail-reader.c | 46 | ||||
-rw-r--r-- | mail/e-mail-reader.h | 4 | ||||
-rw-r--r-- | mail/e-mail-request.c | 11 | ||||
-rw-r--r-- | mail/e-mail-tag-editor.c | 1 | ||||
-rw-r--r-- | mail/e-mail-ui-session.c | 4 | ||||
-rw-r--r-- | mail/e-mail-ui-session.h | 3 | ||||
-rw-r--r-- | mail/e-mail-view.h | 1 | ||||
-rw-r--r-- | mail/em-composer-utils.c | 7 | ||||
-rw-r--r-- | mail/em-config.h | 3 | ||||
-rw-r--r-- | mail/em-event.h | 3 | ||||
-rw-r--r-- | mail/em-filter-context.c | 2 | ||||
-rw-r--r-- | mail/em-filter-context.h | 2 | ||||
-rw-r--r-- | mail/em-filter-editor-folder-element.c | 5 | ||||
-rw-r--r-- | mail/em-filter-editor-folder-element.h | 4 | ||||
-rw-r--r-- | mail/em-filter-editor.h | 3 | ||||
-rw-r--r-- | mail/em-filter-rule.h | 2 | ||||
-rw-r--r-- | mail/em-filter-source-element.c | 12 | ||||
-rw-r--r-- | mail/em-filter-source-element.h | 2 | ||||
-rw-r--r-- | mail/em-folder-properties.c | 2 | ||||
-rw-r--r-- | mail/em-folder-properties.h | 1 | ||||
-rw-r--r-- | mail/em-folder-tree-model.c | 5 | ||||
-rw-r--r-- | mail/em-folder-tree.c | 9 | ||||
-rw-r--r-- | mail/em-folder-tree.h | 3 | ||||
-rw-r--r-- | mail/em-folder-utils.c | 9 | ||||
-rw-r--r-- | mail/em-search-context.c | 7 | ||||
-rw-r--r-- | mail/em-search-context.h | 2 | ||||
-rw-r--r-- | mail/em-subscription-editor.c | 10 | ||||
-rw-r--r-- | mail/em-utils.c | 27 | ||||
-rw-r--r-- | mail/em-vfolder-editor-context.c | 12 | ||||
-rw-r--r-- | mail/em-vfolder-editor-context.h | 4 | ||||
-rw-r--r-- | mail/em-vfolder-editor-rule.c | 1 | ||||
-rw-r--r-- | mail/em-vfolder-editor-rule.h | 4 | ||||
-rw-r--r-- | mail/em-vfolder-editor.h | 3 | ||||
-rw-r--r-- | mail/importers/Makefile.am | 6 | ||||
-rw-r--r-- | mail/importers/elm-importer.c | 3 | ||||
-rw-r--r-- | mail/importers/evolution-mbox-importer.c | 6 | ||||
-rw-r--r-- | mail/importers/mail-importer.c | 4 | ||||
-rw-r--r-- | mail/importers/mail-importer.h | 2 | ||||
-rw-r--r-- | mail/importers/pine-importer.c | 3 | ||||
-rw-r--r-- | mail/mail-autofilter.c | 3 | ||||
-rw-r--r-- | mail/mail-autofilter.h | 3 | ||||
-rw-r--r-- | mail/mail-send-recv.c | 3 | ||||
-rw-r--r-- | mail/mail-vfolder-ui.c | 5 | ||||
-rw-r--r-- | mail/mail-vfolder-ui.h | 7 | ||||
-rw-r--r-- | mail/message-list.c | 30 | ||||
-rw-r--r-- | mail/message-list.h | 2 | ||||
-rw-r--r-- | maint/Makefile.am | 2 | ||||
-rw-r--r-- | modules/addressbook/Makefile.am | 8 | ||||
-rw-r--r-- | modules/addressbook/autocompletion-config.c | 4 | ||||
-rw-r--r-- | modules/addressbook/autocompletion-config.h | 1 | ||||
-rw-r--r-- | modules/addressbook/e-book-config-hook.c | 1 | ||||
-rw-r--r-- | modules/addressbook/e-book-config-name-selector-entry.c | 2 | ||||
-rw-r--r-- | modules/addressbook/e-book-shell-backend.c | 5 | ||||
-rw-r--r-- | modules/addressbook/e-book-shell-content.c | 3 | ||||
-rw-r--r-- | modules/addressbook/e-book-shell-content.h | 2 | ||||
-rw-r--r-- | modules/addressbook/e-book-shell-sidebar.h | 2 | ||||
-rw-r--r-- | modules/addressbook/e-book-shell-view-actions.c | 6 | ||||
-rw-r--r-- | modules/addressbook/e-book-shell-view-private.c | 1 | ||||
-rw-r--r-- | modules/addressbook/e-book-shell-view-private.h | 7 | ||||
-rw-r--r-- | modules/audio-inline/Makefile.am | 5 | ||||
-rw-r--r-- | modules/audio-inline/e-mail-formatter-audio-inline.c | 8 | ||||
-rw-r--r-- | modules/backup-restore/Makefile.am | 10 | ||||
-rw-r--r-- | modules/backup-restore/e-mail-config-restore-page.c | 4 | ||||
-rw-r--r-- | modules/backup-restore/evolution-backup-restore.c | 6 | ||||
-rw-r--r-- | modules/bogofilter/Makefile.am | 1 | ||||
-rw-r--r-- | modules/book-config-google/Makefile.am | 10 | ||||
-rw-r--r-- | modules/book-config-google/evolution-book-config-google.c | 4 | ||||
-rw-r--r-- | modules/book-config-ldap/Makefile.am | 7 | ||||
-rw-r--r-- | modules/book-config-ldap/evolution-book-config-ldap.c | 4 | ||||
-rw-r--r-- | modules/book-config-local/Makefile.am | 10 | ||||
-rw-r--r-- | modules/book-config-local/evolution-book-config-local.c | 3 | ||||
-rw-r--r-- | modules/book-config-webdav/Makefile.am | 10 | ||||
-rw-r--r-- | modules/book-config-webdav/evolution-book-config-webdav.c | 3 | ||||
-rw-r--r-- | modules/cal-config-caldav/Makefile.am | 6 | ||||
-rw-r--r-- | modules/cal-config-caldav/e-caldav-chooser.c | 2 | ||||
-rw-r--r-- | modules/cal-config-caldav/evolution-cal-config-caldav.c | 4 | ||||
-rw-r--r-- | modules/cal-config-contacts/Makefile.am | 10 | ||||
-rw-r--r-- | modules/cal-config-contacts/e-contacts-selector.h | 2 | ||||
-rw-r--r-- | modules/cal-config-contacts/evolution-cal-config-contacts.c | 4 | ||||
-rw-r--r-- | modules/cal-config-google/Makefile.am | 6 | ||||
-rw-r--r-- | modules/cal-config-google/e-google-chooser.c | 2 | ||||
-rw-r--r-- | modules/cal-config-google/evolution-cal-config-google.c | 3 | ||||
-rw-r--r-- | modules/cal-config-local/Makefile.am | 10 | ||||
-rw-r--r-- | modules/cal-config-local/evolution-cal-config-local.c | 3 | ||||
-rw-r--r-- | modules/cal-config-weather/Makefile.am | 6 | ||||
-rw-r--r-- | modules/cal-config-weather/evolution-cal-config-weather.c | 3 | ||||
-rw-r--r-- | modules/cal-config-webcal/Makefile.am | 10 | ||||
-rw-r--r-- | modules/cal-config-webcal/evolution-cal-config-webcal.c | 4 | ||||
-rw-r--r-- | modules/calendar/Makefile.am | 9 | ||||
-rw-r--r-- | modules/calendar/e-cal-attachment-handler.c | 1 | ||||
-rw-r--r-- | modules/calendar/e-cal-attachment-handler.h | 2 | ||||
-rw-r--r-- | modules/calendar/e-cal-config-calendar-item.c | 1 | ||||
-rw-r--r-- | modules/calendar/e-cal-config-date-edit.c | 1 | ||||
-rw-r--r-- | modules/calendar/e-cal-config-hook.c | 1 | ||||
-rw-r--r-- | modules/calendar/e-cal-event-hook.c | 1 | ||||
-rw-r--r-- | modules/calendar/e-cal-shell-backend.c | 5 | ||||
-rw-r--r-- | modules/calendar/e-cal-shell-content.c | 4 | ||||
-rw-r--r-- | modules/calendar/e-cal-shell-content.h | 1 | ||||
-rw-r--r-- | modules/calendar/e-cal-shell-sidebar.c | 4 | ||||
-rw-r--r-- | modules/calendar/e-cal-shell-sidebar.h | 2 | ||||
-rw-r--r-- | modules/calendar/e-cal-shell-view-actions.c | 1 | ||||
-rw-r--r-- | modules/calendar/e-cal-shell-view-private.c | 1 | ||||
-rw-r--r-- | modules/calendar/e-cal-shell-view-private.h | 11 | ||||
-rw-r--r-- | modules/calendar/e-calendar-preferences.c | 6 | ||||
-rw-r--r-- | modules/calendar/e-calendar-preferences.h | 3 | ||||
-rw-r--r-- | modules/calendar/e-memo-shell-backend.c | 3 | ||||
-rw-r--r-- | modules/calendar/e-memo-shell-content.c | 4 | ||||
-rw-r--r-- | modules/calendar/e-memo-shell-content.h | 3 | ||||
-rw-r--r-- | modules/calendar/e-memo-shell-sidebar.c | 2 | ||||
-rw-r--r-- | modules/calendar/e-memo-shell-sidebar.h | 1 | ||||
-rw-r--r-- | modules/calendar/e-memo-shell-view-actions.c | 1 | ||||
-rw-r--r-- | modules/calendar/e-memo-shell-view-private.c | 2 | ||||
-rw-r--r-- | modules/calendar/e-memo-shell-view-private.h | 7 | ||||
-rw-r--r-- | modules/calendar/e-task-shell-backend.c | 3 | ||||
-rw-r--r-- | modules/calendar/e-task-shell-content.c | 4 | ||||
-rw-r--r-- | modules/calendar/e-task-shell-content.h | 3 | ||||
-rw-r--r-- | modules/calendar/e-task-shell-sidebar.c | 2 | ||||
-rw-r--r-- | modules/calendar/e-task-shell-sidebar.h | 1 | ||||
-rw-r--r-- | modules/calendar/e-task-shell-view-actions.c | 1 | ||||
-rw-r--r-- | modules/calendar/e-task-shell-view-private.c | 2 | ||||
-rw-r--r-- | modules/calendar/e-task-shell-view-private.h | 8 | ||||
-rw-r--r-- | modules/composer-autosave/Makefile.am | 5 | ||||
-rw-r--r-- | modules/composer-autosave/e-composer-autosave.c | 1 | ||||
-rw-r--r-- | modules/composer-autosave/e-composer-registry.c | 1 | ||||
-rw-r--r-- | modules/imap-features/Makefile.am | 6 | ||||
-rw-r--r-- | modules/itip-formatter/Makefile.am | 12 | ||||
-rw-r--r-- | modules/itip-formatter/e-conflict-search-selector.h | 2 | ||||
-rw-r--r-- | modules/itip-formatter/e-mail-parser-itip.c | 5 | ||||
-rw-r--r-- | modules/itip-formatter/e-mail-part-itip.h | 1 | ||||
-rw-r--r-- | modules/itip-formatter/itip-view.c | 13 | ||||
-rw-r--r-- | modules/itip-formatter/plugin/Makefile.am | 10 | ||||
-rw-r--r-- | modules/mail-config/Makefile.am | 7 | ||||
-rw-r--r-- | modules/mail-config/e-mail-config-remote-accounts.c | 2 | ||||
-rw-r--r-- | modules/mail-config/e-mail-config-smtp-backend.c | 2 | ||||
-rw-r--r-- | modules/mail/Makefile.am | 12 | ||||
-rw-r--r-- | modules/mail/e-mail-attachment-handler.c | 1 | ||||
-rw-r--r-- | modules/mail/e-mail-attachment-handler.h | 2 | ||||
-rw-r--r-- | modules/mail/e-mail-config-hook.c | 1 | ||||
-rw-r--r-- | modules/mail/e-mail-config-web-view-gtkhtml.c | 1 | ||||
-rw-r--r-- | modules/mail/e-mail-config-web-view.c | 1 | ||||
-rw-r--r-- | modules/mail/e-mail-event-hook.c | 1 | ||||
-rw-r--r-- | modules/mail/e-mail-shell-backend.c | 7 | ||||
-rw-r--r-- | modules/mail/e-mail-shell-backend.h | 3 | ||||
-rw-r--r-- | modules/mail/e-mail-shell-content.c | 6 | ||||
-rw-r--r-- | modules/mail/e-mail-shell-view-private.c | 3 | ||||
-rw-r--r-- | modules/mail/e-mail-shell-view-private.h | 9 | ||||
-rw-r--r-- | modules/mail/e-mail-shell-view.c | 1 | ||||
-rw-r--r-- | modules/mail/em-account-prefs.c | 2 | ||||
-rw-r--r-- | modules/mail/em-account-prefs.h | 2 | ||||
-rw-r--r-- | modules/mail/em-composer-prefs.c | 6 | ||||
-rw-r--r-- | modules/mail/em-composer-prefs.h | 1 | ||||
-rw-r--r-- | modules/mail/em-mailer-prefs.c | 6 | ||||
-rw-r--r-- | modules/mail/em-mailer-prefs.h | 1 | ||||
-rw-r--r-- | modules/mail/em-network-prefs.c | 1 | ||||
-rw-r--r-- | modules/mail/em-network-prefs.h | 2 | ||||
-rw-r--r-- | modules/mailto-handler/Makefile.am | 2 | ||||
-rw-r--r-- | modules/mdn/Makefile.am | 4 | ||||
-rw-r--r-- | modules/mdn/evolution-mdn.c | 2 | ||||
-rw-r--r-- | modules/offline-alert/Makefile.am | 10 | ||||
-rw-r--r-- | modules/offline-alert/evolution-offline-alert.c | 1 | ||||
-rw-r--r-- | modules/online-accounts/Makefile.am | 5 | ||||
-rw-r--r-- | modules/plugin-lib/Makefile.am | 10 | ||||
-rw-r--r-- | modules/plugin-lib/e-plugin-lib.h | 2 | ||||
-rw-r--r-- | modules/plugin-manager/Makefile.am | 9 | ||||
-rw-r--r-- | modules/plugin-manager/evolution-plugin-manager.c | 1 | ||||
-rw-r--r-- | modules/prefer-plain/Makefile.am | 11 | ||||
-rw-r--r-- | modules/prefer-plain/plugin/Makefile.am | 9 | ||||
-rw-r--r-- | modules/prefer-plain/plugin/config-ui.c | 2 | ||||
-rw-r--r-- | modules/spamassassin/Makefile.am | 9 | ||||
-rw-r--r-- | modules/spamassassin/evolution-spamassassin.c | 1 | ||||
-rw-r--r-- | modules/startup-wizard/Makefile.am | 8 | ||||
-rw-r--r-- | modules/startup-wizard/e-mail-config-import-page.c | 2 | ||||
-rw-r--r-- | modules/startup-wizard/e-mail-config-import-page.h | 2 | ||||
-rw-r--r-- | modules/startup-wizard/e-mail-config-import-progress-page.h | 2 | ||||
-rw-r--r-- | modules/startup-wizard/e-startup-assistant.c | 2 | ||||
-rw-r--r-- | modules/startup-wizard/evolution-startup-wizard.c | 3 | ||||
-rw-r--r-- | modules/text-highlight/Makefile.am | 10 | ||||
-rw-r--r-- | modules/tnef-attachment/Makefile.am | 5 | ||||
-rw-r--r-- | modules/tnef-attachment/e-mail-parser-tnef-attachment.c | 19 | ||||
-rw-r--r-- | modules/vcard-inline/Makefile.am | 9 | ||||
-rw-r--r-- | modules/vcard-inline/e-mail-parser-vcard-inline.c | 1 | ||||
-rw-r--r-- | modules/web-inspector/Makefile.am | 10 | ||||
-rw-r--r-- | modules/web-inspector/evolution-web-inspector.c | 3 | ||||
-rw-r--r-- | plugins/attachment-reminder/Makefile.am | 5 | ||||
-rw-r--r-- | plugins/attachment-reminder/attachment-reminder.c | 7 | ||||
-rw-r--r-- | plugins/bbdb/Makefile.am | 4 | ||||
-rw-r--r-- | plugins/bbdb/bbdb.c | 3 | ||||
-rw-r--r-- | plugins/bbdb/gaimbuddies.c | 5 | ||||
-rw-r--r-- | plugins/dbx-import/Makefile.am | 10 | ||||
-rw-r--r-- | plugins/dbx-import/dbx-importer.c | 7 | ||||
-rw-r--r-- | plugins/email-custom-header/Makefile.am | 6 | ||||
-rw-r--r-- | plugins/email-custom-header/email-custom-header.c | 3 | ||||
-rw-r--r-- | plugins/external-editor/Makefile.am | 4 | ||||
-rw-r--r-- | plugins/external-editor/external-editor.c | 1 | ||||
-rw-r--r-- | plugins/face/Makefile.am | 6 | ||||
-rw-r--r-- | plugins/face/face.c | 3 | ||||
-rw-r--r-- | plugins/mail-notification/Makefile.am | 4 | ||||
-rw-r--r-- | plugins/mail-notification/mail-notification.c | 1 | ||||
-rw-r--r-- | plugins/mail-to-task/Makefile.am | 11 | ||||
-rw-r--r-- | plugins/mail-to-task/mail-to-task.c | 6 | ||||
-rw-r--r-- | plugins/mailing-list-actions/Makefile.am | 5 | ||||
-rw-r--r-- | plugins/mailing-list-actions/mailing-list-actions.c | 3 | ||||
-rw-r--r-- | plugins/mark-all-read/Makefile.am | 10 | ||||
-rw-r--r-- | plugins/mark-all-read/mark-all-read.c | 1 | ||||
-rw-r--r-- | plugins/pst-import/Makefile.am | 7 | ||||
-rw-r--r-- | plugins/pst-import/pst-importer.c | 13 | ||||
-rw-r--r-- | plugins/publish-calendar/Makefile.am | 12 | ||||
-rw-r--r-- | plugins/publish-calendar/publish-calendar.c | 3 | ||||
-rw-r--r-- | plugins/publish-calendar/publish-location.c | 3 | ||||
-rw-r--r-- | plugins/publish-calendar/url-editor-dialog.h | 1 | ||||
-rw-r--r-- | plugins/save-calendar/Makefile.am | 10 | ||||
-rw-r--r-- | plugins/save-calendar/format-handler.h | 4 | ||||
-rw-r--r-- | plugins/save-calendar/save-calendar.c | 3 | ||||
-rw-r--r-- | plugins/templates/Makefile.am | 4 | ||||
-rw-r--r-- | plugins/templates/templates.c | 5 | ||||
-rw-r--r-- | po/POTFILES.in | 5 | ||||
-rw-r--r-- | shell/Makefile.am | 25 | ||||
-rw-r--r-- | shell/e-convert-local-mail.c | 1 | ||||
-rw-r--r-- | shell/e-shell-backend.c | 36 | ||||
-rw-r--r-- | shell/e-shell-backend.h | 2 | ||||
-rw-r--r-- | shell/e-shell-content.c | 7 | ||||
-rw-r--r-- | shell/e-shell-migrate.c | 4 | ||||
-rw-r--r-- | shell/e-shell-searchbar.c | 3 | ||||
-rw-r--r-- | shell/e-shell-searchbar.h | 1 | ||||
-rw-r--r-- | shell/e-shell-sidebar.c | 2 | ||||
-rw-r--r-- | shell/e-shell-taskbar.c | 1 | ||||
-rw-r--r-- | shell/e-shell-utils.c | 2 | ||||
-rw-r--r-- | shell/e-shell-utils.h | 2 | ||||
-rw-r--r-- | shell/e-shell-view.c | 8 | ||||
-rw-r--r-- | shell/e-shell-view.h | 7 | ||||
-rw-r--r-- | shell/e-shell-window-actions.c | 7 | ||||
-rw-r--r-- | shell/e-shell-window-private.h | 11 | ||||
-rw-r--r-- | shell/e-shell-window.c | 44 | ||||
-rw-r--r-- | shell/e-shell-window.h | 5 | ||||
-rw-r--r-- | shell/e-shell.c | 3 | ||||
-rw-r--r-- | shell/e-shell.h | 3 | ||||
-rw-r--r-- | shell/es-event.h | 2 | ||||
-rw-r--r-- | shell/main.c | 8 | ||||
-rw-r--r-- | smime/gui/Makefile.am | 8 | ||||
-rw-r--r-- | smime/gui/certificate-manager.c | 4 | ||||
-rw-r--r-- | smime/gui/certificate-manager.h | 1 | ||||
-rw-r--r-- | smime/gui/component.c | 3 | ||||
-rw-r--r-- | smime/lib/Makefile.am | 5 | ||||
-rw-r--r-- | smime/lib/e-cert-db.c | 4 | ||||
-rw-r--r-- | smime/lib/e-pkcs12.c | 2 | ||||
-rw-r--r-- | widgets/LICENSE | 1 | ||||
-rw-r--r-- | widgets/Makefile.am | 9 | ||||
-rw-r--r-- | widgets/e-timezone-dialog/Makefile.am | 29 | ||||
-rw-r--r-- | widgets/menus/Makefile.am | 58 | ||||
-rw-r--r-- | widgets/misc/Makefile.am | 289 | ||||
-rw-r--r-- | widgets/misc/e-canvas-background.h | 70 | ||||
-rw-r--r-- | widgets/misc/e-canvas-vbox.h | 85 | ||||
-rw-r--r-- | widgets/table/Makefile.am | 193 | ||||
-rw-r--r-- | widgets/table/e-table.dia | bin | 4514 -> 0 bytes | |||
-rw-r--r-- | widgets/table/sample.table | 45 | ||||
-rw-r--r-- | widgets/table/spec.xml | 21 | ||||
-rw-r--r-- | widgets/text/Makefile.am | 44 |
993 files changed, 29181 insertions, 5308 deletions
diff --git a/Makefile.am b/Makefile.am index d9403ab794..888734a783 100644 --- a/Makefile.am +++ b/Makefile.am @@ -51,13 +51,8 @@ SUBDIRS = \ m4 \ data \ libgnomecanvas \ - libevolution-utils \ - filter \ - libemail-utils \ - libemail-engine \ e-util \ - a11y \ - widgets \ + libemail-engine \ shell \ $(SMIME_SUBDIR) \ em-format \ diff --git a/a11y/Makefile.am b/a11y/Makefile.am deleted file mode 100644 index 50f603f009..0000000000 --- a/a11y/Makefile.am +++ /dev/null @@ -1,23 +0,0 @@ -# for debug -#A11Y_CFLAGS += -pedantic -ansi -DACC_DEBUG -Werror - -privsolib_LTLIBRARIES = libevolution-a11y.la - -libevolution_a11y_la_CPPFLAGS = \ - $(AM_CPPFLAGS) \ - $(GNOME_PLATFORM_CFLAGS) \ - $(A11Y_CFLAGS) - -libevolution_a11y_la_SOURCES = \ - ea-factory.h \ - gal-a11y-util.c \ - gal-a11y-util.h \ - gal-a11y-factory.h - -libevolution_a11y_la_LDFLAGS = -avoid-version $(NO_UNDEFINED) - -libevolution_a11y_la_LIBADD = \ - $(top_builddir)/e-util/libeutil.la \ - $(GNOME_PLATFORM_LIBS) - --include $(top_srcdir)/git.mk diff --git a/addressbook/gui/contact-editor/Makefile.am b/addressbook/gui/contact-editor/Makefile.am index d67a21bba2..ddd4592bf9 100644 --- a/addressbook/gui/contact-editor/Makefile.am +++ b/addressbook/gui/contact-editor/Makefile.am @@ -3,16 +3,16 @@ privsolib_LTLIBRARIES = libecontacteditor.la libecontacteditor_la_CPPFLAGS = \ $(AM_CPPFLAGS) \ -I$(top_srcdir) \ - -I$(top_srcdir)/widgets \ -I$(top_srcdir)/addressbook/ \ -I$(top_srcdir)/addressbook/gui/merging \ - -I$(top_srcdir)/widgets/table \ -I$(top_builddir)/shell \ -DEVOLUTION_UIDIR=\""$(uidir)"\" \ -DEVOLUTION_IMAGESDIR=\""$(imagesdir)"\" \ -DG_LOG_DOMAIN=\"contact-editor\" \ $(EVOLUTION_DATA_SERVER_CFLAGS) \ - $(GNOME_PLATFORM_CFLAGS) + $(GNOME_PLATFORM_CFLAGS) \ + $(CHAMPLAIN_CFLAGS) \ + $(GTKHTML_CFLAGS) libecontacteditor_la_SOURCES = \ eab-editor.c \ @@ -28,15 +28,15 @@ libecontacteditor_la_LDFLAGS = -avoid-version $(NO_UNDEFINED) libecontacteditor_la_LIBADD = \ $(top_builddir)/e-util/libeutil.la \ - $(top_builddir)/widgets/misc/libemiscwidgets.la \ $(top_builddir)/addressbook/util/libeabutil.la \ $(top_builddir)/addressbook/gui/widgets/libeabwidgets.la \ $(top_builddir)/addressbook/gui/merging/libeabbookmerging.la \ $(top_builddir)/addressbook/printing/libecontactprint.la \ - $(top_builddir)/widgets/menus/libmenus.la \ $(EVOLUTION_ADDRESSBOOK_LIBS) \ $(EVOLUTION_DATA_SERVER_LIBS) \ - $(GNOME_PLATFORM_LIBS) + $(GNOME_PLATFORM_LIBS) \ + $(CHAMPLAIN_LIBS) \ + $(GTKHTML_LIBS) ui_DATA = \ contact-editor.ui \ diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c index 8e2e455dc1..ef0700baed 100644 --- a/addressbook/gui/contact-editor/e-contact-editor.c +++ b/addressbook/gui/contact-editor/e-contact-editor.c @@ -30,23 +30,16 @@ #include <stdlib.h> #include <string.h> #include <time.h> + #include <gtk/gtk.h> #include <glib/gi18n.h> #include <gdk/gdkkeysyms.h> #include <gdk-pixbuf/gdk-pixbuf.h> -#include <libedataserverui/libedataserverui.h> +#include "shell/e-shell.h" #include "addressbook/printing/e-contact-print.h" #include "addressbook/gui/widgets/eab-gui-util.h" -#include "e-util/e-util.h" -#include "libevolution-utils/e-alert-dialog.h" -#include "misc/e-dateedit.h" -#include "misc/e-image-chooser.h" -#include "misc/e-url-entry.h" -#include "e-util/e-icon-factory.h" -#include "e-util/e-util-private.h" -#include "shell/e-shell.h" #include "eab-contact-merging.h" diff --git a/addressbook/gui/contact-editor/e-contact-quick-add.c b/addressbook/gui/contact-editor/e-contact-quick-add.c index e9076a9df8..6dcb7dc628 100644 --- a/addressbook/gui/contact-editor/e-contact-quick-add.c +++ b/addressbook/gui/contact-editor/e-contact-quick-add.c @@ -29,13 +29,10 @@ #include <gtk/gtk.h> #include <glib/gi18n.h> -#include <libedataserverui/libedataserverui.h> - #include <addressbook/util/eab-book-util.h> #include "e-contact-editor.h" #include "e-contact-quick-add.h" #include "eab-contact-merging.h" -#include "libevolution-utils/e-alert-dialog.h" typedef struct _QuickAdd QuickAdd; struct _QuickAdd { diff --git a/addressbook/gui/contact-list-editor/Makefile.am b/addressbook/gui/contact-list-editor/Makefile.am index 01a4c7c375..0479683406 100644 --- a/addressbook/gui/contact-list-editor/Makefile.am +++ b/addressbook/gui/contact-list-editor/Makefile.am @@ -3,7 +3,6 @@ privsolib_LTLIBRARIES = libecontactlisteditor.la libecontactlisteditor_la_CPPFLAGS = \ $(AM_CPPFLAGS) \ -I$(top_srcdir) \ - -I$(top_srcdir)/widgets \ -I$(top_srcdir)/addressbook/ \ -I$(top_srcdir)/addressbook/gui/merging \ -I$(top_srcdir)/addressbook/gui/contact-editor \ @@ -11,7 +10,9 @@ libecontactlisteditor_la_CPPFLAGS = \ -DEVOLUTION_UIDIR=\""$(uidir)"\" \ -DG_LOG_DOMAIN=\"contact-list-editor\" \ $(EVOLUTION_DATA_SERVER_CFLAGS) \ - $(GNOME_PLATFORM_CFLAGS) + $(GNOME_PLATFORM_CFLAGS) \ + $(CHAMPLAIN_CFLAGS) \ + $(GTKHTML_CFLAGS) libecontactlisteditor_la_SOURCES = \ e-contact-list-editor.c \ @@ -24,13 +25,12 @@ libecontactlisteditor_la_LDFLAGS = -avoid-version $(NO_UNDEFINED) libecontactlisteditor_la_LIBADD = \ $(top_builddir)/addressbook/util/libeabutil.la \ $(top_builddir)/addressbook/gui/contact-editor/libecontacteditor.la \ - $(top_builddir)/widgets/table/libetable.la \ - $(top_builddir)/widgets/misc/libemiscwidgets.la \ $(top_builddir)/e-util/libeutil.la \ $(top_builddir)/shell/libeshell.la \ - $(top_builddir)/libevolution-utils/libevolution-utils.la \ $(EVOLUTION_DATA_SERVER_LIBS) \ - $(GNOME_PLATFORM_LIBS) + $(GNOME_PLATFORM_LIBS) \ + $(CHAMPLAIN_LIBS) \ + $(GTKHTML_LIBS) ui_DATA = contact-list-editor.ui 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 a6205757d8..8f0c8783fb 100644 --- a/addressbook/gui/contact-list-editor/e-contact-list-editor.c +++ b/addressbook/gui/contact-list-editor/e-contact-list-editor.c @@ -25,10 +25,6 @@ #endif #include "e-contact-list-editor.h" -#include <e-util/e-util-private.h> -#include <libevolution-utils/e-alert-dialog.h> -#include <e-util/e-selection.h> -#include "shell/e-shell.h" #include <string.h> @@ -38,7 +34,8 @@ #include <camel/camel.h> -#include "e-util/e-util.h" +#include "shell/e-shell.h" + #include "addressbook/gui/widgets/eab-gui-util.h" #include "addressbook/util/eab-book-util.h" diff --git a/addressbook/gui/contact-list-editor/e-contact-list-editor.h b/addressbook/gui/contact-list-editor/e-contact-list-editor.h index 07cc4db6bf..bafd7845b1 100644 --- a/addressbook/gui/contact-list-editor/e-contact-list-editor.h +++ b/addressbook/gui/contact-list-editor/e-contact-list-editor.h @@ -23,8 +23,6 @@ #ifndef __E_CONTACT_LIST_EDITOR_H__ #define __E_CONTACT_LIST_EDITOR_H__ -#include <libedataserverui/libedataserverui.h> - #include "addressbook/gui/contact-editor/eab-editor.h" #define E_TYPE_CONTACT_LIST_EDITOR \ 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 337fd351e4..d2aae534fa 100644 --- a/addressbook/gui/contact-list-editor/e-contact-list-model.c +++ b/addressbook/gui/contact-list-editor/e-contact-list-model.c @@ -26,7 +26,6 @@ #include <string.h> #include "e-contact-list-model.h" -#include "libevolution-utils/e-alert-dialog.h" #include "shell/e-shell.h" #define E_CONTACT_LIST_MODEL_GET_PRIVATE(obj) \ diff --git a/addressbook/gui/merging/Makefile.am b/addressbook/gui/merging/Makefile.am index b1c2b45cf4..a6a1522c7a 100644 --- a/addressbook/gui/merging/Makefile.am +++ b/addressbook/gui/merging/Makefile.am @@ -5,10 +5,10 @@ libeabbookmerging_la_CPPFLAGS = \ -DG_LOG_DOMAIN=\"eab-contact-merging\" \ -DEVOLUTION_UIDIR=\""$(uidir)"\" \ -I$(top_srcdir) \ - -I$(top_srcdir)/widgets \ -I$(top_srcdir)/addressbook \ $(EVOLUTION_DATA_SERVER_CFLAGS) \ $(GNOME_PLATFORM_CFLAGS) \ + $(CHAMPLAIN_CFLAGS) \ $(GTKHTML_CFLAGS) libeabbookmerging_la_SOURCES = \ diff --git a/addressbook/gui/merging/eab-contact-compare.c b/addressbook/gui/merging/eab-contact-compare.c index 7c30b28da8..8b24ea3d57 100644 --- a/addressbook/gui/merging/eab-contact-compare.c +++ b/addressbook/gui/merging/eab-contact-compare.c @@ -28,7 +28,7 @@ #include <ctype.h> #include <string.h> -#include <libedataserverui/libedataserverui.h> +#include "e-util/e-util.h" #include "addressbook/util/eab-book-util.h" #include "eab-contact-compare.h" diff --git a/addressbook/gui/widgets/Makefile.am b/addressbook/gui/widgets/Makefile.am index 19c9c4f72b..e7ca15e386 100644 --- a/addressbook/gui/widgets/Makefile.am +++ b/addressbook/gui/widgets/Makefile.am @@ -12,12 +12,9 @@ libeabwidgets_la_CPPFLAGS = \ -DEVOLUTION_IMAGESDIR=\"${imagesdir}\" \ -DEVOLUTION_PRIVDATADIR=\"${privdatadir}\" \ -I$(top_srcdir) \ - -I$(top_srcdir)/filter \ - -I$(top_srcdir)/widgets \ -I$(top_srcdir)/addressbook \ -I$(top_srcdir)/addressbook/gui/merging \ -I$(top_srcdir)/addressbook/util \ - -I$(top_srcdir)/widgets/misc \ -I$(top_builddir)/shell \ $(EVOLUTION_DATA_SERVER_CFLAGS) \ $(GNOME_PLATFORM_CFLAGS) \ @@ -69,11 +66,7 @@ libeabwidgets_la_SOURCES = \ ea-addressbook.h libeabwidgets_la_LIBADD = \ - $(top_builddir)/widgets/misc/libemiscwidgets.la \ $(top_builddir)/shell/libeshell.la \ - $(top_builddir)/widgets/table/libetable.la \ - $(top_builddir)/widgets/menus/libmenus.la \ - $(top_builddir)/a11y/libevolution-a11y.la \ $(top_builddir)/e-util/libeutil.la \ $(EVOLUTION_DATA_SERVER_LIBS) \ $(GNOME_PLATFORM_LIBS) \ diff --git a/addressbook/gui/widgets/e-addressbook-reflow-adapter.h b/addressbook/gui/widgets/e-addressbook-reflow-adapter.h index d65f3f39fd..fee217c2f1 100644 --- a/addressbook/gui/widgets/e-addressbook-reflow-adapter.h +++ b/addressbook/gui/widgets/e-addressbook-reflow-adapter.h @@ -22,7 +22,8 @@ #define _E_ADDRESSBOOK_REFLOW_ADAPTER_H_ #include <libebook/libebook.h> -#include <text/e-reflow-model.h> + +#include <e-util/e-util.h> #include "e-addressbook-model.h" diff --git a/addressbook/gui/widgets/e-addressbook-selector.c b/addressbook/gui/widgets/e-addressbook-selector.c index 513da877bc..2441a0bc89 100644 --- a/addressbook/gui/widgets/e-addressbook-selector.c +++ b/addressbook/gui/widgets/e-addressbook-selector.c @@ -24,7 +24,7 @@ #include "e-addressbook-selector.h" -#include <e-util/e-selection.h> +#include <e-util/e-util.h> #include <eab-book-util.h> #include <eab-contact-merging.h> diff --git a/addressbook/gui/widgets/e-addressbook-selector.h b/addressbook/gui/widgets/e-addressbook-selector.h index adabea7205..663f58656b 100644 --- a/addressbook/gui/widgets/e-addressbook-selector.h +++ b/addressbook/gui/widgets/e-addressbook-selector.h @@ -21,8 +21,6 @@ #ifndef E_ADDRESSBOOK_SELECTOR_H #define E_ADDRESSBOOK_SELECTOR_H -#include <libedataserverui/libedataserverui.h> - #include "e-addressbook-view.h" /* Standard GObject macros */ diff --git a/addressbook/gui/widgets/e-addressbook-table-adapter.h b/addressbook/gui/widgets/e-addressbook-table-adapter.h index 51c9436ff2..4b089b2d0a 100644 --- a/addressbook/gui/widgets/e-addressbook-table-adapter.h +++ b/addressbook/gui/widgets/e-addressbook-table-adapter.h @@ -21,7 +21,7 @@ #ifndef _EAB_TABLE_ADAPTER_H_ #define _EAB_TABLE_ADAPTER_H_ -#include <table/e-table-model.h> +#include <e-util/e-util.h> /* Standard GObject macros */ #define E_TYPE_ADDRESSBOOK_TABLE_ADAPTER \ diff --git a/addressbook/gui/widgets/e-addressbook-view.c b/addressbook/gui/widgets/e-addressbook-view.c index 5206041d29..53402a9e6e 100644 --- a/addressbook/gui/widgets/e-addressbook-view.c +++ b/addressbook/gui/widgets/e-addressbook-view.c @@ -25,40 +25,29 @@ #include <config.h> #endif +#include <ctype.h> +#include <string.h> + #include <glib/gi18n.h> -#include <table/e-table.h> -#include <table/e-table-model.h> -#include <table/e-cell-date.h> -#include <misc/e-selectable.h> -#include <widgets/menus/gal-view-factory-etable.h> -#include <filter/e-rule-editor.h> -#include <widgets/menus/gal-view-etable.h> -#include <shell/e-shell-sidebar.h> +#include <gdk/gdkkeysyms.h> -#include "addressbook/printing/e-contact-print.h" -#include "ea-addressbook.h" +#include "e-addressbook-view.h" -#include "e-util/e-print.h" -#include "e-util/e-selection.h" #include "e-util/e-util.h" +#include "shell/e-shell-sidebar.h" + +#include "addressbook/printing/e-contact-print.h" +#include "ea-addressbook.h" #include "gal-view-minicard.h" #include "gal-view-factory-minicard.h" -#include "e-addressbook-view.h" #include "e-addressbook-model.h" #include "eab-gui-util.h" #include "util/eab-book-util.h" #include "e-addressbook-table-adapter.h" #include "eab-contact-merging.h" -#include "libevolution-utils/e-alert-dialog.h" -#include "e-util/e-util-private.h" - -#include <gdk/gdkkeysyms.h> -#include <ctype.h> -#include <string.h> - #define E_ADDRESSBOOK_VIEW_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ ((obj), E_TYPE_ADDRESSBOOK_VIEW, EAddressbookViewPrivate)) diff --git a/addressbook/gui/widgets/e-addressbook-view.h b/addressbook/gui/widgets/e-addressbook-view.h index 3c8c5e2218..94668d6ace 100644 --- a/addressbook/gui/widgets/e-addressbook-view.h +++ b/addressbook/gui/widgets/e-addressbook-view.h @@ -25,10 +25,7 @@ #include <libebook/libebook.h> -#include <menus/gal-view-instance.h> -#include <misc/e-selection-model.h> #include <shell/e-shell-view.h> -#include <filter/e-filter-rule.h> #include "e-addressbook-model.h" #include "eab-contact-display.h" diff --git a/addressbook/gui/widgets/e-minicard-label.c b/addressbook/gui/widgets/e-minicard-label.c index 618e4ea160..0e75917b80 100644 --- a/addressbook/gui/widgets/e-minicard-label.c +++ b/addressbook/gui/widgets/e-minicard-label.c @@ -27,14 +27,13 @@ #include "e-minicard-label.h" #include <gtk/gtk.h> -#include <libgnomecanvas/libgnomecanvas.h> #include <glib/gi18n.h> -#include <e-util/e-util.h> -#include <text/e-text.h> -#include <misc/e-canvas.h> -#include <misc/e-canvas-utils.h> #include <gdk/gdkkeysyms.h> +#include <libgnomecanvas/libgnomecanvas.h> + +#include "e-util/e-util.h" + 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); diff --git a/addressbook/gui/widgets/e-minicard-view-widget.c b/addressbook/gui/widgets/e-minicard-view-widget.c index ecb2483652..7ff63a1bd9 100644 --- a/addressbook/gui/widgets/e-minicard-view-widget.c +++ b/addressbook/gui/widgets/e-minicard-view-widget.c @@ -25,11 +25,10 @@ #endif #include <gtk/gtk.h> -#include <misc/e-canvas-background.h> -#include <misc/e-canvas.h> #include <glib/gi18n.h> -#include "e-util/e-util.h" +#include <e-util/e-util.h> + #include "e-minicard-view-widget.h" static void e_minicard_view_widget_set_property diff --git a/addressbook/gui/widgets/e-minicard-view-widget.h b/addressbook/gui/widgets/e-minicard-view-widget.h index f540a43f8e..71fe00a497 100644 --- a/addressbook/gui/widgets/e-minicard-view-widget.h +++ b/addressbook/gui/widgets/e-minicard-view-widget.h @@ -23,9 +23,10 @@ #ifndef __E_MINICARD_VIEW_WIDGET_H__ #define __E_MINICARD_VIEW_WIDGET_H__ -#include <misc/e-canvas.h> #include <libebook/libebook.h> +#include <e-util/e-util.h> + #include "e-minicard-view.h" G_BEGIN_DECLS diff --git a/addressbook/gui/widgets/e-minicard-view.c b/addressbook/gui/widgets/e-minicard-view.c index 1889399f3d..08b0cdabf4 100644 --- a/addressbook/gui/widgets/e-minicard-view.c +++ b/addressbook/gui/widgets/e-minicard-view.c @@ -26,16 +26,17 @@ #include "e-minicard-view.h" -#include "eab-gui-util.h" -#include "util/eab-book-util.h" -#include "e-util/e-util.h" +#include <string.h> #include <gtk/gtk.h> -#include <gdk/gdkkeysyms.h> -#include <misc/e-canvas.h> #include <glib/gi18n.h> -#include <string.h> +#include <gdk/gdkkeysyms.h> + #include "e-util/e-util.h" + +#include "eab-gui-util.h" +#include "util/eab-book-util.h" + #include "ea-addressbook.h" static void e_minicard_view_drag_data_get (GtkWidget *widget, diff --git a/addressbook/gui/widgets/e-minicard-view.h b/addressbook/gui/widgets/e-minicard-view.h index 1024a85088..bf116e4513 100644 --- a/addressbook/gui/widgets/e-minicard-view.h +++ b/addressbook/gui/widgets/e-minicard-view.h @@ -26,8 +26,8 @@ #include "e-minicard.h" -#include <text/e-reflow.h> -#include <misc/e-selection-model-simple.h> +#include <e-util/e-util.h> + #include "e-addressbook-reflow-adapter.h" G_BEGIN_DECLS diff --git a/addressbook/gui/widgets/e-minicard.c b/addressbook/gui/widgets/e-minicard.c index b0dae34b69..6a049aca50 100644 --- a/addressbook/gui/widgets/e-minicard.c +++ b/addressbook/gui/widgets/e-minicard.c @@ -24,20 +24,19 @@ #include <config.h> #endif +#include "e-minicard.h" + #include <string.h> -#include <gdk/gdkkeysyms.h> #include <glib/gi18n.h> +#include <gdk/gdkkeysyms.h> + #include <libgnomecanvas/libgnomecanvas.h> -#include <text/e-text.h> -#include <e-util/e-util.h> -#include <misc/e-canvas-utils.h> -#include <misc/e-canvas.h> + +#include "e-util/e-util.h" + #include "eab-gui-util.h" -#include "e-minicard.h" #include "e-minicard-label.h" #include "e-minicard-view.h" -#include <e-util/e-html-utils.h> -#include <e-util/e-icon-factory.h> #include "ea-addressbook.h" static void e_minicard_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); diff --git a/addressbook/gui/widgets/ea-addressbook.c b/addressbook/gui/widgets/ea-addressbook.c index ca218f4245..51af22d0d4 100644 --- a/addressbook/gui/widgets/ea-addressbook.c +++ b/addressbook/gui/widgets/ea-addressbook.c @@ -24,8 +24,8 @@ #include <config.h> #endif -#include <text/e-text.h> -#include "a11y/ea-factory.h" +#include "e-util/e-util.h" + #include "ea-addressbook.h" #include "ea-minicard.h" #include "ea-minicard-view.h" diff --git a/addressbook/gui/widgets/eab-config.h b/addressbook/gui/widgets/eab-config.h index 3907889415..83c08b4172 100644 --- a/addressbook/gui/widgets/eab-config.h +++ b/addressbook/gui/widgets/eab-config.h @@ -26,7 +26,7 @@ #include <libedataserver/libedataserver.h> -#include "e-util/e-config.h" +#include <e-util/e-util.h> #define EAB_TYPE_CONFIG (eab_config_get_type ()) #define EAB_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EAB_TYPE_CONFIG, EABConfig)) diff --git a/addressbook/gui/widgets/eab-contact-display.c b/addressbook/gui/widgets/eab-contact-display.c index e00e089d38..549278b994 100644 --- a/addressbook/gui/widgets/eab-contact-display.c +++ b/addressbook/gui/widgets/eab-contact-display.c @@ -25,25 +25,17 @@ #endif #include "eab-contact-display.h" -#include "eab-contact-formatter.h" -#include "eab-gui-util.h" -#include "e-util/e-util.h" -#include "e-util/e-util-private.h" -#include "e-util/e-html-utils.h" -#include "e-util/e-icon-factory.h" -#include "e-util/e-plugin-ui.h" -#include "e-util/e-file-request.h" -#include "e-util/e-stock-request.h" +#include <string.h> +#include <glib/gi18n.h> #include <webkit/webkit.h> -#ifdef WITH_CONTACT_MAPS -#include "widgets/misc/e-contact-map.h" -#endif +#include "e-util/e-util.h" -#include <string.h> -#include <glib/gi18n.h> +#include "eab-contact-formatter.h" + +#include "eab-gui-util.h" #define EAB_CONTACT_DISPLAY_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ diff --git a/addressbook/gui/widgets/eab-contact-display.h b/addressbook/gui/widgets/eab-contact-display.h index 79243dedae..484e312b6b 100644 --- a/addressbook/gui/widgets/eab-contact-display.h +++ b/addressbook/gui/widgets/eab-contact-display.h @@ -25,7 +25,7 @@ #include <libebook/libebook.h> -#include <misc/e-web-view.h> +#include <e-util/e-util.h> /* Standard GObject macros */ #define EAB_TYPE_CONTACT_DISPLAY \ diff --git a/addressbook/gui/widgets/eab-contact-formatter.c b/addressbook/gui/widgets/eab-contact-formatter.c index a3893188e3..3684e4b81c 100644 --- a/addressbook/gui/widgets/eab-contact-formatter.c +++ b/addressbook/gui/widgets/eab-contact-formatter.c @@ -20,20 +20,13 @@ #include "eab-contact-formatter.h" -#include "eab-gui-util.h" -#include "e-util/e-util.h" -#include "e-util/e-util-private.h" -#include "e-util/e-html-utils.h" -#include "e-util/e-icon-factory.h" -#include "e-util/e-plugin-ui.h" - -#ifdef WITH_CONTACT_MAPS -#include "widgets/misc/e-contact-map.h" -#endif - #include <string.h> #include <glib/gi18n.h> +#include "e-util/e-util.h" + +#include "eab-gui-util.h" + G_DEFINE_TYPE ( EABContactFormatter, eab_contact_formatter, diff --git a/addressbook/gui/widgets/eab-gui-util.c b/addressbook/gui/widgets/eab-gui-util.c index 736f64d422..1fc8644833 100644 --- a/addressbook/gui/widgets/eab-gui-util.c +++ b/addressbook/gui/widgets/eab-gui-util.c @@ -35,16 +35,10 @@ #include <gtk/gtk.h> #include <glib/gi18n.h> -#include <libedataserverui/libedataserverui.h> +#include "shell/e-shell.h" -#include <e-util/e-util.h> #include "eab-gui-util.h" #include "util/eab-book-util.h" -#include "libevolution-utils/e-alert-dialog.h" -#include "e-util/e-html-utils.h" -#include "shell/e-shell.h" -#include "misc/e-image-chooser.h" -#include <e-util/e-icon-factory.h> #include "eab-contact-merging.h" /* we link to camel for decoding quoted printable email addresses */ diff --git a/addressbook/gui/widgets/eab-gui-util.h b/addressbook/gui/widgets/eab-gui-util.h index 7cdd93e84d..6d3c7bf5cb 100644 --- a/addressbook/gui/widgets/eab-gui-util.h +++ b/addressbook/gui/widgets/eab-gui-util.h @@ -27,7 +27,7 @@ #include <gtk/gtk.h> #include <libebook/libebook.h> -#include "libevolution-utils/e-alert-sink.h" +#include <e-util/e-util.h> G_BEGIN_DECLS diff --git a/addressbook/gui/widgets/gal-view-factory-minicard.h b/addressbook/gui/widgets/gal-view-factory-minicard.h index e96c4e455c..a01f5e9075 100644 --- a/addressbook/gui/widgets/gal-view-factory-minicard.h +++ b/addressbook/gui/widgets/gal-view-factory-minicard.h @@ -26,7 +26,7 @@ #ifndef GAL_VIEW_FACTORY_MINICARD_H #define GAL_VIEW_FACTORY_MINICARD_H -#include <widgets/menus/gal-view-factory.h> +#include <e-util/e-util.h> /* Standard GObject macros */ #define GAL_TYPE_VIEW_FACTORY_MINICARD \ diff --git a/addressbook/gui/widgets/gal-view-minicard.c b/addressbook/gui/widgets/gal-view-minicard.c index a623c57c90..dffe8069be 100644 --- a/addressbook/gui/widgets/gal-view-minicard.c +++ b/addressbook/gui/widgets/gal-view-minicard.c @@ -28,7 +28,6 @@ #endif #include <libxml/parser.h> -#include <libevolution-utils/e-xml-utils.h> #include "gal-view-minicard.h" diff --git a/addressbook/gui/widgets/gal-view-minicard.h b/addressbook/gui/widgets/gal-view-minicard.h index b360301268..04e67113de 100644 --- a/addressbook/gui/widgets/gal-view-minicard.h +++ b/addressbook/gui/widgets/gal-view-minicard.h @@ -25,7 +25,7 @@ #ifndef GAL_VIEW_MINICARD_H #define GAL_VIEW_MINICARD_H -#include <widgets/menus/gal-view.h> +#include <e-util/e-util.h> #include <e-minicard-view-widget.h> #include "e-addressbook-view.h" diff --git a/addressbook/importers/Makefile.am b/addressbook/importers/Makefile.am index 515370d38c..cd509f9eb6 100644 --- a/addressbook/importers/Makefile.am +++ b/addressbook/importers/Makefile.am @@ -7,10 +7,11 @@ libevolution_addressbook_importers_la_CPPFLAGS = \ -DG_LOG_DOMAIN=\"Evolution-Importer\" \ -I$(top_srcdir) \ -I$(top_srcdir)/addressbook \ - -I$(top_srcdir)/widgets \ -I$(top_builddir)/addressbook \ $(EVOLUTION_DATA_SERVER_CFLAGS) \ - $(GNOME_PLATFORM_CFLAGS) + $(GNOME_PLATFORM_CFLAGS) \ + $(CHAMPLAIN_CFLAGS) \ + $(GTKHTML_CFLAGS) libevolution_addressbook_importers_la_SOURCES = \ evolution-ldif-importer.c \ @@ -24,9 +25,10 @@ libevolution_addressbook_importers_la_LIBADD = \ $(top_builddir)/e-util/libeutil.la \ $(top_builddir)/shell/libeshell.la \ $(top_builddir)/addressbook/util/libeabutil.la \ - $(top_builddir)/widgets/misc/libemiscwidgets.la \ $(EVOLUTION_DATA_SERVER_LIBS) \ $(GNOME_PLATFORM_LIBS) \ + $(CHAMPLAIN_LIBS) \ + $(GTKHTML_LIBS) \ $(IMPORTERS_LIBS) -include $(top_srcdir)/git.mk diff --git a/addressbook/importers/evolution-csv-importer.c b/addressbook/importers/evolution-csv-importer.c index 7594ab1cf3..b32f8e1b7b 100644 --- a/addressbook/importers/evolution-csv-importer.c +++ b/addressbook/importers/evolution-csv-importer.c @@ -35,10 +35,8 @@ #include <glib/gstdio.h> #include <libebook/libebook.h> -#include <libedataserverui/libedataserverui.h> #include <shell/e-shell.h> -#include <e-util/e-import.h> #include "evolution-addressbook-importers.h" diff --git a/addressbook/importers/evolution-ldif-importer.c b/addressbook/importers/evolution-ldif-importer.c index c95b2f4357..db2bfbf27d 100644 --- a/addressbook/importers/evolution-ldif-importer.c +++ b/addressbook/importers/evolution-ldif-importer.c @@ -42,10 +42,8 @@ #include <glib/gstdio.h> #include <libebook/libebook.h> -#include <libedataserverui/libedataserverui.h> #include <shell/e-shell.h> -#include <e-util/e-import.h> #include "evolution-addressbook-importers.h" diff --git a/addressbook/importers/evolution-vcard-importer.c b/addressbook/importers/evolution-vcard-importer.c index d430bd24eb..5129754501 100644 --- a/addressbook/importers/evolution-vcard-importer.c +++ b/addressbook/importers/evolution-vcard-importer.c @@ -36,14 +36,10 @@ #include <glib/gstdio.h> #include <libebook/libebook.h> -#include <libedataserverui/libedataserverui.h> #include <util/eab-book-util.h> #include <shell/e-shell.h> -#include <e-util/e-import.h> -#include <e-util/e-datetime-format.h> -#include <misc/e-web-view-preview.h> #include "evolution-addressbook-importers.h" diff --git a/addressbook/printing/Makefile.am b/addressbook/printing/Makefile.am index edf3cc9795..fa92d19676 100644 --- a/addressbook/printing/Makefile.am +++ b/addressbook/printing/Makefile.am @@ -12,7 +12,9 @@ libecontactprint_la_CPPFLAGS = \ -DEVOLUTION_UIDIR=\""$(uidir)"\" \ -DEVOLUTION_ECPSDIR=\""$(ecpsdir)"\" \ $(EVOLUTION_DATA_SERVER_CFLAGS) \ - $(GNOME_PLATFORM_CFLAGS) + $(GNOME_PLATFORM_CFLAGS) \ + $(CHAMPLAIN_CFLAGS) \ + $(GTKHTML_CFLAGS) noinst_LTLIBRARIES = libecontactprint.la @@ -22,10 +24,11 @@ libecontactprint_la_SOURCES = \ e-contact-print.h libecontactprint_la_LIBADD = \ - $(top_builddir)/widgets/misc/libemiscwidgets.la \ $(top_builddir)/e-util/libeutil.la \ $(EVOLUTION_DATA_SERVER_LIBS) \ - $(GNOME_PLATFORM_LIBS) + $(GNOME_PLATFORM_LIBS) \ + $(CHAMPLAIN_LIBS) \ + $(GTKHTML_LIBS) noinst_PROGRAMS = contact-print-test diff --git a/addressbook/printing/e-contact-print.c b/addressbook/printing/e-contact-print.c index 290863c817..248fa97515 100644 --- a/addressbook/printing/e-contact-print.c +++ b/addressbook/printing/e-contact-print.c @@ -33,7 +33,6 @@ #include <libxml/xmlmemory.h> #include <glib/gi18n.h> -#include "e-util/e-print.h" #include "e-util/e-util.h" #include "e-util/e-util-private.h" diff --git a/addressbook/util/Makefile.am b/addressbook/util/Makefile.am index c27b18c67c..10f3bb0b97 100644 --- a/addressbook/util/Makefile.am +++ b/addressbook/util/Makefile.am @@ -10,7 +10,6 @@ libeabutil_la_CPPFLAGS = \ -I$(top_srcdir) \ -I$(top_builddir)/shell \ -I$(top_srcdir)/shell \ - -I$(top_srcdir)/widgets \ $(EVOLUTION_DATA_SERVER_CFLAGS) \ $(GNOME_PLATFORM_CFLAGS) @@ -21,7 +20,6 @@ libeabutil_la_SOURCES = \ libeabutil_la_LDFLAGS = -avoid-version $(NO_UNDEFINED) libeabutil_la_LIBADD = \ - $(top_builddir)/widgets/misc/libemiscwidgets.la \ $(top_builddir)/e-util/libeutil.la \ $(top_builddir)/shell/libeshell.la \ $(EVOLUTION_DATA_SERVER_LIBS) \ diff --git a/calendar/alarm-notify/Makefile.am b/calendar/alarm-notify/Makefile.am index 775a3693cb..2ff5b3dd46 100644 --- a/calendar/alarm-notify/Makefile.am +++ b/calendar/alarm-notify/Makefile.am @@ -12,7 +12,6 @@ evolution_alarm_notify_CPPFLAGS = \ $(AM_CPPFLAGS) \ -DG_LOG_DOMAIN=\"evolution-alarm-notify\" \ -I$(top_srcdir) \ - -I$(top_srcdir)/widgets \ -I$(top_srcdir)/calendar \ -DEVOLUTION_UIDIR=\""$(uidir)"\" \ -DEVOLUTION_ICONDIR=\""$(icondir)"\" \ @@ -21,7 +20,9 @@ evolution_alarm_notify_CPPFLAGS = \ $(EVOLUTION_DATA_SERVER_CFLAGS) \ $(GNOME_PLATFORM_CFLAGS) \ $(LIBNOTIFY_CFLAGS) \ - $(CANBERRA_CFLAGS) + $(CANBERRA_CFLAGS) \ + $(CHAMPLAIN_CFLAGS) \ + $(GTKHTML_CFLAGS) ui_DATA = \ alarm-notify.ui @@ -44,17 +45,17 @@ evolution_alarm_notify_SOURCES = \ evolution_alarm_notify_LDADD = \ $(top_builddir)/e-util/libeutil.la \ $(top_builddir)/composer/libcomposer.la \ - $(top_builddir)/widgets/misc/libemiscwidgets.la \ $(top_builddir)/calendar/gui/libevolution-calendar.la \ $(top_builddir)/calendar/importers/libevolution-calendar-importers.la \ $(top_builddir)/addressbook/gui/contact-editor/libecontacteditor.la \ $(top_builddir)/addressbook/gui/contact-list-editor/libecontactlisteditor.la \ $(top_builddir)/addressbook/util/libeabutil.la \ - $(top_builddir)/libevolution-utils/libevolution-utils.la \ $(EVOLUTION_DATA_SERVER_LIBS) \ $(GNOME_PLATFORM_LIBS) \ $(LIBNOTIFY_LIBS) \ $(CANBERRA_LIBS) \ + $(CHAMPLAIN_LIBS) \ + $(GTKHTML_LIBS) $(EVOLUTIONALARMNOTIFYICON) if OS_WIN32 diff --git a/calendar/alarm-notify/alarm-notify-dialog.c b/calendar/alarm-notify/alarm-notify-dialog.c index 3bb705a772..ac6ce49d93 100644 --- a/calendar/alarm-notify/alarm-notify-dialog.c +++ b/calendar/alarm-notify/alarm-notify-dialog.c @@ -30,14 +30,12 @@ #include <string.h> #include <glib/gi18n.h> +#include "e-util/e-util.h" + #include "alarm-notify-dialog.h" #include "config-data.h" #include "util.h" -#include "e-util/e-util.h" -#include "e-util/e-util-private.h" -#include "misc/e-buffer-tagger.h" - enum { ALARM_DISPLAY_COLUMN, ALARM_SUMMARY_COLUMN, diff --git a/calendar/alarm-notify/alarm-notify.c b/calendar/alarm-notify/alarm-notify.c index 54242f2049..ce7efee9ac 100644 --- a/calendar/alarm-notify/alarm-notify.c +++ b/calendar/alarm-notify/alarm-notify.c @@ -27,6 +27,8 @@ #include <string.h> #include <camel/camel.h> +#include "e-util/e-util.h" + #include "alarm.h" #include "alarm-notify.h" #include "alarm-queue.h" diff --git a/calendar/alarm-notify/alarm-notify.h b/calendar/alarm-notify/alarm-notify.h index 61097f310a..45de689a4e 100644 --- a/calendar/alarm-notify/alarm-notify.h +++ b/calendar/alarm-notify/alarm-notify.h @@ -28,7 +28,6 @@ #include <gtk/gtk.h> #include <libecal/libecal.h> -#include <libedataserverui/libedataserverui.h> /* Standard GObject macros */ #define TYPE_ALARM_NOTIFY \ diff --git a/calendar/gui/Makefile.am b/calendar/gui/Makefile.am index 75991807df..f1c0727ab1 100644 --- a/calendar/gui/Makefile.am +++ b/calendar/gui/Makefile.am @@ -58,8 +58,6 @@ libevolution_calendar_la_CPPFLAGS = \ -I$(top_srcdir)/shell \ -I$(top_srcdir) \ -I$(top_srcdir)/calendar \ - -I$(top_srcdir)/widgets \ - -I$(top_srcdir)/widgets/misc \ -DEVOLUTION_RULEDIR=\"$(ruledir)\" \ -DEVOLUTION_UIDIR=\""$(uidir)"\" \ -DEVOLUTION_ETSPECDIR=\""$(etspecdir)"\" \ @@ -70,6 +68,7 @@ libevolution_calendar_la_CPPFLAGS = \ -DPREFIX=\""$(prefix)"\" \ $(EVOLUTION_DATA_SERVER_CFLAGS) \ $(GNOME_PLATFORM_CFLAGS) \ + $(CHAMPLAIN_CFLAGS) \ $(GTKHTML_CFLAGS) \ $(LIBSOUP_CFLAGS) @@ -205,18 +204,13 @@ libevolution_calendar_la_LIBADD = \ $(top_builddir)/composer/libcomposer.la \ $(top_builddir)/addressbook/gui/contact-editor/libecontacteditor.la \ $(top_builddir)/addressbook/gui/contact-list-editor/libecontactlisteditor.la \ - $(top_builddir)/widgets/menus/libmenus.la \ $(top_builddir)/shell/libeshell.la \ $(top_builddir)/calendar/gui/dialogs/libcal-dialogs.la \ $(top_builddir)/calendar/importers/libevolution-calendar-importers.la \ - $(top_builddir)/libemail-utils/libemail-utils.la \ - $(top_builddir)/widgets/e-timezone-dialog/libetimezonedialog.la \ - $(top_builddir)/widgets/misc/libemiscwidgets.la \ - $(top_builddir)/widgets/table/libetable.la \ - $(top_builddir)/filter/libfilter.la \ $(top_builddir)/e-util/libeutil.la \ $(EVOLUTION_DATA_SERVER_LIBS) \ $(GNOME_PLATFORM_LIBS) \ + $(CHAMPLAIN_LIBS) \ $(GTKHTML_LIBS) \ $(LIBSOUP_LIBS) diff --git a/calendar/gui/calendar-config.c b/calendar/gui/calendar-config.c index 1bc62730ab..15b6024931 100644 --- a/calendar/gui/calendar-config.c +++ b/calendar/gui/calendar-config.c @@ -32,8 +32,7 @@ #include <time.h> #include <string.h> #include <gio/gio.h> -#include <e-util/e-util.h> -#include <widgets/e-timezone-dialog/e-timezone-dialog.h> + #include <shell/e-shell.h> #include "calendar-config-keys.h" diff --git a/calendar/gui/calendar-config.h b/calendar/gui/calendar-config.h index c005ec399e..cd492c1480 100644 --- a/calendar/gui/calendar-config.h +++ b/calendar/gui/calendar-config.h @@ -32,7 +32,7 @@ #include <gdk/gdk.h> #include <libecal/libecal.h> -#include <e-util/e-util-enums.h> +#include <e-util/e-util.h> /* These are used to get/set the working days in the week. The bit-flags are * combined together. The bits must be from 0 (Sun) to 6 (Sat) to match the diff --git a/calendar/gui/calendar-view-factory.h b/calendar/gui/calendar-view-factory.h index bad3dcfd1f..833c4bd281 100644 --- a/calendar/gui/calendar-view-factory.h +++ b/calendar/gui/calendar-view-factory.h @@ -26,7 +26,6 @@ #ifndef CALENDAR_VIEW_FACTORY_H #define CALENDAR_VIEW_FACTORY_H -#include <menus/gal-view-factory.h> #include "gnome-cal.h" G_BEGIN_DECLS diff --git a/calendar/gui/calendar-view.h b/calendar/gui/calendar-view.h index f3a2a3103b..d76f3f5449 100644 --- a/calendar/gui/calendar-view.h +++ b/calendar/gui/calendar-view.h @@ -26,7 +26,6 @@ #ifndef CALENDAR_VIEW_H #define CALENDAR_VIEW_H -#include <menus/gal-view.h> #include "gnome-cal.h" G_BEGIN_DECLS diff --git a/calendar/gui/comp-util.c b/calendar/gui/comp-util.c index c0935ca4e5..c0e6dbb74c 100644 --- a/calendar/gui/comp-util.c +++ b/calendar/gui/comp-util.c @@ -28,12 +28,10 @@ #include <string.h> #include <time.h> -#include <libedataserverui/libedataserverui.h> #include "calendar-config.h" #include "comp-util.h" #include "dialogs/delete-comp.h" -#include "e-util/e-categories-config.h" #include "gnome-cal.h" #include "shell/e-shell-window.h" diff --git a/calendar/gui/comp-util.h b/calendar/gui/comp-util.h index ff7a1351d3..1c91a69d64 100644 --- a/calendar/gui/comp-util.h +++ b/calendar/gui/comp-util.h @@ -28,7 +28,7 @@ #include <gtk/gtk.h> #include <libecal/libecal.h> -#include <e-util/e-util-enums.h> +#include <e-util/e-util.h> struct _EShell; diff --git a/calendar/gui/dialogs/Makefile.am b/calendar/gui/dialogs/Makefile.am index 02af20b87b..fa6ba86e6b 100644 --- a/calendar/gui/dialogs/Makefile.am +++ b/calendar/gui/dialogs/Makefile.am @@ -4,18 +4,18 @@ libcal_dialogs_la_CPPFLAGS = \ $(AM_CPPFLAGS) \ -DG_LOG_DOMAIN=\"calendar-gui\" \ -I$(top_srcdir) \ - -I$(top_srcdir)/widgets \ -I$(top_builddir) \ -I$(top_srcdir)/calendar \ -I$(top_builddir)/shell \ -I$(top_srcdir)/shell \ - -I$(top_srcdir)/widgets/misc \ -DEVOLUTION_UIDIR=\""$(uidir)"\" \ -DEVOLUTION_ICONDIR=\""$(icondir)"\" \ -DEVOLUTION_IMAGESDIR=\""$(imagesdir)"\" \ -DPREFIX=\""$(prefix)"\" \ $(EVOLUTION_DATA_SERVER_CFLAGS) \ - $(GNOME_PLATFORM_CFLAGS) + $(GNOME_PLATFORM_CFLAGS) \ + $(CHAMPLAIN_CFLAGS) \ + $(GTKHTML_CFLAGS) ecalendarincludedir = $(privincludedir)/calendar/gui/dialogs @@ -50,10 +50,11 @@ ecalendarinclude_HEADERS = \ libcal_dialogs_la_LIBADD = \ $(top_builddir)/addressbook/util/libeabutil.la \ $(EVOLUTION_DATA_SERVER_LIBS) \ - $(GNOME_PLATFORM_LIBS) + $(GNOME_PLATFORM_LIBS) \ + $(CHAMPLAIN_LIBS) \ + $(GTKHTML_LIBS) libcal_dialogs_la_SOURCES = \ - $(IDL_GENERATED) \ alarm-dialog.c \ alarm-dialog.h \ alarm-list-dialog.c \ diff --git a/calendar/gui/dialogs/alarm-dialog.c b/calendar/gui/dialogs/alarm-dialog.c index dda1d8548b..d88fd12fb6 100644 --- a/calendar/gui/dialogs/alarm-dialog.c +++ b/calendar/gui/dialogs/alarm-dialog.c @@ -32,12 +32,11 @@ #include <gtk/gtk.h> #include <glib/gi18n.h> #include <libebook/libebook.h> -#include <libedataserverui/libedataserverui.h> -#include "e-util/e-util.h" -#include "e-util/e-dialog-widgets.h" -#include "e-util/e-util-private.h" #include <libical/icalattach.h> + +#include "e-util/e-util.h" + #include "../calendar-config.h" #include "comp-editor-util.h" #include "alarm-dialog.h" diff --git a/calendar/gui/dialogs/cancel-comp.c b/calendar/gui/dialogs/cancel-comp.c index 5dbdb0ef8e..29038f4483 100644 --- a/calendar/gui/dialogs/cancel-comp.c +++ b/calendar/gui/dialogs/cancel-comp.c @@ -26,10 +26,12 @@ #include <config.h> #endif +#include "cancel-comp.h" + #include <gtk/gtk.h> #include <glib/gi18n.h> -#include "libevolution-utils/e-alert-dialog.h" -#include "cancel-comp.h" + +#include "e-util/e-util.h" /* is_past_event: * diff --git a/calendar/gui/dialogs/cancel-comp.h b/calendar/gui/dialogs/cancel-comp.h index bfc1c6cbc4..5e6ea88076 100644 --- a/calendar/gui/dialogs/cancel-comp.h +++ b/calendar/gui/dialogs/cancel-comp.h @@ -26,6 +26,7 @@ #ifndef CANCEL_COMP_H #define CANCEL_COMP_H +#include <gtk/gtk.h> #include <libecal/libecal.h> gboolean cancel_component_dialog (GtkWindow *parent, ECalClient *cal_client, ECalComponent *comp, gboolean deleting); diff --git a/calendar/gui/dialogs/comp-editor-util.c b/calendar/gui/dialogs/comp-editor-util.c index 5938f52e14..52651190ac 100644 --- a/calendar/gui/dialogs/comp-editor-util.c +++ b/calendar/gui/dialogs/comp-editor-util.c @@ -31,9 +31,9 @@ #include <libical/ical.h> #include <glib/gi18n.h> -#include "widgets/misc/e-dateedit.h" +#include "shell/e-shell.h" + #include "../itip-utils.h" -#include <shell/e-shell.h> #include "comp-editor-util.h" /** diff --git a/calendar/gui/dialogs/comp-editor-util.h b/calendar/gui/dialogs/comp-editor-util.h index a4ecc468a7..8c80683696 100644 --- a/calendar/gui/dialogs/comp-editor-util.h +++ b/calendar/gui/dialogs/comp-editor-util.h @@ -28,7 +28,6 @@ #include <gtk/gtk.h> #include "comp-editor.h" #include "../e-meeting-attendee.h" -#include <misc/e-dateedit.h> void comp_editor_dates (CompEditorPageDates *date, ECalComponent *comp); void comp_editor_free_dates (CompEditorPageDates *dates); diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c index 4eaf1bce75..5fa87e861a 100644 --- a/calendar/gui/dialogs/comp-editor.c +++ b/calendar/gui/dialogs/comp-editor.c @@ -38,10 +38,6 @@ #include <gdk/gdkkeysyms.h> #include <libebackend/libebackend.h> -#include <e-util/e-util.h> -#include <libevolution-utils/e-alert-sink.h> -#include <e-util/e-dialog-utils.h> -#include <e-util/e-util-private.h> #include <shell/e-shell.h> #include "../print.h" @@ -55,11 +51,6 @@ #include "comp-editor.h" #include "comp-editor-util.h" #include "../calendar-config-keys.h" -#include "widgets/misc/e-attachment-view.h" -#include "widgets/misc/e-attachment-paned.h" - -#include "libevolution-utils/e-alert-dialog.h" -#include "e-util/e-ui-manager.h" #define COMP_EDITOR_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ diff --git a/calendar/gui/dialogs/comp-editor.h b/calendar/gui/dialogs/comp-editor.h index 14fbc0ff5b..72598acfe0 100644 --- a/calendar/gui/dialogs/comp-editor.h +++ b/calendar/gui/dialogs/comp-editor.h @@ -28,10 +28,10 @@ #include <gtk/gtk.h> #include <libecal/libecal.h> +#include <shell/e-shell.h> + #include "../itip-utils.h" #include "comp-editor-page.h" -#include <shell/e-shell.h> -#include <misc/e-focus-tracker.h> /* Standard GObject macros */ #define TYPE_COMP_EDITOR \ diff --git a/calendar/gui/dialogs/copy-source-dialog.c b/calendar/gui/dialogs/copy-source-dialog.c index 5a7889e138..f8b668b933 100644 --- a/calendar/gui/dialogs/copy-source-dialog.c +++ b/calendar/gui/dialogs/copy-source-dialog.c @@ -27,7 +27,8 @@ #endif #include <glib/gi18n.h> -#include <libedataserverui/libedataserverui.h> + +#include "e-util/e-util.h" #include "copy-source-dialog.h" #include "select-source-dialog.h" diff --git a/calendar/gui/dialogs/delete-comp.c b/calendar/gui/dialogs/delete-comp.c index 93e2df0d91..0ec054cd39 100644 --- a/calendar/gui/dialogs/delete-comp.c +++ b/calendar/gui/dialogs/delete-comp.c @@ -26,10 +26,12 @@ #include <config.h> #endif -#include <glib/gi18n.h> -#include "libevolution-utils/e-alert-dialog.h" #include "delete-comp.h" +#include <glib/gi18n.h> + +#include "e-util/e-util.h" + /** * delete_component_dialog: * @comp: A calendar component if a single component is to be deleted, or NULL diff --git a/calendar/gui/dialogs/e-delegate-dialog.c b/calendar/gui/dialogs/e-delegate-dialog.c index 9ae253dc00..9c5e17f59e 100644 --- a/calendar/gui/dialogs/e-delegate-dialog.c +++ b/calendar/gui/dialogs/e-delegate-dialog.c @@ -29,7 +29,6 @@ #include <gtk/gtk.h> #include <libical/ical.h> #include <libebook/libebook.h> -#include <libedataserverui/libedataserverui.h> #include "e-util/e-util.h" #include "e-util/e-util-private.h" diff --git a/calendar/gui/dialogs/e-send-options-utils.h b/calendar/gui/dialogs/e-send-options-utils.h index f5c3f0a408..6d365b3424 100644 --- a/calendar/gui/dialogs/e-send-options-utils.h +++ b/calendar/gui/dialogs/e-send-options-utils.h @@ -27,7 +27,7 @@ #include <libecal/libecal.h> -#include "misc/e-send-options.h" +#include <e-util/e-util.h> void e_send_options_utils_set_default_data (ESendOptionsDialog *sod, diff --git a/calendar/gui/dialogs/event-editor.c b/calendar/gui/dialogs/event-editor.c index 0681aa4ed7..2ea6297dcc 100644 --- a/calendar/gui/dialogs/event-editor.c +++ b/calendar/gui/dialogs/event-editor.c @@ -32,11 +32,6 @@ #include <string.h> #include <glib/gi18n.h> -#include <misc/e-dateedit.h> -#include <e-util/e-plugin-ui.h> -#include <e-util/e-util-private.h> -#include <e-util/e-ui-manager.h> - #include "event-page.h" #include "recurrence-page.h" #include "schedule-page.h" diff --git a/calendar/gui/dialogs/event-page.c b/calendar/gui/dialogs/event-page.c index 12931cee09..793e98e49e 100644 --- a/calendar/gui/dialogs/event-page.c +++ b/calendar/gui/dialogs/event-page.c @@ -35,19 +35,6 @@ #include <glib/gi18n.h> #include <gdk/gdkkeysyms.h> -#include <libedataserverui/libedataserverui.h> - -#include <e-util/e-util.h> -#include <e-util/e-categories-config.h> -#include <e-util/e-dialog-utils.h> -#include <e-util/e-dialog-widgets.h> -#include <e-util/e-util-private.h> - -#include <misc/e-dateedit.h> -#include <misc/e-send-options.h> -#include <misc/e-spell-entry.h> -#include <misc/e-buffer-tagger.h> - #include "../e-alarm-list.h" #include "../e-meeting-attendee.h" #include "../e-meeting-list-view.h" diff --git a/calendar/gui/dialogs/memo-editor.c b/calendar/gui/dialogs/memo-editor.c index ae0d351618..839bce7bed 100644 --- a/calendar/gui/dialogs/memo-editor.c +++ b/calendar/gui/dialogs/memo-editor.c @@ -31,9 +31,6 @@ #include <string.h> #include <glib/gi18n.h> -#include <e-util/e-plugin-ui.h> -#include <e-util/e-util-private.h> - #include "memo-page.h" #include "cancel-comp.h" #include "memo-editor.h" diff --git a/calendar/gui/dialogs/memo-page.c b/calendar/gui/dialogs/memo-page.c index ec99587f4e..79b659a898 100644 --- a/calendar/gui/dialogs/memo-page.c +++ b/calendar/gui/dialogs/memo-page.c @@ -34,17 +34,6 @@ #include <gtk/gtk.h> #include <glib/gi18n.h> -#include <libedataserverui/libedataserverui.h> - -#include <e-util/e-util.h> -#include <e-util/e-categories-config.h> -#include <e-util/e-dialog-utils.h> -#include <e-util/e-util-private.h> - -#include <misc/e-dateedit.h> -#include <misc/e-spell-entry.h> -#include <misc/e-buffer-tagger.h> - #include "../calendar-config.h" #include "comp-editor.h" #include "comp-editor-util.h" diff --git a/calendar/gui/dialogs/recurrence-page.c b/calendar/gui/dialogs/recurrence-page.c index 77862c6584..d5a93ea9db 100644 --- a/calendar/gui/dialogs/recurrence-page.c +++ b/calendar/gui/dialogs/recurrence-page.c @@ -33,17 +33,12 @@ #include <gtk/gtk.h> #include <glib/gi18n.h> -#include <misc/e-dateedit.h> #include "../tag-calendar.h" #include "../weekday-picker.h" #include "comp-editor-util.h" #include "../e-date-time-list.h" #include "recurrence-page.h" -#include "e-util/e-util.h" -#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)) diff --git a/calendar/gui/dialogs/save-comp.c b/calendar/gui/dialogs/save-comp.c index 2fd53bd5db..3ae26252b7 100644 --- a/calendar/gui/dialogs/save-comp.c +++ b/calendar/gui/dialogs/save-comp.c @@ -25,7 +25,6 @@ #include <config.h> #endif -#include "libevolution-utils/e-alert-dialog.h" #include "save-comp.h" #include "comp-editor.h" diff --git a/calendar/gui/dialogs/schedule-page.c b/calendar/gui/dialogs/schedule-page.c index 516a973751..bd3e05e171 100644 --- a/calendar/gui/dialogs/schedule-page.c +++ b/calendar/gui/dialogs/schedule-page.c @@ -31,8 +31,7 @@ #include <gtk/gtk.h> #include <glib/gi18n.h> -#include <e-util/e-util-private.h> -#include <misc/e-dateedit.h> + #include "../e-meeting-time-sel.h" #include "../itip-utils.h" #include "comp-editor-util.h" diff --git a/calendar/gui/dialogs/schedule-page.h b/calendar/gui/dialogs/schedule-page.h index 1c554364fa..9d38de4a23 100644 --- a/calendar/gui/dialogs/schedule-page.h +++ b/calendar/gui/dialogs/schedule-page.h @@ -28,7 +28,6 @@ #include "../e-meeting-store.h" #include "comp-editor.h" #include "comp-editor-page.h" -#include <libedataserverui/libedataserverui.h> /* Standard GObject macros */ #define TYPE_SCHEDULE_PAGE \ diff --git a/calendar/gui/dialogs/select-source-dialog.c b/calendar/gui/dialogs/select-source-dialog.c index 9f80038e8b..5bdf4a7c5e 100644 --- a/calendar/gui/dialogs/select-source-dialog.c +++ b/calendar/gui/dialogs/select-source-dialog.c @@ -26,7 +26,8 @@ #endif #include <glib/gi18n.h> -#include <libedataserverui/libedataserverui.h> + +#include "e-util/e-util.h" #include "select-source-dialog.h" diff --git a/calendar/gui/dialogs/send-comp.c b/calendar/gui/dialogs/send-comp.c index 73938be875..b69e6eaade 100644 --- a/calendar/gui/dialogs/send-comp.c +++ b/calendar/gui/dialogs/send-comp.c @@ -26,10 +26,12 @@ #include <config.h> #endif -#include <glib/gi18n-lib.h> -#include "libevolution-utils/e-alert-dialog.h" #include "send-comp.h" +#include <glib/gi18n-lib.h> + +#include "e-util/e-util.h" + static gboolean component_has_new_attendees (ECalComponent *comp) { diff --git a/calendar/gui/dialogs/task-details-page.c b/calendar/gui/dialogs/task-details-page.c index 2ada645842..e40db5ba86 100644 --- a/calendar/gui/dialogs/task-details-page.c +++ b/calendar/gui/dialogs/task-details-page.c @@ -31,16 +31,11 @@ #include <gtk/gtk.h> #include <glib/gi18n.h> -#include <misc/e-dateedit.h> -#include <misc/e-url-entry.h> + #include "../e-timezone-entry.h" #include "comp-editor-util.h" #include "task-details-page.h" -#include "e-util/e-util.h" -#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)) diff --git a/calendar/gui/dialogs/task-editor.c b/calendar/gui/dialogs/task-editor.c index 0c81d3ea47..07ad568f9d 100644 --- a/calendar/gui/dialogs/task-editor.c +++ b/calendar/gui/dialogs/task-editor.c @@ -32,9 +32,6 @@ #include <string.h> #include <glib/gi18n.h> -#include "e-util/e-plugin-ui.h" -#include "e-util/e-util-private.h" - #include "task-page.h" #include "task-details-page.h" #include "cancel-comp.h" diff --git a/calendar/gui/dialogs/task-page.c b/calendar/gui/dialogs/task-page.c index ebf279cb22..d8d64f32d6 100644 --- a/calendar/gui/dialogs/task-page.c +++ b/calendar/gui/dialogs/task-page.c @@ -34,17 +34,6 @@ #include <glib/gi18n.h> #include <gdk/gdkkeysyms.h> -#include <libedataserverui/libedataserverui.h> - -#include <misc/e-dateedit.h> -#include <misc/e-spell-entry.h> -#include <misc/e-buffer-tagger.h> - -#include <e-util/e-categories-config.h> -#include <e-util/e-dialog-utils.h> -#include <e-util/e-util-private.h> -#include <e-util/e-util.h> - #include "../e-meeting-attendee.h" #include "../e-meeting-list-view.h" #include "../e-meeting-store.h" diff --git a/calendar/gui/e-cal-component-preview.c b/calendar/gui/e-cal-component-preview.c index fe9870e1d8..0647f9bcab 100644 --- a/calendar/gui/e-cal-component-preview.c +++ b/calendar/gui/e-cal-component-preview.c @@ -33,9 +33,6 @@ #include <glib/gi18n.h> #include <camel/camel.h> -#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)) diff --git a/calendar/gui/e-cal-component-preview.h b/calendar/gui/e-cal-component-preview.h index 5048e3ab07..54909139ec 100644 --- a/calendar/gui/e-cal-component-preview.h +++ b/calendar/gui/e-cal-component-preview.h @@ -26,7 +26,8 @@ #include <gtk/gtk.h> #include <libecal/libecal.h> -#include <misc/e-web-view.h> + +#include <e-util/e-util.h> /* Standard GObject macros */ #define E_TYPE_CAL_COMPONENT_PREVIEW \ diff --git a/calendar/gui/e-cal-config.h b/calendar/gui/e-cal-config.h index 5cadd428a1..e6db09ad6e 100644 --- a/calendar/gui/e-cal-config.h +++ b/calendar/gui/e-cal-config.h @@ -25,8 +25,7 @@ #define E_CAL_CONFIG_H #include <libecal/libecal.h> - -#include "e-util/e-config.h" +#include <e-util/e-util.h> /* Standard GObject macros */ #define E_TYPE_CAL_CONFIG \ diff --git a/calendar/gui/e-cal-event.h b/calendar/gui/e-cal-event.h index 447f1fd418..f44878d01f 100644 --- a/calendar/gui/e-cal-event.h +++ b/calendar/gui/e-cal-event.h @@ -24,8 +24,7 @@ #ifndef __E_CAL_EVENT_H__ #define __E_CAL_EVENT_H__ -#include "e-util/e-event.h" -#include "shell/e-shell-backend.h" +#include <shell/e-shell-backend.h> G_BEGIN_DECLS diff --git a/calendar/gui/e-cal-list-view.c b/calendar/gui/e-cal-list-view.c index 55280ce79c..94722c0319 100644 --- a/calendar/gui/e-cal-list-view.c +++ b/calendar/gui/e-cal-list-view.c @@ -34,16 +34,6 @@ #include <glib/gi18n.h> #include <glib/gstdio.h> #include <gdk/gdkkeysyms.h> -#include <table/e-table-memory-store.h> -#include <table/e-cell-checkbox.h> -#include <table/e-cell-toggle.h> -#include <table/e-cell-text.h> -#include <table/e-cell-combo.h> -#include <table/e-cell-date.h> -#include <table/e-cell-date-edit.h> -#include <e-util/e-categories-config.h> -#include <e-util/e-dialog-utils.h> -#include <e-util/e-util-private.h> #include "e-cal-model-calendar.h" #include "e-cell-date-edit-text.h" diff --git a/calendar/gui/e-cal-list-view.h b/calendar/gui/e-cal-list-view.h index ed4636f753..e5eff477a2 100644 --- a/calendar/gui/e-cal-list-view.h +++ b/calendar/gui/e-cal-list-view.h @@ -27,8 +27,7 @@ #include <time.h> #include <gtk/gtk.h> -#include <table/e-table.h> -#include <table/e-cell-date-edit.h> +#include <e-util/e-util.h> #include "e-calendar-view.h" #include "gnome-cal.h" diff --git a/calendar/gui/e-cal-model.h b/calendar/gui/e-cal-model.h index 7f19e00c16..9164d9c06e 100644 --- a/calendar/gui/e-cal-model.h +++ b/calendar/gui/e-cal-model.h @@ -28,8 +28,8 @@ #include <libecal/libecal.h> -#include <e-util/e-util-enums.h> -#include <table/e-table-model.h> +#include <e-util/e-util.h> + #include "e-cell-date-edit-text.h" /* Standard GObject macros */ diff --git a/calendar/gui/e-calendar-selector.c b/calendar/gui/e-calendar-selector.c index 6c403e43a2..19eb4335b1 100644 --- a/calendar/gui/e-calendar-selector.c +++ b/calendar/gui/e-calendar-selector.c @@ -24,8 +24,6 @@ #include <libecal/libecal.h> -#include "e-util/e-selection.h" - #define E_CALENDAR_SELECTOR_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ ((obj), E_TYPE_CALENDAR_SELECTOR, ECalendarSelectorPrivate)) diff --git a/calendar/gui/e-calendar-selector.h b/calendar/gui/e-calendar-selector.h index 1e7128bbda..50832ead2b 100644 --- a/calendar/gui/e-calendar-selector.h +++ b/calendar/gui/e-calendar-selector.h @@ -21,7 +21,7 @@ #ifndef E_CALENDAR_SELECTOR_H #define E_CALENDAR_SELECTOR_H -#include <libedataserverui/libedataserverui.h> +#include <e-util/e-util.h> /* Standard GObject macros */ #define E_TYPE_CALENDAR_SELECTOR \ diff --git a/calendar/gui/e-calendar-view.c b/calendar/gui/e-calendar-view.c index 2801391952..d5ce9f362a 100644 --- a/calendar/gui/e-calendar-view.c +++ b/calendar/gui/e-calendar-view.c @@ -31,15 +31,7 @@ #include <glib/gstdio.h> #include <gdk/gdkkeysyms.h> #include <libebackend/libebackend.h> -#include <libedataserverui/libedataserverui.h> - -#include <e-util/e-util.h> -#include <libevolution-utils/e-alert-dialog.h> -#include <e-util/e-selection.h> -#include <e-util/e-datetime-format.h> -#include <e-util/e-dialog-utils.h> -#include <e-util/e-icon-factory.h> -#include <misc/e-selectable.h> + #include <shell/e-shell.h> #include "comp-util.h" diff --git a/calendar/gui/e-cell-date-edit-text.c b/calendar/gui/e-cell-date-edit-text.c index 82d94eff11..37e648ed76 100644 --- a/calendar/gui/e-cell-date-edit-text.c +++ b/calendar/gui/e-cell-date-edit-text.c @@ -32,9 +32,6 @@ #include <glib/gi18n.h> #include <libecal/libecal.h> -#include <e-util/e-util.h> -#include <e-util/e-datetime-format.h> - #include "e-cell-date-edit-text.h" #define E_CELL_DATE_EDIT_TEXT_GET_PRIVATE(obj) \ diff --git a/calendar/gui/e-cell-date-edit-text.h b/calendar/gui/e-cell-date-edit-text.h index aab7e27edf..b620143617 100644 --- a/calendar/gui/e-cell-date-edit-text.h +++ b/calendar/gui/e-cell-date-edit-text.h @@ -25,7 +25,7 @@ #define _E_CELL_DATE_EDIT_TEXT_H_ #include <libical/ical.h> -#include <table/e-cell-text.h> +#include <e-util/e-util.h> /* Standard GObject macros */ #define E_TYPE_CELL_DATE_EDIT_TEXT \ diff --git a/calendar/gui/e-day-view-layout.c b/calendar/gui/e-day-view-layout.c index 573a3b3ccd..c4bf94a512 100644 --- a/calendar/gui/e-day-view-layout.c +++ b/calendar/gui/e-day-view-layout.c @@ -31,7 +31,6 @@ #endif #include "e-day-view-layout.h" -#include "e-util/e-bit-array.h" static void e_day_view_layout_long_event (EDayViewEvent *event, guint8 *grid, diff --git a/calendar/gui/e-day-view-main-item.c b/calendar/gui/e-day-view-main-item.c index 61e238eaa4..1492cdebd5 100644 --- a/calendar/gui/e-day-view-main-item.c +++ b/calendar/gui/e-day-view-main-item.c @@ -29,15 +29,13 @@ #include <config.h> #endif -#include <e-calendar-view.h> +#include "e-day-view-main-item.h" -#include "e-util/e-categories-config.h" -#include "e-util/e-util.h" +#include "comp-util.h" +#include "e-calendar-view.h" +#include "e-calendar-view.h" #include "e-day-view-layout.h" -#include "e-day-view-main-item.h" #include "ea-calendar.h" -#include "e-calendar-view.h" -#include "comp-util.h" #define E_DAY_VIEW_MAIN_ITEM_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ diff --git a/calendar/gui/e-day-view-time-item.c b/calendar/gui/e-day-view-time-item.c index f337aa06e1..c6d36d36df 100644 --- a/calendar/gui/e-day-view-time-item.c +++ b/calendar/gui/e-day-view-time-item.c @@ -31,7 +31,6 @@ #include "e-day-view-time-item.h" #include "calendar-config.h" -#include <widgets/e-timezone-dialog/e-timezone-dialog.h> /* The spacing between items in the time column. GRID_X_PAD is the space down * either side of the column, i.e. outside the main horizontal grid lines. diff --git a/calendar/gui/e-day-view-top-item.c b/calendar/gui/e-day-view-top-item.c index 8d961ea6a5..ed5d8b0266 100644 --- a/calendar/gui/e-day-view-top-item.c +++ b/calendar/gui/e-day-view-top-item.c @@ -29,7 +29,6 @@ #endif #include <glib/gi18n.h> -#include "e-util/e-categories-config.h" #include "e-calendar-view.h" #include "e-day-view-top-item.h" diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c index db4557cbff..30eed74413 100644 --- a/calendar/gui/e-day-view.c +++ b/calendar/gui/e-day-view.c @@ -27,19 +27,14 @@ #endif #include "e-day-view.h" -#include "ea-calendar.h" #include <math.h> #include <time.h> -#include <gdk/gdkkeysyms.h> -#include <text/e-text.h> -#include <misc/e-canvas-utils.h> -#include <e-util/e-unicode.h> -#include <libgnomecanvas/libgnomecanvas.h> + #include <glib/gi18n.h> -#include <e-util/e-categories-config.h> -#include <e-util/e-dialog-utils.h> -#include <e-util/e-selection.h> +#include <gdk/gdkkeysyms.h> + +#include "libgnomecanvas/libgnomecanvas.h" #include "dialogs/delete-comp.h" #include "dialogs/delete-error.h" @@ -47,17 +42,18 @@ #include "dialogs/cancel-comp.h" #include "dialogs/recur-comp.h" #include "dialogs/goto-dialog.h" -#include "print.h" + #include "calendar-config.h" #include "comp-util.h" -#include "itip-utils.h" #include "e-cal-model-calendar.h" -#include "e-day-view-time-item.h" -#include "e-day-view-top-item.h" #include "e-day-view-layout.h" #include "e-day-view-main-item.h" +#include "e-day-view-time-item.h" +#include "e-day-view-top-item.h" +#include "ea-calendar.h" +#include "itip-utils.h" #include "misc.h" -#include <e-util/e-icon-factory.h> +#include "print.h" /* The minimum amount of space wanted on each side of the date string. */ #define E_DAY_VIEW_DATE_X_PAD 4 diff --git a/calendar/gui/e-meeting-list-view.c b/calendar/gui/e-meeting-list-view.c index 59ffa099e0..50999c767b 100644 --- a/calendar/gui/e-meeting-list-view.c +++ b/calendar/gui/e-meeting-list-view.c @@ -30,7 +30,6 @@ #include <glib/gi18n.h> #include <libecal/libecal.h> #include <libebook/libebook.h> -#include <libedataserverui/libedataserverui.h> #include "calendar-config.h" #include "e-meeting-list-view.h" diff --git a/calendar/gui/e-meeting-list-view.h b/calendar/gui/e-meeting-list-view.h index d62cb05636..aff278c3bf 100644 --- a/calendar/gui/e-meeting-list-view.h +++ b/calendar/gui/e-meeting-list-view.h @@ -25,7 +25,6 @@ #define _E_MEETING_LIST_VIEW_H_ #include <gtk/gtk.h> -#include <libedataserverui/libedataserverui.h> #include "e-meeting-store.h" diff --git a/calendar/gui/e-meeting-store.c b/calendar/gui/e-meeting-store.c index b8e065e2dd..4e8e4e32d1 100644 --- a/calendar/gui/e-meeting-store.c +++ b/calendar/gui/e-meeting-store.c @@ -31,7 +31,6 @@ #include <libecal/libecal.h> #include <libebackend/libebackend.h> -#include <libedataserverui/libedataserverui.h> #include <shell/e-shell.h> #include <e-util/e-util-enumtypes.h> diff --git a/calendar/gui/e-meeting-store.h b/calendar/gui/e-meeting-store.h index f762cbc7a5..27c1f9ac78 100644 --- a/calendar/gui/e-meeting-store.h +++ b/calendar/gui/e-meeting-store.h @@ -26,7 +26,8 @@ #include <gtk/gtk.h> #include <libecal/libecal.h> -#include <e-util/e-util-enums.h> +#include <e-util/e-util.h> + #include "e-meeting-attendee.h" /* Standard GObject macros */ diff --git a/calendar/gui/e-meeting-time-sel-item.c b/calendar/gui/e-meeting-time-sel-item.c index a15f25a6ef..aaa86230cc 100644 --- a/calendar/gui/e-meeting-time-sel-item.c +++ b/calendar/gui/e-meeting-time-sel-item.c @@ -30,8 +30,6 @@ #include <time.h> #include <glib/gi18n.h> -#include "e-util/e-datetime-format.h" - #include "calendar-config.h" #include "e-meeting-time-sel-item.h" #include "e-meeting-time-sel.h" diff --git a/calendar/gui/e-meeting-time-sel.c b/calendar/gui/e-meeting-time-sel.c index f3f8b3a846..18944065e2 100644 --- a/calendar/gui/e-meeting-time-sel.c +++ b/calendar/gui/e-meeting-time-sel.c @@ -36,13 +36,6 @@ #include <libebackend/libebackend.h> #include <libgnomecanvas/libgnomecanvas.h> -#include "misc/e-canvas.h" -#include "misc/e-canvas-utils.h" -#include "misc/e-dateedit.h" - -#include "e-util/e-util.h" -#include "e-util/e-datetime-format.h" - #include "e-meeting-utils.h" #include "e-meeting-list-view.h" #include "e-meeting-time-sel-item.h" diff --git a/calendar/gui/e-meeting-time-sel.h b/calendar/gui/e-meeting-time-sel.h index 7c3f7c3021..9f4fb0ac31 100644 --- a/calendar/gui/e-meeting-time-sel.h +++ b/calendar/gui/e-meeting-time-sel.h @@ -25,9 +25,9 @@ #include <gtk/gtk.h> #include <libgnomecanvas/libgnomecanvas.h> -#include <text/e-text.h> -#include <table/e-table-model.h> -#include <table/e-table.h> + +#include <e-util/e-util.h> + #include "e-meeting-store.h" #include "e-meeting-list-view.h" diff --git a/calendar/gui/e-memo-list-selector.c b/calendar/gui/e-memo-list-selector.c index 8da45b68f3..366d41e702 100644 --- a/calendar/gui/e-memo-list-selector.c +++ b/calendar/gui/e-memo-list-selector.c @@ -25,7 +25,6 @@ #include <string.h> #include <libecal/libecal.h> -#include "e-util/e-selection.h" #include "calendar/gui/comp-util.h" #define E_MEMO_LIST_SELECTOR_GET_PRIVATE(obj) \ diff --git a/calendar/gui/e-memo-list-selector.h b/calendar/gui/e-memo-list-selector.h index f131d661cc..532fd312c6 100644 --- a/calendar/gui/e-memo-list-selector.h +++ b/calendar/gui/e-memo-list-selector.h @@ -26,7 +26,7 @@ #ifndef E_MEMO_LIST_SELECTOR_H #define E_MEMO_LIST_SELECTOR_H -#include <libedataserverui/libedataserverui.h> +#include <e-util/e-util.h> /* Standard GObject macros */ #define E_TYPE_MEMO_LIST_SELECTOR \ diff --git a/calendar/gui/e-memo-table.c b/calendar/gui/e-memo-table.c index 45d51b9060..7d60f84877 100644 --- a/calendar/gui/e-memo-table.c +++ b/calendar/gui/e-memo-table.c @@ -30,32 +30,20 @@ #include <config.h> #endif +#include "e-memo-table.h" + #include <sys/stat.h> #include <unistd.h> #include <glib/gi18n.h> #include <glib/gstdio.h> -#include <misc/e-selectable.h> -#include <table/e-cell-checkbox.h> -#include <table/e-cell-toggle.h> -#include <table/e-cell-text.h> -#include <table/e-cell-combo.h> -#include <table/e-cell-date.h> -#include <e-util/e-selection.h> -#include <e-util/e-dialog-utils.h> -#include <e-util/e-util-private.h> -#include <table/e-cell-date-edit.h> -#include <table/e-cell-percent.h> #include "dialogs/delete-comp.h" #include "dialogs/delete-error.h" #include "dialogs/memo-editor.h" #include "e-cal-model-memos.h" -#include "e-memo-table.h" #include "e-calendar-view.h" #include "e-cell-date-edit-text.h" #include "print.h" -#include <e-util/e-util-private.h> -#include <e-util/e-icon-factory.h> #include "misc.h" #define E_MEMO_TABLE_GET_PRIVATE(obj) \ diff --git a/calendar/gui/e-memo-table.h b/calendar/gui/e-memo-table.h index 4f52ad35e4..f003aa6fff 100644 --- a/calendar/gui/e-memo-table.h +++ b/calendar/gui/e-memo-table.h @@ -25,9 +25,8 @@ #ifndef E_MEMO_TABLE_H #define E_MEMO_TABLE_H -#include <table/e-table.h> -#include <table/e-cell-date-edit.h> #include <shell/e-shell-view.h> + #include "e-cal-model.h" /* diff --git a/calendar/gui/e-select-names-editable.h b/calendar/gui/e-select-names-editable.h index f168902db9..84732f7e72 100644 --- a/calendar/gui/e-select-names-editable.h +++ b/calendar/gui/e-select-names-editable.h @@ -24,8 +24,6 @@ #ifndef __E_SELECT_NAMES_EDITABLE_H__ #define __E_SELECT_NAMES_EDITABLE_H__ -#include <libedataserverui/libedataserverui.h> - G_BEGIN_DECLS #define E_TYPE_SELECT_NAMES_EDITABLE (e_select_names_editable_get_type ()) diff --git a/calendar/gui/e-task-list-selector.c b/calendar/gui/e-task-list-selector.c index 1b8bbbae48..0989e7436c 100644 --- a/calendar/gui/e-task-list-selector.c +++ b/calendar/gui/e-task-list-selector.c @@ -25,7 +25,6 @@ #include <string.h> #include <libecal/libecal.h> -#include "e-util/e-selection.h" #include "calendar/gui/comp-util.h" #define E_TASK_LIST_SELECTOR_GET_PRIVATE(obj) \ diff --git a/calendar/gui/e-task-list-selector.h b/calendar/gui/e-task-list-selector.h index fd133d1c10..df79d5f0ab 100644 --- a/calendar/gui/e-task-list-selector.h +++ b/calendar/gui/e-task-list-selector.h @@ -26,7 +26,7 @@ #ifndef E_TASK_LIST_SELECTOR_H #define E_TASK_LIST_SELECTOR_H -#include <libedataserverui/libedataserverui.h> +#include <e-util/e-util.h> /* Standard GObject macros */ #define E_TYPE_TASK_LIST_SELECTOR \ diff --git a/calendar/gui/e-task-table.c b/calendar/gui/e-task-table.c index ed73cbe6ef..cda4896292 100644 --- a/calendar/gui/e-task-table.c +++ b/calendar/gui/e-task-table.c @@ -29,36 +29,23 @@ #include <config.h> #endif +#include "e-task-table.h" + #include <sys/stat.h> #include <unistd.h> #include <glib/gi18n.h> #include <glib/gstdio.h> #include <gtk/gtk.h> #include <gdk/gdkkeysyms.h> -#include <misc/e-selectable.h> -#include <table/e-cell-checkbox.h> -#include <table/e-cell-toggle.h> -#include <table/e-cell-text.h> -#include <table/e-cell-combo.h> -#include <table/e-cell-date.h> -#include <e-util/e-selection.h> -#include <e-util/e-dialog-utils.h> -#include <e-util/e-util-private.h> -#include <table/e-cell-date-edit.h> -#include <table/e-cell-percent.h> -#include <table/e-table-sorting-utils.h> #include "calendar-config.h" #include "dialogs/delete-comp.h" #include "dialogs/delete-error.h" #include "dialogs/task-editor.h" #include "e-cal-model-tasks.h" -#include "e-task-table.h" #include "e-calendar-view.h" #include "e-cell-date-edit-text.h" #include "print.h" -#include <e-util/e-util-private.h> -#include <e-util/e-icon-factory.h> #include "misc.h" #define E_TASK_TABLE_GET_PRIVATE(obj) \ diff --git a/calendar/gui/e-task-table.h b/calendar/gui/e-task-table.h index cf215fd449..617679c76b 100644 --- a/calendar/gui/e-task-table.h +++ b/calendar/gui/e-task-table.h @@ -23,9 +23,8 @@ #ifndef E_TASK_TABLE_H #define E_TASK_TABLE_H -#include <table/e-table.h> -#include <table/e-cell-date-edit.h> #include <shell/e-shell-view.h> + #include "e-cal-model.h" /* diff --git a/calendar/gui/e-timezone-entry.c b/calendar/gui/e-timezone-entry.c index 41b40dcf3b..9c9aeefacd 100644 --- a/calendar/gui/e-timezone-entry.c +++ b/calendar/gui/e-timezone-entry.c @@ -32,10 +32,12 @@ #include <config.h> #endif -#include <widgets/e-timezone-dialog/e-timezone-dialog.h> -#include <glib/gi18n.h> #include "e-timezone-entry.h" +#include <glib/gi18n.h> + +#include "e-util/e-util.h" + #define E_TIMEZONE_ENTRY_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ ((obj), E_TYPE_TIMEZONE_ENTRY, ETimezoneEntryPrivate)) diff --git a/calendar/gui/e-week-view-event-item.c b/calendar/gui/e-week-view-event-item.c index 1aa507deb4..298319cdea 100644 --- a/calendar/gui/e-week-view-event-item.c +++ b/calendar/gui/e-week-view-event-item.c @@ -30,15 +30,13 @@ #include <config.h> #endif -#include "e-util/e-categories-config.h" #include "e-week-view-event-item.h" #include <gtk/gtk.h> + #include "e-calendar-view.h" #include "comp-util.h" -#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)) diff --git a/calendar/gui/e-week-view.c b/calendar/gui/e-week-view.c index 9a3e92de24..2e00d3b078 100644 --- a/calendar/gui/e-week-view.c +++ b/calendar/gui/e-week-view.c @@ -30,36 +30,31 @@ #endif #include "e-week-view.h" -#include "ea-calendar.h" #include <math.h> #include <gdk/gdkkeysyms.h> #include <glib/gi18n.h> #include <libgnomecanvas/libgnomecanvas.h> -#include <text/e-text.h> -#include <misc/e-canvas-utils.h> -#include <e-util/e-unicode.h> -#include <e-util/e-categories-config.h> -#include <e-util/e-dialog-utils.h> -#include <e-util/e-util.h> + #include "dialogs/delete-comp.h" #include "dialogs/delete-error.h" #include "dialogs/send-comp.h" #include "dialogs/cancel-comp.h" #include "dialogs/recur-comp.h" #include "dialogs/goto-dialog.h" + #include "calendar-config.h" -#include "comp-util.h" -#include "itip-utils.h" #include "calendar-config.h" -#include "print.h" +#include "comp-util.h" #include "e-cal-model-calendar.h" #include "e-week-view-event-item.h" #include "e-week-view-layout.h" #include "e-week-view-main-item.h" #include "e-week-view-titles-item.h" +#include "ea-calendar.h" +#include "itip-utils.h" #include "misc.h" -#include <e-util/e-icon-factory.h> +#include "print.h" /* Images */ #include "art/jump.xpm" diff --git a/calendar/gui/ea-cal-view-event.c b/calendar/gui/ea-cal-view-event.c index 35c3819062..fe1f731bfe 100644 --- a/calendar/gui/ea-cal-view-event.c +++ b/calendar/gui/ea-cal-view-event.c @@ -24,12 +24,12 @@ #include <config.h> #endif +#include <glib/gi18n.h> + #include "ea-cal-view-event.h" #include "ea-calendar-helpers.h" #include "ea-day-view.h" #include "ea-week-view.h" -#include <text/e-text.h> -#include <glib/gi18n.h> static void ea_cal_view_event_class_init (EaCalViewEventClass *klass); static void ea_cal_view_event_init (EaCalViewEvent *a11y); diff --git a/calendar/gui/ea-calendar-helpers.c b/calendar/gui/ea-calendar-helpers.c index e0234d0a08..8d907f5bbf 100644 --- a/calendar/gui/ea-calendar-helpers.c +++ b/calendar/gui/ea-calendar-helpers.c @@ -31,7 +31,6 @@ #include "e-day-view.h" #include "e-week-view.h" -#include <text/e-text.h> #include <libgnomecanvas/libgnomecanvas.h> /** diff --git a/calendar/gui/ea-calendar.c b/calendar/gui/ea-calendar.c index 2aa7daac88..4fe44ae7b7 100644 --- a/calendar/gui/ea-calendar.c +++ b/calendar/gui/ea-calendar.c @@ -24,10 +24,9 @@ #include <config.h> #endif -#include <text/e-text.h> #include <libgnomecanvas/libgnomecanvas.h> + #include "ea-calendar-helpers.h" -#include "a11y/ea-factory.h" #include "ea-calendar.h" #include "calendar/gui/ea-cal-view.h" diff --git a/calendar/gui/ea-day-view-cell.c b/calendar/gui/ea-day-view-cell.c index 5e25a2aae1..c72b21ea0b 100644 --- a/calendar/gui/ea-day-view-cell.c +++ b/calendar/gui/ea-day-view-cell.c @@ -28,7 +28,6 @@ #include "ea-day-view-cell.h" #include "ea-day-view-main-item.h" #include "ea-day-view.h" -#include "a11y/ea-factory.h" /* EDayViewCell */ diff --git a/calendar/gui/ea-day-view-main-item.c b/calendar/gui/ea-day-view-main-item.c index 3367833a4f..e8f81ff67f 100644 --- a/calendar/gui/ea-day-view-main-item.c +++ b/calendar/gui/ea-day-view-main-item.c @@ -25,12 +25,12 @@ #include <config.h> #endif +#include <glib/gi18n.h> + #include "ea-day-view-main-item.h" #include "e-day-view-top-item.h" #include "ea-day-view.h" #include "ea-day-view-cell.h" -#include "ea-cell-table.h" -#include <glib/gi18n.h> /* EaDayViewMainItem */ static void ea_day_view_main_item_class_init (EaDayViewMainItemClass *klass); diff --git a/calendar/gui/ea-week-view-cell.c b/calendar/gui/ea-week-view-cell.c index 2ceb8e17bc..d888b47774 100644 --- a/calendar/gui/ea-week-view-cell.c +++ b/calendar/gui/ea-week-view-cell.c @@ -28,7 +28,6 @@ #include "ea-week-view-cell.h" #include "ea-week-view-main-item.h" -#include "a11y/ea-factory.h" /* EWeekViewCell */ diff --git a/calendar/gui/ea-week-view-main-item.c b/calendar/gui/ea-week-view-main-item.c index d4597d8fdd..816660cb3f 100644 --- a/calendar/gui/ea-week-view-main-item.c +++ b/calendar/gui/ea-week-view-main-item.c @@ -26,10 +26,11 @@ #endif #include "ea-week-view-main-item.h" + +#include <glib/gi18n.h> + #include "ea-week-view.h" #include "ea-week-view-cell.h" -#include "ea-cell-table.h" -#include <glib/gi18n.h> /* EaWeekViewMainItem */ static void ea_week_view_main_item_class_init diff --git a/calendar/gui/ea-week-view.c b/calendar/gui/ea-week-view.c index 26cdcf2eed..24d6e8de83 100644 --- a/calendar/gui/ea-week-view.c +++ b/calendar/gui/ea-week-view.c @@ -25,11 +25,12 @@ #endif #include "ea-week-view.h" + +#include <glib/gi18n.h> + #include "ea-cal-view-event.h" #include "ea-calendar-helpers.h" #include "ea-gnome-calendar.h" -#include <text/e-text.h> -#include <glib/gi18n.h> static void ea_week_view_class_init (EaWeekViewClass *klass); diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index 0ea1008701..8b9b2b3c17 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -29,38 +29,36 @@ #include <config.h> #endif +#include "gnome-cal.h" + #include <unistd.h> #include <math.h> #include <signal.h> #include <fcntl.h> -#include <gdk/gdkkeysyms.h> + #include <glib/gi18n.h> +#include <gdk/gdkkeysyms.h> -#include <widgets/menus/gal-view-factory-etable.h> -#include <widgets/menus/gal-view-etable.h> -#include <widgets/menus/gal-define-views-dialog.h> -#include "e-util/e-util.h" -#include "libevolution-utils/e-alert-dialog.h" -#include "e-util/e-util-private.h" #include "shell/e-shell.h" + #include "dialogs/delete-error.h" #include "dialogs/event-editor.h" + +#include "calendar-config.h" +#include "calendar-view-factory.h" +#include "calendar-view.h" #include "comp-util.h" +#include "e-cal-list-view.h" #include "e-cal-model-calendar.h" -#include "e-day-view.h" #include "e-day-view-time-item.h" +#include "e-day-view.h" +#include "e-memo-table.h" #include "e-month-view.h" +#include "e-task-table.h" #include "e-week-view.h" -#include "e-cal-list-view.h" -#include "gnome-cal.h" -#include "calendar-config.h" -#include "calendar-view.h" -#include "calendar-view-factory.h" -#include "tag-calendar.h" -#include "misc.h" #include "ea-calendar.h" -#include "e-memo-table.h" -#include "e-task-table.h" +#include "misc.h" +#include "tag-calendar.h" #define d(x) diff --git a/calendar/gui/gnome-cal.h b/calendar/gui/gnome-cal.h index c2f491b1bd..dcb801754f 100644 --- a/calendar/gui/gnome-cal.h +++ b/calendar/gui/gnome-cal.h @@ -31,7 +31,7 @@ #include <gtk/gtk.h> #include <libecal/libecal.h> -#include <misc/e-calendar.h> +#include <e-util/e-util.h> #include "e-cal-model.h" diff --git a/calendar/gui/itip-utils.c b/calendar/gui/itip-utils.c index 1af60b8192..f758574c59 100644 --- a/calendar/gui/itip-utils.c +++ b/calendar/gui/itip-utils.c @@ -29,8 +29,6 @@ #include <libical/ical.h> #include <libsoup/soup.h> -#include <e-util/e-dialog-utils.h> - #include <composer/e-msg-composer.h> #include "itip-utils.h" diff --git a/calendar/gui/print.c b/calendar/gui/print.c index b4e6ff2133..c9e48a520c 100644 --- a/calendar/gui/print.c +++ b/calendar/gui/print.c @@ -28,16 +28,17 @@ #include <config.h> #endif +#include "print.h" + #include <sys/stat.h> #include <sys/time.h> #include <math.h> #include <string.h> #include <time.h> + #include <gtk/gtk.h> #include <glib/gi18n.h> -#include <e-util/e-util.h> -#include <e-util/e-print.h> #include "e-cal-model.h" #include "e-day-view.h" #include "e-day-view-layout.h" @@ -45,7 +46,6 @@ #include "e-week-view-layout.h" #include "e-task-table.h" #include "gnome-cal.h" -#include "print.h" #include "art/jump.xpm" diff --git a/calendar/gui/print.h b/calendar/gui/print.h index b81bcfa36c..1b7d31194b 100644 --- a/calendar/gui/print.h +++ b/calendar/gui/print.h @@ -25,7 +25,8 @@ #ifndef PRINT_H #define PRINT_H -#include <table/e-table.h> +#include <e-util/e-util.h> + #include "calendar/gui/gnome-cal.h" typedef enum { diff --git a/calendar/gui/tag-calendar.h b/calendar/gui/tag-calendar.h index aa3eb2a8a4..b9f406e61f 100644 --- a/calendar/gui/tag-calendar.h +++ b/calendar/gui/tag-calendar.h @@ -28,7 +28,7 @@ #define TAG_CALENDAR_H #include <libecal/libecal.h> -#include <misc/e-calendar.h> +#include <e-util/e-util.h> void tag_calendar_by_client (ECalendar *ecal, ECalClient *client, GCancellable *cancellable); void tag_calendar_by_comp (ECalendar *ecal, ECalComponent *comp, diff --git a/calendar/importers/Makefile.am b/calendar/importers/Makefile.am index 7480358f27..f9e984634d 100644 --- a/calendar/importers/Makefile.am +++ b/calendar/importers/Makefile.am @@ -6,10 +6,10 @@ libevolution_calendar_importers_la_CPPFLAGS = \ -DG_LOG_DOMAIN=\"Evolution-Importer\" \ -I$(top_srcdir) \ -I$(top_srcdir)/calendar \ - -I$(top_srcdir)/widgets \ -I$(top_builddir)/calendar \ $(EVOLUTION_DATA_SERVER_CFLAGS) \ $(GNOME_PLATFORM_CFLAGS) \ + $(CHAMPLAIN_CFLAGS) \ $(GTKHTML_CFLAGS) libevolution_calendar_importers_la_SOURCES = \ @@ -21,9 +21,9 @@ libevolution_calendar_importers_la_LDFLAGS = -avoid-version $(NO_UNDEFINED) libevolution_calendar_importers_la_LIBADD = \ $(top_builddir)/e-util/libeutil.la \ $(top_builddir)/shell/libeshell.la \ - $(top_builddir)/widgets/misc/libemiscwidgets.la \ $(EVOLUTION_DATA_SERVER_LIBS) \ $(GNOME_PLATFORM_LIBS) \ + $(CHAMPLAIN_LIBS) \ $(GTKHTML_LIBS) -include $(top_srcdir)/git.mk diff --git a/calendar/importers/icalendar-importer.c b/calendar/importers/icalendar-importer.c index 89e5f0ccfc..d54a8876c5 100644 --- a/calendar/importers/icalendar-importer.c +++ b/calendar/importers/icalendar-importer.c @@ -36,17 +36,12 @@ #include <gtk/gtk.h> #include <libecal/libecal.h> -#include <libedataserverui/libedataserverui.h> #include <libical/icalvcal.h> -#include "evolution-calendar-importer.h" #include "shell/e-shell.h" -#include "gui/calendar-config-keys.h" -#include "e-util/e-import.h" -#include "e-util/e-util-private.h" -#include "e-util/e-datetime-format.h" -#include "misc/e-web-view-preview.h" +#include "evolution-calendar-importer.h" +#include "gui/calendar-config-keys.h" /* We timeout after 2 minutes, when opening the folders. */ #define IMPORTER_TIMEOUT_SECONDS 120 diff --git a/composer/Makefile.am b/composer/Makefile.am index 59b316097d..d5df64095f 100644 --- a/composer/Makefile.am +++ b/composer/Makefile.am @@ -27,10 +27,6 @@ libcomposer_la_CPPFLAGS = \ -I$(top_srcdir) \ -I$(top_builddir) \ -I$(top_builddir)/composer \ - -I$(top_srcdir)/widgets \ - -I$(top_builddir)/widgets \ - -I$(top_srcdir)/widgets/misc \ - -I$(top_builddir)/widgets/misc \ -I$(top_builddir)/shell \ -I$(top_srcdir)/shell \ -DEVOLUTION_DATADIR=\"$(datadir)\" \ @@ -40,6 +36,7 @@ libcomposer_la_CPPFLAGS = \ -DG_LOG_DOMAIN=\"composer\" \ $(EVOLUTION_DATA_SERVER_CFLAGS) \ $(GNOME_PLATFORM_CFLAGS) \ + $(CHAMPLAIN_CFLAGS) \ $(GTKHTML_CFLAGS) libcomposer_la_SOURCES = \ @@ -60,15 +57,13 @@ libcomposer_la_LDFLAGS = -avoid-version $(NO_UNDEFINED) libcomposer_la_LIBADD = \ $(top_builddir)/e-util/libeutil.la \ - $(top_builddir)/widgets/misc/libemiscwidgets.la \ $(top_builddir)/shell/libeshell.la \ $(top_builddir)/em-format/libemformat.la \ $(top_builddir)/addressbook/gui/contact-editor/libecontacteditor.la \ $(top_builddir)/addressbook/gui/contact-list-editor/libecontactlisteditor.la \ - $(top_builddir)/libemail-utils/libemail-utils.la \ - $(top_builddir)/libevolution-utils/libevolution-utils.la \ $(EVOLUTION_DATA_SERVER_LIBS) \ $(GNOME_PLATFORM_LIBS) \ + $(CHAMPLAIN_CFLAGS) \ $(GTKHTML_LIBS) ui_DATA = evolution-composer.ui diff --git a/composer/e-composer-actions.c b/composer/e-composer-actions.c index 966866b830..1317775364 100644 --- a/composer/e-composer-actions.c +++ b/composer/e-composer-actions.c @@ -25,7 +25,6 @@ #include <errno.h> #include <fcntl.h> -#include <libevolution-utils/e-alert-dialog.h> static void action_attach_cb (GtkAction *action, diff --git a/composer/e-composer-activity.h b/composer/e-composer-activity.h index 431e390062..a437e06e03 100644 --- a/composer/e-composer-activity.h +++ b/composer/e-composer-activity.h @@ -19,7 +19,6 @@ #ifndef E_COMPOSER_ACTIVITY_H #define E_COMPOSER_ACTIVITY_H -#include <e-util/e-activity.h> #include <composer/e-msg-composer.h> /* Standard GObject macros */ diff --git a/composer/e-composer-common.h b/composer/e-composer-common.h index 661797eee6..b58a138373 100644 --- a/composer/e-composer-common.h +++ b/composer/e-composer-common.h @@ -22,5 +22,6 @@ #define E_COMPOSER_COMMON #include <gtk/gtk.h> +#include <e-util/e-util.h> #endif /* E_COMPOSER_COMMON */ diff --git a/composer/e-composer-from-header.c b/composer/e-composer-from-header.c index ceecd68b87..d9afb5985a 100644 --- a/composer/e-composer-from-header.c +++ b/composer/e-composer-from-header.c @@ -24,8 +24,6 @@ #include "e-composer-from-header.h" -#include <misc/e-mail-identity-combo-box.h> - G_DEFINE_TYPE ( EComposerFromHeader, e_composer_from_header, diff --git a/composer/e-composer-header-table.c b/composer/e-composer-header-table.c index 72c8dacaa8..2760ba50ee 100644 --- a/composer/e-composer-header-table.c +++ b/composer/e-composer-header-table.c @@ -22,10 +22,8 @@ #include "e-composer-header-table.h" #include <glib/gi18n-lib.h> -#include <libedataserverui/libedataserverui.h> #include <shell/e-shell.h> -#include <misc/e-mail-signature-combo-box.h> #include "e-msg-composer.h" #include "e-composer-private.h" diff --git a/composer/e-composer-header-table.h b/composer/e-composer-header-table.h index 3e7e16c527..f459aaeae8 100644 --- a/composer/e-composer-header-table.h +++ b/composer/e-composer-header-table.h @@ -22,7 +22,6 @@ #include <shell/e-shell.h> #include <composer/e-composer-header.h> -#include <misc/e-mail-signature-combo-box.h> /* Standard GObject macros */ #define E_TYPE_COMPOSER_HEADER_TABLE \ diff --git a/composer/e-composer-name-header.h b/composer/e-composer-name-header.h index b745941a3e..5632ddf0c0 100644 --- a/composer/e-composer-name-header.h +++ b/composer/e-composer-name-header.h @@ -19,7 +19,6 @@ #define E_COMPOSER_NAME_HEADER_H #include <libebook/libebook.h> -#include <libedataserverui/libedataserverui.h> #include <composer/e-composer-header.h> diff --git a/composer/e-composer-private.h b/composer/e-composer-private.h index 4370b1a12b..fc358b9320 100644 --- a/composer/e-composer-private.h +++ b/composer/e-composer-private.h @@ -35,24 +35,6 @@ #include "e-composer-actions.h" #include "e-composer-activity.h" #include "e-composer-header-table.h" -#include "libevolution-utils/e-alert-sink.h" -#include "e-util/e-charset.h" -#include "e-util/e-marshal.h" -#include "e-util/e-mktemp.h" -#include "e-util/e-plugin-ui.h" -#include "e-util/e-selection.h" -#include "e-util/e-util.h" -#include "widgets/misc/e-activity-bar.h" -#include "widgets/misc/e-alert-bar.h" -#include "widgets/misc/e-attachment.h" -#include "widgets/misc/e-attachment-icon-view.h" -#include "widgets/misc/e-attachment-paned.h" -#include "widgets/misc/e-attachment-store.h" -#include "widgets/misc/e-mail-signature-combo-box.h" -#include "widgets/misc/e-picture-gallery.h" -#include "widgets/misc/e-preferences-window.h" -#include "widgets/misc/e-web-view-gtkhtml.h" -#include "shell/e-shell.h" #ifdef HAVE_XFREE #include <X11/XF86keysym.h> diff --git a/composer/e-composer-spell-header.c b/composer/e-composer-spell-header.c index ad4ddca6dd..a3c945ded4 100644 --- a/composer/e-composer-spell-header.c +++ b/composer/e-composer-spell-header.c @@ -19,8 +19,6 @@ #include <config.h> #endif -#include <misc/e-spell-entry.h> - #include "e-composer-spell-header.h" G_DEFINE_TYPE ( diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c index 5cd9a70f75..dcfd3852e6 100644 --- a/composer/e-msg-composer.c +++ b/composer/e-msg-composer.c @@ -37,10 +37,6 @@ #include <ctype.h> #include <fcntl.h> -#include <libevolution-utils/e-alert-dialog.h> -#include <e-util/e-dialog-utils.h> -#include <e-util/e-util-private.h> - #include "e-composer-private.h" #include <em-format/e-mail-part.h> diff --git a/composer/e-msg-composer.h b/composer/e-msg-composer.h index a85993fd87..941845af70 100644 --- a/composer/e-msg-composer.h +++ b/composer/e-msg-composer.h @@ -28,9 +28,6 @@ #include <gtkhtml-editor.h> #include <libebook/libebook.h> -#include <misc/e-attachment-view.h> -#include <misc/e-focus-tracker.h> -#include <misc/e-web-view-gtkhtml.h> #include <shell/e-shell.h> #include <composer/e-composer-header-table.h> diff --git a/configure.ac b/configure.ac index 7f5f844756..d2d5d5bf10 100644 --- a/configure.ac +++ b/configure.ac @@ -303,7 +303,6 @@ PKG_CHECK_MODULES([EVOLUTION_DATA_SERVER], libebook-1.2 >= eds_minimum_version libecal-1.2 >= eds_minimum_version libedataserver-1.2 >= eds_minimum_version - libedataserverui-3.0 >= eds_minimum_version libebackend-1.2 >= eds_minimum_version]) AC_SUBST(EVOLUTION_DATA_SERVER_CFLAGS) AC_SUBST(EVOLUTION_DATA_SERVER_LIBS) @@ -1565,7 +1564,6 @@ AC_SUBST(EVOLUTION_DIR) AC_CONFIG_FILES([ po/Makefile.in Makefile -a11y/Makefile addressbook/Makefile addressbook/gui/Makefile addressbook/gui/contact-editor/Makefile @@ -1585,10 +1583,10 @@ data/evolution-settings.desktop.in data/icons/Makefile doc/Makefile doc/reference/Makefile -doc/reference/shell/Makefile +doc/reference/libeshell/Makefile +doc/reference/libeutil/Makefile e-util/Makefile em-format/Makefile -filter/Makefile help/Makefile help/quickref/Makefile help/quickref/C/Makefile @@ -1604,10 +1602,6 @@ help/quickref/pl/Makefile help/quickref/pt/Makefile help/quickref/sv/Makefile help/quickref/sq/Makefile -libevolution-utils/Makefile -libevolution-utils/libevolution-utils.pc -libemail-utils/Makefile -libemail-utils/libemail-utils.pc libemail-engine/Makefile libemail-engine/libemail-engine.pc libgnomecanvas/Makefile @@ -1620,12 +1614,6 @@ views/calendar/Makefile views/mail/Makefile views/tasks/Makefile views/memos/Makefile -widgets/Makefile -widgets/e-timezone-dialog/Makefile -widgets/menus/Makefile -widgets/misc/Makefile -widgets/text/Makefile -widgets/table/Makefile calendar/Makefile calendar/alarm-notify/Makefile calendar/importers/Makefile diff --git a/doc/reference/Makefile.am b/doc/reference/Makefile.am index 48d38adb0a..806e1b0d83 100644 --- a/doc/reference/Makefile.am +++ b/doc/reference/Makefile.am @@ -1,3 +1,3 @@ -SUBDIRS = shell +SUBDIRS = libeutil libeshell -include $(top_srcdir)/git.mk diff --git a/doc/reference/shell/Makefile.am b/doc/reference/libeshell/Makefile.am index 40004abf8c..7262075b74 100644 --- a/doc/reference/shell/Makefile.am +++ b/doc/reference/libeshell/Makefile.am @@ -1,5 +1,5 @@ # The name of the module, e.g. 'glib'. -DOC_MODULE=eshell +DOC_MODULE=libeshell # The top-level SGML file. You can change this if you want to. DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.sgml @@ -8,7 +8,7 @@ DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.sgml # gtk-doc will search all .c & .h files beneath here for inline comments # documenting the functions and macros. # e.g. DOC_SOURCE_DIR=../../../gtk -DOC_SOURCE_DIR=../../.. +DOC_SOURCE_DIR=../../../shell # Extra options to pass to gtkdoc-scangobj. Not normally needed. SCANGOBJ_OPTIONS= @@ -33,7 +33,10 @@ HFILE_GLOB=$(top_srcdir)/shell/*.h CFILE_GLOB=$(top_srcdir)/shell/*.c # Header files to ignore when scanning. -IGNORE_HFILES=e-shell-window-private.h +IGNORE_HFILES= \ + evo-version.h \ + e-shell-window-private.h \ + es-event.h # Images to copy into HTML directory. HTML_IMAGES= @@ -54,13 +57,9 @@ GTKDOC_CFLAGS= \ $(EVOLUTION_DATA_SERVER_CFLAGS) \ $(GTKHTML_CFLAGS) GTKDOC_LIBS= \ - $(top_builddir)/libemail-utils/libemail-utils.la \ $(top_builddir)/libemail-engine/libemail-engine.la \ $(top_builddir)/shell/libeshell.la \ $(top_builddir)/e-util/libeutil.la \ - $(top_builddir)/filter/libfilter.la \ - $(top_builddir)/widgets/menus/libmenus.la \ - $(top_builddir)/widgets/misc/libemiscwidgets.la \ $(EVOLUTION_DATA_SERVER_LIBS) \ $(GTKHTML_LIBS) diff --git a/doc/reference/shell/eshell-docs.sgml b/doc/reference/libeshell/libeshell-docs.sgml index df6cd4354d..8a9404fdc9 100644 --- a/doc/reference/shell/eshell-docs.sgml +++ b/doc/reference/libeshell/libeshell-docs.sgml @@ -3,10 +3,10 @@ "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"> <book id="index" xmlns:xi="http://www.w3.org/2003/XInclude"> <bookinfo> - <title>Evolution Shell Reference Manual</title> + <title>Evolution Shell (libeshell)</title> <releaseinfo> The latest version of this documentation can be found on-line at - <ulink role="online-location" url="http://library.gnome.org/devel/eshell/unstable/">http://library.gnome.org/devel/eshell/unstable/</ulink>. + <ulink role="online-location" url="http://library.gnome.org/devel/libeshell/">http://library.gnome.org/devel/libeshell/</ulink>. </releaseinfo> </bookinfo> @@ -26,22 +26,6 @@ </chapter> <chapter> - <title>Basic Utility Functions</title> - <xi:include href="xml/e-alert.xml"/> - <xi:include href="xml/e-bit-array.xml"/> - <xi:include href="xml/e-categories-config.xml"/> - <xi:include href="xml/e-datetime-format.xml"/> - <xi:include href="xml/e-dialog-utils.xml"/> - <xi:include href="xml/e-html-utils.xml"/> - <xi:include href="xml/e-icon-factory.xml"/> - <xi:include href="xml/e-poolv.xml"/> - <xi:include href="xml/e-print.xml"/> - <xi:include href="xml/e-selection.xml"/> - <xi:include href="xml/e-util.xml"/> - <xi:include href="xml/e-xml-utils.xml"/> - </chapter> - - <chapter> <title>Actions</title> <xi:include href="xml/shell-actions.xml"/> <xi:include href="xml/action-groups.xml"/> @@ -52,8 +36,9 @@ <xi:include href="xml/tree_index.sgml"/> </chapter> - <index> + <index id="api-index-full"> <title>Index</title> + <xi:include href="xml/api-index-full.xml"><xi:fallback /></xi:include> </index> </book> diff --git a/doc/reference/shell/eshell-overrides.txt b/doc/reference/libeshell/libeshell-overrides.txt index e69de29bb2..e69de29bb2 100644 --- a/doc/reference/shell/eshell-overrides.txt +++ b/doc/reference/libeshell/libeshell-overrides.txt diff --git a/doc/reference/libeshell/libeshell-sections.txt b/doc/reference/libeshell/libeshell-sections.txt new file mode 100644 index 0000000000..f6b997d4a1 --- /dev/null +++ b/doc/reference/libeshell/libeshell-sections.txt @@ -0,0 +1,423 @@ +<SECTION> +<FILE>e-shell</FILE> +<TITLE>EShell</TITLE> +EShell +e_shell_get_default +e_shell_load_modules +e_shell_get_shell_backends +e_shell_get_canonical_name +e_shell_get_backend_by_name +e_shell_get_backend_by_scheme +e_shell_get_shell_settings +e_shell_get_registry +e_shell_create_shell_window +e_shell_handle_uris +e_shell_submit_alert +e_shell_get_active_window +e_shell_get_meego_mode +e_shell_get_express_mode +e_shell_get_small_screen_mode +e_shell_get_module_directory +e_shell_get_network_available +e_shell_set_network_available +e_shell_lock_network_available +e_shell_get_online +e_shell_set_online +e_shell_get_preferences_window +e_shell_event +EShellQuitReason +e_shell_quit +e_shell_cancel_quit +e_shell_adapt_window_size +e_shell_set_startup_view +e_shell_get_startup_view +E_SHELL_MIGRATE_ERROR +EShellMigrateError +e_shell_migrate_attempt +e_shell_detect_meego +<SUBSECTION Standard> +E_SHELL +E_IS_SHELL +E_TYPE_SHELL +E_SHELL_CLASS +E_IS_SHELL_CLASS +E_SHELL_GET_CLASS +E_TYPE_SHELL_QUIT_REASON +EShellClass +e_shell_get_type +e_shell_quit_reason_get_type +<SUBSECTION Private> +EShellPrivate +e_shell_migrate_error_quark +</SECTION> + +<SECTION> +<FILE>e-shell-backend</FILE> +<TITLE>EShellBackend</TITLE> +EShellBackend +e_shell_backend_compare +e_shell_backend_get_config_dir +e_shell_backend_get_data_dir +e_shell_backend_get_shell +e_shell_backend_add_activity +e_shell_backend_cancel_all +e_shell_backend_is_busy +e_shell_backend_get_prefer_new_item +e_shell_backend_set_prefer_new_item +e_shell_backend_start +e_shell_backend_is_started +e_shell_backend_migrate +<SUBSECTION Standard> +E_SHELL_BACKEND +E_IS_SHELL_BACKEND +E_TYPE_SHELL_BACKEND +E_SHELL_BACKEND_CLASS +E_IS_SHELL_BACKEND_CLASS +E_SHELL_BACKEND_GET_CLASS +EShellBackendClass +e_shell_backend_get_type +<SUBSECTION Private> +EShellBackendPrivate +</SECTION> + +<SECTION> +<FILE>e-shell-content</FILE> +<TITLE>EShellContent</TITLE> +EShellContent +e_shell_content_new +e_shell_content_set_searchbar +e_shell_content_check_state +e_shell_content_focus_search_results +e_shell_content_get_alert_bar +e_shell_content_get_shell_view +e_shell_content_get_view_id +e_shell_content_set_view_id +e_shell_content_run_advanced_search_dialog +e_shell_content_run_edit_searches_dialog +e_shell_content_run_save_search_dialog +<SUBSECTION Standard> +E_SHELL_CONTENT +E_IS_SHELL_CONTENT +E_TYPE_SHELL_CONTENT +E_SHELL_CONTENT_CLASS +E_IS_SHELL_CONTENT_CLASS +E_SHELL_CONTENT_GET_CLASS +EShellContentClass +e_shell_content_get_type +<SUBSECTION Private> +EShellContentPrivate +</SECTION> + +<SECTION> +<FILE>e-shell-searchbar</FILE> +<TITLE>EShellSearchbar</TITLE> +EShellSearchbar +e_shell_searchbar_new +e_shell_searchbar_get_shell_view +e_shell_searchbar_get_express_mode +e_shell_searchbar_set_express_mode +e_shell_searchbar_get_filter_combo_box +e_shell_searchbar_get_filter_visible +e_shell_searchbar_set_filter_visible +e_shell_searchbar_get_labels_visible +e_shell_searchbar_set_labels_visible +e_shell_searchbar_get_search_hint +e_shell_searchbar_set_search_hint +e_shell_searchbar_get_search_option +e_shell_searchbar_set_search_option +e_shell_searchbar_get_search_text +e_shell_searchbar_set_search_text +e_shell_searchbar_get_search_visible +e_shell_searchbar_set_search_visible +e_shell_searchbar_get_search_box +e_shell_searchbar_get_scope_combo_box +e_shell_searchbar_get_scope_visible +e_shell_searchbar_set_scope_visible +e_shell_searchbar_set_state_dirty +e_shell_searchbar_get_state_group +e_shell_searchbar_set_state_group +e_shell_searchbar_load_state +e_shell_searchbar_save_state +<SUBSECTION Standard> +E_SHELL_SEARCHBAR +E_IS_SHELL_SEARCHBAR +E_TYPE_SHELL_SEARCHBAR +E_SHELL_SEARCHBAR_CLASS +E_IS_SHELL_SEARCHBAR_CLASS +E_SHELL_SEARCHBAR_GET_CLASS +EShellSearchbarClass +e_shell_searchbar_get_type +<SUBSECTION Private> +EShellSearchbarPrivate +</SECTION> + +<SECTION> +<FILE>e-shell-settings</FILE> +<TITLE>EShellSettings</TITLE> +EShellSettings +e_shell_settings_install_property +e_shell_settings_install_property_for_key +e_shell_settings_enable_debug +e_shell_settings_get_boolean +e_shell_settings_set_boolean +e_shell_settings_get_int +e_shell_settings_set_int +e_shell_settings_get_string +e_shell_settings_set_string +e_shell_settings_get_object +e_shell_settings_set_object +e_shell_settings_get_pointer +e_shell_settings_set_pointer +<SUBSECTION Standard> +E_SHELL_SETTINGS +E_IS_SHELL_SETTINGS +E_TYPE_SHELL_SETTINGS +E_SHELL_SETTINGS_CLASS +E_IS_SHELL_SETTINGS_CLASS +E_SHELL_SETTINGS_GET_CLASS +EShellSettingsClass +e_shell_settings_get_type +<SUBSECTION Private> +EShellSettingsPrivate +</SECTION> + +<SECTION> +<FILE>e-shell-sidebar</FILE> +<TITLE>EShellSidebar</TITLE> +EShellSidebar +e_shell_sidebar_new +e_shell_sidebar_check_state +e_shell_sidebar_get_shell_view +e_shell_sidebar_get_icon_name +e_shell_sidebar_set_icon_name +e_shell_sidebar_get_primary_text +e_shell_sidebar_set_primary_text +e_shell_sidebar_get_secondary_text +e_shell_sidebar_set_secondary_text +<SUBSECTION Standard> +E_SHELL_SIDEBAR +E_IS_SHELL_SIDEBAR +E_TYPE_SHELL_SIDEBAR +E_SHELL_SIDEBAR_CLASS +E_IS_SHELL_SIDEBAR_CLASS +E_SHELL_SIDEBAR_GET_CLASS +EShellSidebarClass +e_shell_sidebar_get_type +<SUBSECTION Private> +EShellSidebarPrivate +</SECTION> + +<SECTION> +<FILE>e-shell-switcher</FILE> +<TITLE>EShellSwitcher</TITLE> +EShellSwitcher +e_shell_switcher_new +e_shell_switcher_add_action +e_shell_switcher_get_style +e_shell_switcher_set_style +e_shell_switcher_unset_style +e_shell_switcher_get_visible +e_shell_switcher_set_visible +<SUBSECTION Standard> +E_SHELL_SWITCHER +E_IS_SHELL_SWITCHER +E_TYPE_SHELL_SWITCHER +E_SHELL_SWITCHER_CLASS +E_IS_SHELL_SWITCHER_CLASS +E_SHELL_SWITCHER_GET_CLASS +EShellSwitcherClass +e_shell_switcher_get_type +<SUBSECTION Private> +EShellSwitcherPrivate +E_SHELL_SWITCHER_DEFAULT_TOOLBAR_STYLE +</SECTION> + +<SECTION> +<FILE>e-shell-taskbar</FILE> +<TITLE>EShellTaskbar</TITLE> +EShellTaskbar +e_shell_taskbar_new +e_shell_taskbar_get_shell_view +e_shell_taskbar_get_message +e_shell_taskbar_set_message +e_shell_taskbar_unset_message +e_shell_taskbar_get_activity_count +<SUBSECTION Standard> +E_SHELL_TASKBAR +E_IS_SHELL_TASKBAR +E_TYPE_SHELL_TASKBAR +E_SHELL_TASKBAR_CLASS +E_IS_SHELL_TASKBAR_CLASS +E_SHELL_TASKBAR_GET_CLASS +EShellTaskbarClass +e_shell_taskbar_get_type +<SUBSECTION Private> +EShellTaskbarPrivate +</SECTION> + +<SECTION> +<FILE>e-shell-utils</FILE> +<TITLE>Shell Utilities</TITLE> +e_shell_configure_ui_manager +e_shell_run_open_dialog +e_shell_run_save_dialog +e_shell_utils_import_uris +e_shell_hide_widgets_for_express_mode +</SECTION> + +<SECTION> +<FILE>e-shell-view</FILE> +<TITLE>EShellView</TITLE> +EShellView +EShellViewClass +e_shell_view_get_name +e_shell_view_get_action +e_shell_view_get_title +e_shell_view_set_title +e_shell_view_get_view_id +e_shell_view_set_view_id +e_shell_view_is_active +e_shell_view_get_page_num +e_shell_view_set_page_num +e_shell_view_get_searchbar +e_shell_view_get_search_name +e_shell_view_get_search_rule +e_shell_view_set_search_rule +e_shell_view_get_search_query +e_shell_view_get_shell_backend +e_shell_view_get_shell_content +e_shell_view_get_shell_sidebar +e_shell_view_get_shell_taskbar +e_shell_view_get_shell_window +e_shell_view_get_state_key_file +e_shell_view_set_state_dirty +e_shell_view_clear_search +e_shell_view_custom_search +e_shell_view_execute_search +e_shell_view_block_execute_search +e_shell_view_unblock_execute_search +e_shell_view_is_execute_search_blocked +e_shell_view_update_actions +e_shell_view_block_update_actions +e_shell_view_unblock_update_actions +e_shell_view_show_popup_menu +e_shell_view_new_view_instance +e_shell_view_write_source +e_shell_view_remove_source +e_shell_view_remote_delete_source +<SUBSECTION Standard> +E_SHELL_VIEW +E_IS_SHELL_VIEW +E_TYPE_SHELL_VIEW +E_SHELL_VIEW_CLASS +E_IS_SHELL_VIEW_CLASS +E_SHELL_VIEW_GET_CLASS +e_shell_view_get_type +<SUBSECTION Private> +EShellViewPrivate +</SECTION> + +<SECTION> +<FILE>e-shell-window</FILE> +<TITLE>EShellWindow</TITLE> +EShellWindow +e_shell_window_new +e_shell_window_get_shell +e_shell_window_get_shell_view +e_shell_window_peek_shell_view +e_shell_window_get_shell_view_action +e_shell_window_get_alert_bar +e_shell_window_get_focus_tracker +e_shell_window_get_ui_manager +e_shell_window_get_action +e_shell_window_get_action_group +e_shell_window_get_managed_widget +e_shell_window_get_active_view +e_shell_window_set_active_view +e_shell_window_get_safe_mode +e_shell_window_set_safe_mode +e_shell_window_add_action_group +e_shell_window_get_sidebar_visible +e_shell_window_set_sidebar_visible +e_shell_window_get_switcher_visible +e_shell_window_set_switcher_visible +e_shell_window_get_taskbar_visible +e_shell_window_set_taskbar_visible +e_shell_window_get_toolbar_visible +e_shell_window_set_toolbar_visible +e_shell_window_get_toolbar_new_prefer_item +e_shell_window_set_toolbar_new_prefer_item +e_shell_window_register_new_item_actions +e_shell_window_register_new_source_actions +e_shell_window_get_menu_bar_box +<SUBSECTION Standard> +E_SHELL_WINDOW +E_IS_SHELL_WINDOW +E_TYPE_SHELL_WINDOW +E_SHELL_WINDOW_CLASS +E_IS_SHELL_WINDOW_CLASS +E_SHELL_WINDOW_GET_CLASS +EShellWindowClass +e_shell_window_get_type +<SUBSECTION Private> +EShellWindowPrivate +E_SHELL_WINDOW_ACTION +E_SHELL_WINDOW_ACTION_GROUP +</SECTION> + +<SECTION> +<FILE>shell-actions</FILE> +<TITLE>Shell Actions</TITLE> +E_SHELL_WINDOW_ACTION_ABOUT +E_SHELL_WINDOW_ACTION_CLOSE +E_SHELL_WINDOW_ACTION_CONTENTS +E_SHELL_WINDOW_ACTION_COPY_CLIPBOARD +E_SHELL_WINDOW_ACTION_CUT_CLIPBOARD +E_SHELL_WINDOW_ACTION_DELETE_SELECTION +E_SHELL_WINDOW_ACTION_GAL_CUSTOM_VIEW +E_SHELL_WINDOW_ACTION_GAL_DEFINE_VIEWS +E_SHELL_WINDOW_ACTION_GAL_SAVE_CUSTOM_VIEW +E_SHELL_WINDOW_ACTION_GROUP_NEW_WINDOW +E_SHELL_WINDOW_ACTION_IMPORT +E_SHELL_WINDOW_ACTION_NEW_WINDOW +E_SHELL_WINDOW_ACTION_PAGE_SETUP +E_SHELL_WINDOW_ACTION_PASTE_CLIPBOARD +E_SHELL_WINDOW_ACTION_PREFERENCES +E_SHELL_WINDOW_ACTION_QUICK_REFERENCE +E_SHELL_WINDOW_ACTION_QUIT +E_SHELL_WINDOW_ACTION_SEARCH_ADVANCED +E_SHELL_WINDOW_ACTION_SEARCH_CLEAR +E_SHELL_WINDOW_ACTION_SEARCH_EDIT +E_SHELL_WINDOW_ACTION_SEARCH_OPTIONS +E_SHELL_WINDOW_ACTION_SEARCH_QUICK +E_SHELL_WINDOW_ACTION_SEARCH_SAVE +E_SHELL_WINDOW_ACTION_SELECT_ALL +E_SHELL_WINDOW_ACTION_SHOW_SIDEBAR +E_SHELL_WINDOW_ACTION_SHOW_SWITCHER +E_SHELL_WINDOW_ACTION_SHOW_TASKBAR +E_SHELL_WINDOW_ACTION_SHOW_TOOLBAR +E_SHELL_WINDOW_ACTION_SUBMIT_BUG +E_SHELL_WINDOW_ACTION_SWITCHER_INITIAL +E_SHELL_WINDOW_ACTION_SWITCHER_MENU +E_SHELL_WINDOW_ACTION_SWITCHER_STYLE_BOTH +E_SHELL_WINDOW_ACTION_SWITCHER_STYLE_ICONS +E_SHELL_WINDOW_ACTION_SWITCHER_STYLE_TEXT +E_SHELL_WINDOW_ACTION_SWITCHER_STYLE_USER +E_SHELL_WINDOW_ACTION_WORK_OFFLINE +E_SHELL_WINDOW_ACTION_WORK_ONLINE +</SECTION> + +<SECTION> +<FILE>action-groups</FILE> +<TITLE>Action Groups</TITLE> +E_SHELL_WINDOW_ACTION_GROUP_SHELL +E_SHELL_WINDOW_ACTION_GROUP_SWITCHER +E_SHELL_WINDOW_ACTION_GROUP_NEW_ITEM +E_SHELL_WINDOW_ACTION_GROUP_NEW_SOURCE +E_SHELL_WINDOW_ACTION_GROUP_CUSTOM_RULES +E_SHELL_WINDOW_ACTION_GROUP_GAL_VIEW +E_SHELL_WINDOW_ACTION_GROUP_LOCKDOWN_APPLICATION_HANDLERS +E_SHELL_WINDOW_ACTION_GROUP_LOCKDOWN_PRINTING +E_SHELL_WINDOW_ACTION_GROUP_LOCKDOWN_PRINT_SETUP +E_SHELL_WINDOW_ACTION_GROUP_LOCKDOWN_SAVE_TO_DISK +</SECTION> diff --git a/doc/reference/shell/eshell.types b/doc/reference/libeshell/libeshell.types index 0832576163..b0038d55e1 100644 --- a/doc/reference/shell/eshell.types +++ b/doc/reference/libeshell/libeshell.types @@ -1,4 +1,3 @@ -e_bit_array_get_type e_shell_get_type e_shell_backend_get_type e_shell_content_get_type diff --git a/doc/reference/shell/tmpl/e-mail-account-manager.sgml b/doc/reference/libeshell/tmpl/e-mail-account-manager.sgml index 49fe04bdf2..49fe04bdf2 100644 --- a/doc/reference/shell/tmpl/e-mail-account-manager.sgml +++ b/doc/reference/libeshell/tmpl/e-mail-account-manager.sgml diff --git a/doc/reference/shell/tmpl/e-mail-account-tree-view.sgml b/doc/reference/libeshell/tmpl/e-mail-account-tree-view.sgml index eaee2f12c5..eaee2f12c5 100644 --- a/doc/reference/shell/tmpl/e-mail-account-tree-view.sgml +++ b/doc/reference/libeshell/tmpl/e-mail-account-tree-view.sgml diff --git a/doc/reference/shell/tmpl/e-mail-identity-combo-box.sgml b/doc/reference/libeshell/tmpl/e-mail-identity-combo-box.sgml index fec8130b21..fec8130b21 100644 --- a/doc/reference/shell/tmpl/e-mail-identity-combo-box.sgml +++ b/doc/reference/libeshell/tmpl/e-mail-identity-combo-box.sgml diff --git a/doc/reference/libeutil/Makefile.am b/doc/reference/libeutil/Makefile.am new file mode 100644 index 0000000000..71eabf3d76 --- /dev/null +++ b/doc/reference/libeutil/Makefile.am @@ -0,0 +1,67 @@ +# The name of the module. +DOC_MODULE = libeutil + +# The top-level SGML file. +DOC_MAIN_SGML_FILE = libeutil-docs.sgml + +# Extra options to supply to gtkdoc-scan. +SCAN_OPTIONS = --deprecated-guards="EDS_DISABLE_DEPRECATED" + +# The directory containing the source code. Relative to $(srcdir). +DOC_SOURCE_DIR = $(top_srcdir)/e-util + +# Used for dependencies. The docs will be rebuilt if any of these change. +HFILE_GLOB = $(top_srcdir)/e-util/*.h +CFILE_GLOB = $(top_srcdir)/e-util/*.c + +# Ignore all accessiblity headers. +IGNORE_HFILES = \ + ea-calendar-cell.h \ + ea-calendar-item.h \ + ea-cell-table.h \ + ea-factory.h \ + ea-widgets.h \ + gal-a11y-e-cell-registry.h \ + gal-a11y-e-cell-toggle.h \ + gal-a11y-e-cell-tree.h \ + gal-a11y-e-cell-vbox.h \ + gal-a11y-e-cell.h \ + gal-a11y-e-popup.h \ + gal-a11y-e-table-click-to-add-factory.h \ + gal-a11y-e-table-click-to-add.h \ + gal-a11y-e-table-column-header.h \ + gal-a11y-e-table-factory.h \ + gal-a11y-e-table-item-factory.h \ + gal-a11y-e-table-item.h \ + gal-a11y-e-table.h \ + gal-a11y-e-text-factory.h \ + gal-a11y-e-text.h \ + gal-a11y-e-tree-factory.h \ + gal-a11y-e-tree.h \ + gal-a11y-factory.h + gal-a11y-util.h \ + $(NULL) + +GTKDOC_CFLAGS = \ + -I$(top_srcdir) \ + -I$(top_builddir) \ + $(EVOLUTION_DATA_SERVER_CFLAGS) \ + $(GNOME_PLATFORM_CFLAGS) \ + $(CHAMPLAIN_CFLAGS) \ + $(GTKHTML_CFLAGS) \ + $(NULL) + +GTKDOC_LIBS = \ + $(top_builddir)/e-util/libeutil.la \ + $(EVOLUTION_DATA_SERVER_LIBS) \ + $(GNOME_PLATFORM_LIBS) \ + $(CHAMPLAIN_LIBS) \ + $(GTKHTML_LIBS) \ + $(NULL) + +# This includes the standard gtk-doc make rules, copied by gtkdocize. +include $(top_srcdir)/gtk-doc.make + +#TESTS = $(GTKDOC_CHECK) + +-include $(top_srcdir)/git.mk diff --git a/doc/reference/libeutil/libeutil-docs.sgml b/doc/reference/libeutil/libeutil-docs.sgml new file mode 100644 index 0000000000..329047b791 --- /dev/null +++ b/doc/reference/libeutil/libeutil-docs.sgml @@ -0,0 +1,263 @@ +<?xml version="1.0"?> +<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" + "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [ +<!ENTITY % local.common.attrib "xmlns:xi CDATA #FIXED 'http://www.w3.org/2003/XInclude'"> +]> +<book id="index" xmlns:xi="http://www.w3.org/2003/XInclude"> + <bookinfo> + <title>Evolution Utilities (libeutil)</title> + <releaseinfo> + The latest version of this documentation can be found on-line at + <ulink role="online-location" url="http://library.gnome.org/devel/libeutil/">http://library.gnome.org/devel/libeutil/</ulink>. + </releaseinfo> + </bookinfo> + + <chapter> + <title>Basic Utility Functions</title> + <xi:include href="xml/e-alert.xml"/> + <xi:include href="xml/e-datetime-format.xml"/> + <xi:include href="xml/e-html-utils.xml"/> + <xi:include href="xml/e-misc-utils.xml"/> + <xi:include href="xml/e-poolv.xml"/> + <xi:include href="xml/e-print.xml"/> + <xi:include href="xml/e-selection.xml"/> + <xi:include href="xml/e-xml-utils.xml"/> + <xi:include href="xml/e-bit-array.xml"/> + <xi:include href="xml/e-dialog-utils.xml"/> + <xi:include href="xml/e-icon-factory.xml"/> + <xi:include href="xml/e-passwords.xml"/> + </chapter> + + <chapter> + <title>Attachment Management</title> + <xi:include href="xml/e-attachment.xml"/> + <xi:include href="xml/e-attachment-bar.xml"/> + <xi:include href="xml/e-attachment-button.xml"/> + <xi:include href="xml/e-attachment-dialog.xml"/> + <xi:include href="xml/e-attachment-paned.xml"/> + <xi:include href="xml/e-attachment-store.xml"/> + <xi:include href="xml/e-attachment-view.xml"/> + <xi:include href="xml/e-attachment-icon-view.xml"/> + <xi:include href="xml/e-attachment-tree-view.xml"/> + <xi:include href="xml/e-attachment-handler.xml"/> + </chapter> + + <chapter> + <title>Category Management</title> + <xi:include href="xml/e-categories-config.xml"/> + <xi:include href="xml/e-categories-dialog.xml"/> + <xi:include href="xml/e-categories-editor.xml"/> + <xi:include href="xml/e-categories-selector.xml"/> + <xi:include href="xml/e-category-completion.xml"/> + <xi:include href="xml/e-category-editor.xml"/> + </chapter> + + <chapter> + <title>Filtering and Searching</title> + <xi:include href="xml/e-rule-context.xml"/> + <xi:include href="xml/e-rule-editor.xml"/> + <xi:include href="xml/e-filter-rule.xml"/> + <xi:include href="xml/e-filter-part.xml"/> + <xi:include href="xml/e-filter-element.xml"/> + <xi:include href="xml/e-filter-code.xml"/> + <xi:include href="xml/e-filter-color.xml"/> + <xi:include href="xml/e-filter-datespec.xml"/> + <xi:include href="xml/e-filter-file.xml"/> + <xi:include href="xml/e-filter-input.xml"/> + <xi:include href="xml/e-filter-int.xml"/> + <xi:include href="xml/e-filter-option.xml"/> + </chapter> + + <chapter> + <title>Tables and Trees</title> + <xi:include href="xml/e-table.xml"/> + <xi:include href="xml/e-table-click-to-add.xml"/> + <xi:include href="xml/e-table-col-dnd.xml"/> + <xi:include href="xml/e-table-col.xml"/> + <xi:include href="xml/e-table-column-specification.xml"/> + <xi:include href="xml/e-table-config.xml"/> + <xi:include href="xml/e-table-defines.xml"/> + <xi:include href="xml/e-table-extras.xml"/> + <xi:include href="xml/e-table-field-chooser-dialog.xml"/> + <xi:include href="xml/e-table-field-chooser-item.xml"/> + <xi:include href="xml/e-table-field-chooser.xml"/> + <xi:include href="xml/e-table-group-container.xml"/> + <xi:include href="xml/e-table-group-leaf.xml"/> + <xi:include href="xml/e-table-group.xml"/> + <xi:include href="xml/e-table-header-item.xml"/> + <xi:include href="xml/e-table-header-utils.xml"/> + <xi:include href="xml/e-table-header.xml"/> + <xi:include href="xml/e-table-item.xml"/> + <xi:include href="xml/e-table-memory-callbacks.xml"/> + <xi:include href="xml/e-table-memory-store.xml"/> + <xi:include href="xml/e-table-memory.xml"/> + <xi:include href="xml/e-table-model.xml"/> + <xi:include href="xml/e-table-one.xml"/> + <xi:include href="xml/e-table-search.xml"/> + <xi:include href="xml/e-table-selection-model.xml"/> + <xi:include href="xml/e-table-sort-info.xml"/> + <xi:include href="xml/e-table-sorted-variable.xml"/> + <xi:include href="xml/e-table-sorted.xml"/> + <xi:include href="xml/e-table-sorter.xml"/> + <xi:include href="xml/e-table-sorting-utils.xml"/> + <xi:include href="xml/e-table-specification.xml"/> + <xi:include href="xml/e-table-state.xml"/> + <xi:include href="xml/e-table-subset-variable.xml"/> + <xi:include href="xml/e-table-subset.xml"/> + <xi:include href="xml/e-table-utils.xml"/> + <xi:include href="xml/e-table-without.xml"/> + <xi:include href="xml/e-tree.xml"/> + <xi:include href="xml/e-tree-memory-callbacks.xml"/> + <xi:include href="xml/e-tree-memory.xml"/> + <xi:include href="xml/e-tree-model.xml"/> + <xi:include href="xml/e-tree-selection-model.xml"/> + <xi:include href="xml/e-tree-sorted.xml"/> + <xi:include href="xml/e-tree-table-adapter.xml"/> + <xi:include href="xml/e-cell.xml"/> + <xi:include href="xml/e-cell-checkbox.xml"/> + <xi:include href="xml/e-cell-combo.xml"/> + <xi:include href="xml/e-cell-date-edit.xml"/> + <xi:include href="xml/e-cell-date.xml"/> + <xi:include href="xml/e-cell-hbox.xml"/> + <xi:include href="xml/e-cell-number.xml"/> + <xi:include href="xml/e-cell-percent.xml"/> + <xi:include href="xml/e-cell-pixbuf.xml"/> + <xi:include href="xml/e-cell-popup.xml"/> + <xi:include href="xml/e-cell-size.xml"/> + <xi:include href="xml/e-cell-text.xml"/> + <xi:include href="xml/e-cell-toggle.xml"/> + <xi:include href="xml/e-cell-tree.xml"/> + <xi:include href="xml/e-cell-vbox.xml"/> + <xi:include href="xml/e-popup-menu.xml"/> + </chapter> + + <chapter> + <title>Text Processing</title> + <xi:include href="xml/e-text.xml"/> + <xi:include href="xml/e-text-model.xml"/> + <xi:include href="xml/e-text-model-repos.xml"/> + <xi:include href="xml/e-text-event-processor.xml"/> + <xi:include href="xml/e-text-event-processor-emacs-like.xml"/> + <xi:include href="xml/e-text-event-processor-types.xml"/> + <xi:include href="xml/e-reflow.xml"/> + <xi:include href="xml/e-reflow-model.xml"/> + </chapter> + + <chapter> + <title>View Management</title> + <xi:include href="xml/gal-view.xml"/> + <xi:include href="xml/gal-view-factory.xml"/> + <xi:include href="xml/gal-view-instance.xml"/> + <xi:include href="xml/gal-view-collection.xml"/> + <xi:include href="xml/gal-view-etable.xml"/> + <xi:include href="xml/gal-view-factory-etable.xml"/> + <xi:include href="xml/gal-view-new-dialog.xml"/> + <xi:include href="xml/gal-define-views-dialog.xml"/> + <xi:include href="xml/gal-define-views-model.xml"/> + <xi:include href="xml/gal-view-instance-save-as-dialog.xml"/> + </chapter> + + <chapter> + <title>(Unsorted Sections)</title> + <xi:include href="xml/e-action-combo-box.xml"/> + <xi:include href="xml/e-activity-bar.xml"/> + <xi:include href="xml/e-activity-proxy.xml"/> + <xi:include href="xml/e-activity.xml"/> + <xi:include href="xml/e-alarm-selector.xml"/> + <xi:include href="xml/e-alert-bar.xml"/> + <xi:include href="xml/e-alert-dialog.xml"/> + <xi:include href="xml/e-alert-sink.xml"/> + <xi:include href="xml/e-auth-combo-box.xml"/> + <xi:include href="xml/e-autocomplete-selector.xml"/> + <xi:include href="xml/e-book-source-config.xml"/> + <xi:include href="xml/e-buffer-tagger.xml"/> + <xi:include href="xml/e-cal-source-config.xml"/> + <xi:include href="xml/e-calendar-item.xml"/> + <xi:include href="xml/e-calendar.xml"/> + <xi:include href="xml/e-canvas-background.xml"/> + <xi:include href="xml/e-canvas-utils.xml"/> + <xi:include href="xml/e-canvas-vbox.xml"/> + <xi:include href="xml/e-canvas.xml"/> + <xi:include href="xml/e-cell-renderer-color.xml"/> + <xi:include href="xml/e-charset-combo-box.xml"/> + <xi:include href="xml/e-charset.xml"/> + <xi:include href="xml/e-client-utils.xml"/> + <xi:include href="xml/e-config.xml"/> + <xi:include href="xml/e-contact-store.xml"/> + <xi:include href="xml/e-dateedit.xml"/> + <xi:include href="xml/e-destination-store.xml"/> + <xi:include href="xml/e-dialog-widgets.xml"/> + <xi:include href="xml/e-event.xml"/> + <xi:include href="xml/e-file-request.xml"/> + <xi:include href="xml/e-file-utils.xml"/> + <xi:include href="xml/e-focus-tracker.xml"/> + <xi:include href="xml/e-image-chooser.xml"/> + <xi:include href="xml/e-import-assistant.xml"/> + <xi:include href="xml/e-import.xml"/> + <xi:include href="xml/e-interval-chooser.xml"/> + <xi:include href="xml/e-mail-identity-combo-box.xml"/> + <xi:include href="xml/e-mail-signature-combo-box.xml"/> + <xi:include href="xml/e-mail-signature-editor.xml"/> + <xi:include href="xml/e-mail-signature-manager.xml"/> + <xi:include href="xml/e-mail-signature-preview.xml"/> + <xi:include href="xml/e-mail-signature-script-dialog.xml"/> + <xi:include href="xml/e-mail-signature-tree-view.xml"/> + <xi:include href="xml/e-map.xml"/> + <xi:include href="xml/e-menu-tool-action.xml"/> + <xi:include href="xml/e-menu-tool-button.xml"/> + <xi:include href="xml/e-mktemp.xml"/> + <xi:include href="xml/e-name-selector-dialog.xml"/> + <xi:include href="xml/e-name-selector-entry.xml"/> + <xi:include href="xml/e-name-selector-list.xml"/> + <xi:include href="xml/e-name-selector-model.xml"/> + <xi:include href="xml/e-name-selector.xml"/> + <xi:include href="xml/e-online-button.xml"/> + <xi:include href="xml/e-paned.xml"/> + <xi:include href="xml/e-picture-gallery.xml"/> + <xi:include href="xml/e-plugin-ui.xml"/> + <xi:include href="xml/e-plugin.xml"/> + <xi:include href="xml/e-popup-action.xml"/> + <xi:include href="xml/e-port-entry.xml"/> + <xi:include href="xml/e-preferences-window.xml"/> + <xi:include href="xml/e-preview-pane.xml"/> + <xi:include href="xml/e-printable.xml"/> + <xi:include href="xml/e-search-bar.xml"/> + <xi:include href="xml/e-selectable.xml"/> + <xi:include href="xml/e-selection-model-array.xml"/> + <xi:include href="xml/e-selection-model-simple.xml"/> + <xi:include href="xml/e-selection-model.xml"/> + <xi:include href="xml/e-send-options.xml"/> + <xi:include href="xml/e-sorter-array.xml"/> + <xi:include href="xml/e-sorter.xml"/> + <xi:include href="xml/e-source-combo-box.xml"/> + <xi:include href="xml/e-source-config-backend.xml"/> + <xi:include href="xml/e-source-config-dialog.xml"/> + <xi:include href="xml/e-source-config.xml"/> + <xi:include href="xml/e-source-selector-dialog.xml"/> + <xi:include href="xml/e-source-selector.xml"/> + <xi:include href="xml/e-source-util.xml"/> + <xi:include href="xml/e-spell-entry.xml"/> + <xi:include href="xml/e-stock-request.xml"/> + <xi:include href="xml/e-timezone-dialog.xml"/> + <xi:include href="xml/e-tree-model-generator.xml"/> + <xi:include href="xml/e-ui-manager.xml"/> + <xi:include href="xml/e-unicode.xml"/> + <xi:include href="xml/e-url-entry.xml"/> + <xi:include href="xml/e-web-view-gtkhtml.xml"/> + <xi:include href="xml/e-web-view-preview.xml"/> + <xi:include href="xml/e-web-view.xml"/> + </chapter> + + <chapter> + <title>Object Hierarchy</title> + <xi:include href="xml/tree_index.sgml"/> + </chapter> + + <index id="api-index-full"> + <title>Index</title> + <xi:include href="xml/api-index-full.xml"><xi:fallback /></xi:include> + </index> + + <xi:include href="xml/annotation-glossary.xml"><xi:fallback /></xi:include> + +</book> diff --git a/doc/reference/libeutil/libeutil-overrides.txt b/doc/reference/libeutil/libeutil-overrides.txt new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/doc/reference/libeutil/libeutil-overrides.txt diff --git a/doc/reference/libeutil/libeutil-sections.txt b/doc/reference/libeutil/libeutil-sections.txt new file mode 100644 index 0000000000..98b939826e --- /dev/null +++ b/doc/reference/libeutil/libeutil-sections.txt @@ -0,0 +1,1900 @@ +<SECTION> +<FILE>e-action-combo-box</FILE> +<TITLE>EActionComboBox</TITLE> +EActionComboBox +e_action_combo_box_new +e_action_combo_box_new_with_action +e_action_combo_box_get_action +e_action_combo_box_set_action +e_action_combo_box_get_current_value +e_action_combo_box_set_current_value +e_action_combo_box_add_separator_before +e_action_combo_box_add_separator_after +<SUBSECTION Standard> +E_ACTION_COMBO_BOX +E_IS_ACTION_COMBO_BOX +E_TYPE_ACTION_COMBO_BOX +E_ACTION_COMBO_BOX_CLASS +E_IS_ACTION_COMBO_BOX_CLASS +E_ACTION_COMBO_BOX_GET_CLASS +EActionComboBoxClass +e_action_combo_box_get_type +<SUBSECTION Private> +EActionComboBoxPrivate +</SECTION> + +<SECTION> +<FILE>e-activity</FILE> +<TITLE>EActivity</TITLE> +EActivity +e_activity_new +e_activity_describe +e_activity_get_alert_sink +e_activity_set_alert_sink +e_activity_get_cancellable +e_activity_set_cancellable +e_activity_get_icon_name +e_activity_set_icon_name +e_activity_get_percent +e_activity_set_percent +EActivityState +e_activity_get_state +e_activity_set_state +e_activity_get_text +e_activity_set_text +<SUBSECTION Standard> +E_ACTIVITY +E_IS_ACTIVITY +E_TYPE_ACTIVITY +E_ACTIVITY_CLASS +E_IS_ACTIVITY_CLASS +E_ACTIVITY_GET_CLASS +EActivityClass +e_activity_get_type +<SUBSECTION Private> +EActivityPrivate +</SECTION> + +<SECTION> +<FILE>e-activity-bar</FILE> +<TITLE>EActivityBar</TITLE> +EActivityBar +e_activity_bar_new +e_activity_bar_get_activity +e_activity_bar_set_activity +<SUBSECTION Standard> +E_ACTIVITY_BAR +E_IS_ACTIVITY_BAR +E_TYPE_ACTIVITY_BAR +E_ACTIVITY_BAR_CLASS +E_IS_ACTIVITY_BAR_CLASS +E_ACTIVITY_BAR_GET_CLASS +EActivityBarClass +e_activity_bar_get_type +<SUBSECTION Private> +EActivityBarPrivate +</SECTION> + +<SECTION> +<FILE>e-activity-proxy</FILE> +<TITLE>EActivityProxy</TITLE> +EActivityProxy +e_activity_proxy_new +e_activity_proxy_get_activity +<SUBSECTION Standard> +E_ACTIVITY_PROXY +E_IS_ACTIVITY_PROXY +E_TYPE_ACTIVITY_PROXY +E_ACTIVITY_PROXY_CLASS +E_IS_ACTIVITY_PROXY_CLASS +E_ACTIVITY_PROXY_GET_CLASS +EActivityProxyClass +e_activity_proxy_get_type +<SUBSECTION Private> +EActivityProxyPrivate +</SECTION> + +<SECTION> +<FILE>e-alarm-selector</FILE> +<TITLE>EAlarmSelector</TITLE> +EAlarmSelector +e_alarm_selector_new +<SUBSECTION Standard> +E_ALARM_SELECTOR +E_IS_ALARM_SELECTOR +E_TYPE_ALARM_SELECTOR +E_ALARM_SELECTOR_CLASS +E_IS_ALARM_SELECTOR_CLASS +E_ALARM_SELECTOR_GET_CLASS +EAlarmSelectorClass +e_alarm_selector_get_type +<SUBSECTION Private> +EAlarmSelectorPrivate +</SECTION> + +<SECTION> +<FILE>e-alert</FILE> +<TITLE>EAlert</TITLE> +E_ALERT_ASK_FILE_EXISTS_OVERWRITE +E_ALERT_NO_SAVE_FILE +E_ALERT_NO_LOAD_FILE +EAlert +e_alert_new +e_alert_new_valist +e_alert_get_default_response +e_alert_set_default_response +e_alert_get_message_type +e_alert_set_message_type +e_alert_get_primary_text +e_alert_set_primary_text +e_alert_get_secondary_text +e_alert_set_secondary_text +e_alert_get_stock_id +e_alert_add_action +e_alert_peek_actions +e_alert_create_image +e_alert_response +e_alert_start_timer +e_alert_submit +e_alert_submit_valist +<SUBSECTION Standard> +E_ALERT +E_IS_ALERT +E_TYPE_ALERT +E_ALERT_CLASS +E_IS_ALERT_CLASS +E_ALERT_GET_CLASS +EAlertClass +e_alert_get_type +<SUBSECTION Private> +EAlertPrivate +</SECTION> + +<SECTION> +<FILE>e-alert-bar</FILE> +<TITLE>EAlertBar</TITLE> +EAlertBar +e_alert_bar_new +e_alert_bar_clear +e_alert_bar_add_alert +<SUBSECTION Standard> +E_ALERT_BAR +E_IS_ALERT_BAR +E_TYPE_ALERT_BAR +E_ALERT_BAR_CLASS +E_IS_ALERT_BAR_CLASS +E_ALERT_BAR_GET_CLASS +EAlertBarClass +e_alert_bar_get_type +<SUBSECTION Private> +EAlertBarPrivate +</SECTION> + +<SECTION> +<FILE>e-alert-dialog</FILE> +<TITLE>EAlertDialog</TITLE> +EAlertDialog +e_alert_dialog_new +e_alert_dialog_new_for_args +e_alert_run_dialog +e_alert_run_dialog_for_args +e_alert_dialog_get_alert +e_alert_dialog_get_content_area +<SUBSECTION Standard> +E_ALERT_DIALOG +E_IS_ALERT_DIALOG +E_TYPE_ALERT_DIALOG +E_ALERT_DIALOG_CLASS +E_IS_ALERT_DIALOG_CLASS +E_ALERT_DIALOG_GET_CLASS +EAlertDialogClass +e_alert_dialog_get_type +<SUBSECTION Private> +EAlertDialogPrivate +</SECTION> + +<SECTION> +<FILE>e-alert-sink</FILE> +<TITLE>EAlertSink</TITLE> +EAlertSink +EAlertSinkInterface +e_alert_sink_submit_alert +<SUBSECTION Standard> +E_ALERT_SINK +E_IS_ALERT_SINK +E_TYPE_ALERT_SINK +E_ALERT_SINK_INTERFACE +E_IS_ALERT_SINK_INTERFACE +E_ALERT_SINK_GET_INTERFACE +e_alert_sink_get_type +</SECTION> + +<SECTION> +<FILE>e-attachment</FILE> +<TITLE>EAttachment</TITLE> +EAttachment +e_attachment_new +e_attachment_new_for_path +e_attachment_new_for_uri +e_attachment_new_for_message +e_attachment_add_to_multipart +e_attachment_cancel +e_attachment_get_can_show +e_attachment_set_can_show +e_attachment_get_disposition +e_attachment_set_disposition +e_attachment_get_file +e_attachment_set_file +e_attachment_get_file_info +e_attachment_set_file_info +e_attachment_get_icon +e_attachment_get_loading +e_attachment_get_mime_part +e_attachment_set_mime_part +e_attachment_get_percent +e_attachment_get_reference +e_attachment_set_reference +e_attachment_get_saving +e_attachment_get_shown +e_attachment_set_shown +e_attachment_get_encrypted +e_attachment_set_encrypted +e_attachment_get_signed +e_attachment_set_signed +e_attachment_get_description +e_attachment_get_thumbnail_path +e_attachment_is_rfc822 +e_attachment_list_apps +e_attachment_load_async +e_attachment_load_finish +e_attachment_open_async +e_attachment_open_finish +e_attachment_save_async +e_attachment_save_finish +e_attachment_load_handle_error +e_attachment_open_handle_error +e_attachment_save_handle_error +<SUBSECTION Standard> +E_ATTACHMENT +E_IS_ATTACHMENT +E_TYPE_ATTACHMENT +E_ATTACHMENT_CLASS +E_IS_ATTACHMENT_CLASS +E_ATTACHMENT_GET_CLASS +EAttachmentClass +e_attachment_get_type +<SUBSECTION Private> +EAttachmentPrivate +</SECTION> + +<SECTION> +<FILE>e-attachment-bar</FILE> +<TITLE>EAttachmentBar</TITLE> +EAttachmentBar +e_attachment_bar_new +e_attachment_bar_get_active_view +e_attachment_bar_set_active_view +e_attachment_bar_get_expanded +e_attachment_bar_set_expanded +e_attachment_bar_get_store +<SUBSECTION Standard> +E_ATTACHMENT_BAR +E_IS_ATTACHMENT_BAR +E_TYPE_ATTACHMENT_BAR +E_ATTACHMENT_BAR_CLASS +E_IS_ATTACHMENT_BAR_CLASS +E_ATTACHMENT_BAR_GET_CLASS +EAttachmentBarClass +e_attachment_bar_get_type +<SUBSECTION Private> +EAttachmentBarPrivate +</SECTION> + +<SECTION> +<FILE>e-attachment-button</FILE> +<TITLE>EAttachmentButton</TITLE> +EAttachmentButton +e_attachment_button_new +e_attachment_button_get_view +e_attachment_button_get_attachment +e_attachment_button_set_attachment +e_attachment_button_get_expandable +e_attachment_button_set_expandable +e_attachment_button_get_expanded +e_attachment_button_set_expanded +<SUBSECTION Standard> +E_ATTACHMENT_BUTTON +E_IS_ATTACHMENT_BUTTON +E_TYPE_ATTACHMENT_BUTTON +E_ATTACHMENT_BUTTON_CLASS +E_IS_ATTACHMENT_BUTTON_CLASS +E_ATTACHMENT_BUTTON_GET_CLASS +EAttachmentButtonClass +e_attachment_button_get_type +<SUBSECTION Private> +EAttachmentButtonPrivate +</SECTION> + +<SECTION> +<FILE>e-attachment-dialog</FILE> +<TITLE>EAttachmentDialog</TITLE> +EAttachmentDialog +e_attachment_dialog_new +e_attachment_dialog_get_attachment +e_attachment_dialog_set_attachment +<SUBSECTION Standard> +E_ATTACHMENT_DIALOG +E_IS_ATTACHMENT_DIALOG +E_TYPE_ATTACHMENT_DIALOG +E_ATTACHMENT_DIALOG_CLASS +E_IS_ATTACHMENT_DIALOG_CLASS +E_ATTACHMENT_DIALOG_GET_CLASS +EAttachmentDialogClass +e_attachment_dialog_get_type +<SUBSECTION Private> +EAttachmentDialogPrivate +</SECTION> + +<SECTION> +<FILE>e-attachment-handler</FILE> +<TITLE>EAttachmentHandler</TITLE> +EAttachmentHandler +EAttachmentHandlerImage +EAttachmentHandlerSendto +e_attachment_handler_get_view +e_attachment_handler_get_drag_actions +e_attachment_handler_get_target_table +<SUBSECTION Standard> +E_ATTACHMENT_HANDLER +E_IS_ATTACHMENT_HANDLER +E_TYPE_ATTACHMENT_HANDLER +E_ATTACHMENT_HANDLER_CLASS +E_IS_ATTACHMENT_HANDLER_CLASS +E_ATTACHMENT_HANDLER_GET_CLASS +E_ATTACHMENT_HANDLER_IMAGE +E_IS_ATTACHMENT_HANDLER_IMAGE +E_TYPE_ATTACHMENT_HANDLER_IMAGE +E_ATTACHMENT_HANDLER_IMAGE_CLASS +E_IS_ATTACHMENT_HANDLER_IMAGE_CLASS +E_ATTACHMENT_HANDLER_IMAGE_GET_CLASS +E_ATTACHMENT_HANDLER_SENDTO +E_IS_ATTACHMENT_HANDLER_SENDTO +E_TYPE_ATTACHMENT_HANDLER_SENDTO +E_ATTACHMENT_HANDLER_SENDTO_CLASS +E_IS_ATTACHMENT_HANDLER_SENDTO_CLASS +E_ATTACHMENT_HANDLER_SENDTO_GET_CLASS +EAttachmentHandlerClass +EAttachmentHandlerImageClass +EAttachmentHandlerSendtoClass +e_attachment_handler_get_type +e_attachment_handler_image_get_type +e_attachment_handler_sendto_get_type +<SUBSECTION Private> +EAttachmentHandlerPrivate +EAttachmentHandlerImagePrivate +EAttachmentHandlerSendtoPrivate +</SECTION> + +<SECTION> +<FILE>e-attachment-icon-view</FILE> +<TITLE>EAttachmentIconView</TITLE> +EAttachmentIconView +e_attachment_icon_view_new +e_attachment_icon_view_set_default_icon_size +<SUBSECTION Standard> +E_ATTACHMENT_ICON_VIEW +E_IS_ATTACHMENT_ICON_VIEW +E_TYPE_ATTACHMENT_ICON_VIEW +E_ATTACHMENT_ICON_VIEW_CLASS +E_IS_ATTACHMENT_ICON_VIEW_CLASS +E_ATTACHMENT_ICON_VIEW_GET_CLASS +EAttachmentIconViewClass +e_attachment_icon_view_get_type +<SUBSECTION Private> +EAttachmentIconViewPrivate +</SECTION> + +<SECTION> +<FILE>e-attachment-paned</FILE> +<TITLE>EAttachmentPaned</TITLE> +EAttachmentPaned +e_attachment_paned_new +e_attachment_paned_get_content_area +e_attachment_paned_get_active_view +e_attachment_paned_set_active_view +e_attachment_paned_get_expanded +e_attachment_paned_set_expanded +e_attachment_paned_drag_data_received +e_attachment_paned_get_controls_container +e_attachment_paned_get_view_combo +e_attachment_paned_set_default_height +<SUBSECTION Standard> +E_ATTACHMENT_PANED +E_IS_ATTACHMENT_PANED +E_TYPE_ATTACHMENT_PANED +E_ATTACHMENT_PANED_CLASS +E_IS_ATTACHMENT_PANED_CLASS +E_ATTACHMENT_PANED_GET_CLASS +EAttachmentPanedClass +e_attachment_paned_get_type +<SUBSECTION Private> +EAttachmentPanedPrivate +</SECTION> + +<SECTION> +<FILE>e-attachment-store</FILE> +<TITLE>EAttachmentStore</TITLE> +EAttachmentStore +e_attachment_store_new +e_attachment_store_add_attachment +e_attachment_store_remove_attachment +e_attachment_store_add_to_multipart +e_attachment_store_get_attachments +e_attachment_store_get_num_attachments +e_attachment_store_get_num_loading +e_attachment_store_get_total_size +e_attachment_store_run_load_dialog +e_attachment_store_run_save_dialog +e_attachment_store_get_uris_async +e_attachment_store_get_uris_finish +e_attachment_store_load_async +e_attachment_store_load_finish +e_attachment_store_save_async +e_attachment_store_save_finish +<SUBSECTION Standard> +E_ATTACHMENT_STORE +E_IS_ATTACHMENT_STORE +E_TYPE_ATTACHMENT_STORE +E_ATTACHMENT_STORE_CLASS +E_IS_ATTACHMENT_STORE_CLASS +E_ATTACHMENT_STORE_GET_CLASS +EAttachmentStoreClass +e_attachment_store_get_type +<SUBSECTION Private> +EAttachmentStorePrivate +</SECTION> + +<SECTION> +<FILE>e-attachment-tree-view</FILE> +<TITLE>EAttachmentTreeView</TITLE> +EAttachmentTreeView +e_attachment_tree_view_new +<SUBSECTION Standard> +E_ATTACHMENT_TREE_VIEW +E_IS_ATTACHMENT_TREE_VIEW +E_TYPE_ATTACHMENT_TREE_VIEW +E_ATTACHMENT_TREE_VIEW_CLASS +E_IS_ATTACHMENT_TREE_VIEW_CLASS +E_ATTACHMENT_TREE_VIEW_GET_CLASS +EAttachmentTreeViewClass +e_attachment_tree_view_get_type +<SUBSECTION Private> +EAttachmentTreeViewPrivate +</SECTION> + +<SECTION> +<FILE>e-attachment-view</FILE> +<TITLE>EAttachmentView</TITLE> +EAttachmentView +e_attachment_view_init +e_attachment_view_dispose +e_attachment_view_finalize +e_attachment_view_get_private +e_attachment_view_get_store +e_attachment_view_get_editable +e_attachment_view_set_editable +e_attachment_view_get_target_list +e_attachment_view_get_drag_actions +e_attachment_view_get_selected_attachments +e_attachment_view_open_path +e_attachment_view_remove_selected +e_attachment_view_button_press_event +e_attachment_view_button_release_event +e_attachment_view_motion_notify_event +e_attachment_view_key_press_event +e_attachment_view_get_path_at_pos +e_attachment_view_get_selected_paths +e_attachment_view_path_is_selected +e_attachment_view_select_path +e_attachment_view_unselect_path +e_attachment_view_select_all +e_attachment_view_unselect_all +e_attachment_view_sync_selection +e_attachment_view_drag_source_set +e_attachment_view_drag_source_unset +e_attachment_view_drag_begin +e_attachment_view_drag_end +e_attachment_view_drag_data_get +e_attachment_view_drag_dest_set +e_attachment_view_drag_dest_unset +e_attachment_view_drag_motion +e_attachment_view_drag_drop +e_attachment_view_drag_data_received +e_attachment_view_get_action +e_attachment_view_add_action_group +e_attachment_view_get_action_group +e_attachment_view_get_popup_menu +e_attachment_view_get_ui_manager +e_attachment_view_show_popup_menu +e_attachment_view_update_actions +<SUBSECTION Standard> +E_ATTACHMENT_VIEW +E_IS_ATTACHMENT_VIEW +E_TYPE_ATTACHMENT_VIEW +E_ATTACHMENT_VIEW_IFACE +E_IS_ATTACHMENT_VIEW_IFACE +E_ATTACHMENT_VIEW_GET_IFACE +EAttachmentViewIface +e_attachment_view_get_type +<SUBSECTION Private> +EAttachmentViewPrivate +</SECTION> + +<SECTION> +<FILE>e-auth-combo-box</FILE> +<TITLE>EAuthComboBox</TITLE> +EAuthComboBox +e_auth_combo_box_new +e_auth_combo_box_get_provider +e_auth_combo_box_set_provider +e_auth_combo_box_update_available +<SUBSECTION Standard> +E_AUTH_COMBO_BOX +E_IS_AUTH_COMBO_BOX +E_TYPE_AUTH_COMBO_BOX +E_AUTH_COMBO_BOX_CLASS +E_IS_AUTH_COMBO_BOX_CLASS +E_AUTH_COMBO_BOX_GET_CLASS +EAuthComboBoxClass +e_auth_combo_box_get_type +<SUBSECTION Private> +EAuthComboBoxPrivate +</SECTION> + +<SECTION> +<FILE>e-autocomplete-selector</FILE> +<TITLE>EAutocompleteSelector</TITLE> +EAutocompleteSelector +e_autocomplete_selector_new +<SUBSECTION Standard> +E_AUTOCOMPLETE_SELECTOR +E_IS_AUTOCOMPLETE_SELECTOR +E_TYPE_AUTOCOMPLETE_SELECTOR +E_AUTOCOMPLETE_SELECTOR_CLASS +E_IS_AUTOCOMPLETE_SELECTOR_CLASS +E_AUTOCOMPLETE_SELECTOR_GET_CLASS +EAutocompleteSelectorClass +e_autocomplete_selector_get_type +<SUBSECTION Private> +EAutocompleteSelectorPrivate +</SECTION> + +<SECTION> +<FILE>e-bit-array</FILE> +<TITLE>Bit Arrays (Legacy)</TITLE> +EBitArray +e_bit_array_new +e_bit_array_value_at +e_bit_array_foreach +e_bit_array_selected_count +e_bit_array_select_all +e_bit_array_invert_selection +e_bit_array_bit_count +e_bit_array_change_one_row +e_bit_array_change_range +e_bit_array_select_single_row +e_bit_array_toggle_single_row +e_bit_array_insert +e_bit_array_delete +e_bit_array_delete_single_mode +e_bit_array_move_row +<SUBSECTION Standard> +E_BIT_ARRAY +E_IS_BIT_ARRAY +E_BIT_ARRAY_TYPE +E_BIT_ARRAY_CLASS +E_IS_BIT_ARRAY_CLASS +EBitArrayClass +e_bit_array_get_type +</SECTION> + +<SECTION> +<FILE>e-book-source-config</FILE> +<TITLE>EBookSourceConfig</TITLE> +EBookSourceConfig +e_book_source_config_new +e_book_source_config_add_offline_toggle +<SUBSECTION Standard> +E_BOOK_SOURCE_CONFIG +E_IS_BOOK_SOURCE_CONFIG +E_TYPE_BOOK_SOURCE_CONFIG +E_BOOK_SOURCE_CONFIG_CLASS +E_IS_BOOK_SOURCE_CONFIG_CLASS +E_BOOK_SOURCE_CONFIG_GET_CLASS +EBookSourceConfigClass +e_book_source_config_get_type +<SUBSECTION Private> +EBookSourceConfigPrivate +</SECTION> + +<SECTION> +<FILE>e-cal-source-config</FILE> +<TITLE>ECalSourceConfig</TITLE> +ECalSourceConfig +e_cal_source_config_new +e_cal_source_config_get_source_type +e_cal_source_config_add_offline_toggle +<SUBSECTION Standard> +E_CAL_SOURCE_CONFIG +E_IS_CAL_SOURCE_CONFIG +E_TYPE_CAL_SOURCE_CONFIG +E_CAL_SOURCE_CONFIG_CLASS +E_IS_CAL_SOURCE_CONFIG_CLASS +E_CAL_SOURCE_CONFIG_GET_CLASS +ECalSourceConfigClass +e_cal_source_config_get_type +<SUBSECTION Private> +ECalSourceConfigPrivate +</SECTION> + +<SECTION> +<FILE>e-calendar</FILE> +<TITLE>ECalendar</TITLE> +ECalendar +e_calendar_new +e_calendar_set_minimum_size +e_calendar_set_maximum_size +e_calendar_get_border_size +e_calendar_set_focusable +<SUBSECTION Standard> +E_CALENDAR +E_IS_CALENDAR +E_TYPE_CALENDAR +E_CALENDAR_CLASS +E_IS_CALENDAR_CLASS +E_CALENDAR_GET_CLASS +ECalendarClass +e_calendar_get_type +</SECTION> + +<SECTION> +<FILE>e-calendar-item</FILE> +<TITLE>ECalendarItem</TITLE> +E_CALENDAR_ITEM_YPAD_ABOVE_MONTH_NAME +E_CALENDAR_ITEM_YPAD_BELOW_MONTH_NAME +E_CALENDAR_ITEM_MARK_BOLD +E_CALENDAR_ITEM_MARK_ITALIC +E_CALENDAR_ITEM_MIN_CELL_XPAD +E_CALENDAR_ITEM_MIN_CELL_YPAD +E_CALENDAR_ITEM_YPAD_ABOVE_DAY_LETTERS +E_CALENDAR_ITEM_YPAD_BELOW_DAY_LETTERS +E_CALENDAR_ITEM_YPAD_ABOVE_CELLS +E_CALENDAR_ITEM_YPAD_BELOW_CELLS +E_CALENDAR_ITEM_XPAD_BEFORE_MONTH_NAME_WITH_BUTTON +E_CALENDAR_ITEM_XPAD_BEFORE_MONTH_NAME +E_CALENDAR_ITEM_XPAD_AFTER_MONTH_NAME +E_CALENDAR_ITEM_XPAD_AFTER_MONTH_NAME_WITH_BUTTON +E_CALENDAR_ITEM_XPAD_BEFORE_WEEK_NUMBERS +E_CALENDAR_ITEM_XPAD_AFTER_WEEK_NUMBERS +E_CALENDAR_ITEM_XPAD_BEFORE_CELLS +E_CALENDAR_ITEM_XPAD_AFTER_CELLS +ECalendarItemColors +ECalendarItem +e_calendar_item_get_first_month +e_calendar_item_set_first_month +e_calendar_item_get_max_days_sel +e_calendar_item_set_max_days_sel +e_calendar_item_get_days_start_week_sel +e_calendar_item_set_days_start_week_sel +e_calendar_item_get_display_popup +e_calendar_item_set_display_popup +e_calendar_item_get_date_range +e_calendar_item_get_selection +e_calendar_item_set_selection +e_calendar_item_clear_marks +e_calendar_item_mark_day +e_calendar_item_mark_days +ECalendarItemStyleCallback +e_calendar_item_set_style_callback +ECalendarItemGetTimeCallback +e_calendar_item_set_get_time_callback +e_calendar_item_normalize_date +e_calendar_item_get_week_number +e_calendar_item_style_set +<SUBSECTION Standard> +E_CALENDAR_ITEM +E_IS_CALENDAR_ITEM +E_TYPE_CALENDAR_ITEM +E_CALENDAR_ITEM_CLASS +E_IS_CALENDAR_ITEM_CLASS +E_CALENDAR_ITEM_GET_CLASS +ECalendarItemClass +e_calendar_item_get_type +</SECTION> + +<SECTION> +<FILE>e-canvas</FILE> +<TITLE>ECanvas</TITLE> +ECanvasItemSelectionFunc +ECanvasItemSelectionCompareFunc +ECanvasSelectionInfo +ECanvas +e_canvas_new +e_canvas_item_grab_focus +e_canvas_item_request_reflow +e_canvas_item_request_parent_reflow +ECanvasItemReflowFunc +e_canvas_item_set_reflow_callback +ECanvasItemGrabCancelled +e_canvas_item_grab +e_canvas_item_ungrab +<SUBSECTION Standard> +E_CANVAS +E_IS_CANVAS +E_TYPE_CANVAS +E_CANVAS_CLASS +E_IS_CANVAS_CLASS +E_TYPE_CANVAS_CLASS +ECanvasClass +e_canvas_get_type +</SECTION> + +<SECTION> +<FILE>e-canvas-background</FILE> +<TITLE>ECanvasBackground</TITLE> +ECanvasBackground +<SUBSECTION Standard> +E_CANVAS_BACKGROUND +E_IS_CANVAS_BACKGROUND +E_TYPE_CANVAS_BACKGROUND +E_CANVAS_BACKGROUND_CLASS +E_IS_CANVAS_BACKGROUND_CLASS +E_CANVAS_BACKGROUND_GET_CLASS +ECanvasBackgroundClass +e_canvas_background_get_type +<SUBSECTION Private> +ECanvasBackgroundPrivate +</SECTION> + +<SECTION> +<FILE>e-canvas-vbox</FILE> +<TITLE>ECanvasVbox</TITLE> +ECanvasVbox +e_canvas_vbox_add_item +e_canvas_vbox_add_item_start +<SUBSECTION Standard> +E_CANVAS_VBOX +E_IS_CANVAS_VBOX +E_TYPE_CANVAS_VBOX +E_CANVAS_VBOX_CLASS +E_IS_CANVAS_VBOX_CLASS +E_CANVAS_VBOX_GET_CLASS +ECanvasVboxClass +e_canvas_vbox_get_type +</SECTION> + +<SECTION> +<FILE>e-categories-config</FILE> +<TITLE>Categories</TITLE> +e_categories_config_get_icon_for +e_categories_config_open_dialog_for_entry +</SECTION> + +<SECTION> +<FILE>e-categories-dialog</FILE> +<TITLE>ECategoriesDialog</TITLE> +ECategoriesDialog +e_categories_dialog_new +e_categories_dialog_get_categories +e_categories_dialog_set_categories +<SUBSECTION Standard> +E_CATEGORIES_DIALOG +E_IS_CATEGORIES_DIALOG +E_TYPE_CATEGORIES_DIALOG +E_CATEGORIES_DIALOG_CLASS +E_IS_CATEGORIES_DIALOG_CLASS +E_CATEGORIES_DIALOG_GET_CLASS +ECategoriesDialogClass +e_categories_dialog_get_type +<SUBSECTION Private> +ECategoriesDialogPrivate +</SECTION> + +<SECTION> +<FILE>e-categories-editor</FILE> +<TITLE>ECategoriesEditor</TITLE> +ECategoriesEditor +e_categories_editor_new +e_categories_editor_get_categories +e_categories_editor_set_categories +e_categories_editor_get_entry_visible +e_categories_editor_set_entry_visible +<SUBSECTION Standard> +E_CATEGORIES_EDITOR +E_IS_CATEGORIES_EDITOR +E_TYPE_CATEGORIES_EDITOR +E_CATEGORIES_EDITOR_CLASS +E_IS_CATEGORIES_EDITOR_CLASS +E_CATEGORIES_EDITOR_GET_CLASS +ECategoriesEditorClass +e_categories_editor_get_type +<SUBSECTION Private> +ECategoriesEditorPrivate +</SECTION> + +<SECTION> +<FILE>e-categories-selector</FILE> +<TITLE>ECategoriesSelector</TITLE> +ECategoriesSelector +e_categories_selector_new +e_categories_selector_get_checked +e_categories_selector_set_checked +e_categories_selector_get_items_checkable +e_categories_selector_set_items_checkable +e_categories_selector_delete_selection +e_categories_selector_get_selected +<SUBSECTION Standard> +E_CATEGORIES_SELECTOR +E_IS_CATEGORIES_SELECTOR +E_TYPE_CATEGORIES_SELECTOR +E_CATEGORIES_SELECTOR_CLASS +E_IS_CATEGORIES_SELECTOR_CLASS +E_CATEGORIES_SELECTOR_GET_CLASS +ECategoriesSelectorClass +e_categories_selector_get_type +<SUBSECTION Private> +ECategoriesSelectorPrivate +</SECTION> + +<SECTION> +<FILE>e-category-completion</FILE> +<TITLE>ECategoryCompletion</TITLE> +ECategoryCompletion +e_category_completion_new +<SUBSECTION Standard> +E_TYPE_CATEGORY_COMPLETION +E_CATEGORY_COMPLETION +E_CATEGORY_COMPLETION_CLASS +E_IS_CATEGORY_COMPLETION +E_IS_CATEGORY_COMPLETION_CLASS +E_CATEGORY_COMPLETION_GET_CLASS +ECategoryCompletionClass +e_category_completion_get_type +<SUBSECTION Private> +ECategoryCompletionPrivate +</SECTION> + +<SECTION> +<FILE>e-category-editor</FILE> +<TITLE>ECategoryEditor</TITLE> +ECategoryEditor +e_category_editor_new +e_category_editor_create_category +e_category_editor_edit_category +<SUBSECTION Standard> +E_CATEGORY_EDITOR +E_IS_CATEGORY_EDITOR +E_TYPE_CATEGORY_EDITOR +E_CATEGORY_EDITOR_CLASS +E_IS_CATEGORY_EDITOR_CLASS +E_CATEGORY_EDITOR_GET_CLASS +ECategoryEditorClass +e_category_editor_get_type +<SUBSECTION Private> +ECategoryEditorPrivate +</SECTION> + +<SECTION> +<FILE>e-cell-renderer-color</FILE> +<TITLE>ECellRendererColor</TITLE> +ECellRendererColor +e_cell_renderer_color_new +<SUBSECTION Standard> +E_TYPE_CELL_RENDERER_COLOR +E_CELL_RENDERER_COLOR +E_CELL_RENDERER_COLOR_CLASS +E_IS_CELL_RENDERER_COLOR +E_IS_CELL_RENDERER_COLOR_CLASS +E_CELL_RENDERER_COLOR_GET_CLASS +ECellRendererColorClass +e_cell_renderer_color_get_type +<SUBSECTION Private> +ECellRendererColorPrivate +</SECTION> + +<SECTION> +<FILE>e-charset-combo-box</FILE> +<TITLE>ECharsetComboBox</TITLE> +ECharsetComboBox +e_charset_combo_box_new +e_charset_combo_box_get_charset +e_charset_combo_box_set_charset +<SUBSECTION Standard> +E_CHARSET_COMBO_BOX +E_IS_CHARSET_COMBO_BOX +E_TYPE_CHARSET_COMBO_BOX +E_CHARSET_COMBO_BOX_CLASS +E_IS_CHARSET_COMBO_BOX_CLASS +E_CHARSET_COMBO_BOX_GET_CLASS +ECharsetComboBoxClass +e_charset_combo_box_get_type +<SUBSECTION Private> +ECharsetComboBoxPrivate +</SECTION> + +<SECTION> +<FILE>e-client-utils</FILE> +<TITLE>EClient Utilities</TITLE> +EClientSourceType +e_client_utils_new +e_client_utils_open_new +e_client_utils_open_new_finish +</SECTION> + +<SECTION> +<FILE>e-contact-store</FILE> +<TITLE>EContactStore</TITLE> +EContactStore +e_contact_store_new +e_contact_store_get_client +e_contact_store_get_contact +e_contact_store_find_contact +e_contact_store_get_clients +e_contact_store_add_client +e_contact_store_remove_client +e_contact_store_set_query +e_contact_store_peek_query +<SUBSECTION Standard> +E_CONTACT_STORE +E_IS_CONTACT_STORE +E_TYPE_CONTACT_STORE +E_CONTACT_STORE_CLASS +E_IS_CONTACT_STORE_CLASS +E_CONTACT_STORE_GET_CLASS +EContactStoreClass +e_contact_store_get_type +<SUBSECTION Private> +EContactStorePrivate +</SECTION> + +<SECTION> +<FILE>e-date-edit</FILE> +<TITLE>EDateEdit</TITLE> +EDateEditGetTimeCallback +e_date_edit_new +e_date_edit_set_editable +e_date_edit_date_is_valid +e_date_edit_time_is_valid +e_date_edit_get_time +e_date_edit_set_time +e_date_edit_get_date +e_date_edit_set_date +e_date_edit_get_time_of_day +e_date_edit_set_time_of_day +e_date_edit_set_date_and_time_of_day +e_date_edit_get_show_date +e_date_edit_set_show_date +e_date_edit_get_show_time +e_date_edit_set_show_time +e_date_edit_get_week_start_day +e_date_edit_set_week_start_day +e_date_edit_get_show_week_numbers +e_date_edit_set_show_week_numbers +e_date_edit_get_use_24_hour_format +e_date_edit_set_use_24_hour_format +e_date_edit_get_allow_no_date_set +e_date_edit_set_allow_no_date_set +e_date_edit_get_time_popup_range +e_date_edit_set_time_popup_range +e_date_edit_get_make_time_insensitive +e_date_edit_set_make_time_insensitive +e_date_edit_get_twodigit_year_can_future +e_date_edit_set_twodigit_year_can_future +e_date_edit_set_get_time_callback +e_date_edit_get_entry +<SUBSECTION Standard> +E_DATE_EDIT +E_IS_DATE_EDIT +E_TYPE_DATE_EDIT +E_DATE_EDIT_CLASS +E_IS_DATE_EDIT_CLASS +E_DATE_EDIT_GET_CLASS +EDateEditClass +e_date_edit_get_type +<SUBSECTION Private> +EDateEditPrivate +</SECTION> + +<SECTION> +<FILE>e-datetime-format</FILE> +<TITLE>Date and Time Formatting</TITLE> +DTFormatKind +e_datetime_format_add_setup_widget +e_datetime_format_format +e_datetime_format_format_tm +</SECTION> + +<SECTION> +<FILE>e-destination-store</FILE> +<TITLE>EDestinationStore</TITLE> +EDestinationStore +EDestinationStoreColumnType +e_destination_store_new +e_destination_store_get_destination +e_destination_store_list_destinations +e_destination_store_insert_destination +e_destination_store_append_destination +e_destination_store_remove_destination +e_destination_store_remove_destination_nth +e_destination_store_get_destination_count +e_destination_store_get_path +e_destination_store_get_stamp +<SUBSECTION Standard> +E_DESTINATION_STORE +E_IS_DESTINATION_STORE +E_TYPE_DESTINATION_STORE +E_DESTINATION_STORE_CLASS +E_IS_DESTINATION_STORE_CLASS +E_DESTINATION_STORE_GET_CLASS +EDestinationStoreClass +e_destination_store_get_type +<SUBSECTION Private> +EDestinationStorePrivate +</SECTION> + +<SECTION> +<FILE>e-dialog-utils</FILE> +<TITLE>Dialog Utilities (Legacy)</TITLE> +e_notice +e_dialog_combo_box_set +e_dialog_combo_box_get +</SECTION> + +<SECTION> +<FILE>e-file-request</FILE> +<TITLE>EFileRequest</TITLE> +EFileRequest +<SUBSECTION Standard> +E_FILE_REQUEST +E_IS_FILE_REQUEST +E_TYPE_FILE_REQUEST +E_FILE_REQUEST_CLASS +E_IS_FILE_REQUEST_CLASS +E_FILE_REQUEST_GET_CLASS +EFileRequestClass +e_file_request_get_type +<SUBSECTION Private> +EFileRequestPrivate +</SECTION> + +<SECTION> +<FILE>e-filter-code</FILE> +<TITLE>EFilterCode</TITLE> +EFilterCode +e_filter_code_new +<SUBSECTION Standard> +E_FILTER_CODE +E_IS_FILTER_CODE +E_TYPE_FILTER_CODE +E_FILTER_CODE_CLASS +E_IS_FILTER_CODE_CLASS +E_FILTER_CODE_GET_CLASS +EFilterCodeClass +e_filter_code_get_type +<SUBSECTION Private> +EFilterCodePrivate +</SECTION> + +<SECTION> +<FILE>e-filter-color</FILE> +<TITLE>EFilterColor</TITLE> +EFilterColor +e_filter_color_new +<SUBSECTION Standard> +E_FILTER_COLOR +E_IS_FILTER_COLOR +E_TYPE_FILTER_COLOR +E_FILTER_COLOR_CLASS +E_IS_FILTER_COLOR_CLASS +E_FILTER_COLOR_GET_CLASS +EFilterColorClass +e_filter_color_get_type +<SUBSECTION Private> +EFilterColorPrivate +</SUBSECTION> + +<SECTION> +<FILE>e-filter-datespec</FILE> +<TITLE>EFilterDatespec</TITLE> +EFilterDatespec +EFilterDatespecType +e_filter_datespec_new +<SUBSECTION Standard> +E_FILTER_DATESPEC +E_IS_FILTER_DATESPEC +E_TYPE_FILTER_DATESPEC +E_FILTER_DATESPEC_CLASS +E_IS_FILTER_DATESPEC_CLASS +E_FILTER_DATESPEC_GET_CLASS +EFilterDatespecClass +e_filter_datespec_get_type +<SUBSECTION Private> +EFilterDatespecPrivate +</SUBSECTION> + +<SECTION> +<FILE>e-filter-element</FILE> +<TITLE>EFilterElement</TITLE> +EFilterElement +e_filter_element_new +e_filter_element_set_data +e_filter_element_validate +e_filter_element_eq +e_filter_element_xml_create +e_filter_element_xml_encode +e_filter_element_xml_decode +e_filter_element_clone +e_filter_element_copy_value +e_filter_element_get_widget +e_filter_element_build_code +e_filter_element_format_sexp +<SUBSECTION Standard> +E_FILTER_ELEMENT +E_IS_FILTER_ELEMENT +E_TYPE_FILTER_ELEMENT +E_FILTER_ELEMENT_CLASS +E_IS_FILTER_ELEMENT_CLASS +E_FILTER_ELEMENT_GET_CLASS +EFilterElementClass +e_filter_element_get_type +<SUBSECTION Private> +EFilterElementPrivate +</SECTION> + +<SECTION> +<FILE>e-filter-file</FILE> +<TITLE>EFilterFile</TITLE> +EFilterFile +e_filter_file_new +e_filter_file_new_type_name +e_filter_file_set_path +<SUBSECTION Standard> +E_FILTER_FILE +E_IS_FILTER_FILE +E_TYPE_FILTER_FILE +E_FILTER_FILE_CLASS +E_IS_FILTER_FILE_CLASS +E_FILTER_FILE_GET_CLASS +EFilterFileClass +e_filter_file_get_type +<SUBSECTION Private> +EFilterFilePrivate +</SECTION> + +<SECTION> +<FILE>e-filter-input</FILE> +<TITLE>EFilterInput</TITLE> +EFilterInput +e_filter_input_new +e_filter_input_new_type_name +e_filter_input_set_value +<SUBSECTION Standard> +E_FILTER_INPUT +E_IS_FILTER_INPUT +E_TYPE_FILTER_INPUT +E_FILTER_INPUT_CLASS +E_IS_FILTER_INPUT_CLASS +E_TYPE_FILTER_INPUT_CLASS +EFilterInputClass +e_filter_input_get_type +<SUBSECTION Private> +EFilterInputPrivate +</SECTION> + +<SECTION> +<FILE>e-filter-int</FILE> +<TITLE>EFilterInt</TITLE> +EFilterInt +e_filter_int_new +e_filter_int_new_type +e_filter_int_set_value +<SUBSECTION Standard> +E_FILTER_INT +E_IS_FILTER_INT +E_TYPE_FILTER_INT +E_FILTER_INT_CLASS +E_IS_FILTER_INT_CLASS +E_FILTER_INT_GET_CLASS +EFilterIntClass +e_filter_int_get_type +<SUBSECTION Private> +EFilterIntPrivate +</SECTION> + +<SECTION> +<FILE>e-filter-option</FILE> +<TITLE>EFilterOption</TITLE> +EFilterOption +e_filter_option_new +e_filter_option_set_current +e_filter_option_get_current +e_filter_option_add +e_filter_option_remove_all +<SUBSECTION Standard> +E_FILTER_OPTION +E_IS_FILTER_OPTION +E_TYPE_FILTER_OPTION +E_FILTER_OPTION_CLASS +E_IS_FILTER_OPTION_CLASS +E_FILTER_OPTION_GET_CLASS +EFilterOptionClass +e_filter_option_get_type +<SUBSECTION Private> +EFilterOptionPrivate +</SECTION> + +<SECTION> +<FILE>e-filter-part</FILE> +<TITLE>EFilterPart</TITLE> +EFilterPart +e_filter_part_new +e_filter_part_validate +e_filter_part_eq +e_filter_part_xml_create +e_filter_part_xml_encode +e_filter_part_xml_decode +e_filter_part_clone +e_filter_part_copy_values +e_filter_part_find_element +e_filter_part_get_widget +e_filter_part_build_code +e_filter_part_expand_code +e_filter_part_build_code_list +e_filter_part_find_list +e_filter_part_next_list +<SUBSECTION Standard> +E_FILTER_PART +E_IS_FILTER_PART +E_TYPE_FILTER_PART +E_FILTER_PART_CLASS +E_IS_FILTER_PART_CLASS +E_FILTER_PART_GET_CLASS +EFilterPartClass +e_filter_part_get_type +<SUBSECTION Private> +EFilterPartPrivate +</SECTION> + +<SECTION> +<FILE>e-filter-rule</FILE> +<TITLE>EFilterRule</TITLE> +EFilterRule +e_filter_rule_new +e_filter_rule_clone +e_filter_rule_set_name +E_FILTER_SOURCE_INCOMING +E_FILTER_SOURCE_DEMAND +E_FILTER_SOURCE_OUTGOING +E_FILTER_SOURCE_JUNKTEST +e_filter_rule_set_source +e_filter_rule_validate +e_filter_rule_eq +e_filter_rule_xml_encode +e_filter_rule_xml_decode +e_filter_rule_copy +e_filter_rule_add_part +e_filter_rule_remove_part +e_filter_rule_replace_part +e_filter_rule_get_widget +e_filter_rule_build_code +e_filter_rule_emit_changed +e_filter_rule_next_list +e_filter_rule_find_list +<SUBSECTION Standard> +E_FILTER_RULE +E_IS_FILTER_RULE +E_TYPE_FILTER_RULE +E_FILTER_RULE_CLASS +E_IS_FILTER_RULE_CLASS +E_FILTER_RULE_GET_CLASS +EFilterRuleClass +e_filter_rule_get_type +<SUBSECTION Private> +EFilterRulePrivate +</SECTION> + +<SECTION> +<FILE>e-focus-tracker</FILE> +<TITLE>EFocusTracker</TITLE> +EFocusTracker +e_focus_tracker_new +e_focus_tracker_get_focus +e_focus_tracker_get_window +e_focus_tracker_get_cut_clipboard_action +e_focus_tracker_set_cut_clipboard_action +e_focus_tracker_get_copy_clipboard_action +e_focus_tracker_set_copy_clipboard_action +e_focus_tracker_get_paste_clipboard_action +e_focus_tracker_set_paste_clipboard_action +e_focus_tracker_get_delete_selection_action +e_focus_tracker_set_delete_selection_action +e_focus_tracker_get_select_all_action +e_focus_tracker_set_select_all_action +e_focus_tracker_update_actions +e_focus_tracker_cut_clipboard +e_focus_tracker_copy_clipboard +e_focus_tracker_paste_clipboard +e_focus_tracker_delete_selection +e_focus_tracker_select_all +<SUBSECTION Standard> +E_FOCUS_TRACKER +E_IS_FOCUS_TRACKER +E_TYPE_FOCUS_TRACKER +E_FOCUS_TRACKER_CLASS +E_IS_FOCUS_TRACKER_CLASS +E_FOCUS_TRACKER_GET_CLASS +EFocusTrackerClass +e_focus_tracker_get_type +<SUBSECTION Private> +EFocusTrackerPrivate +</SECTION> + +<SECTION> +<FILE>e-html-utils</FILE> +<TITLE>Text to HTML Conversion</TITLE> +E_TEXT_TO_HTML_PRE +E_TEXT_TO_HTML_CONVERT_NL +E_TEXT_TO_HTML_CONVERT_SPACES +E_TEXT_TO_HTML_CONVERT_URLS +E_TEXT_TO_HTML_MARK_CITATION +E_TEXT_TO_HTML_CONVERT_ADDRESSES +E_TEXT_TO_HTML_ESCAPE_8BIT +E_TEXT_TO_HTML_CITE +e_text_to_html_full +e_text_to_html +</SECTION> + +<SECTION> +<FILE>e-icon-factory</FILE> +<TITLE>Icon Utilities (Legacy)</TITLE> +e_icon_factory_get_icon_filename +e_icon_factory_get_icon +e_icon_factory_pixbuf_scale +e_icon_factory_create_thumbnail +</SECTION> + +<SECTION> +<FILE>e-mail-identity-combo-box</FILE> +<TITLE>EMailIdentityComboBox</TITLE> +EMailIdentityComboBox +e_mail_identity_combo_box_new +e_mail_identity_combo_box_refresh +e_mail_identity_combo_box_get_registry +<SUBSECTION Standard> +E_MAIL_IDENTITY_COMBO_BOX +E_IS_MAIL_IDENTITY_COMBO_BOX +E_TYPE_MAIL_IDENTITY_COMBO_BOX +E_MAIL_IDENTITY_COMBO_BOX_CLASS +E_IS_MAIL_IDENTITY_COMBO_BOX_CLASS +E_MAIL_IDENTITY_COMBO_BOX_GET_CLASS +EMailIdentityComboBoxClass +e_mail_identity_combo_box_get_type +<SUBSECTION Private> +EMailIdentityComboBoxPrivate +</SECTION> + +<SECTION> +<FILE>e-misc-utils</FILE> +<TITLE>Miscellaneous Utilities</TITLE> +e_get_accels_filename +e_show_uri +e_display_help +e_lookup_action +e_lookup_action_group +e_action_compare_by_label +e_action_group_remove_all_actions +e_radio_action_get_current_action +e_categories_add_change_hook +e_str_without_underscores +e_str_compare +e_str_case_compare +e_collate_compare +e_int_compare +e_color_to_value +e_format_number +ESortCompareFunc +e_bsearch +e_strftime_fix_am_pm +e_utf8_strftime_fix_am_pm +e_get_month_name +e_get_weekday_name +e_flexible_strtod +e_ascii_dtostr +e_file_lock_create +e_file_lock_destroy +e_file_lock_exists +e_util_guess_mime_type +e_util_get_category_filter_options +e_binding_transform_color_to_string +e_binding_transform_string_to_color +e_binding_transform_source_to_uid +e_binding_transform_uid_to_source +e_charset_add_radio_actions +e_file_replace_contents_async +e_file_replace_contents_finish +e_mktemp +e_mkstemp +e_mkdtemp +</SECTION> + +<SECTION> +<FILE>e-name-selector</FILE> +<TITLE>ENameSelector</TITLE> +ENameSelector +e_name_selector_new +e_name_selector_get_registry +e_name_selector_peek_model +e_name_selector_peek_dialog +e_name_selector_peek_section_entry +e_name_selector_peek_section_list +e_name_selector_show_dialog +e_name_selector_load_books +e_name_selector_cancel_loading +<SUBSECTION Standard> +E_NAME_SELECTOR +E_IS_NAME_SELECTOR +E_TYPE_NAME_SELECTOR +E_NAME_SELECTOR_CLASS +E_IS_NAME_SELECTOR_CLASS +E_NAME_SELECTOR_GET_CLASS +ENameSelectorClass +e_name_selector_get_type +<SUBSECTION Private> +ENameSelectorPrivate +</SECTION> + +<SECTION> +<FILE>e-name-selector-dialog</FILE> +<TITLE>ENameSelectorDialog</TITLE> +ENameSelectorDialog +e_name_selector_dialog_new +e_name_selector_dialog_get_registry +e_name_selector_dialog_peek_model +e_name_selector_dialog_set_model +e_name_selector_dialog_set_destination_index +e_name_selector_dialog_set_scrolling_policy +e_name_selector_dialog_get_section_visible +e_name_selector_dialog_set_section_visible +<SUBSECTION Standard> +E_NAME_SELECTOR_DIALOG +E_IS_NAME_SELECTOR_DIALOG +E_TYPE_NAME_SELECTOR_DIALOG +E_NAME_SELECTOR_DIALOG_CLASS +E_IS_NAME_SELECTOR_DIALOG_CLASS +E_NAME_SELECTOR_DIALOG_GET_CLASS +ENameSelectorDialogClass +e_name_selector_dialog_get_type +<SUBSECTION Private> +ENameSelectorDialogPrivate +</SECTION> + +<SECTION> +<FILE>e-name-selector-entry</FILE> +<TITLE>ENameSelectorEntry</TITLE> +ENameSelectorEntry +e_name_selector_entry_new +e_name_selector_entry_get_registry +e_name_selector_entry_set_registry +e_name_selector_entry_get_minimum_query_length +e_name_selector_entry_set_minimum_query_length +e_name_selector_entry_get_show_address +e_name_selector_entry_set_show_address +e_name_selector_entry_peek_contact_store +e_name_selector_entry_set_contact_store +e_name_selector_entry_peek_destination_store +e_name_selector_entry_set_destination_store +e_name_selector_entry_get_popup_destination +e_name_selector_entry_set_contact_editor_func +e_name_selector_entry_set_contact_list_editor_func +ens_util_populate_user_query_fields +<SUBSECTION Standard> +E_NAME_SELECTOR_ENTRY +E_IS_NAME_SELECTOR_ENTRY +E_TYPE_NAME_SELECTOR_ENTRY +E_NAME_SELECTOR_ENTRY_CLASS +E_IS_NAME_SELECTOR_ENTRY_CLASS +E_NAME_SELECTOR_ENTRY_GET_CLASS +ENameSelectorEntryClass +e_name_selector_entry_get_type +<SUBSECTION Private> +ENameSelectorEntryPrivate +</SECTION> + +<SECTION> +<FILE>e-name-selector-list</FILE> +<TITLE>ENameSelectorList</TITLE> +ENameSelectorList +e_name_selector_list_new +e_name_selector_list_expand_clicked +<SUBSECTION Standard> +E_NAME_SELECTOR_LIST +E_IS_NAME_SELECTOR_LIST +E_TYPE_NAME_SELECTOR_LIST +E_NAME_SELECTOR_LIST_CLASS +E_IS_NAME_SELECTOR_LIST_CLASS +E_NAME_SELECTOR_LIST_GET_CLASS +ENameSelectorListClass +e_name_selector_list_get_type +<SUBSECTION Private> +ENameSelectorListPrivate +</SECTION> + +<SECTION> +<FILE>e-name-selector-model</FILE> +<TITLE>ENameSelectorModel</TITLE> +ENameSelectorModel +e_name_selector_model_new +e_name_selector_model_peek_contact_store +e_name_selector_model_peek_contact_filter +e_name_selector_model_list_sections +e_name_selector_model_peek_section +e_name_selector_model_add_section +e_name_selector_model_remove_section +e_name_selector_model_get_contact_emails_without_used +e_name_selector_model_free_emails_list +<SUBSECTION Standard> +E_NAME_SELECTOR_MODEL +E_IS_NAME_SELECTOR_MODEL +E_TYPE_NAME_SELECTOR_MODEL +E_NAME_SELECTOR_MODEL_CLASS +E_IS_NAME_SELECTOR_MODEL_CLASS +E_NAME_SELECTOR_MODEL_GET_CLASS +ENameSelectorModelClass +e_name_selector_model_get_type +<SUBSECTION Private> +ENameSelectorModelPrivate +</SECTION> + +<SECTION> +<FILE>e-passwords</FILE> +<TITLE>Password Utilities (Legacy)</TITLE> +e_passwords_init +e_passwords_shutdown +e_passwords_cancel +e_passwords_set_online +e_passwords_remember_password +e_passwords_add_password +e_passwords_get_password +e_passwords_forget_password +e_passwords_forget_passwords +e_passwords_clear_passwords +EPasswordsRememberType +e_passwords_ask_password +</SECTION> + +<SECTION> +<FILE>e-poolv</FILE> +<TITLE>EPoolv</TITLE> +EPoolv +e_poolv_new +e_poolv_set +e_poolv_get +e_poolv_destroy +</SECTION> + +<SECTION> +<FILE>e-popup-action</FILE> +<TITLE>EPopupAction</TITLE> +EPopupAction +e_popup_action_new +EPopupActionEntry +e_action_group_add_popup_actions +<SUBSECTION Standard> +E_POPUP_ACTION +E_IS_POPUP_ACTION +E_TYPE_POPUP_ACTION +E_POPUP_ACTION_CLASS +E_IS_POPUP_ACTION_CLASS +E_POPUP_ACTION_GET_CLASS +EPopupActionClass +e_popup_action_get_type +<SUBSECTION Private> +EPopupActionPrivate +</SECTION> + +<SECTION> +<FILE>e-print</FILE> +<TITLE>Printing</TITLE> +e_print_operation_new +e_print_run_page_setup_dialog +</SECTION> + +<SECTION> +<FILE>e-rule-context</FILE> +<TITLE>ERuleContext</TITLE> +ERuleContext +ERuleContextRegisterFunc +ERuleContextPartFunc +ERuleContextRuleFunc +ERuleContextNextPartFunc +ERuleContextNextRuleFunc +e_rule_context_new +e_rule_context_load +e_rule_context_save +e_rule_context_revert +e_rule_context_add_part +e_rule_context_find_part +e_rule_context_create_part +e_rule_context_next_part +e_rule_context_next_rule +e_rule_context_find_rule +e_rule_context_find_rank_rule +e_rule_context_add_rule +e_rule_context_add_rule_gui +e_rule_context_remove_rule +e_rule_context_rank_rule +e_rule_context_get_rank_rule +e_rule_context_add_part_set +e_rule_context_add_rule_set +e_rule_context_new_element +e_rule_context_delete_uri +e_rule_context_rename_uri +e_rule_context_free_uri_list +<SUBSECTION Standard> +E_RULE_CONTEXT +E_IS_RULE_CONTEXT +E_TYPE_RULE_CONTEXT +E_RULE_CONTEXT_CLASS +E_IS_RULE_CONTEXT_CLASS +E_RULE_CONTEXT_GET_CLASS +ERuleContextClass +e_rule_context_get_type +<SUBSECTION Private> +ERuleContextPrivate +</SECTION> + +<SECTION> +<FILE>e-rule-editor</FILE> +<TITLE>ERuleEditor</TITLE> +ERuleEditor +ERuleEditorUndo +e_rule_editor_new +e_rule_editor_construct +e_rule_editor_set_source +e_rule_editor_set_sensitive +e_rule_editor_create_rule +<SUBSECTION Standard> +E_RULE_EDITOR +E_IS_RULE_EDITOR +E_TYPE_RULE_EDITOR +E_RULE_EDITOR_CLASS +E_IS_RULE_EDITOR_CLASS +E_RULE_EDITOR_GET_CLASS +ERuleEditorClass +e_rule_editor_get_type +<SUBSECTION Private> +ERuleEditorPrivate +</SECTION> + +<SECTION> +<FILE>e-selection</FILE> +<TITLE>Selections</TITLE> +e_target_list_add_calendar_targets +e_target_list_add_directory_targets +e_selection_data_set_calendar +e_selection_data_set_directory +e_selection_data_get_calendar +e_selection_data_get_directory +e_selection_data_targets_include_calendar +e_selection_data_targets_include_directory +e_targets_include_calendar +e_targets_include_directory +e_clipboard_set_calendar +e_clipboard_set_directory +e_clipboard_request_calendar +e_clipboard_request_directory +e_clipboard_wait_for_calendar +e_clipboard_wait_for_directory +e_clipboard_wait_is_calendar_available +e_clipboard_wait_is_directory_available +</SECTION> + +<SECTION> +<FILE>e-source-combo-box</FILE> +<TITLE>ESourceComboBox</TITLE> +ESourceComboBox +e_source_combo_box_new +e_source_combo_box_get_registry +e_source_combo_box_set_registry +e_source_combo_box_get_extension_name +e_source_combo_box_set_extension_name +e_source_combo_box_get_show_colors +e_source_combo_box_set_show_colors +e_source_combo_box_ref_active +e_source_combo_box_set_active +<SUBSECTION Standard> +E_SOURCE_COMBO_BOX +E_IS_SOURCE_COMBO_BOX +E_TYPE_SOURCE_COMBO_BOX +E_SOURCE_COMBO_BOX_CLASS +E_IS_SOURCE_COMBO_BOX_CLASS +E_SOURCE_COMBO_BOX_GET_CLASS +ESourceComboBoxClass +e_source_combo_box_get_type +<SUBSECTION Private> +ESourceComboBoxPrivate +</SECTION> + +<SECTION> +<FILE>e-source-selector</FILE> +<TITLE>ESourceSelector</TITLE> +ESourceSelector +e_source_selector_new +e_source_selector_get_registry +e_source_selector_get_extension_name +e_source_selector_get_show_colors +e_source_selector_set_show_colors +e_source_selector_get_show_toggles +e_source_selector_set_show_toggles +e_source_selector_select_source +e_source_selector_unselect_source +e_source_selector_select_exclusive +e_source_selector_source_is_selected +e_source_selector_get_selection +e_source_selector_free_selection +e_source_selector_set_select_new +e_source_selector_edit_primary_selection +e_source_selector_ref_primary_selection +e_source_selector_set_primary_selection +e_source_selector_ref_source_by_path +e_source_selector_queue_write +<SUBSECTION Standard> +E_SOURCE_SELECTOR +E_IS_SOURCE_SELECTOR +E_TYPE_SOURCE_SELECTOR +E_SOURCE_SELECTOR_CLASS +E_IS_SOURCE_SELECTOR_CLASS +E_SOURCE_SELECTOR_GET_CLASS +ESourceSelectorClass +e_source_selector_get_type +<SUBSECTION Private> +ESourceSelectorPrivate +</SECTION> + +<SECTION> +<FILE>e-source-selector-dialog</FILE> +<TITLE>ESourceSelectorDialog</TITLE> +ESourceSelectorDialog +e_source_selector_dialog_new +e_source_selector_dialog_get_registry +e_source_selector_dialog_get_extension_name +e_source_selector_dialog_get_selector +e_source_selector_dialog_peek_primary_selection +<SUBSECTION Standard> +E_SOURCE_SELECTOR_DIALOG +E_IS_SOURCE_SELECTOR_DIALOG +E_TYPE_SOURCE_SELECTOR_DIALOG +E_SOURCE_SELECTOR_DIALOG_CLASS +E_IS_SOURCE_SELECTOR_DIALOG_CLASS +E_SOURCE_SELECTOR_DIALOG_GET_CLASS +ESourceSelectorDialogClass +e_source_selector_dialog_get_type +<SUBSECTION Private> +ESourceSelectorDialogPrivate +</SECTION> + +<SECTION> +<FILE>e-tree-model-generator</FILE> +<TITLE>ETreeModelGenerator</TITLE> +ETreeModelGeneratorGenerateFunc +ETreeModelGeneratorModifyFunc +ETreeModelGenerator +e_tree_model_generator_new +e_tree_model_generator_get_model +e_tree_model_generator_set_generate_func +e_tree_model_generator_set_modify_func +e_tree_model_generator_convert_child_path_to_path +e_tree_model_generator_convert_child_iter_to_iter +e_tree_model_generator_convert_path_to_child_path +e_tree_model_generator_convert_iter_to_child_iter +<SUBSECTION Standard> +E_TREE_MODEL_GENERATOR +E_IS_TREE_MODEL_GENERATOR +E_TYPE_TREE_MODEL_GENERATOR +E_TREE_MODEL_GENERATOR_CLASS +E_IS_TREE_MODEL_GENERATOR_CLASS +E_TREE_MODEL_GENERATOR_GET_CLASS +ETreeModelGeneratorClass +e_tree_model_generator_get_type +<SUBSECTION Private> +ETreeModelGeneratorPrivate +</SECTION> + +<SECTION> +<FILE>e-web-view</FILE> +<TITLE>EWebView</TITLE> +EWebView +e_web_view_new +e_web_view_clear +e_web_view_load_string +e_web_view_get_caret_mode +e_web_view_set_caret_mode +e_web_view_get_copy_target_list +e_web_view_get_disable_printing +e_web_view_set_disable_printing +e_web_view_get_disable_save_to_disk +e_web_view_set_disable_save_to_disk +e_web_view_get_editable +e_web_view_set_editable +e_web_view_get_inline_spelling +e_web_view_set_inline_spelling +e_web_view_get_magic_links +e_web_view_set_magic_links +e_web_view_get_magic_smileys +e_web_view_set_magic_smileys +e_web_view_get_selected_uri +e_web_view_set_selected_uri +e_web_view_get_open_proxy +e_web_view_set_open_proxy +e_web_view_get_paste_target_list +e_web_view_get_print_proxy +e_web_view_set_print_proxy +e_web_view_get_save_as_proxy +e_web_view_set_save_as_proxy +e_web_view_get_action +e_web_view_get_action_group +e_web_view_extract_uri +e_web_view_copy_clipboard +e_web_view_cut_clipboard +e_web_view_is_selection_active +e_web_view_paste_clipboard +e_web_view_scroll_forward +e_web_view_scroll_backward +e_web_view_select_all +e_web_view_unselect_all +e_web_view_zoom_100 +e_web_view_zoom_in +e_web_view_zoom_out +e_web_view_get_ui_manager +e_web_view_get_popup_menu +e_web_view_show_popup_menu +e_web_view_status_message +e_web_view_stop_loading +e_web_view_update_actions +<SUBSECTION Standard> +E_WEB_VIEW +E_IS_WEB_VIEW +E_TYPE_WEB_VIEW +E_WEB_VIEW_CLASS +E_IS_WEB_VIEW_CLASS +E_WEB_VIEW_GET_CLASS +EWebViewClass +e_web_view_get_type +<SUBSECTION Private> +EWebViewPrivate +</SECTION> + +<SECTION> +<FILE>e-xml-utils</FILE> +<TITLE>Reading and Writing XML</TITLE> +e_xml_get_child_by_name_by_lang +e_xml_get_child_by_name_by_lang_list +e_xml_get_child_by_name_no_lang +e_xml_get_integer_prop_by_name +e_xml_get_integer_prop_by_name_with_default +e_xml_set_integer_prop_by_name +e_xml_get_uint_prop_by_name +e_xml_get_uint_prop_by_name_with_default +e_xml_set_uint_prop_by_name +e_xml_get_bool_prop_by_name +e_xml_get_bool_prop_by_name_with_default +e_xml_set_bool_prop_by_name +e_xml_get_double_prop_by_name +e_xml_get_double_prop_by_name_with_default +e_xml_set_double_prop_by_name +e_xml_get_string_prop_by_name +e_xml_get_string_prop_by_name_with_default +e_xml_set_string_prop_by_name +e_xml_get_translated_string_prop_by_name +</SECTION> + diff --git a/doc/reference/libeutil/libeutil.types b/doc/reference/libeutil/libeutil.types new file mode 100644 index 0000000000..b78b7ade94 --- /dev/null +++ b/doc/reference/libeutil/libeutil.types @@ -0,0 +1,170 @@ +#include <e-util/e-util.h> + +e_action_combo_box_get_type +e_activity_bar_get_type +e_activity_get_type +e_activity_proxy_get_type +e_alarm_selector_get_type +e_alert_bar_get_type +e_alert_dialog_get_type +e_alert_get_type +e_alert_sink_get_type +e_attachment_bar_get_type +e_attachment_button_get_type +e_attachment_dialog_get_type +e_attachment_get_type +e_attachment_handler_get_type +e_attachment_handler_image_get_type +e_attachment_handler_sendto_get_type +e_attachment_icon_view_get_type +e_attachment_paned_get_type +e_attachment_store_get_type +e_attachment_tree_view_get_type +e_attachment_view_get_type +e_auth_combo_box_get_type +e_bit_array_get_type +e_book_source_config_get_type +e_cal_source_config_get_type +e_calendar_get_type +e_calendar_item_get_type +e_canvas_background_get_type +e_canvas_get_type +e_canvas_vbox_get_type +e_categories_dialog_get_type +e_categories_editor_get_type +e_categories_selector_get_type +e_category_completion_get_type +e_category_editor_get_type +e_cell_checkbox_get_type +e_cell_combo_get_type +e_cell_date_edit_get_type +e_cell_date_get_type +e_cell_get_type +e_cell_hbox_get_type +e_cell_number_get_type +e_cell_percent_get_type +e_cell_pixbuf_get_type +e_cell_popup_get_type +e_cell_renderer_color_get_type +e_cell_size_get_type +e_cell_text_get_type +e_cell_toggle_get_type +e_cell_tree_get_type +e_cell_vbox_get_type +e_charset_combo_box_get_type +e_config_get_type +e_config_hook_get_type +e_contact_store_get_type +e_date_edit_get_type +e_destination_store_get_type +e_event_get_type +e_event_hook_get_type +e_file_request_get_type +e_filter_code_get_type +e_filter_color_get_type +e_filter_datespec_get_type +e_filter_element_get_type +e_filter_file_get_type +e_filter_input_get_type +e_filter_int_get_type +e_filter_option_get_type +e_filter_part_get_type +e_filter_rule_get_type +e_focus_tracker_get_type +e_image_chooser_get_type +e_import_assistant_get_type +e_import_get_type +e_import_hook_get_type +e_interval_chooser_get_type +e_map_get_type +e_menu_tool_action_get_type +e_menu_tool_button_get_type +e_name_selector_dialog_get_type +e_name_selector_entry_get_type +e_name_selector_get_type +e_name_selector_list_get_type +e_name_selector_model_get_type +e_online_button_get_type +e_paned_get_type +e_picture_gallery_get_type +e_plugin_get_type +e_plugin_hook_get_type +e_plugin_ui_hook_get_type +e_popup_action_get_type +e_port_entry_get_type +e_preferences_window_get_type +e_preview_pane_get_type +e_printable_get_type +e_reflow_get_type +e_reflow_model_get_type +e_rule_context_get_type +e_rule_editor_get_type +e_search_bar_get_type +e_selectable_get_type +e_selection_model_array_get_type +e_selection_model_get_type +e_selection_model_simple_get_type +e_send_options_dialog_get_type +e_sorter_array_get_type +e_sorter_get_type +e_source_combo_box_get_type +e_source_config_dialog_get_type +e_source_config_get_type +e_source_selector_dialog_get_type +e_source_selector_get_type +e_spell_entry_get_type +e_stock_request_get_type +e_table_click_to_add_get_type +e_table_col_get_type +e_table_column_specification_get_type +e_table_config_get_type +e_table_extras_get_type +e_table_field_chooser_dialog_get_type +e_table_field_chooser_get_type +e_table_field_chooser_item_get_type +e_table_get_type +e_table_group_get_type +e_table_group_leaf_get_type +e_table_header_get_type +e_table_header_item_get_type +e_table_item_get_type +e_table_memory_get_type +e_table_memory_store_get_type +e_table_model_get_type +e_table_one_get_type +e_table_search_get_type +e_table_selection_model_get_type +e_table_sort_info_get_type +e_table_sorted_get_type +e_table_sorter_get_type +e_table_specification_get_type +e_table_state_get_type +e_table_subset_get_type +e_table_without_get_type +e_text_event_processor_emacs_like_get_type +e_text_event_processor_get_type +e_text_get_type +e_text_model_get_type +e_timezone_dialog_get_type +e_tree_get_type +e_tree_memory_get_type +e_tree_model_generator_get_type +e_tree_model_get_type +e_tree_selection_model_get_type +e_tree_sorted_get_type +e_tree_table_adapter_get_type +e_ui_manager_get_type +e_url_entry_get_type +e_web_view_get_type +e_web_view_gtkhtml_get_type +e_web_view_preview_get_type +gal_define_views_dialog_get_type +gal_define_views_model_get_type +gal_view_collection_get_type +gal_view_etable_get_type +gal_view_factory_etable_get_type +gal_view_factory_get_type +gal_view_get_type +gal_view_instance_get_type +gal_view_instance_save_as_dialog_get_type +gal_view_new_dialog_get_type diff --git a/doc/reference/shell/eshell-sections.txt b/doc/reference/shell/eshell-sections.txt deleted file mode 100644 index 27fbe428c2..0000000000 --- a/doc/reference/shell/eshell-sections.txt +++ /dev/null @@ -1,1096 +0,0 @@ -<SECTION> -<FILE>e-shell</FILE> -<TITLE>EShell</TITLE> -EShell -e_shell_get_default -e_shell_load_modules -e_shell_get_shell_backends -e_shell_get_canonical_name -e_shell_get_backend_by_name -e_shell_get_backend_by_scheme -e_shell_get_shell_settings -e_shell_create_shell_window -e_shell_handle_uris -e_shell_submit_alert -e_shell_get_active_window -e_shell_get_meego_mode -e_shell_get_express_mode -e_shell_get_small_screen_mode -e_shell_get_module_directory -e_shell_get_network_available -e_shell_set_network_available -e_shell_lock_network_available -e_shell_get_online -e_shell_set_online -e_shell_get_preferences_window -e_shell_event -EShellQuitReason -e_shell_quit -e_shell_cancel_quit -e_shell_adapt_window_size -e_shell_set_startup_view -e_shell_get_startup_view -E_SHELL_MIGRATE_ERROR -EShellMigrateError -e_shell_migrate_attempt -e_shell_detect_meego -<SUBSECTION Standard> -E_SHELL -E_IS_SHELL -E_TYPE_SHELL -E_SHELL_CLASS -E_IS_SHELL_CLASS -E_SHELL_GET_CLASS -EShellClass -e_shell_get_type -e_shell_quit_reason_get_type -<SUBSECTION Private> -EShellPrivate -e_shell_migrate_error_quark -</SECTION> - -<SECTION> -<FILE>e-shell-backend</FILE> -<TITLE>EShellBackend</TITLE> -EShellBackend -e_shell_backend_compare -e_shell_backend_get_config_dir -e_shell_backend_get_data_dir -e_shell_backend_get_shell -e_shell_backend_add_activity -e_shell_backend_cancel_all -e_shell_backend_is_busy -e_shell_backend_start -e_shell_backend_is_started -e_shell_backend_migrate -<SUBSECTION Standard> -E_SHELL_BACKEND -E_IS_SHELL_BACKEND -E_TYPE_SHELL_BACKEND -E_SHELL_BACKEND_CLASS -E_IS_SHELL_BACKEND_CLASS -E_SHELL_BACKEND_GET_CLASS -EShellBackendClass -e_shell_backend_get_type -<SUBSECTION Private> -EShellBackendPrivate -</SECTION> - -<SECTION> -<FILE>e-shell-content</FILE> -<TITLE>EShellContent</TITLE> -EShellContent -e_shell_content_new -e_shell_content_set_searchbar -e_shell_content_check_state -e_shell_content_focus_search_results -e_shell_content_get_alert_bar -e_shell_content_get_shell_view -e_shell_content_get_view_id -e_shell_content_set_view_id -e_shell_content_run_advanced_search_dialog -e_shell_content_run_edit_searches_dialog -e_shell_content_run_save_search_dialog -<SUBSECTION Standard> -E_SHELL_CONTENT -E_IS_SHELL_CONTENT -E_TYPE_SHELL_CONTENT -E_SHELL_CONTENT_CLASS -E_IS_SHELL_CONTENT_CLASS -E_SHELL_CONTENT_GET_CLASS -EShellContentClass -e_shell_content_get_type -<SUBSECTION Private> -EShellContentPrivate -</SECTION> - -<SECTION> -<FILE>e-shell-searchbar</FILE> -<TITLE>EShellSearchbar</TITLE> -EShellSearchbar -e_shell_searchbar_new -e_shell_searchbar_get_shell_view -e_shell_searchbar_get_express_mode -e_shell_searchbar_set_express_mode -e_shell_searchbar_get_filter_combo_box -e_shell_searchbar_get_filter_visible -e_shell_searchbar_set_filter_visible -e_shell_searchbar_get_labels_visible -e_shell_searchbar_set_labels_visible -e_shell_searchbar_get_search_hint -e_shell_searchbar_set_search_hint -e_shell_searchbar_get_search_option -e_shell_searchbar_set_search_option -e_shell_searchbar_get_search_text -e_shell_searchbar_set_search_text -e_shell_searchbar_get_search_visible -e_shell_searchbar_set_search_visible -e_shell_searchbar_get_scope_combo_box -e_shell_searchbar_get_scope_visible -e_shell_searchbar_set_scope_visible -e_shell_searchbar_set_state_dirty -e_shell_searchbar_get_state_group -e_shell_searchbar_set_state_group -e_shell_searchbar_load_state -e_shell_searchbar_save_state -<SUBSECTION Standard> -E_SHELL_SEARCHBAR -E_IS_SHELL_SEARCHBAR -E_TYPE_SHELL_SEARCHBAR -E_SHELL_SEARCHBAR_CLASS -E_IS_SHELL_SEARCHBAR_CLASS -E_SHELL_SEARCHBAR_GET_CLASS -EShellSearchbarClass -e_shell_searchbar_get_type -<SUBSECTION Private> -EShellSearchbarPrivate -</SECTION> - -<SECTION> -<FILE>e-shell-settings</FILE> -<TITLE>EShellSettings</TITLE> -EShellSettings -e_shell_settings_install_property -e_shell_settings_install_property_for_key -e_shell_settings_enable_debug -e_shell_settings_get_boolean -e_shell_settings_set_boolean -e_shell_settings_get_int -e_shell_settings_set_int -e_shell_settings_get_string -e_shell_settings_set_string -e_shell_settings_get_object -e_shell_settings_set_object -e_shell_settings_get_pointer -e_shell_settings_set_pointer -<SUBSECTION Standard> -E_SHELL_SETTINGS -E_IS_SHELL_SETTINGS -E_TYPE_SHELL_SETTINGS -E_SHELL_SETTINGS_CLASS -E_IS_SHELL_SETTINGS_CLASS -E_SHELL_SETTINGS_GET_CLASS -EShellSettingsClass -e_shell_settings_get_type -<SUBSECTION Private> -EShellSettingsPrivate -</SECTION> - -<SECTION> -<FILE>e-shell-sidebar</FILE> -<TITLE>EShellSidebar</TITLE> -EShellSidebar -e_shell_sidebar_new -e_shell_sidebar_check_state -e_shell_sidebar_get_shell_view -e_shell_sidebar_get_icon_name -e_shell_sidebar_set_icon_name -e_shell_sidebar_get_primary_text -e_shell_sidebar_set_primary_text -e_shell_sidebar_get_secondary_text -e_shell_sidebar_set_secondary_text -<SUBSECTION Standard> -E_SHELL_SIDEBAR -E_IS_SHELL_SIDEBAR -E_TYPE_SHELL_SIDEBAR -E_SHELL_SIDEBAR_CLASS -E_IS_SHELL_SIDEBAR_CLASS -E_SHELL_SIDEBAR_GET_CLASS -EShellSidebarClass -e_shell_sidebar_get_type -<SUBSECTION Private> -EShellSidebarPrivate -</SECTION> - -<SECTION> -<FILE>e-shell-switcher</FILE> -<TITLE>EShellSwitcher</TITLE> -EShellSwitcher -e_shell_switcher_new -e_shell_switcher_add_action -e_shell_switcher_get_style -e_shell_switcher_set_style -e_shell_switcher_unset_style -e_shell_switcher_get_visible -e_shell_switcher_set_visible -<SUBSECTION Standard> -E_SHELL_SWITCHER -E_IS_SHELL_SWITCHER -E_TYPE_SHELL_SWITCHER -E_SHELL_SWITCHER_CLASS -E_IS_SHELL_SWITCHER_CLASS -E_SHELL_SWITCHER_GET_CLASS -EShellSwitcherClass -e_shell_switcher_get_type -<SUBSECTION Private> -EShellSwitcherPrivate -E_SHELL_SWITCHER_DEFAULT_TOOLBAR_STYLE -</SECTION> - -<SECTION> -<FILE>e-shell-taskbar</FILE> -<TITLE>EShellTaskbar</TITLE> -EShellTaskbar -e_shell_taskbar_new -e_shell_taskbar_get_shell_view -e_shell_taskbar_get_message -e_shell_taskbar_set_message -e_shell_taskbar_unset_message -e_shell_taskbar_get_activity_count -<SUBSECTION Standard> -E_SHELL_TASKBAR -E_IS_SHELL_TASKBAR -E_TYPE_SHELL_TASKBAR -E_SHELL_TASKBAR_CLASS -E_IS_SHELL_TASKBAR_CLASS -E_SHELL_TASKBAR_GET_CLASS -EShellTaskbarClass -e_shell_taskbar_get_type -<SUBSECTION Private> -EShellTaskbarPrivate -</SECTION> - -<SECTION> -<FILE>e-shell-utils</FILE> -<TITLE>Shell Utilities</TITLE> -e_shell_configure_ui_manager -e_shell_run_open_dialog -e_shell_run_save_dialog -e_shell_utils_import_uris -e_shell_hide_widgets_for_express_mode -</SECTION> - -<SECTION> -<FILE>e-shell-view</FILE> -<TITLE>EShellView</TITLE> -EShellView -EShellViewClass -e_shell_view_get_name -e_shell_view_get_action -e_shell_view_get_title -e_shell_view_set_title -e_shell_view_get_view_id -e_shell_view_set_view_id -e_shell_view_is_active -e_shell_view_get_page_num -e_shell_view_set_page_num -e_shell_view_get_searchbar -e_shell_view_get_search_name -e_shell_view_get_search_rule -e_shell_view_set_search_rule -e_shell_view_get_search_query -e_shell_view_get_size_group -e_shell_view_get_shell_backend -e_shell_view_get_shell_content -e_shell_view_get_shell_sidebar -e_shell_view_get_shell_taskbar -e_shell_view_get_shell_window -e_shell_view_get_state_key_file -e_shell_view_set_state_dirty -e_shell_view_clear_search -e_shell_view_custom_search -e_shell_view_execute_search -e_shell_view_block_execute_search -e_shell_view_unblock_execute_search -e_shell_view_update_actions -e_shell_view_block_update_actions -e_shell_view_unblock_update_actions -e_shell_view_show_popup_menu -e_shell_view_new_view_instance -<SUBSECTION Standard> -E_SHELL_VIEW -E_IS_SHELL_VIEW -E_TYPE_SHELL_VIEW -E_SHELL_VIEW_CLASS -E_IS_SHELL_VIEW_CLASS -E_SHELL_VIEW_GET_CLASS -e_shell_view_get_type -<SUBSECTION Private> -EShellViewPrivate -</SECTION> - -<SECTION> -<FILE>e-shell-window</FILE> -<TITLE>EShellWindow</TITLE> -EShellWindow -e_shell_window_new -e_shell_window_get_shell -e_shell_window_get_shell_view -e_shell_window_peek_shell_view -e_shell_window_get_shell_view_action -e_shell_window_get_alert_bar -e_shell_window_get_focus_tracker -e_shell_window_get_ui_manager -e_shell_window_get_action -e_shell_window_get_action_group -e_shell_window_get_managed_widget -e_shell_window_get_active_view -e_shell_window_set_active_view -e_shell_window_get_safe_mode -e_shell_window_set_safe_mode -e_shell_window_add_action_group -e_shell_window_get_sidebar_visible -e_shell_window_set_sidebar_visible -e_shell_window_get_switcher_visible -e_shell_window_set_switcher_visible -e_shell_window_get_taskbar_visible -e_shell_window_set_taskbar_visible -e_shell_window_get_toolbar_visible -e_shell_window_set_toolbar_visible -e_shell_window_register_new_item_actions -e_shell_window_register_new_source_actions -e_shell_window_get_menu_bar_box -<SUBSECTION Standard> -E_SHELL_WINDOW -E_IS_SHELL_WINDOW -E_TYPE_SHELL_WINDOW -E_SHELL_WINDOW_CLASS -E_IS_SHELL_WINDOW_CLASS -E_SHELL_WINDOW_GET_CLASS -EShellWindowClass -e_shell_window_get_type -<SUBSECTION Private> -EShellWindowPrivate -E_SHELL_WINDOW_ACTION -E_SHELL_WINDOW_ACTION_GROUP -</SECTION> - -<SECTION> -<FILE>e-action-combo-box</FILE> -EActionComboBox -e_action_combo_box_new -e_action_combo_box_new_with_action -e_action_combo_box_get_action -e_action_combo_box_set_action -e_action_combo_box_get_current_value -e_action_combo_box_set_current_value -e_action_combo_box_add_separator_before -e_action_combo_box_add_separator_after -<SUBSECTION Standard> -E_ACTION_COMBO_BOX -E_IS_ACTION_COMBO_BOX -E_TYPE_ACTION_COMBO_BOX -E_ACTION_COMBO_BOX_CLASS -E_IS_ACTION_COMBO_BOX_CLASS -E_ACTION_COMBO_BOX_GET_CLASS -EActionComboBoxClass -e_action_combo_box_get_type -<SUBSECTION Private> -EActionComboBoxPrivate -</SECTION> - -<SECTION> -<FILE>e-activity</FILE> -EActivity -e_activity_new -e_activity_describe -e_activity_get_alert_sink -e_activity_set_alert_sink -e_activity_get_cancellable -e_activity_set_cancellable -e_activity_get_icon_name -e_activity_set_icon_name -e_activity_get_percent -e_activity_set_percent -e_activity_get_state -e_activity_set_state -e_activity_get_text -e_activity_set_text -<SUBSECTION Standard> -E_ACTIVITY -E_IS_ACTIVITY -E_TYPE_ACTIVITY -E_ACTIVITY_CLASS -E_IS_ACTIVITY_CLASS -E_ACTIVITY_GET_CLASS -EActivityClass -e_activity_get_type -<SUBSECTION Private> -EActivityPrivate -</SECTION> - -<SECTION> -<FILE>e-activity-proxy</FILE> -EActivityProxy -e_activity_proxy_new -e_activity_proxy_get_activity -<SUBSECTION Standard> -E_ACTIVITY_PROXY -E_IS_ACTIVITY_PROXY -E_TYPE_ACTIVITY_PROXY -E_ACTIVITY_PROXY_CLASS -E_IS_ACTIVITY_PROXY_CLASS -E_ACTIVITY_PROXY_GET_CLASS -EActivityProxyClass -e_activity_proxy_get_type -<SUBSECTION Private> -EActivityProxyPrivate -</SECTION> - -<SECTION> -<FILE>e-alert</FILE> -<TITLE>User Alert Handling</TITLE> -E_ALERT_ASK_FILE_EXISTS_OVERWRITE -E_ALERT_NO_SAVE_FILE -E_ALERT_NO_LOAD_FILE -EAlert -e_alert_new -e_alert_run_dialog -e_alert_run_dialog_for_args -</SECTION> - -<SECTION> -<FILE>e-attachment</FILE> -EAttachment -e_attachment_new -e_attachment_new_for_path -e_attachment_new_for_uri -e_attachment_new_for_message -e_attachment_add_to_multipart -e_attachment_cancel -e_attachment_get_can_show -e_attachment_set_can_show -e_attachment_get_disposition -e_attachment_set_disposition -e_attachment_get_file -e_attachment_set_file -e_attachment_get_file_info -e_attachment_set_file_info -e_attachment_get_icon -e_attachment_get_loading -e_attachment_get_mime_part -e_attachment_set_mime_part -e_attachment_get_percent -e_attachment_get_reference -e_attachment_set_reference -e_attachment_get_saving -e_attachment_get_shown -e_attachment_set_shown -e_attachment_get_encrypted -e_attachment_set_encrypted -e_attachment_get_signed -e_attachment_set_signed -e_attachment_get_description -e_attachment_get_thumbnail_path -e_attachment_is_rfc822 -e_attachment_list_apps -e_attachment_load_async -e_attachment_load_finish -e_attachment_open_async -e_attachment_open_finish -e_attachment_save_async -e_attachment_save_finish -e_attachment_load_handle_error -e_attachment_open_handle_error -e_attachment_save_handle_error -<SUBSECTION Standard> -E_ATTACHMENT -E_IS_ATTACHMENT -E_TYPE_ATTACHMENT -E_ATTACHMENT_CLASS -E_IS_ATTACHMENT_CLASS -E_ATTACHMENT_GET_CLASS -EAttachmentClass -e_attachment_get_type -<SUBSECTION Private> -EAttachmentPrivate -</SECTION> - -<SECTION> -<FILE>e-attachment-button</FILE> -EAttachmentButton -e_attachment_button_new -e_attachment_button_get_view -e_attachment_button_get_attachment -e_attachment_button_set_attachment -e_attachment_button_get_expandable -e_attachment_button_set_expandable -e_attachment_button_get_expanded -e_attachment_button_set_expanded -<SUBSECTION Standard> -E_ATTACHMENT_BUTTON -E_IS_ATTACHMENT_BUTTON -E_TYPE_ATTACHMENT_BUTTON -E_ATTACHMENT_BUTTON_CLASS -E_IS_ATTACHMENT_BUTTON_CLASS -E_ATTACHMENT_BUTTON_GET_CLASS -EAttachmentButtonClass -e_attachment_button_get_type -<SUBSECTION Private> -EAttachmentButtonPrivate -</SECTION> - -<SECTION> -<FILE>e-attachment-dialog</FILE> -EAttachmentDialog -e_attachment_dialog_new -e_attachment_dialog_get_attachment -e_attachment_dialog_set_attachment -<SUBSECTION Standard> -E_ATTACHMENT_DIALOG -E_IS_ATTACHMENT_DIALOG -E_TYPE_ATTACHMENT_DIALOG -E_ATTACHMENT_DIALOG_CLASS -E_IS_ATTACHMENT_DIALOG_CLASS -E_ATTACHMENT_DIALOG_GET_CLASS -EAttachmentDialogClass -e_attachment_dialog_get_type -<SUBSECTION Private> -EAttachmentDialogPrivate -</SECTION> - -<SECTION> -<FILE>e-attachment-handler</FILE> -EAttachmentHandler -e_attachment_handler_get_view -e_attachment_handler_get_drag_actions -e_attachment_handler_get_target_table -<SUBSECTION Standard> -E_ATTACHMENT_HANDLER -E_IS_ATTACHMENT_HANDLER -E_TYPE_ATTACHMENT_HANDLER -E_ATTACHMENT_HANDLER_CLASS -E_IS_ATTACHMENT_HANDLER_CLASS -E_ATTACHMENT_HANDLER_GET_CLASS -EAttachmentHandlerClass -e_attachment_handler_get_type -e_attachment_handler_image_get_type -e_attachment_handler_sendto_get_type -<SUBSECTION Private> -EAttachmentHandlerPrivate -</SECTION> - -<SECTION> -<FILE>e-attachment-icon-view</FILE> -EAttachmentIconView -e_attachment_icon_view_new -e_attachment_icon_view_set_default_icon_size -<SUBSECTION Standard> -E_ATTACHMENT_ICON_VIEW -E_IS_ATTACHMENT_ICON_VIEW -E_TYPE_ATTACHMENT_ICON_VIEW -E_ATTACHMENT_ICON_VIEW_CLASS -E_IS_ATTACHMENT_ICON_VIEW_CLASS -E_ATTACHMENT_ICON_VIEW_GET_CLASS -EAttachmentIconViewClass -e_attachment_icon_view_get_type -<SUBSECTION Private> -EAttachmentIconViewPrivate -</SECTION> - -<SECTION> -<FILE>e-attachment-paned</FILE> -EAttachmentPaned -e_attachment_paned_new -e_attachment_paned_get_content_area -e_attachment_paned_get_active_view -e_attachment_paned_set_active_view -e_attachment_paned_get_expanded -e_attachment_paned_set_expanded -e_attachment_paned_drag_data_received -e_attachment_paned_get_controls_container -e_attachment_paned_get_view_combo -e_attachment_paned_set_default_height -<SUBSECTION Standard> -E_ATTACHMENT_PANED -E_IS_ATTACHMENT_PANED -E_TYPE_ATTACHMENT_PANED -E_ATTACHMENT_PANED_CLASS -E_IS_ATTACHMENT_PANED_CLASS -E_ATTACHMENT_PANED_GET_CLASS -EAttachmentPanedClass -e_attachment_paned_get_type -<SUBSECTION Private> -EAttachmentPanedPrivate -</SECTION> - -<SECTION> -<FILE>e-attachment-store</FILE> -EAttachmentStore -e_attachment_store_new -e_attachment_store_add_attachment -e_attachment_store_remove_attachment -e_attachment_store_add_to_multipart -e_attachment_store_get_attachments -e_attachment_store_get_num_attachments -e_attachment_store_get_num_loading -e_attachment_store_get_total_size -e_attachment_store_run_load_dialog -e_attachment_store_run_save_dialog -e_attachment_store_get_uris_async -e_attachment_store_get_uris_finish -e_attachment_store_load_async -e_attachment_store_load_finish -e_attachment_store_save_async -e_attachment_store_save_finish -<SUBSECTION Standard> -E_ATTACHMENT_STORE -E_IS_ATTACHMENT_STORE -E_TYPE_ATTACHMENT_STORE -E_ATTACHMENT_STORE_CLASS -E_IS_ATTACHMENT_STORE_CLASS -E_ATTACHMENT_STORE_GET_CLASS -EAttachmentStoreClass -e_attachment_store_get_type -<SUBSECTION Private> -EAttachmentStorePrivate -</SECTION> - -<SECTION> -<FILE>e-attachment-tree-view</FILE> -EAttachmentTreeView -e_attachment_tree_view_new -<SUBSECTION Standard> -E_ATTACHMENT_TREE_VIEW -E_IS_ATTACHMENT_TREE_VIEW -E_TYPE_ATTACHMENT_TREE_VIEW -E_ATTACHMENT_TREE_VIEW_CLASS -E_IS_ATTACHMENT_TREE_VIEW_CLASS -E_ATTACHMENT_TREE_VIEW_GET_CLASS -EAttachmentTreeViewClass -e_attachment_tree_view_get_type -<SUBSECTION Private> -EAttachmentTreeViewPrivate -</SECTION> - -<SECTION> -<FILE>e-attachment-view</FILE> -EAttachmentView -e_attachment_view_init -e_attachment_view_dispose -e_attachment_view_finalize -e_attachment_view_get_private -e_attachment_view_get_store -e_attachment_view_get_editable -e_attachment_view_set_editable -e_attachment_view_get_target_list -e_attachment_view_get_drag_actions -e_attachment_view_get_selected_attachments -e_attachment_view_open_path -e_attachment_view_remove_selected -e_attachment_view_button_press_event -e_attachment_view_button_release_event -e_attachment_view_motion_notify_event -e_attachment_view_key_press_event -e_attachment_view_get_path_at_pos -e_attachment_view_get_selected_paths -e_attachment_view_path_is_selected -e_attachment_view_select_path -e_attachment_view_unselect_path -e_attachment_view_select_all -e_attachment_view_unselect_all -e_attachment_view_sync_selection -e_attachment_view_drag_source_set -e_attachment_view_drag_source_unset -e_attachment_view_drag_begin -e_attachment_view_drag_end -e_attachment_view_drag_data_get -e_attachment_view_drag_dest_set -e_attachment_view_drag_dest_unset -e_attachment_view_drag_motion -e_attachment_view_drag_drop -e_attachment_view_drag_data_received -e_attachment_view_get_action -e_attachment_view_add_action_group -e_attachment_view_get_action_group -e_attachment_view_get_popup_menu -e_attachment_view_get_ui_manager -e_attachment_view_recent_action_new -e_attachment_view_show_popup_menu -e_attachment_view_update_actions -<SUBSECTION Standard> -E_ATTACHMENT_VIEW -E_IS_ATTACHMENT_VIEW -E_TYPE_ATTACHMENT_VIEW -E_ATTACHMENT_VIEW_IFACE -E_IS_ATTACHMENT_VIEW_IFACE -E_ATTACHMENT_VIEW_GET_IFACE -EAttachmentViewIface -e_attachment_view_get_type -<SUBSECTION Private> -EAttachmentViewPrivate -</SECTION> - -<SECTION> -<FILE>e-bit-array</FILE> -<TITLE>Bit Arrays (Legacy)</TITLE> -EBitArray -e_bit_array_new -e_bit_array_value_at -e_bit_array_foreach -e_bit_array_selected_count -e_bit_array_select_all -e_bit_array_invert_selection -e_bit_array_bit_count -e_bit_array_change_one_row -e_bit_array_change_range -e_bit_array_select_single_row -e_bit_array_toggle_single_row -e_bit_array_insert -e_bit_array_delete -e_bit_array_delete_single_mode -e_bit_array_move_row -<SUBSECTION Standard> -E_BIT_ARRAY -E_IS_BIT_ARRAY -E_BIT_ARRAY_TYPE -E_BIT_ARRAY_CLASS -E_IS_BIT_ARRAY_CLASS -EBitArrayClass -e_bit_array_get_type -</SECTION> - -<SECTION> -<FILE>e-categories-config</FILE> -<TITLE>Categories</TITLE> -e_categories_config_get_icon_for -e_categories_config_open_dialog_for_entry -</SECTION> - -<SECTION> -<FILE>e-datetime-format</FILE> -<TITLE>Date and Time Formatting</TITLE> -DTFormatKind -e_datetime_format_add_setup_widget -e_datetime_format_format -e_datetime_format_format_tm -</SECTION> - -<SECTION> -<FILE>e-dialog-utils</FILE> -<TITLE>Dialog Utilities (Legacy)</TITLE> -e_notice -e_dialog_combo_box_set -e_dialog_combo_box_get -</SECTION> - -<SECTION> -<FILE>e-html-utils</FILE> -<TITLE>Text to HTML Conversion</TITLE> -E_TEXT_TO_HTML_PRE -E_TEXT_TO_HTML_CONVERT_NL -E_TEXT_TO_HTML_CONVERT_SPACES -E_TEXT_TO_HTML_CONVERT_URLS -E_TEXT_TO_HTML_MARK_CITATION -E_TEXT_TO_HTML_CONVERT_ADDRESSES -E_TEXT_TO_HTML_ESCAPE_8BIT -E_TEXT_TO_HTML_CITE -e_text_to_html_full -e_text_to_html -</SECTION> - -<SECTION> -<FILE>e-icon-factory</FILE> -<TITLE>Icon Utilities (Legacy)</TITLE> -e_icon_factory_get_icon_filename -e_icon_factory_get_icon -e_icon_factory_pixbuf_scale -e_icon_factory_create_thumbnail -</SECTION> - -<SECTION> -<FILE>e-mail-account-manager</FILE> -EMailAccountManager -e_mail_account_manager_new -e_mail_account_manager_add_account -e_mail_account_manager_edit_account -e_mail_account_manager_delete_account -e_mail_account_manager_get_registry -<SUBSECTION Standard> -E_MAIL_ACCOUNT_MANAGER -E_IS_MAIL_ACCOUNT_MANAGER -E_TYPE_MAIL_ACCOUNT_MANAGER -E_MAIL_ACCOUNT_MANAGER_CLASS -E_IS_MAIL_ACCOUNT_MANAGER_CLASS -E_MAIL_ACCOUNT_MANAGER_GET_CLASS -e_mail_account_manager_get_type -<SUBSECTION Private> -EMailAccountManagerPrivate -</SECTION> - -<SECTION> -<FILE>e-mail-account-tree-view</FILE> -EMailAccountTreeView -e_mail_account_tree_view_new -e_mail_account_tree_view_refresh -e_mail_account_tree_view_enable_selected -e_mail_account_tree_view_disable_selected -e_mail_account_tree_view_get_registry -e_mail_account_tree_view_get_selected_source -e_mail_account_tree_view_set_selected_source -<SUBSECTION Standard> -E_MAIL_ACCOUNT_TREE_VIEW -E_IS_MAIL_ACCOUNT_TREE_VIEW -E_TYPE_MAIL_ACCOUNT_TREE_VIEW -E_MAIL_ACCOUNT_TREE_VIEW_CLASS -E_IS_MAIL_ACCOUNT_TREE_VIEW_CLASS -E_MAIL_ACCOUNT_TREE_VIEW_GET_CLASS -EMailAccountTreeViewClass -e_mail_account_tree_view_get_type -<SUBSECTION Private> -EMailAccountTreeViewPrivate -</SECTION> - -<SECTION> -<FILE>e-mail-identity-combo-box</FILE> -EMailIdentityComboBox -e_mail_identity_combo_box_new -e_mail_identity_combo_box_refresh -e_mail_identity_combo_box_get_registry -<SUBSECTION Standard> -E_MAIL_IDENTITY_COMBO_BOX -E_IS_MAIL_IDENTITY_COMBO_BOX -E_TYPE_MAIL_IDENTITY_COMBO_BOX -E_MAIL_IDENTITY_COMBO_BOX_CLASS -E_IS_MAIL_IDENTITY_COMBO_BOX_CLASS -E_MAIL_IDENTITY_COMBO_BOX_GET_CLASS -EMailIdentityComboBoxClass -e_mail_identity_combo_box_get_type -<SUBSECTION Private> -EMailIdentityComboBoxPrivate -</SECTION> - -<SECTION> -<FILE>e-poolv</FILE> -<TITLE>EPoolv</TITLE> -EPoolv -e_poolv_new -e_poolv_set -e_poolv_get -e_poolv_destroy -</SECTION> - -<SECTION> -<FILE>e-popup-action</FILE> -EPopupAction -e_popup_action_new -EPopupActionEntry -e_action_group_add_popup_actions -<SUBSECTION Standard> -E_POPUP_ACTION -E_IS_POPUP_ACTION -E_TYPE_POPUP_ACTION -E_POPUP_ACTION_CLASS -E_IS_POPUP_ACTION_CLASS -E_POPUP_ACTION_GET_CLASS -EPopupActionClass -e_popup_action_get_type -<SUBSECTION Private> -EPopupActionPrivate -</SECTION> - -<SECTION> -<FILE>e-print</FILE> -<TITLE>Printing</TITLE> -e_print_operation_new -e_print_run_page_setup_dialog -</SECTION> - -<SECTION> -<FILE>e-selection</FILE> -<TITLE>Selections</TITLE> -e_target_list_add_calendar_targets -e_target_list_add_directory_targets -e_selection_data_set_calendar -e_selection_data_set_directory -e_selection_data_get_calendar -e_selection_data_get_directory -e_selection_data_targets_include_calendar -e_selection_data_targets_include_directory -e_targets_include_calendar -e_targets_include_directory -e_clipboard_set_calendar -e_clipboard_set_directory -e_clipboard_request_calendar -e_clipboard_request_directory -e_clipboard_wait_for_calendar -e_clipboard_wait_for_directory -e_clipboard_wait_is_calendar_available -e_clipboard_wait_is_directory_available -</SECTION> - -<SECTION> -EWebView -e_web_view_new -e_web_view_clear -e_web_view_load_string -e_web_view_get_animate -e_web_view_set_animate -e_web_view_get_caret_mode -e_web_view_set_caret_mode -e_web_view_get_copy_target_list -e_web_view_get_disable_printing -e_web_view_set_disable_printing -e_web_view_get_disable_save_to_disk -e_web_view_set_disable_save_to_disk -e_web_view_get_editable -e_web_view_set_editable -e_web_view_get_inline_spelling -e_web_view_set_inline_spelling -e_web_view_get_magic_links -e_web_view_set_magic_links -e_web_view_get_magic_smileys -e_web_view_set_magic_smileys -e_web_view_get_selected_uri -e_web_view_set_selected_uri -e_web_view_get_open_proxy -e_web_view_set_open_proxy -e_web_view_get_paste_target_list -e_web_view_get_print_proxy -e_web_view_set_print_proxy -e_web_view_get_save_as_proxy -e_web_view_set_save_as_proxy -e_web_view_get_action -e_web_view_get_action_group -e_web_view_extract_uri -e_web_view_copy_clipboard -e_web_view_cut_clipboard -e_web_view_is_selection_active -e_web_view_paste_clipboard -e_web_view_scroll_forward -e_web_view_scroll_backward -e_web_view_select_all -e_web_view_unselect_all -e_web_view_zoom_100 -e_web_view_zoom_in -e_web_view_zoom_out -e_web_view_get_ui_manager -e_web_view_get_popup_menu -e_web_view_show_popup_menu -e_web_view_status_message -e_web_view_stop_loading -e_web_view_update_actions -<SUBSECTION Standard> -E_WEB_VIEW -E_IS_WEB_VIEW -E_TYPE_WEB_VIEW -E_WEB_VIEW_CLASS -E_IS_WEB_VIEW_CLASS -E_WEB_VIEW_GET_CLASS -EWebViewClass -e_web_view_get_type -<SUBSECTION Private> -EWebViewPrivate -</SECTION> - -<SECTION> -<FILE>e-util</FILE> -<TITLE>Miscellaneous Utilities</TITLE> -e_get_accels_filename -e_show_uri -e_display_help -e_lookup_action -e_lookup_action_group -e_action_compare_by_label -e_action_group_remove_all_actions -e_radio_action_get_current_action -e_categories_add_change_hook -e_str_without_underscores -e_str_compare -e_str_case_compare -e_collate_compare -e_int_compare -e_color_to_value -e_format_number -ESortCompareFunc -e_bsearch -e_strftime_fix_am_pm -e_utf8_strftime_fix_am_pm -e_get_month_name -e_get_weekday_name -e_flexible_strtod -e_ascii_dtostr -e_file_lock_create -e_file_lock_destroy -e_file_lock_exists -e_util_guess_mime_type -e_util_get_category_filter_options -e_binding_transform_color_to_string -e_binding_transform_string_to_color -e_binding_transform_source_to_uid -e_binding_transform_uid_to_source -e_charset_add_radio_actions -e_file_replace_contents_async -e_file_replace_contents_finish -e_mktemp -e_mkstemp -e_mkdtemp -<SUBSECTION Standard> -E_TYPE_CAMEL_OBJECT -e_camel_object_get_type -</SECTION> - -<SECTION> -<FILE>e-xml-utils</FILE> -<TITLE>Reading and Writing XML</TITLE> -e_xml_get_child_by_name_by_lang -e_xml_get_child_by_name_by_lang_list -e_xml_get_child_by_name_no_lang -e_xml_get_integer_prop_by_name -e_xml_get_integer_prop_by_name_with_default -e_xml_set_integer_prop_by_name -e_xml_get_uint_prop_by_name -e_xml_get_uint_prop_by_name_with_default -e_xml_set_uint_prop_by_name -e_xml_get_bool_prop_by_name -e_xml_get_bool_prop_by_name_with_default -e_xml_set_bool_prop_by_name -e_xml_get_double_prop_by_name -e_xml_get_double_prop_by_name_with_default -e_xml_set_double_prop_by_name -e_xml_get_string_prop_by_name -e_xml_get_string_prop_by_name_with_default -e_xml_set_string_prop_by_name -e_xml_get_translated_string_prop_by_name -</SECTION> - -<SECTION> -<FILE>shell-actions</FILE> -<TITLE>Shell Actions</TITLE> -E_SHELL_WINDOW_ACTION_ABOUT -E_SHELL_WINDOW_ACTION_CLOSE -E_SHELL_WINDOW_ACTION_CONTENTS -E_SHELL_WINDOW_ACTION_FORGET_PASSWORDS -E_SHELL_WINDOW_ACTION_GAL_CUSTOM_VIEW -E_SHELL_WINDOW_ACTION_GAL_DEFINE_VIEWS -E_SHELL_WINDOW_ACTION_GAL_SAVE_CUSTOM_VIEW -E_SHELL_WINDOW_ACTION_IMPORT -E_SHELL_WINDOW_ACTION_NEW_WINDOW -E_SHELL_WINDOW_ACTION_PAGE_SETUP -E_SHELL_WINDOW_ACTION_PREFERENCES -E_SHELL_WINDOW_ACTION_QUICK_REFERENCE -E_SHELL_WINDOW_ACTION_QUIT -E_SHELL_WINDOW_ACTION_SEARCH_ADVANCED -E_SHELL_WINDOW_ACTION_SEARCH_CLEAR -E_SHELL_WINDOW_ACTION_SEARCH_EDIT -E_SHELL_WINDOW_ACTION_SEARCH_OPTIONS -E_SHELL_WINDOW_ACTION_SEARCH_QUICK -E_SHELL_WINDOW_ACTION_SEARCH_SAVE -E_SHELL_WINDOW_ACTION_SHOW_SIDEBAR -E_SHELL_WINDOW_ACTION_SHOW_SWITCHER -E_SHELL_WINDOW_ACTION_SHOW_TASKBAR -E_SHELL_WINDOW_ACTION_SHOW_TOOLBAR -E_SHELL_WINDOW_ACTION_SUBMIT_BUG -E_SHELL_WINDOW_ACTION_SWITCHER_INITIAL -E_SHELL_WINDOW_ACTION_SWITCHER_STYLE_BOTH -E_SHELL_WINDOW_ACTION_SWITCHER_STYLE_ICONS -E_SHELL_WINDOW_ACTION_SWITCHER_STYLE_TEXT -E_SHELL_WINDOW_ACTION_SWITCHER_STYLE_USER -E_SHELL_WINDOW_ACTION_WORK_OFFLINE -E_SHELL_WINDOW_ACTION_WORK_ONLINE -</SECTION> - -<SECTION> -<FILE>action-groups</FILE> -<TITLE>Action Groups</TITLE> -E_SHELL_WINDOW_ACTION_GROUP_SHELL -E_SHELL_WINDOW_ACTION_GROUP_SWITCHER -E_SHELL_WINDOW_ACTION_GROUP_NEW_ITEM -E_SHELL_WINDOW_ACTION_GROUP_NEW_SOURCE -E_SHELL_WINDOW_ACTION_GROUP_CUSTOM_RULES -E_SHELL_WINDOW_ACTION_GROUP_GAL_VIEW -E_SHELL_WINDOW_ACTION_GROUP_LOCKDOWN_APPLICATION_HANDLERS -E_SHELL_WINDOW_ACTION_GROUP_LOCKDOWN_PRINTING -E_SHELL_WINDOW_ACTION_GROUP_LOCKDOWN_PRINT_SETUP -E_SHELL_WINDOW_ACTION_GROUP_LOCKDOWN_SAVE_TO_DISK -</SECTION> diff --git a/e-util/Makefile.am b/e-util/Makefile.am index 4464f93045..15a9bcd8ac 100644 --- a/e-util/Makefile.am +++ b/e-util/Makefile.am @@ -1,3 +1,5 @@ +NULL = + eutilincludedir = $(privincludedir)/e-util ecpsdir = $(privdatadir)/ecps ruledir = $(privdatadir) @@ -22,133 +24,650 @@ e-marshal.c: e-marshal.list ENUM_GENERATED = e-util-enumtypes.h e-util-enumtypes.c MARSHAL_GENERATED = e-marshal.c e-marshal.h -if OS_WIN32 -PLATFORM_SOURCES = e-win32-reloc.c e-win32-defaults.c e-win32-defaults.h -endif +error_DATA = \ + e-system.error \ + filter.error \ + widgets.error \ + $(NULL) +errordir = $(privdatadir)/errors +@EVO_PLUGIN_RULE@ + +ui_DATA = \ + e-send-options.ui \ + e-table-config.ui \ + e-timezone-dialog.ui \ + filter.ui \ + gal-define-views.ui \ + gal-view-instance-save-as-dialog.ui \ + gal-view-new-dialog.ui \ + $(NULL) + +xpm_icons = \ + arrow-down.xpm \ + arrow-up.xpm \ + check-empty.xpm \ + check-filled.xpm \ + tree-expanded.xpm \ + tree-unexpanded.xpm \ + $(NULL) privsolib_LTLIBRARIES = libeutil.la -eutilinclude_HEADERS = \ - e-activity.h \ - e-bit-array.h \ - e-categories-config.h \ - e-charset.h \ - e-config.h \ - e-datetime-format.h \ - e-dialog-utils.h \ - e-dialog-widgets.h \ - e-event.h \ - e-file-request.h \ - e-file-utils.h \ - e-html-utils.h \ - e-icon-factory.h \ - e-import.h \ - e-marshal.h \ - e-mktemp.h \ - e-poolv.h \ - e-print.h \ - e-plugin.h \ - e-plugin-ui.h \ - e-selection.h \ - e-sorter.h \ - e-sorter-array.h \ - e-source-util.h \ - e-stock-request.h \ - e-text-event-processor-emacs-like.h \ - e-text-event-processor-types.h \ - e-text-event-processor.h \ - e-ui-manager.h \ - e-util.h \ - e-util-enums.h \ - e-util-enumtypes.h \ - e-unicode.h - -libeutil_la_CPPFLAGS = \ - $(AM_CPPFLAGS) \ - -I$(top_srcdir) \ - -I$(top_builddir) \ - -I$(top_srcdir)/widgets \ - -DEVOLUTION_BINDIR=\""$(bindir)"\" \ - -DEVOLUTION_DATADIR=\""$(datadir)"\" \ - -DEVOLUTION_ECPSDIR=\""$(ecpsdir)"\" \ - -DEVOLUTION_ETSPECDIR=\""$(etspecdir)"\" \ - -DEVOLUTION_GALVIEWSDIR=\""$(viewsdir)"\" \ - -DEVOLUTION_HELPDIR=\""$(evolutionhelpdir)"\" \ - -DEVOLUTION_ICONDIR=\""$(icondir)"\" \ - -DEVOLUTION_IMAGESDIR=\""$(imagesdir)"\" \ - -DEVOLUTION_LIBDIR=\""$(datadir)"\" \ - -DEVOLUTION_LIBEXECDIR=\""$(privlibexecdir)"\" \ - -DEVOLUTION_LOCALEDIR=\""$(localedir)"\" \ - -DEVOLUTION_MODULEDIR=\""$(moduledir)"\" \ - -DEVOLUTION_PLUGINDIR=\""$(plugindir)"\" \ - -DEVOLUTION_PREFIX=\""$(prefix)"\" \ - -DEVOLUTION_PRIVDATADIR=\""$(privdatadir)"\" \ - -DEVOLUTION_SOUNDDIR=\""$(soundsdir)"\" \ - -DEVOLUTION_SYSCONFDIR=\""$(sysconfdir)"\" \ - -DEVOLUTION_TOOLSDIR=\""$(privlibexecdir)"\" \ - -DEVOLUTION_UIDIR=\""$(uidir)"\" \ - -DEVOLUTION_RULEDIR=\"$(ruledir)\" \ - -DG_LOG_DOMAIN=\"e-utils\" \ - $(EVOLUTION_DATA_SERVER_CFLAGS) \ - $(GNOME_PLATFORM_CFLAGS) - -libeutil_la_SOURCES = \ - $(eutilinclude_HEADERS) \ - e-activity.c \ - e-bit-array.c \ - e-categories-config.c \ - e-charset.c \ - e-config.c \ - e-datetime-format.c \ - e-dialog-utils.c \ - e-dialog-widgets.c \ - e-event.c \ - e-file-request.c \ - e-file-utils.c \ - e-html-utils.c \ - e-icon-factory.c \ - e-import.c \ - e-marshal.c \ - e-mktemp.c \ - e-poolv.c \ - e-plugin.c \ - e-plugin-ui.c \ - e-print.c \ - e-selection.c \ - e-sorter.c \ - e-sorter-array.c \ - e-source-util.c \ - e-stock-request.c \ - e-text-event-processor-emacs-like.c \ - e-text-event-processor.c \ - e-ui-manager.c \ - e-util.c \ - e-unicode.c \ - e-util-enumtypes.c \ - e-util-private.h \ - $(PLATFORM_SOURCES) +noinst_PROGRAMS = \ + evolution-source-viewer \ + test-calendar \ + test-category-completion \ + test-contact-store \ + test-dateedit \ + test-mail-signatures \ + test-name-selector \ + test-preferences-window \ + test-source-combo-box \ + test-source-config \ + test-source-selector \ + $(NULL) + +libeutil_la_CPPFLAGS = \ + $(AM_CPPFLAGS) \ + -I$(top_srcdir) \ + -I$(top_builddir) \ + -DLIBEUTIL_COMPILATION \ + -DEVOLUTION_BINDIR=\""$(bindir)"\" \ + -DEVOLUTION_DATADIR=\""$(datadir)"\" \ + -DEVOLUTION_ECPSDIR=\""$(ecpsdir)"\" \ + -DEVOLUTION_ETSPECDIR=\""$(etspecdir)"\" \ + -DEVOLUTION_GALVIEWSDIR=\""$(viewsdir)"\" \ + -DEVOLUTION_HELPDIR=\""$(evolutionhelpdir)"\" \ + -DEVOLUTION_ICONDIR=\""$(icondir)"\" \ + -DEVOLUTION_IMAGESDIR=\""$(imagesdir)"\" \ + -DEVOLUTION_LIBDIR=\""$(datadir)"\" \ + -DEVOLUTION_LIBEXECDIR=\""$(privlibexecdir)"\" \ + -DEVOLUTION_LOCALEDIR=\""$(localedir)"\" \ + -DEVOLUTION_MODULEDIR=\""$(moduledir)"\" \ + -DEVOLUTION_PLUGINDIR=\""$(plugindir)"\" \ + -DEVOLUTION_PREFIX=\""$(prefix)"\" \ + -DEVOLUTION_PRIVDATADIR=\""$(privdatadir)"\" \ + -DEVOLUTION_SOUNDDIR=\""$(soundsdir)"\" \ + -DEVOLUTION_SYSCONFDIR=\""$(sysconfdir)"\" \ + -DEVOLUTION_TOOLSDIR=\""$(privlibexecdir)"\" \ + -DEVOLUTION_UIDIR=\""$(uidir)"\" \ + -DEVOLUTION_RULEDIR=\"$(ruledir)\" \ + -DG_LOG_DOMAIN=\"libeutil\" \ + $(EVOLUTION_DATA_SERVER_CFLAGS) \ + $(GNOME_PLATFORM_CFLAGS) \ + $(CHAMPLAIN_CFLAGS) \ + $(GEO_CFLAGS) \ + $(GTKHTML_CFLAGS) \ + $(NULL) + +eutilinclude_HEADERS = \ + e-util.h \ + e-action-combo-box.h \ + e-activity-bar.h \ + e-activity-proxy.h \ + e-activity.h \ + e-alarm-selector.h \ + e-alert-bar.h \ + e-alert-dialog.h \ + e-alert-sink.h \ + e-alert.h \ + e-attachment-bar.h \ + e-attachment-button.h \ + e-attachment-dialog.h \ + e-attachment-handler-image.h \ + e-attachment-handler-sendto.h \ + e-attachment-handler.h \ + e-attachment-icon-view.h \ + e-attachment-paned.h \ + e-attachment-store.h \ + e-attachment-tree-view.h \ + e-attachment-view.h \ + e-attachment.h \ + e-auth-combo-box.h \ + e-autocomplete-selector.h \ + e-bit-array.h \ + e-book-source-config.h \ + e-buffer-tagger.h \ + e-cal-source-config.h \ + e-calendar-item.h \ + e-calendar.h \ + e-canvas-background.h \ + e-canvas-utils.h \ + e-canvas-vbox.h \ + e-canvas.h \ + e-categories-config.h \ + e-categories-dialog.h \ + e-categories-editor.h \ + e-categories-selector.h \ + e-category-completion.h \ + e-category-editor.h \ + e-cell-checkbox.h \ + e-cell-combo.h \ + e-cell-date-edit.h \ + e-cell-date.h \ + e-cell-hbox.h \ + e-cell-number.h \ + e-cell-percent.h \ + e-cell-pixbuf.h \ + e-cell-popup.h \ + e-cell-renderer-color.h \ + e-cell-size.h \ + e-cell-text.h \ + e-cell-toggle.h \ + e-cell-tree.h \ + e-cell-vbox.h \ + e-cell.h \ + e-charset-combo-box.h \ + e-charset.h \ + e-client-utils.h \ + e-config.h \ + e-contact-map-window.h \ + e-contact-map.h \ + e-contact-marker.h \ + e-contact-store.h \ + e-dateedit.h \ + e-datetime-format.h \ + e-destination-store.h \ + e-dialog-utils.h \ + e-dialog-widgets.h \ + e-event.h \ + e-file-request.h \ + e-file-utils.h \ + e-filter-code.h \ + e-filter-color.h \ + e-filter-datespec.h \ + e-filter-element.h \ + e-filter-file.h \ + e-filter-input.h \ + e-filter-int.h \ + e-filter-option.h \ + e-filter-part.h \ + e-filter-rule.h \ + e-focus-tracker.h \ + e-html-utils.h \ + e-icon-factory.h \ + e-image-chooser.h \ + e-import-assistant.h \ + e-import.h \ + e-interval-chooser.h \ + e-mail-identity-combo-box.h \ + e-mail-signature-combo-box.h \ + e-mail-signature-editor.h \ + e-mail-signature-manager.h \ + e-mail-signature-preview.h \ + e-mail-signature-script-dialog.h \ + e-mail-signature-tree-view.h \ + e-map.h \ + e-marshal.h \ + e-menu-tool-action.h \ + e-menu-tool-button.h \ + e-misc-utils.h \ + e-mktemp.h \ + e-name-selector-dialog.h \ + e-name-selector-entry.h \ + e-name-selector-list.h \ + e-name-selector-model.h \ + e-name-selector.h \ + e-online-button.h \ + e-paned.h \ + e-passwords.h \ + e-picture-gallery.h \ + e-plugin-ui.h \ + e-plugin.h \ + e-poolv.h \ + e-popup-action.h \ + e-popup-menu.h \ + e-port-entry.h \ + e-preferences-window.h \ + e-preview-pane.h \ + e-print.h \ + e-printable.h \ + e-reflow-model.h \ + e-reflow.h \ + e-rule-context.h \ + e-rule-editor.h \ + e-search-bar.h \ + e-selectable.h \ + e-selection-model-array.h \ + e-selection-model-simple.h \ + e-selection-model.h \ + e-selection.h \ + e-send-options.h \ + e-sorter-array.h \ + e-sorter.h \ + e-source-combo-box.h \ + e-source-config-backend.h \ + e-source-config-dialog.h \ + e-source-config.h \ + e-source-selector-dialog.h \ + e-source-selector.h \ + e-source-util.h \ + e-spell-entry.h \ + e-stock-request.h \ + e-table-click-to-add.h \ + e-table-col-dnd.h \ + e-table-col.h \ + e-table-column-specification.h \ + e-table-config.h \ + e-table-defines.h \ + e-table-extras.h \ + e-table-field-chooser-dialog.h \ + e-table-field-chooser-item.h \ + e-table-field-chooser.h \ + e-table-group-container.h \ + e-table-group-leaf.h \ + e-table-group.h \ + e-table-header-item.h \ + e-table-header-utils.h \ + e-table-header.h \ + e-table-item.h \ + e-table-memory-callbacks.h \ + e-table-memory-store.h \ + e-table-memory.h \ + e-table-model.h \ + e-table-one.h \ + e-table-search.h \ + e-table-selection-model.h \ + e-table-sort-info.h \ + e-table-sorted-variable.h \ + e-table-sorted.h \ + e-table-sorter.h \ + e-table-sorting-utils.h \ + e-table-specification.h \ + e-table-state.h \ + e-table-subset-variable.h \ + e-table-subset.h \ + e-table-utils.h \ + e-table-without.h \ + e-table.h \ + e-text-event-processor-emacs-like.h \ + e-text-event-processor-types.h \ + e-text-event-processor.h \ + e-text-model-repos.h \ + e-text-model.h \ + e-text.h \ + e-timezone-dialog.h \ + e-tree-memory-callbacks.h \ + e-tree-memory.h \ + e-tree-model-generator.h \ + e-tree-model.h \ + e-tree-selection-model.h \ + e-tree-sorted.h \ + e-tree-table-adapter.h \ + e-tree.h \ + e-ui-manager.h \ + e-unicode.h \ + e-url-entry.h \ + e-util-enums.h \ + e-util-enumtypes.h \ + e-web-view-gtkhtml.h \ + e-web-view-preview.h \ + e-web-view.h \ + e-xml-utils.h \ + ea-calendar-cell.h \ + ea-calendar-item.h \ + ea-cell-table.h \ + ea-factory.h \ + ea-widgets.h \ + gal-a11y-e-cell-popup.h \ + gal-a11y-e-cell-registry.h \ + gal-a11y-e-cell-toggle.h \ + gal-a11y-e-cell-tree.h \ + gal-a11y-e-cell-vbox.h \ + gal-a11y-e-cell.h \ + gal-a11y-e-table-click-to-add-factory.h \ + gal-a11y-e-table-click-to-add.h \ + gal-a11y-e-table-column-header.h \ + gal-a11y-e-table-factory.h \ + gal-a11y-e-table-item-factory.h \ + gal-a11y-e-table-item.h \ + gal-a11y-e-table.h \ + gal-a11y-e-text-factory.h \ + gal-a11y-e-text.h \ + gal-a11y-e-tree-factory.h \ + gal-a11y-e-tree.h \ + gal-a11y-factory.h \ + gal-a11y-util.h \ + gal-define-views-dialog.h \ + gal-define-views-model.h \ + gal-view-collection.h \ + gal-view-etable.h \ + gal-view-factory-etable.h \ + gal-view-factory.h \ + gal-view-instance-save-as-dialog.h \ + gal-view-instance.h \ + gal-view-new-dialog.h \ + gal-view.h \ + $(NULL) + +if OS_WIN32 +PLATFORM_SOURCES = \ + e-win32-reloc.c \ + e-win32-defaults.c \ + e-win32-defaults.h \ + $(NULL) +endif + +libeutil_la_SOURCES = \ + $(eutilinclude_HEADERS) \ + e-action-combo-box.c \ + e-activity-bar.c \ + e-activity-proxy.c \ + e-activity.c \ + e-alarm-selector.c \ + e-alert-bar.c \ + e-alert-dialog.c \ + e-alert-sink.c \ + e-alert.c \ + e-attachment-bar.c \ + e-attachment-button.c \ + e-attachment-dialog.c \ + e-attachment-handler-image.c \ + e-attachment-handler-sendto.c \ + e-attachment-handler.c \ + e-attachment-icon-view.c \ + e-attachment-paned.c \ + e-attachment-store.c \ + e-attachment-tree-view.c \ + e-attachment-view.c \ + e-attachment.c \ + e-auth-combo-box.c \ + e-autocomplete-selector.c \ + e-bit-array.c \ + e-book-source-config.c \ + e-buffer-tagger.c \ + e-cal-source-config.c \ + e-calendar-item.c \ + e-calendar.c \ + e-canvas-background.c \ + e-canvas-utils.c \ + e-canvas-vbox.c \ + e-canvas.c \ + e-categories-config.c \ + e-categories-dialog.c \ + e-categories-editor.c \ + e-categories-selector.c \ + e-category-completion.c \ + e-category-editor.c \ + e-cell-checkbox.c \ + e-cell-combo.c \ + e-cell-date-edit.c \ + e-cell-date.c \ + e-cell-hbox.c \ + e-cell-number.c \ + e-cell-percent.c \ + e-cell-pixbuf.c \ + e-cell-popup.c \ + e-cell-renderer-color.c \ + e-cell-size.c \ + e-cell-text.c \ + e-cell-toggle.c \ + e-cell-tree.c \ + e-cell-vbox.c \ + e-cell.c \ + e-charset-combo-box.c \ + e-charset.c \ + e-client-utils.c \ + e-config.c \ + e-contact-map-window.c \ + e-contact-map.c \ + e-contact-marker.c \ + e-contact-store.c \ + e-dateedit.c \ + e-datetime-format.c \ + e-destination-store.c \ + e-dialog-utils.c \ + e-dialog-widgets.c \ + e-event.c \ + e-file-request.c \ + e-file-utils.c \ + e-filter-code.c \ + e-filter-color.c \ + e-filter-datespec.c \ + e-filter-element.c \ + e-filter-file.c \ + e-filter-input.c \ + e-filter-int.c \ + e-filter-option.c \ + e-filter-part.c \ + e-filter-rule.c \ + e-focus-tracker.c \ + e-html-utils.c \ + e-icon-factory.c \ + e-image-chooser.c \ + e-import-assistant.c \ + e-import.c \ + e-interval-chooser.c \ + e-mail-identity-combo-box.c \ + e-mail-signature-combo-box.c \ + e-mail-signature-editor.c \ + e-mail-signature-manager.c \ + e-mail-signature-preview.c \ + e-mail-signature-script-dialog.c \ + e-mail-signature-tree-view.c \ + e-map.c \ + e-marshal.c \ + e-menu-tool-action.c \ + e-menu-tool-button.c \ + e-misc-utils.c \ + e-mktemp.c \ + e-name-selector-dialog.c \ + e-name-selector-entry.c \ + e-name-selector-list.c \ + e-name-selector-model.c \ + e-name-selector.c \ + e-online-button.c \ + e-paned.c \ + e-passwords.c \ + e-picture-gallery.c \ + e-plugin-ui.c \ + e-plugin.c \ + e-poolv.c \ + e-popup-action.c \ + e-popup-menu.c \ + e-port-entry.c \ + e-preferences-window.c \ + e-preview-pane.c \ + e-print.c \ + e-printable.c \ + e-reflow-model.c \ + e-reflow.c \ + e-rule-context.c \ + e-rule-editor.c \ + e-search-bar.c \ + e-selectable.c \ + e-selection-model-array.c \ + e-selection-model-simple.c \ + e-selection-model.c \ + e-selection.c \ + e-send-options.c \ + e-sorter-array.c \ + e-sorter.c \ + e-source-combo-box.c \ + e-source-config-backend.c \ + e-source-config-dialog.c \ + e-source-config.c \ + e-source-selector-dialog.c \ + e-source-selector.c \ + e-source-util.c \ + e-spell-entry.c \ + e-stock-request.c \ + e-table-click-to-add.c \ + e-table-col.c \ + e-table-column-specification.c \ + e-table-config.c \ + e-table-extras.c \ + e-table-field-chooser-dialog.c \ + e-table-field-chooser-item.c \ + e-table-field-chooser.c \ + e-table-group-container.c \ + e-table-group-leaf.c \ + e-table-group.c \ + e-table-header-item.c \ + e-table-header-utils.c \ + e-table-header.c \ + e-table-item.c \ + e-table-memory-callbacks.c \ + e-table-memory-store.c \ + e-table-memory.c \ + e-table-model.c \ + e-table-one.c \ + e-table-search.c \ + e-table-selection-model.c \ + e-table-sort-info.c \ + e-table-sorted-variable.c \ + e-table-sorted.c \ + e-table-sorter.c \ + e-table-sorting-utils.c \ + e-table-specification.c \ + e-table-state.c \ + e-table-subset-variable.c \ + e-table-subset.c \ + e-table-utils.c \ + e-table-without.c \ + e-table.c \ + e-text-event-processor-emacs-like.c \ + e-text-event-processor.c \ + e-text-model-repos.c \ + e-text-model.c \ + e-text.c \ + e-timezone-dialog.c \ + e-tree-memory-callbacks.c \ + e-tree-memory.c \ + e-tree-model-generator.c \ + e-tree-model.c \ + e-tree-selection-model.c \ + e-tree-sorted.c \ + e-tree-table-adapter.c \ + e-tree.c \ + e-ui-manager.c \ + e-unicode.c \ + e-url-entry.c \ + e-util-enumtypes.c \ + e-util-private.h \ + e-web-view-gtkhtml.c \ + e-web-view-preview.c \ + e-web-view.c \ + e-xml-utils.c \ + ea-calendar-cell.c \ + ea-calendar-item.c \ + ea-cell-table.c \ + ea-widgets.c \ + gal-a11y-e-cell-popup.c \ + gal-a11y-e-cell-registry.c \ + gal-a11y-e-cell-toggle.c \ + gal-a11y-e-cell-tree.c \ + gal-a11y-e-cell-vbox.c \ + gal-a11y-e-cell.c \ + gal-a11y-e-table-click-to-add-factory.c \ + gal-a11y-e-table-click-to-add.c \ + gal-a11y-e-table-column-header.c \ + gal-a11y-e-table-factory.c \ + gal-a11y-e-table-item-factory.c \ + gal-a11y-e-table-item.c \ + gal-a11y-e-table.c \ + gal-a11y-e-text-factory.c \ + gal-a11y-e-text.c \ + gal-a11y-e-tree-factory.c \ + gal-a11y-e-tree.c \ + gal-a11y-util.c \ + gal-define-views-dialog.c \ + gal-define-views-model.c \ + gal-view-collection.c \ + gal-view-etable.c \ + gal-view-factory-etable.c \ + gal-view-factory.c \ + gal-view-instance-save-as-dialog.c \ + gal-view-instance.c \ + gal-view-new-dialog.c \ + gal-view.c \ + $(PLATFORM_SOURCES) \ + $(NULL) libeutil_la_LDFLAGS = -avoid-version $(NO_UNDEFINED) -libeutil_la_LIBADD = \ - $(top_builddir)/libevolution-utils/libevolution-utils.la \ - $(ICONV_LIBS) \ - $(EVOLUTION_DATA_SERVER_LIBS) \ - $(GNOME_PLATFORM_LIBS) \ - $(INTLLIBS) +libeutil_la_LIBADD = \ + $(top_builddir)/libgnomecanvas/libgnomecanvas.la \ + $(ICONV_LIBS) \ + $(EVOLUTION_DATA_SERVER_LIBS) \ + $(GNOME_PLATFORM_LIBS) \ + $(CHAMPLAIN_LIBS) \ + $(GEO_LIBS) \ + $(GTKHTML_LIBS) \ + $(INTLLIBS) \ + $(MATH_LIB) \ + $(NULL) -error_DATA = e-system.error -errordir = $(privdatadir)/errors -@EVO_PLUGIN_RULE@ +TEST_CPPFLAGS = \ + $(libeutil_la_CPPFLAGS) \ + $(NULL) + +TEST_LDADD = \ + $(top_builddir)/e-util/libeutil.la \ + $(libeutil_la_LIBADD) \ + $(NULL) + +evolution_source_viewer_CPPFLAGS = $(TEST_CPPFLAGS) +evolution_source_viewer_SOURCES = evolution-source-viewer.c +evolution_source_viewer_LDADD = $(TEST_LDADD) + +test_calendar_CPPFLAGS = $(TEST_CPPFLAGS) +test_calendar_SOURCES = test-calendar.c +test_calendar_LDADD = $(TEST_LDADD) + +test_category_completion_CPPFLAGS = $(TEST_CPPFLAGS) +test_category_completion_SOURCES = test-category-completion.c +test_category_completion_LDADD = $(TEST_LDADD) + +test_contact_store_CPPFLAGS = $(TEST_CPPFLAGS) +test_contact_store_SOURCES = test-contact-store.c +test_contact_store_LDADD = $(TEST_LDADD) + +test_dateedit_CPPFLAGS = $(TEST_CPPFLAGS) +test_dateedit_SOURCES = test-dateedit.c +test_dateedit_LDADD = $(TEST_LDADD) + +test_mail_signatures_CPPFLAGS = $(TEST_CPPFLAGS) +test_mail_signatures_SOURCES = test-mail-signatures.c +test_mail_signatures_LDADD = $(TEST_LDADD) + +test_name_selector_CPPFLAGS = $(TEST_CPPFLAGS) +test_name_selector_SOURCES = test-name-selector.c +test_name_selector_LDADD = $(TEST_LDADD) + +test_preferences_window_CPPFLAGS = $(TEST_CPPFLAGS) +test_preferences_window_SOURCES = test-preferences-window.c +test_preferences_window_LDADD = $(TEST_LDADD) + +test_source_combo_box_CPPFLAGS = $(TEST_CPPFLAGS) +test_source_combo_box_SOURCES = test-source-combo-box.c +test_source_combo_box_LDADD = $(TEST_LDADD) + +test_source_config_CPPFLAGS = $(TEST_CPPFLAGS) +test_source_config_SOURCES = test-source-config.c +test_source_config_LDADD = $(TEST_LDADD) + +test_source_selector_CPPFLAGS = $(TEST_CPPFLAGS) +test_source_selector_SOURCES = test-source-selector.c +test_source_selector_LDADD = $(TEST_LDADD) + +EXTRA_DIST = \ + e-util-enumtypes.h.template \ + e-util-enumtypes.c.template \ + e-system.error.xml \ + filter.error.xml \ + widgets.error.xml \ + e-marshal.list \ + $(ui_DATA) + $(NULL) -EXTRA_DIST = \ - e-util-enumtypes.h.template \ - e-util-enumtypes.c.template \ - e-system.error.xml \ - e-marshal.list +BUILT_SOURCES = \ + $(ENUM_GENERATED) \ + $(MARSHAL_GENERATED) \ + $(error_DATA) \ + $(NULL) -BUILT_SOURCES = $(ENUM_GENERATED) $(MARSHAL_GENERATED) $(error_DATA) -CLEANFILES = $(BUILT_SOURCES) +CLEANFILES = $(BUILT_SOURCES) dist-hook: cd $(distdir); rm -f $(BUILT_SOURCES) diff --git a/widgets/table/arrow-down.xpm b/e-util/arrow-down.xpm index f1e6cb4b3c..f1e6cb4b3c 100644 --- a/widgets/table/arrow-down.xpm +++ b/e-util/arrow-down.xpm diff --git a/widgets/table/arrow-up.xpm b/e-util/arrow-up.xpm index 0cc5b9a00c..0cc5b9a00c 100644 --- a/widgets/table/arrow-up.xpm +++ b/e-util/arrow-up.xpm diff --git a/widgets/table/check-empty.xpm b/e-util/check-empty.xpm index 746b20234e..746b20234e 100644 --- a/widgets/table/check-empty.xpm +++ b/e-util/check-empty.xpm diff --git a/widgets/table/check-filled.xpm b/e-util/check-filled.xpm index c0468fc25b..c0468fc25b 100644 --- a/widgets/table/check-filled.xpm +++ b/e-util/check-filled.xpm diff --git a/widgets/misc/e-action-combo-box.c b/e-util/e-action-combo-box.c index 0747a6ed27..0747a6ed27 100644 --- a/widgets/misc/e-action-combo-box.c +++ b/e-util/e-action-combo-box.c diff --git a/widgets/misc/e-action-combo-box.h b/e-util/e-action-combo-box.h index 300338639a..43adeaff7a 100644 --- a/widgets/misc/e-action-combo-box.h +++ b/e-util/e-action-combo-box.h @@ -18,6 +18,10 @@ * Boston, MA 02111-1307, USA. */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_ACTION_COMBO_BOX_H #define E_ACTION_COMBO_BOX_H diff --git a/widgets/misc/e-activity-bar.c b/e-util/e-activity-bar.c index f85b403bd7..f85b403bd7 100644 --- a/widgets/misc/e-activity-bar.c +++ b/e-util/e-activity-bar.c diff --git a/widgets/misc/e-activity-bar.h b/e-util/e-activity-bar.h index 24f56eca53..d56378e2c1 100644 --- a/widgets/misc/e-activity-bar.h +++ b/e-util/e-activity-bar.h @@ -16,6 +16,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_ACTIVITY_BAR_H #define E_ACTIVITY_BAR_H diff --git a/widgets/misc/e-activity-proxy.c b/e-util/e-activity-proxy.c index 7547088aac..7547088aac 100644 --- a/widgets/misc/e-activity-proxy.c +++ b/e-util/e-activity-proxy.c diff --git a/widgets/misc/e-activity-proxy.h b/e-util/e-activity-proxy.h index 975cd6ff05..75125351f4 100644 --- a/widgets/misc/e-activity-proxy.h +++ b/e-util/e-activity-proxy.h @@ -19,6 +19,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_ACTIVITY_PROXY_H #define E_ACTIVITY_PROXY_H diff --git a/e-util/e-activity.c b/e-util/e-activity.c index cd1c5699b2..5eefb652b0 100644 --- a/e-util/e-activity.c +++ b/e-util/e-activity.c @@ -29,8 +29,7 @@ #include <glib/gi18n.h> #include <camel/camel.h> -#include "e-util/e-util.h" -#include "e-util/e-util-enumtypes.h" +#include "e-util-enumtypes.h" #define E_ACTIVITY_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ diff --git a/e-util/e-activity.h b/e-util/e-activity.h index 4cc9951fde..ac380a030c 100644 --- a/e-util/e-activity.h +++ b/e-util/e-activity.h @@ -19,11 +19,16 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_ACTIVITY_H #define E_ACTIVITY_H #include <gtk/gtk.h> -#include <libevolution-utils/e-alert-sink.h> + +#include <e-util/e-alert-sink.h> #include <e-util/e-util-enums.h> /* Standard GObject macros */ diff --git a/widgets/misc/e-alarm-selector.c b/e-util/e-alarm-selector.c index bdc1b7e35e..bdc1b7e35e 100644 --- a/widgets/misc/e-alarm-selector.c +++ b/e-util/e-alarm-selector.c diff --git a/widgets/misc/e-alarm-selector.h b/e-util/e-alarm-selector.h index 63500866c9..c545a46cf1 100644 --- a/widgets/misc/e-alarm-selector.h +++ b/e-util/e-alarm-selector.h @@ -16,10 +16,14 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_ALARM_SELECTOR_H #define E_ALARM_SELECTOR_H -#include <libedataserverui/libedataserverui.h> +#include <e-util/e-source-selector.h> /* Standard GObject macros */ #define E_TYPE_ALARM_SELECTOR \ diff --git a/widgets/misc/e-alert-bar.c b/e-util/e-alert-bar.c index 2022af99f1..2022af99f1 100644 --- a/widgets/misc/e-alert-bar.c +++ b/e-util/e-alert-bar.c diff --git a/widgets/misc/e-alert-bar.h b/e-util/e-alert-bar.h index f0cf39abb1..ae5b315b40 100644 --- a/widgets/misc/e-alert-bar.h +++ b/e-util/e-alert-bar.h @@ -16,11 +16,16 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_ALERT_BAR_H #define E_ALERT_BAR_H #include <gtk/gtk.h> -#include <libevolution-utils/e-alert.h> + +#include <e-util/e-alert.h> /* Standard GObject macros */ #define E_TYPE_ALERT_BAR \ diff --git a/libevolution-utils/e-alert-dialog.c b/e-util/e-alert-dialog.c index 75650902ae..75650902ae 100644 --- a/libevolution-utils/e-alert-dialog.c +++ b/e-util/e-alert-dialog.c diff --git a/libevolution-utils/e-alert-dialog.h b/e-util/e-alert-dialog.h index cfdcca5875..3d2662a398 100644 --- a/libevolution-utils/e-alert-dialog.h +++ b/e-util/e-alert-dialog.h @@ -25,7 +25,8 @@ #define E_ALERT_DIALOG_H #include <gtk/gtk.h> -#include <libevolution-utils/e-alert.h> + +#include <e-util/e-alert.h> /* Standard GObject macros */ #define E_TYPE_ALERT_DIALOG \ diff --git a/libevolution-utils/e-alert-sink.c b/e-util/e-alert-sink.c index 53965c86da..3077261a90 100644 --- a/libevolution-utils/e-alert-sink.c +++ b/e-util/e-alert-sink.c @@ -19,7 +19,7 @@ /** * SECTION: e-alert-sink * @short_description: an interface to handle alerts - * @include: libevolution-utils/e-alert-sink.h + * @include: e-util/e-util.h * * A widget that implements #EAlertSink means it can handle #EAlerts, * usually by displaying them to the user. diff --git a/libevolution-utils/e-alert-sink.h b/e-util/e-alert-sink.h index 73199c1e2e..c8fd5127e7 100644 --- a/libevolution-utils/e-alert-sink.h +++ b/e-util/e-alert-sink.h @@ -20,7 +20,8 @@ #define E_ALERT_SINK_H #include <gtk/gtk.h> -#include <libevolution-utils/e-alert.h> + +#include <e-util/e-alert.h> /* Standard GObject macros */ #define E_TYPE_ALERT_SINK \ diff --git a/libevolution-utils/e-alert.c b/e-util/e-alert.c index 5a08e07122..5a08e07122 100644 --- a/libevolution-utils/e-alert.c +++ b/e-util/e-alert.c diff --git a/libevolution-utils/e-alert.h b/e-util/e-alert.h index f62e612235..f62e612235 100644 --- a/libevolution-utils/e-alert.h +++ b/e-util/e-alert.h diff --git a/widgets/misc/e-attachment-bar.c b/e-util/e-attachment-bar.c index 3fc4753055..3fc4753055 100644 --- a/widgets/misc/e-attachment-bar.c +++ b/e-util/e-attachment-bar.c diff --git a/widgets/misc/e-attachment-bar.h b/e-util/e-attachment-bar.h index 3542f217df..9f35ae2aba 100644 --- a/widgets/misc/e-attachment-bar.h +++ b/e-util/e-attachment-bar.h @@ -19,11 +19,15 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_ATTACHMENT_BAR_H #define E_ATTACHMENT_BAR_H #include <gtk/gtk.h> -#include <misc/e-attachment-view.h> +#include <e-util/e-attachment-view.h> /* Standard GObject macros */ #define E_TYPE_ATTACHMENT_BAR \ diff --git a/widgets/misc/e-attachment-button.c b/e-util/e-attachment-button.c index a2057e3354..a2057e3354 100644 --- a/widgets/misc/e-attachment-button.c +++ b/e-util/e-attachment-button.c diff --git a/widgets/misc/e-attachment-button.h b/e-util/e-attachment-button.h index 56adf704f0..abe5fa4dc9 100644 --- a/widgets/misc/e-attachment-button.h +++ b/e-util/e-attachment-button.h @@ -19,12 +19,16 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_ATTACHMENT_BUTTON_H #define E_ATTACHMENT_BUTTON_H #include <gtk/gtk.h> -#include <misc/e-attachment.h> -#include <misc/e-attachment-view.h> +#include <e-util/e-attachment.h> +#include <e-util/e-attachment-view.h> /* Standard GObject macros */ #define E_TYPE_ATTACHMENT_BUTTON \ diff --git a/widgets/misc/e-attachment-dialog.c b/e-util/e-attachment-dialog.c index 9a9a1e7942..9a9a1e7942 100644 --- a/widgets/misc/e-attachment-dialog.c +++ b/e-util/e-attachment-dialog.c diff --git a/widgets/misc/e-attachment-dialog.h b/e-util/e-attachment-dialog.h index 503dcbbc67..af7141190e 100644 --- a/widgets/misc/e-attachment-dialog.h +++ b/e-util/e-attachment-dialog.h @@ -19,11 +19,15 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_ATTACHMENT_DIALOG_H #define E_ATTACHMENT_DIALOG_H #include <gtk/gtk.h> -#include <misc/e-attachment.h> +#include <e-util/e-attachment.h> /* Standard GObject macros */ #define E_TYPE_ATTACHMENT_DIALOG \ diff --git a/widgets/misc/e-attachment-handler-image.c b/e-util/e-attachment-handler-image.c index a8c29f24c0..36c3a83614 100644 --- a/widgets/misc/e-attachment-handler-image.c +++ b/e-util/e-attachment-handler-image.c @@ -28,8 +28,6 @@ #include <glib/gi18n.h> #include <gdesktop-enums.h> -#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)) diff --git a/widgets/misc/e-attachment-handler-image.h b/e-util/e-attachment-handler-image.h index bade5cec5e..e0e0cb3b23 100644 --- a/widgets/misc/e-attachment-handler-image.h +++ b/e-util/e-attachment-handler-image.h @@ -19,10 +19,14 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_ATTACHMENT_HANDLER_IMAGE_H #define E_ATTACHMENT_HANDLER_IMAGE_H -#include <misc/e-attachment-handler.h> +#include <e-util/e-attachment-handler.h> /* Standard GObject macros */ #define E_TYPE_ATTACHMENT_HANDLER_IMAGE \ diff --git a/widgets/misc/e-attachment-handler-sendto.c b/e-util/e-attachment-handler-sendto.c index f0fe698713..f0fe698713 100644 --- a/widgets/misc/e-attachment-handler-sendto.c +++ b/e-util/e-attachment-handler-sendto.c diff --git a/widgets/misc/e-attachment-handler-sendto.h b/e-util/e-attachment-handler-sendto.h index 9ae272ad7a..17115c4104 100644 --- a/widgets/misc/e-attachment-handler-sendto.h +++ b/e-util/e-attachment-handler-sendto.h @@ -18,10 +18,14 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_ATTACHMENT_HANDLER_SENDTO_H #define E_ATTACHMENT_HANDLER_SENDTO_H -#include <misc/e-attachment-handler.h> +#include <e-util/e-attachment-handler.h> /* Standard GObject macros */ #define E_TYPE_ATTACHMENT_HANDLER_SENDTO \ diff --git a/widgets/misc/e-attachment-handler.c b/e-util/e-attachment-handler.c index 87b9abddb5..87b9abddb5 100644 --- a/widgets/misc/e-attachment-handler.c +++ b/e-util/e-attachment-handler.c diff --git a/widgets/misc/e-attachment-handler.h b/e-util/e-attachment-handler.h index 301f789b07..086ba8ff6a 100644 --- a/widgets/misc/e-attachment-handler.h +++ b/e-util/e-attachment-handler.h @@ -19,12 +19,16 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_ATTACHMENT_HANDLER_H #define E_ATTACHMENT_HANDLER_H #include <libebackend/libebackend.h> -#include <misc/e-attachment-view.h> +#include <e-util/e-attachment-view.h> /* Standard GObject macros */ #define E_TYPE_ATTACHMENT_HANDLER \ diff --git a/widgets/misc/e-attachment-icon-view.c b/e-util/e-attachment-icon-view.c index 2be8009e8a..2be8009e8a 100644 --- a/widgets/misc/e-attachment-icon-view.c +++ b/e-util/e-attachment-icon-view.c diff --git a/widgets/misc/e-attachment-icon-view.h b/e-util/e-attachment-icon-view.h index e89992fb76..bd3d2109db 100644 --- a/widgets/misc/e-attachment-icon-view.h +++ b/e-util/e-attachment-icon-view.h @@ -19,6 +19,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_ATTACHMENT_ICON_VIEW_H #define E_ATTACHMENT_ICON_VIEW_H diff --git a/widgets/misc/e-attachment-paned.c b/e-util/e-attachment-paned.c index a3c4efb187..a3c4efb187 100644 --- a/widgets/misc/e-attachment-paned.c +++ b/e-util/e-attachment-paned.c diff --git a/widgets/misc/e-attachment-paned.h b/e-util/e-attachment-paned.h index 7daffd5508..af44cd6d67 100644 --- a/widgets/misc/e-attachment-paned.h +++ b/e-util/e-attachment-paned.h @@ -19,6 +19,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_ATTACHMENT_PANED_H #define E_ATTACHMENT_PANED_H diff --git a/widgets/misc/e-attachment-store.c b/e-util/e-attachment-store.c index 95465eba81..f434f5e81c 100644 --- a/widgets/misc/e-attachment-store.c +++ b/e-util/e-attachment-store.c @@ -28,8 +28,7 @@ #include <errno.h> #include <glib/gi18n.h> -#include "e-util/e-util.h" -#include "e-util/e-mktemp.h" +#include "e-mktemp.h" #define E_ATTACHMENT_STORE_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ diff --git a/widgets/misc/e-attachment-store.h b/e-util/e-attachment-store.h index a963f0558f..a112b0e56c 100644 --- a/widgets/misc/e-attachment-store.h +++ b/e-util/e-attachment-store.h @@ -19,11 +19,15 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_ATTACHMENT_STORE_H #define E_ATTACHMENT_STORE_H #include <gtk/gtk.h> -#include <misc/e-attachment.h> +#include <e-util/e-attachment.h> /* Standard GObject macros */ #define E_TYPE_ATTACHMENT_STORE \ diff --git a/widgets/misc/e-attachment-tree-view.c b/e-util/e-attachment-tree-view.c index b73751fbbd..b73751fbbd 100644 --- a/widgets/misc/e-attachment-tree-view.c +++ b/e-util/e-attachment-tree-view.c diff --git a/widgets/misc/e-attachment-tree-view.h b/e-util/e-attachment-tree-view.h index 4300ffa71f..416a09b7f6 100644 --- a/widgets/misc/e-attachment-tree-view.h +++ b/e-util/e-attachment-tree-view.h @@ -19,6 +19,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_ATTACHMENT_TREE_VIEW_H #define E_ATTACHMENT_TREE_VIEW_H diff --git a/widgets/misc/e-attachment-view.c b/e-util/e-attachment-view.c index e8f9af8fdb..e468c14120 100644 --- a/widgets/misc/e-attachment-view.c +++ b/e-util/e-attachment-view.c @@ -28,13 +28,12 @@ #include <glib/gi18n.h> #include <gdk/gdkkeysyms.h> -#include "e-util/e-selection.h" -#include "e-util/e-ui-manager.h" -#include "e-util/e-util.h" - #include "e-attachment-dialog.h" #include "e-attachment-handler-image.h" #include "e-attachment-handler-sendto.h" +#include "e-misc-utils.h" +#include "e-selection.h" +#include "e-ui-manager.h" enum { UPDATE_ACTIONS, diff --git a/widgets/misc/e-attachment-view.h b/e-util/e-attachment-view.h index 87274d0c63..174181541a 100644 --- a/widgets/misc/e-attachment-view.h +++ b/e-util/e-attachment-view.h @@ -19,11 +19,15 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_ATTACHMENT_VIEW_H #define E_ATTACHMENT_VIEW_H #include <gtk/gtk.h> -#include <misc/e-attachment-store.h> +#include <e-util/e-attachment-store.h> /* Standard GObject macros */ #define E_TYPE_ATTACHMENT_VIEW \ diff --git a/widgets/misc/e-attachment.c b/e-util/e-attachment.c index 4ebaef3747..3357775111 100644 --- a/widgets/misc/e-attachment.c +++ b/e-util/e-attachment.c @@ -31,10 +31,9 @@ #include <libedataserver/libedataserver.h> -#include "e-util/e-icon-factory.h" -#include "e-util/e-util.h" -#include "e-util/e-mktemp.h" #include "e-attachment-store.h" +#include "e-icon-factory.h" +#include "e-mktemp.h" #define E_ATTACHMENT_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ diff --git a/widgets/misc/e-attachment.h b/e-util/e-attachment.h index 890c13294e..268bcf68b9 100644 --- a/widgets/misc/e-attachment.h +++ b/e-util/e-attachment.h @@ -19,6 +19,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_ATTACHMENT_H #define E_ATTACHMENT_H diff --git a/widgets/misc/e-auth-combo-box.c b/e-util/e-auth-combo-box.c index bd3d8c78ea..bd3d8c78ea 100644 --- a/widgets/misc/e-auth-combo-box.c +++ b/e-util/e-auth-combo-box.c diff --git a/widgets/misc/e-auth-combo-box.h b/e-util/e-auth-combo-box.h index e449f1c06b..a8ec3f9bf6 100644 --- a/widgets/misc/e-auth-combo-box.h +++ b/e-util/e-auth-combo-box.h @@ -16,6 +16,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_AUTH_COMBO_BOX_H #define E_AUTH_COMBO_BOX_H diff --git a/widgets/misc/e-autocomplete-selector.c b/e-util/e-autocomplete-selector.c index c0bf207bbd..c0bf207bbd 100644 --- a/widgets/misc/e-autocomplete-selector.c +++ b/e-util/e-autocomplete-selector.c diff --git a/widgets/misc/e-autocomplete-selector.h b/e-util/e-autocomplete-selector.h index 4e44efc7f3..af17f21828 100644 --- a/widgets/misc/e-autocomplete-selector.h +++ b/e-util/e-autocomplete-selector.h @@ -16,10 +16,14 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_AUTOCOMPLETE_SELECTOR_H #define E_AUTOCOMPLETE_SELECTOR_H -#include <libedataserverui/libedataserverui.h> +#include <e-util/e-source-selector.h> /* Standard GObject macros */ #define E_TYPE_AUTOCOMPLETE_SELECTOR \ diff --git a/e-util/e-bit-array.c b/e-util/e-bit-array.c index 456a4d495d..b17f8a089b 100644 --- a/e-util/e-bit-array.c +++ b/e-util/e-bit-array.c @@ -28,7 +28,6 @@ #include <gtk/gtk.h> #include "e-bit-array.h" -#include "e-util.h" #define ONES ((guint32) 0xffffffff) diff --git a/e-util/e-bit-array.h b/e-util/e-bit-array.h index 717fe585e7..39b55d906c 100644 --- a/e-util/e-bit-array.h +++ b/e-util/e-bit-array.h @@ -21,6 +21,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef _E_BIT_ARRAY_H_ #define _E_BIT_ARRAY_H_ diff --git a/widgets/misc/e-book-source-config.c b/e-util/e-book-source-config.c index 56d9771d9f..56d9771d9f 100644 --- a/widgets/misc/e-book-source-config.c +++ b/e-util/e-book-source-config.c diff --git a/widgets/misc/e-book-source-config.h b/e-util/e-book-source-config.h index 18e075511e..3e000789e9 100644 --- a/widgets/misc/e-book-source-config.h +++ b/e-util/e-book-source-config.h @@ -16,10 +16,14 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_BOOK_SOURCE_CONFIG_H #define E_BOOK_SOURCE_CONFIG_H -#include <misc/e-source-config.h> +#include <e-util/e-source-config.h> /* Standard GObject macros */ #define E_TYPE_BOOK_SOURCE_CONFIG \ diff --git a/widgets/misc/e-buffer-tagger.c b/e-util/e-buffer-tagger.c index b68d414868..c05a854020 100644 --- a/widgets/misc/e-buffer-tagger.c +++ b/e-util/e-buffer-tagger.c @@ -30,9 +30,10 @@ #include <string.h> #include <ctype.h> -#include "e-util/e-util.h" #include "e-buffer-tagger.h" +#include "e-misc-utils.h" + enum EBufferTaggerState { E_BUFFER_TAGGER_STATE_NONE = 0, diff --git a/widgets/misc/e-buffer-tagger.h b/e-util/e-buffer-tagger.h index 86e6710d01..f00606ea44 100644 --- a/widgets/misc/e-buffer-tagger.h +++ b/e-util/e-buffer-tagger.h @@ -19,6 +19,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_BUFFER_TAGGER_H #define E_BUFFER_TAGGER_H diff --git a/widgets/misc/e-cal-source-config.c b/e-util/e-cal-source-config.c index e57d0c6745..e009ac6650 100644 --- a/widgets/misc/e-cal-source-config.c +++ b/e-util/e-cal-source-config.c @@ -21,7 +21,7 @@ #include <config.h> #include <glib/gi18n-lib.h> -#include <e-util/e-util.h> +#include "e-misc-utils.h" #define E_CAL_SOURCE_CONFIG_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ diff --git a/widgets/misc/e-cal-source-config.h b/e-util/e-cal-source-config.h index 4db861069e..dc78f70e87 100644 --- a/widgets/misc/e-cal-source-config.h +++ b/e-util/e-cal-source-config.h @@ -16,11 +16,15 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_CAL_SOURCE_CONFIG_H #define E_CAL_SOURCE_CONFIG_H #include <libecal/libecal.h> -#include <misc/e-source-config.h> +#include <e-util/e-source-config.h> /* Standard GObject macros */ #define E_TYPE_CAL_SOURCE_CONFIG \ diff --git a/widgets/misc/e-calendar-item.c b/e-util/e-calendar-item.c index 96b39529b1..3e7715414c 100644 --- a/widgets/misc/e-calendar-item.c +++ b/e-util/e-calendar-item.c @@ -28,7 +28,6 @@ #include <libebackend/libebackend.h> #include "e-calendar-item.h" -#include "ea-widgets.h" #include <time.h> #include <stdlib.h> @@ -36,7 +35,9 @@ #include <gtk/gtk.h> #include <gdk/gdkkeysyms.h> #include <glib/gi18n.h> -#include <e-util/e-util.h> + +#include "ea-widgets.h" +#include "e-misc-utils.h" static const gint e_calendar_item_days_in_month[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 diff --git a/widgets/misc/e-calendar-item.h b/e-util/e-calendar-item.h index d8fc5f7277..a4c0867b66 100644 --- a/widgets/misc/e-calendar-item.h +++ b/e-util/e-calendar-item.h @@ -22,6 +22,10 @@ */ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef _E_CALENDAR_ITEM_H_ #define _E_CALENDAR_ITEM_H_ @@ -128,8 +132,7 @@ typedef struct tm (*ECalendarItemGetTimeCallback) (ECalendarItem *calitem, (G_TYPE_INSTANCE_GET_CLASS \ ((obj), E_TYPE_CALENDAR_ITEM, ECalendarItemClass)) -struct _ECalendarItem -{ +struct _ECalendarItem { GnomeCanvasItem canvas_item; /* The year & month of the first calendar being displayed. */ @@ -270,8 +273,7 @@ struct _ECalendarItem gboolean date_range_changed; }; -struct _ECalendarItemClass -{ +struct _ECalendarItemClass { GnomeCanvasItemClass parent_class; void (* date_range_changed) (ECalendarItem *calitem); diff --git a/widgets/misc/e-calendar.c b/e-util/e-calendar.c index 38336cb618..38336cb618 100644 --- a/widgets/misc/e-calendar.c +++ b/e-util/e-calendar.c diff --git a/widgets/misc/e-calendar.h b/e-util/e-calendar.h index bdf77786f2..9a3651348c 100644 --- a/widgets/misc/e-calendar.h +++ b/e-util/e-calendar.h @@ -20,12 +20,16 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef _E_CALENDAR_H_ #define _E_CALENDAR_H_ #include <gtk/gtk.h> -#include <misc/e-canvas.h> -#include "e-calendar-item.h" +#include <e-util/e-canvas.h> +#include <e-util/e-calendar-item.h> G_BEGIN_DECLS diff --git a/widgets/misc/e-canvas-background.c b/e-util/e-canvas-background.c index 0b1f05a6b8..6379697719 100644 --- a/widgets/misc/e-canvas-background.c +++ b/e-util/e-canvas-background.c @@ -26,6 +26,8 @@ #include <config.h> #endif +#include "e-canvas-background.h" + #include <math.h> #include <stdio.h> #include <string.h> @@ -34,15 +36,13 @@ #include <gtk/gtk.h> #include <glib/gi18n.h> -#include "e-util/e-util.h" -#include "misc/e-canvas.h" -#include "misc/e-canvas-utils.h" -#include "e-canvas-background.h" +#include "e-canvas.h" +#include "e-canvas-utils.h" #define E_CANVAS_BACKGROUND_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), E_CANVAS_BACKGROUND_TYPE, ECanvasBackgroundPrivate)) + ((obj), E_TYPE_CANVAS_BACKGROUND, ECanvasBackgroundPrivate)) /* workaround for avoiding API broken */ #define ecb_get_type e_canvas_background_get_type diff --git a/e-util/e-canvas-background.h b/e-util/e-canvas-background.h new file mode 100644 index 0000000000..c57c64f787 --- /dev/null +++ b/e-util/e-canvas-background.h @@ -0,0 +1,75 @@ +/* + * e-canvas-background.h - background color for canvas. + * + * 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: + * Chris Lahey <clahey@ximian.com> + * + * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) + * + */ + +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + +#ifndef E_CANVAS_BACKGROUND_H +#define E_CANVAS_BACKGROUND_H + +#include <libgnomecanvas/gnome-canvas.h> + +/* Standard GObject macros */ +#define E_TYPE_CANVAS_BACKGROUND \ + (e_canvas_background_get_type ()) +#define E_CANVAS_BACKGROUND(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST \ + ((obj), E_TYPE_CANVAS_BACKGROUND, ECanvasBackground)) +#define E_CANVAS_BACKGROUND_CLASS(cls) \ + (G_TYPE_CHECK_CLASS_CAST \ + ((cls), E_TYPE_CANVAS_BACKGROUND, ECanvasBackgroundClass)) +#define E_IS_CANVAS_BACKGROUND(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE \ + ((obj), E_TYPE_CANVAS_BACKGROUND)) +#define E_IS_CANVAS_BACKGROUND_CLASS(cls) \ + (G_TYPE_CHECK_CLASS_TYPE \ + ((cls), E_TYPE_CANVAS_BACKGROUND)) +#define E_CANVAS_BACKGROUND_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS \ + ((obj), E_TYPE_CANVAS_BACKGROUND, ECanvasBackgroundClass)) + +G_BEGIN_DECLS + +typedef struct _ECanvasBackground ECanvasBackground; +typedef struct _ECanvasBackgroundClass ECanvasBackgroundClass; +typedef struct _ECanvasBackgroundPrivate ECanvasBackgroundPrivate; + +struct _ECanvasBackground { + GnomeCanvasItem item; + ECanvasBackgroundPrivate *priv; +}; + +struct _ECanvasBackgroundClass { + GnomeCanvasItemClass parent_class; + + void (*style_set) (ECanvasBackground *eti, + GtkStyle *previous_style); +}; + +GType e_canvas_background_get_type (void) G_GNUC_CONST; + +G_END_DECLS + +#endif /* E_CANVAS_BACKGROUND */ diff --git a/widgets/misc/e-canvas-utils.c b/e-util/e-canvas-utils.c index ec3aad3858..ec3aad3858 100644 --- a/widgets/misc/e-canvas-utils.c +++ b/e-util/e-canvas-utils.c diff --git a/widgets/misc/e-canvas-utils.h b/e-util/e-canvas-utils.h index 0843ba8f17..c12f156c59 100644 --- a/widgets/misc/e-canvas-utils.h +++ b/e-util/e-canvas-utils.h @@ -20,6 +20,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef __E_CANVAS_UTILS__ #define __E_CANVAS_UTILS__ diff --git a/widgets/misc/e-canvas-vbox.c b/e-util/e-canvas-vbox.c index 1767c1ac14..f8de013557 100644 --- a/widgets/misc/e-canvas-vbox.c +++ b/e-util/e-canvas-vbox.c @@ -30,7 +30,6 @@ #include <gtk/gtk.h> #include <glib/gi18n.h> -#include "e-util/e-util.h" #include "e-canvas.h" #include "e-canvas-utils.h" diff --git a/e-util/e-canvas-vbox.h b/e-util/e-canvas-vbox.h new file mode 100644 index 0000000000..5255e7683d --- /dev/null +++ b/e-util/e-canvas-vbox.h @@ -0,0 +1,92 @@ +/* + * 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: + * Chris Lahey <clahey@ximian.com> + * + * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) + * + */ + +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + +#ifndef E_CANVAS_VBOX_H +#define E_CANVAS_VBOX_H + +#include <gtk/gtk.h> +#include <libgnomecanvas/gnome-canvas.h> + +/* Standard GObject macros */ +#define E_TYPE_CANVAS_VBOX \ + (e_canvas_vbox_get_type ()) +#define E_CANVAS_VBOX(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST \ + ((obj), E_TYPE_CANVAS_VBOX, ECanvasVbox)) +#define E_CANVAS_VBOX_CLASS(cls) \ + (G_TYPE_CHECK_CLASS_CAST \ + ((cls), E_TYPE_CANVAS_VBOX, ECanvasVboxClass)) +#define E_IS_CANVAS_VBOX(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE \ + ((obj), E_TYPE_CANVAS_VBOX)) +#define E_IS_CANVAS_VBOX_CLASS(cls) \ + (G_TYPE_CHECK_CLASS_TYPE \ + ((cls), E_TYPE_CANVAS_VBOX)) +#define E_CANVAS_VBOX_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS \ + ((obj), E_TYPE_CANVAS_VBOX, ECanvasVboxClass)) + +G_BEGIN_DECLS + +typedef struct _ECanvasVbox ECanvasVbox; +typedef struct _ECanvasVboxClass ECanvasVboxClass; + +struct _ECanvasVbox { + GnomeCanvasGroup parent; + + /* item specific fields */ + GList *items; /* Of type GnomeCanvasItem */ + + gdouble width; + gdouble minimum_width; + gdouble height; + gdouble spacing; +}; + +struct _ECanvasVboxClass { + GnomeCanvasGroupClass parent_class; + + void (*add_item) (ECanvasVbox *canvas_vbox, + GnomeCanvasItem *item); + void (*add_item_start) (ECanvasVbox *canvas_vbox, + GnomeCanvasItem *item); +}; + +/* + * To be added to a CanvasVbox, an item must have the argument "width" as + * a Read/Write argument and "height" as a Read Only argument. It + * should also do an ECanvas parent CanvasVbox request if its size + * changes. + */ +GType e_canvas_vbox_get_type (void) G_GNUC_CONST; +void e_canvas_vbox_add_item (ECanvasVbox *canvas_vbox, + GnomeCanvasItem *item); +void e_canvas_vbox_add_item_start (ECanvasVbox *canvas_vbox, + GnomeCanvasItem *item); + +G_END_DECLS + +#endif /* E_CANVAS_VBOX_H */ diff --git a/widgets/misc/e-canvas.c b/e-util/e-canvas.c index 3ffc105867..d39f9f7684 100644 --- a/widgets/misc/e-canvas.c +++ b/e-util/e-canvas.c @@ -26,8 +26,6 @@ #include <gtk/gtk.h> -#include "e-util/e-util.h" - #include "e-canvas.h" #define d(x) diff --git a/widgets/misc/e-canvas.h b/e-util/e-canvas.h index c5f2087cd0..8d704b963c 100644 --- a/widgets/misc/e-canvas.h +++ b/e-util/e-canvas.h @@ -20,6 +20,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_CANVAS_H #define E_CANVAS_H diff --git a/e-util/e-categories-config.c b/e-util/e-categories-config.c index 519fc5db32..611c7fa4af 100644 --- a/e-util/e-categories-config.c +++ b/e-util/e-categories-config.c @@ -30,9 +30,8 @@ #include <gtk/gtk.h> #include <glib/gi18n.h> -#include <libedataserverui/libedataserverui.h> - -#include "e-util/e-util.h" +#include "e-categories-dialog.h" +#include "e-misc-utils.h" static GHashTable *pixbufs_cache = NULL; diff --git a/e-util/e-categories-config.h b/e-util/e-categories-config.h index 82294ae6b9..f778e0116f 100644 --- a/e-util/e-categories-config.h +++ b/e-util/e-categories-config.h @@ -23,6 +23,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef __E_CATEGORIES_CONFIG_H__ #define __E_CATEGORIES_CONFIG_H__ diff --git a/e-util/e-categories-dialog.c b/e-util/e-categories-dialog.c new file mode 100644 index 0000000000..8f46b1041d --- /dev/null +++ b/e-util/e-categories-dialog.c @@ -0,0 +1,155 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* + * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU Lesser General Public + * License as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include <string.h> +#include <gtk/gtk.h> +#include <gdk/gdkkeysyms.h> +#include <glib/gi18n-lib.h> + +#include <libedataserver/libedataserver.h> + +#include "e-categories-dialog.h" +#include "e-categories-editor.h" +#include "e-categories-selector.h" +#include "e-category-completion.h" +#include "e-category-editor.h" + +#define E_CATEGORIES_DIALOG_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE \ + ((obj), E_TYPE_CATEGORIES_DIALOG, ECategoriesDialogPrivate)) + +G_DEFINE_TYPE (ECategoriesDialog, e_categories_dialog, GTK_TYPE_DIALOG) + +struct _ECategoriesDialogPrivate { + GtkWidget *categories_editor; +}; + +static void +entry_changed_cb (GtkEntry *entry, + ECategoriesDialog *dialog) +{ + gtk_dialog_set_response_sensitive ( + GTK_DIALOG (dialog), GTK_RESPONSE_OK, TRUE); +} + +static void +e_categories_dialog_class_init (ECategoriesDialogClass *class) +{ + g_type_class_add_private (class, sizeof (ECategoriesDialogPrivate)); +} + +static void +e_categories_dialog_init (ECategoriesDialog *dialog) +{ + GtkWidget *dialog_content; + GtkWidget *categories_editor; + + dialog->priv = E_CATEGORIES_DIALOG_GET_PRIVATE (dialog); + + categories_editor = e_categories_editor_new (); + dialog->priv->categories_editor = categories_editor; + + dialog_content = gtk_dialog_get_content_area (GTK_DIALOG (dialog)); + gtk_container_set_border_width (GTK_CONTAINER (dialog), 12); + gtk_box_pack_start ( + GTK_BOX (dialog_content), categories_editor, TRUE, TRUE, 0); + gtk_box_set_spacing (GTK_BOX (dialog_content), 12); + + g_signal_connect ( + categories_editor, "entry-changed", + G_CALLBACK (entry_changed_cb), dialog); + + gtk_dialog_add_buttons ( + GTK_DIALOG (dialog), + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, + GTK_STOCK_OK, GTK_RESPONSE_OK, NULL); + gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK); + gtk_dialog_set_response_sensitive ( + GTK_DIALOG (dialog), GTK_RESPONSE_OK, FALSE); + gtk_window_set_title (GTK_WINDOW (dialog), _("Categories")); + + gtk_widget_show_all (categories_editor); +} + +/** + * e_categories_dialog_new: + * @categories: Comma-separated list of categories + * + * Creates a new #ECategoriesDialog widget and sets the initial selection + * to @categories. + * + * Returns: a new #ECategoriesDialog + **/ +GtkWidget * +e_categories_dialog_new (const gchar *categories) +{ + ECategoriesDialog *dialog; + + dialog = g_object_new (E_TYPE_CATEGORIES_DIALOG, NULL); + + if (categories) + e_categories_dialog_set_categories (dialog, categories); + + return GTK_WIDGET (dialog); +} + +/** + * e_categories_dialog_get_categories: + * @dialog: An #ECategoriesDialog + * + * Gets a comma-separated list of the categories currently selected + * in the dialog. + * + * Returns: a comma-separated list of categories. Free returned + * pointer with g_free(). + **/ +gchar * +e_categories_dialog_get_categories (ECategoriesDialog *dialog) +{ + gchar *categories; + + g_return_val_if_fail (E_IS_CATEGORIES_DIALOG (dialog), NULL); + + categories = e_categories_editor_get_categories ( + E_CATEGORIES_EDITOR (dialog->priv->categories_editor)); + + return categories; +} + +/** + * e_categories_dialog_set_categories: + * @dialog: An #ECategoriesDialog + * @categories: Comma-separated list of categories + * + * Sets the list of categories selected on the dialog. + **/ +void +e_categories_dialog_set_categories (ECategoriesDialog *dialog, + const gchar *categories) +{ + g_return_if_fail (E_IS_CATEGORIES_DIALOG (dialog)); + + e_categories_editor_set_categories ( + E_CATEGORIES_EDITOR (dialog->priv->categories_editor), + categories); +} diff --git a/e-util/e-categories-dialog.h b/e-util/e-categories-dialog.h new file mode 100644 index 0000000000..5ad35e098c --- /dev/null +++ b/e-util/e-categories-dialog.h @@ -0,0 +1,73 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* + * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU Lesser General Public + * License as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + +#ifndef E_CATEGORIES_DIALOG_H +#define E_CATEGORIES_DIALOG_H + +#include <gtk/gtk.h> + +/* Standard GObject macros */ +#define E_TYPE_CATEGORIES_DIALOG \ + (e_categories_dialog_get_type ()) +#define E_CATEGORIES_DIALOG(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST \ + ((obj), E_TYPE_CATEGORIES_DIALOG, ECategoriesDialog)) +#define E_CATEGORIES_DIALOG_CLASS(cls) \ + (G_TYPE_CHECK_CLASS_CAST \ + ((cls), E_TYPE_CATEGORIES_DIALOG, ECategoriesDialogClass)) +#define E_IS_CATEGORIES_DIALOG(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE \ + ((obj), E_TYPE_CATEGORIES_DIALOG)) +#define E_IS_CATEGORIES_DIALOG_CLASS(cls) \ + (G_TYPE_CHECK_CLASS_TYPE \ + ((cls), E_TYPE_CATEGORIES_DIALOG)) +#define E_CATEGORIES_DIALOG_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS \ + ((obj), E_TYPE_CATEGORIES_DIALOG, ECategoriesDialogClass)) + +G_BEGIN_DECLS + +typedef struct _ECategoriesDialog ECategoriesDialog; +typedef struct _ECategoriesDialogClass ECategoriesDialogClass; +typedef struct _ECategoriesDialogPrivate ECategoriesDialogPrivate; + +struct _ECategoriesDialog { + GtkDialog parent; + ECategoriesDialogPrivate *priv; +}; + +struct _ECategoriesDialogClass { + GtkDialogClass parent_class; +}; + +GType e_categories_dialog_get_type (void); +GtkWidget * e_categories_dialog_new (const gchar *categories); +gchar * e_categories_dialog_get_categories + (ECategoriesDialog *dialog); +void e_categories_dialog_set_categories + (ECategoriesDialog *dialog, + const gchar *categories); + +G_END_DECLS + +#endif /* E_CATEGORIES_DIALOG_H */ diff --git a/e-util/e-categories-editor.c b/e-util/e-categories-editor.c new file mode 100644 index 0000000000..ecbebf6083 --- /dev/null +++ b/e-util/e-categories-editor.c @@ -0,0 +1,435 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* + * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU Lesser General Public + * License as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include <config.h> +#include <string.h> +#include <gtk/gtk.h> +#include <gdk/gdkkeysyms.h> +#include <glib/gi18n-lib.h> + +#include <libedataserver/libedataserver.h> + +#include "e-categories-editor.h" +#include "e-categories-selector.h" +#include "e-category-completion.h" +#include "e-category-editor.h" + +#define E_CATEGORIES_EDITOR_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE \ + ((obj), E_TYPE_CATEGORIES_EDITOR, ECategoriesEditorPrivate)) + +struct _ECategoriesEditorPrivate { + ECategoriesSelector *categories_list; + GtkWidget *categories_entry; + GtkWidget *categories_entry_label; + GtkWidget *new_button; + GtkWidget *edit_button; + GtkWidget *delete_button; + + guint ignore_category_changes : 1; +}; + +enum { + COLUMN_ACTIVE, + COLUMN_ICON, + COLUMN_CATEGORY, + N_COLUMNS +}; + +enum { + PROP_0, + PROP_ENTRY_VISIBLE +}; + +enum { + ENTRY_CHANGED, + LAST_SIGNAL +}; + +static gint signals[LAST_SIGNAL] = {0}; + +G_DEFINE_TYPE (ECategoriesEditor, e_categories_editor, GTK_TYPE_GRID) + +static void +entry_changed_cb (GtkEntry *entry, + ECategoriesEditor *editor) +{ + g_signal_emit (editor, signals[ENTRY_CHANGED], 0); +} + +static void +categories_editor_selection_changed_cb (ECategoriesEditor *editor, + GtkTreeSelection *selection) +{ + GtkWidget *widget; + gint n_rows; + + n_rows = gtk_tree_selection_count_selected_rows (selection); + + widget = editor->priv->edit_button; + gtk_widget_set_sensitive (widget, n_rows == 1); + + widget = editor->priv->delete_button; + gtk_widget_set_sensitive (widget, n_rows >= 1); +} + +static void +category_checked_cb (ECategoriesSelector *selector, + const gchar *category, + const gboolean checked, + ECategoriesEditor *editor) +{ + GtkEntry *entry; + gchar *categories; + + entry = GTK_ENTRY (editor->priv->categories_entry); + categories = e_categories_selector_get_checked (selector); + + gtk_entry_set_text (entry, categories); + + g_free (categories); +} + +static void +new_button_clicked_cb (GtkButton *button, + ECategoriesEditor *editor) +{ + ECategoryEditor *cat_editor = e_category_editor_new (); + + e_category_editor_create_category (cat_editor); + + gtk_widget_destroy (GTK_WIDGET (cat_editor)); +} + +static void +edit_button_clicked_cb (GtkButton *button, + ECategoriesEditor *editor) +{ + ECategoryEditor *cat_editor = e_category_editor_new (); + gchar *category; + + category = e_categories_selector_get_selected ( + editor->priv->categories_list); + + e_category_editor_edit_category (cat_editor, category); + + gtk_widget_destroy (GTK_WIDGET (cat_editor)); + g_free (category); +} + +static void +categories_editor_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) +{ + switch (property_id) { + case PROP_ENTRY_VISIBLE: + e_categories_editor_set_entry_visible ( + E_CATEGORIES_EDITOR (object), + g_value_get_boolean (value)); + return; + } + + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); +} + +static void +categories_editor_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) +{ + switch (property_id) { + case PROP_ENTRY_VISIBLE: + g_value_set_boolean ( + value, e_categories_editor_get_entry_visible ( + E_CATEGORIES_EDITOR (object))); + return; + } + + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); +} + +static void +e_categories_editor_class_init (ECategoriesEditorClass *class) +{ + GObjectClass *object_class; + + g_type_class_add_private (class, sizeof (ECategoriesEditorPrivate)); + + object_class = G_OBJECT_CLASS (class); + object_class->set_property = categories_editor_set_property; + object_class->get_property = categories_editor_get_property; + + g_object_class_install_property ( + object_class, + PROP_ENTRY_VISIBLE, + g_param_spec_boolean ( + "entry-visible", + NULL, + NULL, + TRUE, + G_PARAM_READWRITE)); + + signals[ENTRY_CHANGED] = g_signal_new ( + "entry-changed", + G_TYPE_FROM_CLASS (class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (ECategoriesEditorClass, entry_changed), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); +} + +static void +e_categories_editor_init (ECategoriesEditor *editor) +{ + GtkEntryCompletion *completion; + GtkGrid *grid; + GtkWidget *entry_categories; + GtkWidget *label_header; + GtkWidget *label2; + GtkWidget *scrolledwindow1; + GtkWidget *categories_list; + GtkWidget *hbuttonbox1; + GtkWidget *button_new; + GtkWidget *button_edit; + GtkWidget *button_delete; + + gtk_widget_set_size_request (GTK_WIDGET (editor), -1, 400); + + grid = GTK_GRID (editor); + + gtk_grid_set_row_spacing (grid, 6); + gtk_grid_set_column_spacing (grid, 6); + + label_header = gtk_label_new_with_mnemonic ( + _("Currently _used categories:")); + gtk_widget_set_halign (label_header, GTK_ALIGN_FILL); + gtk_grid_attach (grid, label_header, 0, 0, 1, 1); + gtk_label_set_justify (GTK_LABEL (label_header), GTK_JUSTIFY_CENTER); + gtk_misc_set_alignment (GTK_MISC (label_header), 0, 0.5); + + entry_categories = gtk_entry_new (); + gtk_widget_set_hexpand (entry_categories, TRUE); + gtk_widget_set_halign (entry_categories, GTK_ALIGN_FILL); + gtk_grid_attach (grid, entry_categories, 0, 1, 1, 1); + + label2 = gtk_label_new_with_mnemonic (_("_Available Categories:")); + gtk_widget_set_halign (label2, GTK_ALIGN_FILL); + gtk_grid_attach (grid, label2, 0, 2, 1, 1); + gtk_label_set_justify (GTK_LABEL (label2), GTK_JUSTIFY_CENTER); + gtk_misc_set_alignment (GTK_MISC (label2), 0, 0.5); + + scrolledwindow1 = gtk_scrolled_window_new (NULL, NULL); + g_object_set (G_OBJECT (scrolledwindow1), + "hexpand", TRUE, + "halign", GTK_ALIGN_FILL, + "vexpand", TRUE, + "valign", GTK_ALIGN_FILL, + NULL); + gtk_grid_attach (grid, scrolledwindow1, 0, 3, 1, 1); + gtk_scrolled_window_set_policy ( + GTK_SCROLLED_WINDOW (scrolledwindow1), + GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); + gtk_scrolled_window_set_shadow_type ( + GTK_SCROLLED_WINDOW (scrolledwindow1), GTK_SHADOW_IN); + + categories_list = GTK_WIDGET (e_categories_selector_new ()); + gtk_container_add (GTK_CONTAINER (scrolledwindow1), categories_list); + gtk_widget_set_size_request (categories_list, -1, 350); + gtk_tree_view_set_headers_visible ( + GTK_TREE_VIEW (categories_list), FALSE); + gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (categories_list), TRUE); + g_signal_connect ( + G_OBJECT (categories_list), "category-checked", + G_CALLBACK (category_checked_cb), editor); + + hbuttonbox1 = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL); + g_object_set (G_OBJECT (hbuttonbox1), + "hexpand", TRUE, + "halign", GTK_ALIGN_FILL, + NULL); + gtk_grid_attach (grid, hbuttonbox1, 0, 4, 1, 1); + gtk_box_set_spacing (GTK_BOX (hbuttonbox1), 6); + + button_new = gtk_button_new_from_stock (GTK_STOCK_NEW); + gtk_container_add (GTK_CONTAINER (hbuttonbox1), button_new); + gtk_widget_set_can_default (button_new, TRUE); + + button_edit = gtk_button_new_from_stock (GTK_STOCK_EDIT); + gtk_container_add (GTK_CONTAINER (hbuttonbox1), button_edit); + gtk_widget_set_can_default (button_edit, TRUE); + + button_delete = gtk_button_new_from_stock (GTK_STOCK_DELETE); + gtk_container_add (GTK_CONTAINER (hbuttonbox1), button_delete); + gtk_widget_set_can_default (button_delete, TRUE); + + gtk_label_set_mnemonic_widget ( + GTK_LABEL (label_header), entry_categories); + gtk_label_set_mnemonic_widget ( + GTK_LABEL (label2), categories_list); + + editor->priv = E_CATEGORIES_EDITOR_GET_PRIVATE (editor); + + editor->priv->categories_list = E_CATEGORIES_SELECTOR (categories_list); + editor->priv->categories_entry = entry_categories; + editor->priv->categories_entry_label = label_header; + + g_signal_connect_swapped ( + editor->priv->categories_list, "selection-changed", + G_CALLBACK (categories_editor_selection_changed_cb), editor); + + completion = e_category_completion_new (); + gtk_entry_set_completion ( + GTK_ENTRY (editor->priv->categories_entry), completion); + g_object_unref (completion); + + editor->priv->new_button = button_new; + g_signal_connect ( + editor->priv->new_button, "clicked", + G_CALLBACK (new_button_clicked_cb), editor); + + editor->priv->edit_button = button_edit; + g_signal_connect ( + editor->priv->edit_button, "clicked", + G_CALLBACK (edit_button_clicked_cb), editor); + + editor->priv->delete_button = button_delete; + g_signal_connect_swapped ( + editor->priv->delete_button, "clicked", + G_CALLBACK (e_categories_selector_delete_selection), + editor->priv->categories_list); + + g_signal_connect ( + editor->priv->categories_entry, "changed", + G_CALLBACK (entry_changed_cb), editor); + + gtk_widget_show_all (GTK_WIDGET (editor)); +} + +/** + * e_categories_editor_new: + * + * Creates a new #ECategoriesEditor widget. + * + * Returns: a new #ECategoriesEditor + * + * Since: 3.2 + **/ +GtkWidget * +e_categories_editor_new (void) +{ + return g_object_new (E_TYPE_CATEGORIES_EDITOR, NULL); +} + +/** + * e_categories_editor_get_categories: + * @editor: an #ECategoriesEditor + * + * Gets a comma-separated list of the categories currently selected + * in the editor. + * + * Returns: a comma-separated list of categories. Free returned + * pointer with g_free(). + * + * Since: 3.2 + **/ +gchar * +e_categories_editor_get_categories (ECategoriesEditor *editor) +{ + ECategoriesSelector *categories_list; + + g_return_val_if_fail (E_IS_CATEGORIES_EDITOR (editor), NULL); + + categories_list = editor->priv->categories_list; + + return e_categories_selector_get_checked (categories_list); +} + +/** + * e_categories_editor_set_categories: + * @editor: an #ECategoriesEditor + * @categories: comma-separated list of categories + * + * Sets the list of categories selected on the editor. + * + * Since: 3.2 + **/ +void +e_categories_editor_set_categories (ECategoriesEditor *editor, + const gchar *categories) +{ + ECategoriesSelector *categories_list; + + g_return_if_fail (E_IS_CATEGORIES_EDITOR (editor)); + + categories_list = editor->priv->categories_list; + + e_categories_selector_set_checked (categories_list, categories); + category_checked_cb (categories_list, NULL, FALSE, editor); +} + +/** + * e_categories_editor_get_entry_visible: + * @editor: an #ECategoriesEditor + * + * Return the visibility of the category input entry. + * + * Returns: whether the entry is visible + * + * Since: 3.2 + **/ +gboolean +e_categories_editor_get_entry_visible (ECategoriesEditor *editor) +{ + g_return_val_if_fail (E_IS_CATEGORIES_EDITOR (editor), TRUE); + + return gtk_widget_get_visible (editor->priv->categories_entry); +} + +/** + * e_categories_editor_set_entry_visible: + * @editor: an #ECategoriesEditor + * @entry_visible: whether to make the entry visible + * + * Sets the visibility of the category input entry. + * + * Since: 3.2 + **/ +void +e_categories_editor_set_entry_visible (ECategoriesEditor *editor, + gboolean entry_visible) +{ + g_return_if_fail (E_IS_CATEGORIES_EDITOR (editor)); + + if ((gtk_widget_get_visible (editor->priv->categories_entry) ? 1 : 0) == + (entry_visible ? 1 : 0)) + return; + + gtk_widget_set_visible ( + editor->priv->categories_entry, entry_visible); + gtk_widget_set_visible ( + editor->priv->categories_entry_label, entry_visible); + e_categories_selector_set_items_checkable ( + editor->priv->categories_list, entry_visible); + + g_object_notify (G_OBJECT (editor), "entry-visible"); +} diff --git a/e-util/e-categories-editor.h b/e-util/e-categories-editor.h new file mode 100644 index 0000000000..07c9dc6987 --- /dev/null +++ b/e-util/e-categories-editor.h @@ -0,0 +1,88 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* + * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU Lesser General Public + * License as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + +#ifndef E_CATEGORIES_EDITOR_H +#define E_CATEGORIES_EDITOR_H + +#include <gtk/gtk.h> + +/* Standard GObject macros */ +#define E_TYPE_CATEGORIES_EDITOR \ + (e_categories_editor_get_type ()) +#define E_CATEGORIES_EDITOR(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST \ + ((obj), E_TYPE_CATEGORIES_EDITOR, ECategoriesEditor)) +#define E_CATEGORIES_EDITOR_CLASS(cls) \ + (G_TYPE_CHECK_CLASS_CAST \ + ((cls), E_TYPE_CATEGORIES_EDITOR, ECategoriesEditorClass)) +#define E_IS_CATEGORIES_EDITOR(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE \ + ((obj), E_TYPE_CATEGORIES_EDITOR)) +#define E_IS_CATEGORIES_EDITOR_CLASS(cls) \ + (G_TYPE_CHECK_CLASS_TYPE \ + ((cls), E_TYPE_CATEGORIES_EDITOR)) +#define E_CATEGORIES_EDITOR_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS \ + ((obj), E_TYPE_CATEGORIES_EDITOR, ECategoriesEditorClass)) + +G_BEGIN_DECLS + +typedef struct _ECategoriesEditor ECategoriesEditor; +typedef struct _ECategoriesEditorClass ECategoriesEditorClass; +typedef struct _ECategoriesEditorPrivate ECategoriesEditorPrivate; + +/** + * ECategoriesEditor: + * + * Contains only private data that should be read and manipulated using the + * functions below. + * + * Since: 3.2 + **/ +struct _ECategoriesEditor { + GtkGrid parent; + ECategoriesEditorPrivate *priv; +}; + +struct _ECategoriesEditorClass { + GtkGridClass parent_class; + + void (*entry_changed) (GtkEntry *entry); +}; + +GType e_categories_editor_get_type (void); +GtkWidget * e_categories_editor_new (void); +gchar * e_categories_editor_get_categories + (ECategoriesEditor *editor); +void e_categories_editor_set_categories + (ECategoriesEditor *editor, + const gchar *categories); +gboolean e_categories_editor_get_entry_visible + (ECategoriesEditor *editor); +void e_categories_editor_set_entry_visible + (ECategoriesEditor *editor, + gboolean entry_visible); + +G_END_DECLS + +#endif /* E_CATEGORIES_EDITOR_H */ diff --git a/e-util/e-categories-selector.c b/e-util/e-categories-selector.c new file mode 100644 index 0000000000..5a05238626 --- /dev/null +++ b/e-util/e-categories-selector.c @@ -0,0 +1,587 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* + * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU Lesser General Public + * License as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include <config.h> +#include <glib/gi18n-lib.h> + +#include <libedataserver/libedataserver.h> + +#include "e-categories-selector.h" + +#define E_CATEGORIES_SELECTOR_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE \ + ((obj), E_TYPE_CATEGORIES_SELECTOR, ECategoriesSelectorPrivate)) + +struct _ECategoriesSelectorPrivate { + gboolean checkable; + GHashTable *selected_categories; + + gboolean ignore_category_changes; +}; + +enum { + PROP_0, + PROP_ITEMS_CHECKABLE +}; + +enum { + CATEGORY_CHECKED, + SELECTION_CHANGED, + LAST_SIGNAL +}; + +enum { + COLUMN_ACTIVE, + COLUMN_ICON, + COLUMN_CATEGORY, + N_COLUMNS +}; + +static gint signals[LAST_SIGNAL] = {0}; + +G_DEFINE_TYPE ( + ECategoriesSelector, + e_categories_selector, + GTK_TYPE_TREE_VIEW) + +static void +categories_selector_build_model (ECategoriesSelector *selector) +{ + GtkListStore *store; + GList *list, *iter; + + store = gtk_list_store_new ( + N_COLUMNS, G_TYPE_BOOLEAN, GDK_TYPE_PIXBUF, G_TYPE_STRING); + + gtk_tree_sortable_set_sort_column_id ( + GTK_TREE_SORTABLE (store), + COLUMN_CATEGORY, GTK_SORT_ASCENDING); + + list = e_categories_get_list (); + for (iter = list; iter != NULL; iter = iter->next) { + const gchar *category_name = iter->data; + const gchar *filename; + GdkPixbuf *pixbuf = NULL; + GtkTreeIter iter; + gboolean active; + + /* Only add user-visible categories. */ + if (!e_categories_is_searchable (category_name)) + continue; + + active = (g_hash_table_lookup ( + selector->priv->selected_categories, + category_name) != NULL); + + filename = e_categories_get_icon_file_for (category_name); + if (filename != NULL) + pixbuf = gdk_pixbuf_new_from_file (filename, NULL); + + gtk_list_store_append (store, &iter); + + gtk_list_store_set ( + store, &iter, + COLUMN_ACTIVE, active, + COLUMN_ICON, pixbuf, + COLUMN_CATEGORY, category_name, + -1); + + if (pixbuf != NULL) + g_object_unref (pixbuf); + } + + gtk_tree_view_set_model ( + GTK_TREE_VIEW (selector), GTK_TREE_MODEL (store)); + + /* This has to be reset everytime we install a new model */ + gtk_tree_view_set_search_column ( + GTK_TREE_VIEW (selector), COLUMN_CATEGORY); + + g_list_free (list); + g_object_unref (store); +} + +static void +category_toggled_cb (GtkCellRenderer *renderer, + const gchar *path, + ECategoriesSelector *selector) +{ + GtkTreeModel *model; + GtkTreePath *tree_path; + GtkTreeIter iter; + + model = gtk_tree_view_get_model (GTK_TREE_VIEW (selector)); + g_return_if_fail (model); + + tree_path = gtk_tree_path_new_from_string (path); + g_return_if_fail (tree_path); + + if (gtk_tree_model_get_iter (model, &iter, tree_path)) { + gchar *category; + gboolean active; + + gtk_tree_model_get ( + model, &iter, + COLUMN_ACTIVE, &active, + COLUMN_CATEGORY, &category, -1); + + gtk_list_store_set ( + GTK_LIST_STORE (model), &iter, + COLUMN_ACTIVE, !active, -1); + + if (active) + g_hash_table_remove ( + selector->priv->selected_categories, category); + else + g_hash_table_insert ( + selector->priv->selected_categories, + g_strdup (category), g_strdup (category)); + + g_signal_emit ( + selector, signals[CATEGORY_CHECKED], 0, + category, !active); + + g_free (category); + } + + gtk_tree_path_free (tree_path); +} + +static void +categories_selector_listener_cb (gpointer useless_pointer, + ECategoriesSelector *selector) +{ + if (!selector->priv->ignore_category_changes) + categories_selector_build_model (selector); +} + +static gboolean +categories_selector_key_press_event (ECategoriesSelector *selector, + GdkEventKey *event) +{ + if (event->keyval == GDK_KEY_Delete) { + e_categories_selector_delete_selection (selector); + return TRUE; + } + + return FALSE; +} + +static void +categories_selector_selection_changed (GtkTreeSelection *selection, + ECategoriesSelector *selector) +{ + g_signal_emit (selector, signals[SELECTION_CHANGED], 0, selection); +} + +static void +categories_selector_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) +{ + switch (property_id) { + case PROP_ITEMS_CHECKABLE: + g_value_set_boolean ( + value, + e_categories_selector_get_items_checkable ( + E_CATEGORIES_SELECTOR (object))); + return; + } + + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); +} + +static void +categories_selector_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) +{ + switch (property_id) { + case PROP_ITEMS_CHECKABLE: + e_categories_selector_set_items_checkable ( + E_CATEGORIES_SELECTOR (object), + g_value_get_boolean (value)); + return; + } + + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); +} + +static void +categories_selector_dispose (GObject *object) +{ + ECategoriesSelectorPrivate *priv; + + priv = E_CATEGORIES_SELECTOR_GET_PRIVATE (object); + + if (priv->selected_categories != NULL) { + g_hash_table_destroy (priv->selected_categories); + priv->selected_categories = NULL; + } + + /* Chain up to parent's dispose() method.*/ + G_OBJECT_CLASS (e_categories_selector_parent_class)->dispose (object); +} + +static void +categories_selector_finalize (GObject *object) +{ + e_categories_unregister_change_listener ( + G_CALLBACK (categories_selector_listener_cb), object); +} + +static void +e_categories_selector_class_init (ECategoriesSelectorClass *class) +{ + GObjectClass *object_class; + + g_type_class_add_private (class, sizeof (ECategoriesSelectorPrivate)); + + object_class = G_OBJECT_CLASS (class); + object_class->set_property = categories_selector_set_property; + object_class->get_property = categories_selector_get_property; + object_class->dispose = categories_selector_dispose; + object_class->finalize = categories_selector_finalize; + + g_object_class_install_property ( + object_class, + PROP_ITEMS_CHECKABLE, + g_param_spec_boolean ( + "items-checkable", + NULL, + NULL, + TRUE, + G_PARAM_READWRITE)); + + signals[CATEGORY_CHECKED] = g_signal_new ( + "category-checked", + G_TYPE_FROM_CLASS (class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (ECategoriesSelectorClass, category_checked), + NULL, NULL, NULL, + G_TYPE_NONE, 2, + G_TYPE_STRING, + G_TYPE_BOOLEAN); + + signals[SELECTION_CHANGED] = g_signal_new ( + "selection-changed", + G_TYPE_FROM_CLASS (class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (ECategoriesSelectorClass, selection_changed), + NULL, NULL, + g_cclosure_marshal_VOID__OBJECT, + G_TYPE_NONE, 1, + GTK_TYPE_TREE_SELECTION); +} + +static void +e_categories_selector_init (ECategoriesSelector *selector) +{ + GtkCellRenderer *renderer; + GtkTreeViewColumn *column; + GtkTreeSelection *selection; + + selector->priv = E_CATEGORIES_SELECTOR_GET_PRIVATE (selector); + + selector->priv->checkable = TRUE; + selector->priv->selected_categories = g_hash_table_new_full ( + (GHashFunc) g_str_hash, + (GEqualFunc) g_str_equal, + (GDestroyNotify) g_free, + (GDestroyNotify) g_free); + selector->priv->ignore_category_changes = FALSE; + + renderer = gtk_cell_renderer_toggle_new (); + column = gtk_tree_view_column_new_with_attributes ( + "?", renderer, "active", COLUMN_ACTIVE, NULL); + gtk_tree_view_append_column (GTK_TREE_VIEW (selector), column); + + g_signal_connect ( + renderer, "toggled", + G_CALLBACK (category_toggled_cb), selector); + + renderer = gtk_cell_renderer_pixbuf_new (); + column = gtk_tree_view_column_new_with_attributes ( + _("Icon"), renderer, "pixbuf", COLUMN_ICON, NULL); + gtk_tree_view_append_column (GTK_TREE_VIEW (selector), column); + + renderer = gtk_cell_renderer_text_new (); + column = gtk_tree_view_column_new_with_attributes ( + _("Category"), renderer, "text", COLUMN_CATEGORY, NULL); + gtk_tree_view_append_column (GTK_TREE_VIEW (selector), column); + + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (selector)); + g_signal_connect ( + selection, "changed", + G_CALLBACK (categories_selector_selection_changed), selector); + + g_signal_connect ( + selector, "key-press-event", + G_CALLBACK (categories_selector_key_press_event), NULL); + + e_categories_register_change_listener ( + G_CALLBACK (categories_selector_listener_cb), selector); + + categories_selector_build_model (selector); +} + +/** + * e_categories_selector_new: + * + * Since: 3.2 + **/ +GtkWidget * +e_categories_selector_new (void) +{ + return g_object_new ( + E_TYPE_CATEGORIES_SELECTOR, + "items-checkable", TRUE, NULL); +} + +/** + * e_categories_selector_get_items_checkable: + * + * Since: 3.2 + **/ +gboolean +e_categories_selector_get_items_checkable (ECategoriesSelector *selector) +{ + g_return_val_if_fail (E_IS_CATEGORIES_SELECTOR (selector), TRUE); + + return selector->priv->checkable; +} + +/** + * e_categories_selector_set_items_checkable: + * + * Since: 3.2 + **/ +void +e_categories_selector_set_items_checkable (ECategoriesSelector *selector, + gboolean checkable) +{ + GtkTreeViewColumn *column; + + g_return_if_fail (E_IS_CATEGORIES_SELECTOR (selector)); + + if ((selector->priv->checkable ? 1 : 0) == (checkable ? 1 : 0)) + return; + + selector->priv->checkable = checkable; + + column = gtk_tree_view_get_column ( + GTK_TREE_VIEW (selector), COLUMN_ACTIVE); + gtk_tree_view_column_set_visible (column, checkable); + + g_object_notify (G_OBJECT (selector), "items-checkable"); +} + +/** + * e_categories_selector_get_checked: + * + * Free returned pointer with g_free(). + * + * Since: 3.2 + **/ +gchar * +e_categories_selector_get_checked (ECategoriesSelector *selector) +{ + GString *str; + GList *list, *category; + + g_return_val_if_fail (E_IS_CATEGORIES_SELECTOR (selector), NULL); + + str = g_string_new (""); + list = g_hash_table_get_values (selector->priv->selected_categories); + + /* to get them always in the same order */ + list = g_list_sort (list, (GCompareFunc) g_utf8_collate); + + for (category = list; category != NULL; category = category->next) { + if (str->len > 0) + g_string_append_printf ( + str, ",%s", (gchar *) category->data); + else + g_string_append (str, (gchar *) category->data); + } + + g_list_free (list); + + return g_string_free (str, FALSE); +} + +/** + * e_categories_selector_set_checked: + * + * Since: 3.2 + **/ +void +e_categories_selector_set_checked (ECategoriesSelector *selector, + const gchar *categories) +{ + GtkTreeModel *model; + GtkTreeIter iter; + gchar **arr; + gint i; + + g_return_if_fail (E_IS_CATEGORIES_SELECTOR (selector)); + + /* Clean up table of selected categories. */ + g_hash_table_remove_all (selector->priv->selected_categories); + + arr = g_strsplit (categories, ",", 0); + if (arr) { + for (i = 0; arr[i] != NULL; i++) { + g_strstrip (arr[i]); + g_hash_table_insert ( + selector->priv->selected_categories, + g_strdup (arr[i]), g_strdup (arr[i])); + } + g_strfreev (arr); + } + + model = gtk_tree_view_get_model (GTK_TREE_VIEW (selector)); + if (gtk_tree_model_get_iter_first (model, &iter)) { + do { + gchar *category_name; + gboolean found; + + gtk_tree_model_get ( + model, &iter, + COLUMN_CATEGORY, &category_name, + -1); + found = (g_hash_table_lookup ( + selector->priv->selected_categories, + category_name) != NULL); + gtk_list_store_set ( + GTK_LIST_STORE (model), &iter, + COLUMN_ACTIVE, found, -1); + + g_free (category_name); + } while (gtk_tree_model_iter_next (model, &iter)); + } +} + +/** + * e_categories_selector_delete_selection: + * + * Since: 3.2 + **/ +void +e_categories_selector_delete_selection (ECategoriesSelector *selector) +{ + GtkTreeModel *model; + GtkTreeSelection *selection; + GList *selected, *item; + + g_return_if_fail (E_IS_CATEGORIES_SELECTOR (selector)); + + model = gtk_tree_view_get_model (GTK_TREE_VIEW (selector)); + g_return_if_fail (model != NULL); + + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (selector)); + selected = gtk_tree_selection_get_selected_rows (selection, &model); + + /* Remove categories in reverse order to avoid invalidating + * tree paths as we iterate over the list. Note, the list is + * probably already sorted but we sort again just to be safe. */ + selected = g_list_reverse (g_list_sort ( + selected, (GCompareFunc) gtk_tree_path_compare)); + + /* Prevent the model from being rebuilt every time we + * remove a category, since we're already modifying it. */ + selector->priv->ignore_category_changes = TRUE; + + for (item = selected; item != NULL; item = item->next) { + GtkTreePath *path = item->data; + GtkTreeIter iter; + gchar *category; + + gtk_tree_model_get_iter (model, &iter, path); + gtk_tree_model_get ( + model, &iter, + COLUMN_CATEGORY, &category, -1); + gtk_list_store_remove (GTK_LIST_STORE (model), &iter); + e_categories_remove (category); + g_free (category); + } + + selector->priv->ignore_category_changes = FALSE; + + /* If we only remove one category, try to select another */ + if (g_list_length (selected) == 1) { + GtkTreePath *path = selected->data; + + gtk_tree_selection_select_path (selection, path); + if (!gtk_tree_selection_path_is_selected (selection, path)) + if (gtk_tree_path_prev (path)) + gtk_tree_selection_select_path (selection, path); + } + + g_list_foreach (selected, (GFunc) gtk_tree_path_free, NULL); + g_list_free (selected); +} + +/** + * e_categories_selector_get_selected: + * + * Free returned pointer with g_free(). + * + * Since: 3.2 + **/ +gchar * +e_categories_selector_get_selected (ECategoriesSelector *selector) +{ + GtkTreeModel *model; + GtkTreeSelection *selection; + GList *selected, *item; + GString *str = g_string_new (""); + + g_return_val_if_fail (E_IS_CATEGORIES_SELECTOR (selector), NULL); + + model = gtk_tree_view_get_model (GTK_TREE_VIEW (selector)); + g_return_val_if_fail (model != NULL, NULL); + + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (selector)); + selected = gtk_tree_selection_get_selected_rows (selection, &model); + + for (item = selected; item != NULL; item = item->next) { + GtkTreePath *path = item->data; + GtkTreeIter iter; + gchar *category; + + gtk_tree_model_get_iter (model, &iter, path); + gtk_tree_model_get ( + model, &iter, + COLUMN_CATEGORY, &category, -1); + if (str->len == 0) + g_string_assign (str, category); + else + g_string_append_printf (str, ",%s", category); + + g_free (category); + } + + g_list_foreach (selected, (GFunc) gtk_tree_path_free, NULL); + g_list_free (selected); + + return g_string_free (str, FALSE); +} diff --git a/e-util/e-categories-selector.h b/e-util/e-categories-selector.h new file mode 100644 index 0000000000..6ffc9f82ef --- /dev/null +++ b/e-util/e-categories-selector.h @@ -0,0 +1,97 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* + * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU Lesser General Public + * License as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + +#ifndef E_CATEGORIES_SELECTOR_H +#define E_CATEGORIES_SELECTOR_H + +#include <gtk/gtk.h> + +/* Standard GObject macros */ +#define E_TYPE_CATEGORIES_SELECTOR \ + (e_categories_selector_get_type ()) +#define E_CATEGORIES_SELECTOR(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST \ + ((obj), E_TYPE_CATEGORIES_SELECTOR, ECategoriesSelector)) +#define E_CATEGORIES_SELECTOR_CLASS(cls) \ + (G_TYPE_CHECK_CLASS_CAST \ + ((cls), E_TYPE_CATEGORIES_SELECTOR, ECategoriesSelectorClass)) +#define E_IS_CATEGORIES_SELECTOR(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE \ + ((obj), E_TYPE_CATEGORIES_SELECTOR)) +#define E_IS_CATEGORIES_SELECTOR_CLASS(cls) \ + (G_TYPE_CHECK_CLASS_TYPE \ + ((cls), E_TYPE_CATEGORIES_SELECTOR)) +#define E_CATEGORIES_SELECTOR_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS \ + ((obj), E_TYPE_CATEGORIES_SELECTOR, ECategoriesSelectorClass)) + +G_BEGIN_DECLS + +typedef struct _ECategoriesSelector ECategoriesSelector; +typedef struct _ECategoriesSelectorClass ECategoriesSelectorClass; +typedef struct _ECategoriesSelectorPrivate ECategoriesSelectorPrivate; + +/** + * ECategoriesSelector: + * + * Contains only private data that should be read and manipulated using the + * functions below. + * + * Since: 3.2 + **/ +struct _ECategoriesSelector { + GtkTreeView parent; + ECategoriesSelectorPrivate *priv; +}; + +struct _ECategoriesSelectorClass { + GtkTreeViewClass parent_class; + + void (*category_checked) (ECategoriesSelector *selector, + const gchar *category, + gboolean checked); + + void (*selection_changed) (ECategoriesSelector *selector, + GtkTreeSelection *selection); +}; + +GType e_categories_selector_get_type (void); +GtkWidget * e_categories_selector_new (void); +gchar * e_categories_selector_get_checked + (ECategoriesSelector *selector); +void e_categories_selector_set_checked + (ECategoriesSelector *selector, + const gchar *categories); +gboolean e_categories_selector_get_items_checkable + (ECategoriesSelector *selector); +void e_categories_selector_set_items_checkable + (ECategoriesSelector *selectr, + gboolean checkable); +void e_categories_selector_delete_selection + (ECategoriesSelector *selector); +gchar * e_categories_selector_get_selected + (ECategoriesSelector *selector); + +G_END_DECLS + +#endif /* E_CATEGORIES_SELECTOR_H */ diff --git a/e-util/e-category-completion.c b/e-util/e-category-completion.c new file mode 100644 index 0000000000..095df50b45 --- /dev/null +++ b/e-util/e-category-completion.c @@ -0,0 +1,505 @@ +/* + * 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/> + * + * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) + */ + +#include "e-category-completion.h" + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include <string.h> +#include <glib/gi18n-lib.h> + +#include <libedataserver/libedataserver.h> + +#define E_CATEGORY_COMPLETION_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE \ + ((obj), E_TYPE_CATEGORY_COMPLETION, ECategoryCompletionPrivate)) + +struct _ECategoryCompletionPrivate { + GtkWidget *last_known_entry; + gchar *create; + gchar *prefix; +}; + +enum { + COLUMN_PIXBUF, + COLUMN_CATEGORY, + COLUMN_NORMALIZED, + NUM_COLUMNS +}; + +G_DEFINE_TYPE ( + ECategoryCompletion, + e_category_completion, + GTK_TYPE_ENTRY_COMPLETION) + +/* Forward Declarations */ + +static void +category_completion_track_entry (GtkEntryCompletion *completion); + +static void +category_completion_build_model (GtkEntryCompletion *completion) +{ + GtkListStore *store; + GList *list; + + store = gtk_list_store_new ( + NUM_COLUMNS, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING); + + list = e_categories_get_list (); + while (list != NULL) { + const gchar *category = list->data; + const gchar *filename; + gchar *normalized; + gchar *casefolded; + GdkPixbuf *pixbuf = NULL; + GtkTreeIter iter; + + /* Only add user-visible categories. */ + if (!e_categories_is_searchable (category)) { + list = g_list_delete_link (list, list); + continue; + } + + filename = e_categories_get_icon_file_for (category); + if (filename != NULL && *filename != '\0') + pixbuf = gdk_pixbuf_new_from_file (filename, NULL); + + normalized = g_utf8_normalize ( + category, -1, G_NORMALIZE_DEFAULT); + casefolded = g_utf8_casefold (normalized, -1); + + gtk_list_store_append (store, &iter); + + gtk_list_store_set ( + store, &iter, COLUMN_PIXBUF, pixbuf, + COLUMN_CATEGORY, category, COLUMN_NORMALIZED, + casefolded, -1); + + g_free (normalized); + g_free (casefolded); + + if (pixbuf != NULL) + g_object_unref (pixbuf); + + list = g_list_delete_link (list, list); + } + + gtk_entry_completion_set_model (completion, GTK_TREE_MODEL (store)); +} + +static void +category_completion_categories_changed_cb (GObject *some_private_object, + GtkEntryCompletion *completion) +{ + category_completion_build_model (completion); +} + +static void +category_completion_complete (GtkEntryCompletion *completion, + const gchar *category) +{ + GtkEditable *editable; + GtkWidget *entry; + const gchar *text; + const gchar *cp; + gint start_pos; + gint end_pos; + glong offset; + + entry = gtk_entry_completion_get_entry (completion); + + editable = GTK_EDITABLE (entry); + text = gtk_entry_get_text (GTK_ENTRY (entry)); + + /* Get the cursor position as a character offset. */ + offset = gtk_editable_get_position (editable); + + /* Find the rightmost comma before the cursor. */ + cp = g_utf8_offset_to_pointer (text, offset); + cp = g_utf8_strrchr (text, (gssize) (cp - text), ','); + + /* Calculate the selection start position as a character offset. */ + if (cp == NULL) + offset = 0; + else { + cp = g_utf8_next_char (cp); + if (g_unichar_isspace (g_utf8_get_char (cp))) + cp = g_utf8_next_char (cp); + offset = g_utf8_pointer_to_offset (text, cp); + } + start_pos = (gint) offset; + + /* Find the leftmost comma after the cursor. */ + cp = g_utf8_offset_to_pointer (text, offset); + cp = g_utf8_strchr (cp, -1, ','); + + /* Calculate the selection end position as a character offset. */ + if (cp == NULL) + offset = -1; + else { + cp = g_utf8_next_char (cp); + if (g_unichar_isspace (g_utf8_get_char (cp))) + cp = g_utf8_next_char (cp); + offset = g_utf8_pointer_to_offset (text, cp); + } + end_pos = (gint) offset; + + /* Complete the partially typed category. */ + gtk_editable_delete_text (editable, start_pos, end_pos); + gtk_editable_insert_text (editable, category, -1, &start_pos); + gtk_editable_insert_text (editable, ",", 1, &start_pos); + gtk_editable_set_position (editable, start_pos); +} + +static gboolean +category_completion_is_match (GtkEntryCompletion *completion, + const gchar *key, + GtkTreeIter *iter) +{ + ECategoryCompletionPrivate *priv; + GtkTreeModel *model; + GtkWidget *entry; + GValue value = { 0, }; + gboolean match; + + priv = E_CATEGORY_COMPLETION_GET_PRIVATE (completion); + entry = gtk_entry_completion_get_entry (completion); + model = gtk_entry_completion_get_model (completion); + + /* XXX This would be easier if GtkEntryCompletion had an 'entry' + * property that we could listen to for notifications. */ + if (entry != priv->last_known_entry) + category_completion_track_entry (completion); + + if (priv->prefix == NULL) + return FALSE; + + gtk_tree_model_get_value (model, iter, COLUMN_NORMALIZED, &value); + match = g_str_has_prefix (g_value_get_string (&value), priv->prefix); + g_value_unset (&value); + + return match; +} + +static void +category_completion_update_prefix (GtkEntryCompletion *completion) +{ + ECategoryCompletionPrivate *priv; + GtkEditable *editable; + GtkTreeModel *model; + GtkWidget *entry; + GtkTreeIter iter; + const gchar *text; + const gchar *start; + const gchar *end; + const gchar *cp; + gboolean valid; + gchar *input; + glong offset; + + priv = E_CATEGORY_COMPLETION_GET_PRIVATE (completion); + entry = gtk_entry_completion_get_entry (completion); + model = gtk_entry_completion_get_model (completion); + + /* XXX This would be easier if GtkEntryCompletion had an 'entry' + * property that we could listen to for notifications. */ + if (entry != priv->last_known_entry) { + category_completion_track_entry (completion); + return; + } + + editable = GTK_EDITABLE (entry); + text = gtk_entry_get_text (GTK_ENTRY (entry)); + + /* Get the cursor position as a character offset. */ + offset = gtk_editable_get_position (editable); + + /* Find the rightmost comma before the cursor. */ + cp = g_utf8_offset_to_pointer (text, offset); + cp = g_utf8_strrchr (text, (gsize) (cp - text), ','); + + /* Mark the start of the prefix. */ + if (cp == NULL) + start = text; + else { + cp = g_utf8_next_char (cp); + if (g_unichar_isspace (g_utf8_get_char (cp))) + cp = g_utf8_next_char (cp); + start = cp; + } + + /* Find the leftmost comma after the cursor. */ + cp = g_utf8_offset_to_pointer (text, offset); + cp = g_utf8_strchr (cp, -1, ','); + + /* Mark the end of the prefix. */ + if (cp == NULL) + end = text + strlen (text); + else + end = cp; + + if (priv->create != NULL) + gtk_entry_completion_delete_action (completion, 0); + + g_free (priv->create); + priv->create = NULL; + + g_free (priv->prefix); + priv->prefix = NULL; + + if (start == end) + return; + + input = g_strstrip (g_strndup (start, end - start)); + priv->create = input; + + input = g_utf8_normalize (input, -1, G_NORMALIZE_DEFAULT); + priv->prefix = g_utf8_casefold (input, -1); + g_free (input); + + if (*priv->create == '\0') { + g_free (priv->create); + priv->create = NULL; + return; + } + + valid = gtk_tree_model_get_iter_first (model, &iter); + while (valid) { + GValue value = { 0, }; + + gtk_tree_model_get_value ( + model, &iter, COLUMN_NORMALIZED, &value); + if (strcmp (g_value_get_string (&value), priv->prefix) == 0) { + g_value_unset (&value); + g_free (priv->create); + priv->create = NULL; + return; + } + g_value_unset (&value); + + valid = gtk_tree_model_iter_next (model, &iter); + } + + input = g_strdup_printf (_("Create category \"%s\""), priv->create); + gtk_entry_completion_insert_action_text (completion, 0, input); + g_free (input); +} + +static gboolean +category_completion_sanitize_suffix (GtkEntry *entry, + GdkEventFocus *event, + GtkEntryCompletion *completion) +{ + const gchar *text; + + g_return_val_if_fail (entry != NULL, FALSE); + g_return_val_if_fail (completion != NULL, FALSE); + + text = gtk_entry_get_text (entry); + if (text) { + gint len = strlen (text), old_len = len; + + while (len > 0 && (text[len -1] == ' ' || text[len - 1] == ',')) + len--; + + if (old_len != len) { + gchar *tmp = g_strndup (text, len); + + gtk_entry_set_text (entry, tmp); + + g_free (tmp); + } + } + + return FALSE; +} + +static void +category_completion_track_entry (GtkEntryCompletion *completion) +{ + ECategoryCompletionPrivate *priv; + + priv = E_CATEGORY_COMPLETION_GET_PRIVATE (completion); + + if (priv->last_known_entry != NULL) { + g_signal_handlers_disconnect_matched ( + priv->last_known_entry, G_SIGNAL_MATCH_DATA, + 0, 0, NULL, NULL, completion); + g_object_unref (priv->last_known_entry); + } + + g_free (priv->prefix); + priv->prefix = NULL; + + priv->last_known_entry = gtk_entry_completion_get_entry (completion); + if (priv->last_known_entry == NULL) + return; + + g_object_ref (priv->last_known_entry); + + g_signal_connect_swapped ( + priv->last_known_entry, "notify::cursor-position", + G_CALLBACK (category_completion_update_prefix), completion); + + g_signal_connect_swapped ( + priv->last_known_entry, "notify::text", + G_CALLBACK (category_completion_update_prefix), completion); + + g_signal_connect ( + priv->last_known_entry, "focus-out-event", + G_CALLBACK (category_completion_sanitize_suffix), completion); + + category_completion_update_prefix (completion); +} + +static void +category_completion_constructed (GObject *object) +{ + GtkCellRenderer *renderer; + GtkEntryCompletion *completion; + + /* Chain up to parent's constructed() method. */ + G_OBJECT_CLASS (e_category_completion_parent_class)->constructed (object); + + completion = GTK_ENTRY_COMPLETION (object); + + gtk_entry_completion_set_match_func ( + completion, (GtkEntryCompletionMatchFunc) + category_completion_is_match, NULL, NULL); + + gtk_entry_completion_set_text_column (completion, COLUMN_CATEGORY); + + renderer = gtk_cell_renderer_pixbuf_new (); + gtk_cell_layout_pack_start ( + GTK_CELL_LAYOUT (completion), renderer, FALSE); + gtk_cell_layout_add_attribute ( + GTK_CELL_LAYOUT (completion), + renderer, "pixbuf", COLUMN_PIXBUF); + gtk_cell_layout_reorder ( + GTK_CELL_LAYOUT (completion), renderer, 0); + + e_categories_register_change_listener ( + G_CALLBACK (category_completion_categories_changed_cb), + completion); + + category_completion_build_model (completion); +} + +static void +category_completion_dispose (GObject *object) +{ + ECategoryCompletionPrivate *priv; + + priv = E_CATEGORY_COMPLETION_GET_PRIVATE (object); + + if (priv->last_known_entry != NULL) { + g_signal_handlers_disconnect_matched ( + priv->last_known_entry, G_SIGNAL_MATCH_DATA, + 0, 0, NULL, NULL, object); + g_object_unref (priv->last_known_entry); + priv->last_known_entry = NULL; + } + + /* Chain up to parent's dispose() method. */ + G_OBJECT_CLASS (e_category_completion_parent_class)->dispose (object); +} + +static void +category_completion_finalize (GObject *object) +{ + ECategoryCompletionPrivate *priv; + + priv = E_CATEGORY_COMPLETION_GET_PRIVATE (object); + + g_free (priv->create); + g_free (priv->prefix); + + e_categories_unregister_change_listener ( + G_CALLBACK (category_completion_categories_changed_cb), + object); + + /* Chain up to parent's finalize() method. */ + G_OBJECT_CLASS (e_category_completion_parent_class)->finalize (object); +} + +static gboolean +category_completion_match_selected (GtkEntryCompletion *completion, + GtkTreeModel *model, + GtkTreeIter *iter) +{ + GValue value = { 0, }; + + gtk_tree_model_get_value (model, iter, COLUMN_CATEGORY, &value); + category_completion_complete (completion, g_value_get_string (&value)); + g_value_unset (&value); + + return TRUE; +} + +static void +category_completion_action_activated (GtkEntryCompletion *completion, + gint index) +{ + ECategoryCompletionPrivate *priv; + gchar *category; + + priv = E_CATEGORY_COMPLETION_GET_PRIVATE (completion); + + category = g_strdup (priv->create); + e_categories_add (category, NULL, NULL, TRUE); + category_completion_complete (completion, category); + g_free (category); +} + +static void +e_category_completion_class_init (ECategoryCompletionClass *class) +{ + GObjectClass *object_class; + GtkEntryCompletionClass *entry_completion_class; + + g_type_class_add_private (class, sizeof (ECategoryCompletionPrivate)); + + object_class = G_OBJECT_CLASS (class); + object_class->constructed = category_completion_constructed; + object_class->dispose = category_completion_dispose; + object_class->finalize = category_completion_finalize; + + entry_completion_class = GTK_ENTRY_COMPLETION_CLASS (class); + entry_completion_class->match_selected = category_completion_match_selected; + entry_completion_class->action_activated = category_completion_action_activated; +} + +static void +e_category_completion_init (ECategoryCompletion *category_completion) +{ + category_completion->priv = + E_CATEGORY_COMPLETION_GET_PRIVATE (category_completion); +} + +/** + * e_category_completion_new: + * + * Since: 2.26 + **/ +GtkEntryCompletion * +e_category_completion_new (void) +{ + return g_object_new (E_TYPE_CATEGORY_COMPLETION, NULL); +} diff --git a/e-util/e-category-completion.h b/e-util/e-category-completion.h new file mode 100644 index 0000000000..477a036cd3 --- /dev/null +++ b/e-util/e-category-completion.h @@ -0,0 +1,72 @@ +/* + * 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/> + * + * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) + */ + +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + +#ifndef E_CATEGORY_COMPLETION_H +#define E_CATEGORY_COMPLETION_H + +#include <gtk/gtk.h> + +/* Standard GObject macros */ +#define E_TYPE_CATEGORY_COMPLETION \ + (e_category_completion_get_type ()) +#define E_CATEGORY_COMPLETION(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST \ + ((obj), E_TYPE_CATEGORY_COMPLETION, ECategoryCompletion)) +#define E_CATEGORY_COMPLETION_CLASS(cls) \ + (G_TYPE_CHECK_CLASS_CAST \ + ((cls), E_TYPE_CATEGORY_COMPLETION, ECategoryCompletionClass)) +#define E_IS_CATEGORY_COMPLETION(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE \ + ((obj), E_TYPE_CATEGORY_COMPLETION)) +#define E_IS_CATEGORY_COMPLETION_CLASS(cls) \ + (G_TYPE_CHECK_CLASS_TYPE \ + ((cls), E_TYPE_CATEGORY_COMPLETION)) +#define E_CATEGORY_COMPLETION_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS \ + ((obj), E_TYPE_CATEGORY_COMPLETION, ECategoryCompletionClass)) + +G_BEGIN_DECLS + +typedef struct _ECategoryCompletion ECategoryCompletion; +typedef struct _ECategoryCompletionClass ECategoryCompletionClass; +typedef struct _ECategoryCompletionPrivate ECategoryCompletionPrivate; + +/** + * ECategoryCompletion: + * + * Since: 2.26 + **/ +struct _ECategoryCompletion { + GtkEntryCompletion parent; + ECategoryCompletionPrivate *priv; +}; + +struct _ECategoryCompletionClass { + GtkEntryCompletionClass parent_class; +}; + +GType e_category_completion_get_type (void); +GtkEntryCompletion * + e_category_completion_new (void); + +G_END_DECLS + +#endif /* E_CATEGORY_COMPLETION_H */ diff --git a/e-util/e-category-editor.c b/e-util/e-category-editor.c new file mode 100644 index 0000000000..33ad6dde6c --- /dev/null +++ b/e-util/e-category-editor.c @@ -0,0 +1,343 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* + * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU Lesser General Public + * License as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include <string.h> +#include <gtk/gtk.h> +#include <glib/gi18n-lib.h> + +#include <libedataserver/libedataserver.h> + +#include "e-category-editor.h" + +#define E_CATEGORY_EDITOR_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE \ + ((obj), E_TYPE_CATEGORY_EDITOR, ECategoryEditorPrivate)) + +struct _ECategoryEditorPrivate { + GtkWidget *category_name; + GtkWidget *category_icon; +}; + +G_DEFINE_TYPE (ECategoryEditor, e_category_editor, GTK_TYPE_DIALOG) + +static void +update_preview (GtkFileChooser *chooser, + gpointer user_data) +{ + GtkImage *image; + gchar *filename; + + g_return_if_fail (chooser != NULL); + + image = GTK_IMAGE (gtk_file_chooser_get_preview_widget (chooser)); + g_return_if_fail (image != NULL); + + filename = gtk_file_chooser_get_preview_filename (chooser); + + gtk_image_set_from_file (image, filename); + gtk_file_chooser_set_preview_widget_active (chooser, filename != NULL); + + g_free (filename); +} + +static void +file_chooser_response (GtkDialog *dialog, + gint response_id, + GtkFileChooser *button) +{ + g_return_if_fail (button != NULL); + + if (response_id == GTK_RESPONSE_NO) + gtk_file_chooser_unselect_all (button); +} + +static void +category_editor_category_name_changed (GtkEntry *category_name_entry, + ECategoryEditor *editor) +{ + gchar *name; + + g_return_if_fail (editor != NULL); + g_return_if_fail (category_name_entry != NULL); + + name = g_strdup (gtk_entry_get_text (category_name_entry)); + if (name != NULL) + name = g_strstrip (name); + + gtk_dialog_set_response_sensitive ( + GTK_DIALOG (editor), GTK_RESPONSE_OK, name && *name); + + g_free (name); +} + +static gchar * +check_category_name (const gchar *name) +{ + GString *str = NULL; + gchar *p = (gchar *) name; + + str = g_string_new (""); + while (*p) { + switch (*p) { + case ',': + break; + default: + str = g_string_append_c (str, *p); + } + p++; + } + + p = g_strstrip (g_string_free (str, FALSE)); + + return p; +} + +static void +e_category_editor_class_init (ECategoryEditorClass *class) +{ + g_type_class_add_private (class, sizeof (ECategoryEditorPrivate)); +} + +static void +e_category_editor_init (ECategoryEditor *editor) +{ + GtkWidget *dialog_content; + GtkWidget *dialog_action_area; + GtkGrid *grid_category_properties; + GtkWidget *label_name; + GtkWidget *label_icon; + GtkWidget *category_name; + GtkWidget *chooser_button; + GtkWidget *no_image_button; + GtkWidget *chooser_dialog; + GtkWidget *preview; + + editor->priv = E_CATEGORY_EDITOR_GET_PRIVATE (editor); + + chooser_dialog = gtk_file_chooser_dialog_new ( + _("Category Icon"), + NULL, GTK_FILE_CHOOSER_ACTION_OPEN, + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, NULL); + + no_image_button = gtk_button_new_with_mnemonic (_("_No Image")); + gtk_button_set_image ( + GTK_BUTTON (no_image_button), + gtk_image_new_from_stock ( + GTK_STOCK_CLOSE, GTK_ICON_SIZE_BUTTON)); + gtk_dialog_add_action_widget ( + GTK_DIALOG (chooser_dialog), + no_image_button, GTK_RESPONSE_NO); + gtk_dialog_add_button ( + GTK_DIALOG (chooser_dialog), + GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT); + gtk_file_chooser_set_local_only ( + GTK_FILE_CHOOSER (chooser_dialog), TRUE); + gtk_widget_show (no_image_button); + + g_signal_connect ( + chooser_dialog, "update-preview", + G_CALLBACK (update_preview), NULL); + + preview = gtk_image_new (); + gtk_file_chooser_set_preview_widget ( + GTK_FILE_CHOOSER (chooser_dialog), preview); + gtk_file_chooser_set_preview_widget_active ( + GTK_FILE_CHOOSER (chooser_dialog), TRUE); + gtk_widget_show_all (preview); + + dialog_content = gtk_dialog_get_content_area (GTK_DIALOG (editor)); + + grid_category_properties = GTK_GRID (gtk_grid_new ()); + gtk_box_pack_start ( + GTK_BOX (dialog_content), + GTK_WIDGET (grid_category_properties), TRUE, TRUE, 0); + gtk_container_set_border_width ( + GTK_CONTAINER (grid_category_properties), 12); + gtk_grid_set_row_spacing (grid_category_properties, 6); + gtk_grid_set_column_spacing (grid_category_properties, 6); + + label_name = gtk_label_new_with_mnemonic (_("Category _Name")); + gtk_widget_set_halign (label_name, GTK_ALIGN_FILL); + gtk_misc_set_alignment (GTK_MISC (label_name), 0, 0.5); + gtk_grid_attach (grid_category_properties, label_name, 0, 0, 1, 1); + + category_name = gtk_entry_new (); + gtk_widget_set_hexpand (category_name, TRUE); + gtk_widget_set_halign (category_name, GTK_ALIGN_FILL); + gtk_label_set_mnemonic_widget (GTK_LABEL (label_name), category_name); + gtk_grid_attach (grid_category_properties, category_name, 1, 0, 1, 1); + editor->priv->category_name = category_name; + + label_icon = gtk_label_new_with_mnemonic (_("Category _Icon")); + gtk_widget_set_halign (label_icon, GTK_ALIGN_FILL); + gtk_misc_set_alignment (GTK_MISC (label_icon), 0, 0.5); + gtk_grid_attach (grid_category_properties, label_icon, 0, 1, 1, 1); + + chooser_button = GTK_WIDGET ( + gtk_file_chooser_button_new_with_dialog (chooser_dialog)); + gtk_widget_set_hexpand (chooser_button, TRUE); + gtk_widget_set_halign (chooser_button, GTK_ALIGN_FILL); + gtk_label_set_mnemonic_widget (GTK_LABEL (label_icon), chooser_button); + gtk_grid_attach (grid_category_properties, chooser_button, 1, 1, 1, 1); + editor->priv->category_icon = chooser_button; + + g_signal_connect ( + chooser_dialog, "response", + G_CALLBACK (file_chooser_response), chooser_button); + + dialog_action_area = gtk_dialog_get_action_area (GTK_DIALOG (editor)); + gtk_button_box_set_layout ( + GTK_BUTTON_BOX (dialog_action_area), GTK_BUTTONBOX_END); + + gtk_dialog_add_buttons ( + GTK_DIALOG (editor), + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, + GTK_STOCK_OK, GTK_RESPONSE_OK, NULL); + gtk_dialog_set_default_response (GTK_DIALOG (editor), GTK_RESPONSE_OK); + gtk_window_set_title (GTK_WINDOW (editor), _("Category Properties")); + gtk_window_set_type_hint ( + GTK_WINDOW (editor), GDK_WINDOW_TYPE_HINT_DIALOG); + + gtk_widget_show_all (dialog_content); + + g_signal_connect ( + category_name, "changed", + G_CALLBACK (category_editor_category_name_changed), editor); + + category_editor_category_name_changed ( + GTK_ENTRY (category_name), editor); +} + +/** + * e_categort_editor_new: + * + * Creates a new #ECategoryEditor widget. + * + * Returns: a new #ECategoryEditor + * + * Since: 3.2 + **/ +ECategoryEditor * +e_category_editor_new () +{ + return g_object_new (E_TYPE_CATEGORY_EDITOR, NULL); +} + +/** + * e_category_editor_create_category: + * + * Since: 3.2 + **/ +const gchar * +e_category_editor_create_category (ECategoryEditor *editor) +{ + GtkEntry *entry; + GtkFileChooser *file_chooser; + + g_return_val_if_fail (E_IS_CATEGORY_EDITOR (editor), NULL); + + entry = GTK_ENTRY (editor->priv->category_name); + file_chooser = GTK_FILE_CHOOSER (editor->priv->category_icon); + + do { + const gchar *category_name; + const gchar *correct_category_name; + + if (gtk_dialog_run (GTK_DIALOG (editor)) != GTK_RESPONSE_OK) + return NULL; + + category_name = gtk_entry_get_text (entry); + correct_category_name = check_category_name (category_name); + + if (e_categories_exist (correct_category_name)) { + GtkWidget *error_dialog; + + error_dialog = gtk_message_dialog_new ( + GTK_WINDOW (editor), + 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, + _("There is already a category '%s' in the " + "configuration. Please use another name"), + category_name); + + gtk_dialog_run (GTK_DIALOG (error_dialog)); + gtk_widget_destroy (error_dialog); + + /* Now we loop and run the dialog again. */ + + } else { + gchar *category_icon; + + category_icon = + gtk_file_chooser_get_filename (file_chooser); + e_categories_add ( + correct_category_name, NULL, + category_icon, TRUE); + g_free (category_icon); + + return correct_category_name; + } + + } while (TRUE); +} + +/** + * e_category_editor_edit_category: + * + * Since: 3.2 + **/ +gboolean +e_category_editor_edit_category (ECategoryEditor *editor, + const gchar *category) +{ + GtkFileChooser *file_chooser; + const gchar *icon_file; + + g_return_val_if_fail (E_IS_CATEGORY_EDITOR (editor), FALSE); + g_return_val_if_fail (category != NULL, FALSE); + + file_chooser = GTK_FILE_CHOOSER (editor->priv->category_icon); + + gtk_entry_set_text (GTK_ENTRY (editor->priv->category_name), category); + gtk_widget_set_sensitive (editor->priv->category_name, FALSE); + + icon_file = e_categories_get_icon_file_for (category); + if (icon_file) { + gtk_file_chooser_set_filename (file_chooser, icon_file); + update_preview (file_chooser, NULL); + } + + if (gtk_dialog_run (GTK_DIALOG (editor)) == GTK_RESPONSE_OK) { + gchar *category_icon; + + category_icon = gtk_file_chooser_get_filename (file_chooser); + e_categories_set_icon_file_for (category, category_icon); + + gtk_dialog_set_response_sensitive ( + GTK_DIALOG (editor), GTK_RESPONSE_OK, TRUE); + + g_free (category_icon); + + return TRUE; + } + + return FALSE; +} diff --git a/e-util/e-category-editor.h b/e-util/e-category-editor.h new file mode 100644 index 0000000000..bf5ebbe1a8 --- /dev/null +++ b/e-util/e-category-editor.h @@ -0,0 +1,81 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* + * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU Lesser General Public + * License as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + +#ifndef E_CATEGORY_EDITOR_H +#define E_CATEGORY_EDITOR_H + +#include <gtk/gtk.h> + +/* Standard GObject macros */ +#define E_TYPE_CATEGORY_EDITOR \ + (e_category_editor_get_type ()) +#define E_CATEGORY_EDITOR(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST \ + ((obj), E_TYPE_CATEGORY_EDITOR, ECategoryEditor)) +#define E_CATEGORY_EDITOR_CLASS(cls) \ + (G_TYPE_CHECK_CLASS_CAST \ + ((cls), E_TYPE_CATEGORY_EDITOR, ECategoryEditorClass)) +#define E_IS_CATEGORY_EDITOR(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE \ + ((obj), E_TYPE_CATEGORY_EDITOR)) +#define E_IS_CATEGORY_EDITOR_CLASS(cls) \ + (G_TYPE_CHECK_CLASS_TYPE \ + ((cls), E_TYPE_CATEGORY_EDITOR)) +#define E_CATEGORY_EDITOR_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS \ + ((obj), E_TYPE_CATEGORY_EDITOR, ECategoryEditorClass)) + +G_BEGIN_DECLS + +typedef struct _ECategoryEditor ECategoryEditor; +typedef struct _ECategoryEditorClass ECategoryEditorClass; +typedef struct _ECategoryEditorPrivate ECategoryEditorPrivate; + +/** + * ECategoryEditor: + * + * Contains only private data that should be read and manipulated using the + * functions below. + * + * Since: 3.2 + **/ +struct _ECategoryEditor { + GtkDialog parent; + ECategoryEditorPrivate *priv; +}; + +struct _ECategoryEditorClass { + GtkDialogClass parent_class; +}; + +GType e_category_editor_get_type (void); +ECategoryEditor * + e_category_editor_new (void); +const gchar * e_category_editor_create_category + (ECategoryEditor *editor); +gboolean e_category_editor_edit_category (ECategoryEditor *editor, + const gchar *category); + +G_END_DECLS + +#endif /* E_CATEGORY_EDITOR_H */ diff --git a/widgets/table/e-cell-checkbox.c b/e-util/e-cell-checkbox.c index 0d30031397..c4340426bd 100644 --- a/widgets/table/e-cell-checkbox.c +++ b/e-util/e-cell-checkbox.c @@ -29,8 +29,6 @@ #include <gtk/gtk.h> #include <libgnomecanvas/libgnomecanvas.h> -#include "e-util/e-util.h" - #include "e-table-item.h" #include "e-cell-checkbox.h" diff --git a/widgets/table/e-cell-checkbox.h b/e-util/e-cell-checkbox.h index 8306b2d29a..2d1d9db053 100644 --- a/widgets/table/e-cell-checkbox.h +++ b/e-util/e-cell-checkbox.h @@ -21,10 +21,14 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef _E_CELL_CHECKBOX_H_ #define _E_CELL_CHECKBOX_H_ -#include <table/e-cell-toggle.h> +#include <e-util/e-cell-toggle.h> /* Standard GObject macros */ #define E_TYPE_CELL_CHECKBOX \ diff --git a/widgets/table/e-cell-combo.c b/e-util/e-cell-combo.c index bc82042d7a..dba6b53c50 100644 --- a/widgets/table/e-cell-combo.c +++ b/e-util/e-cell-combo.c @@ -57,18 +57,17 @@ #include <config.h> #endif +#include "e-cell-combo.h" + #include <string.h> -#include <gdk/gdkkeysyms.h> #include <gtk/gtk.h> - #include <glib/gi18n.h> -#include "e-util/e-util.h" -#include "e-util/e-unicode.h" +#include <gdk/gdkkeysyms.h> -#include "e-table-item.h" -#include "e-cell-combo.h" #include "e-cell-text.h" +#include "e-table-item.h" +#include "e-unicode.h" #define d(x) diff --git a/widgets/table/e-cell-combo.h b/e-util/e-cell-combo.h index 3d2fb339de..04f17c60fa 100644 --- a/widgets/table/e-cell-combo.h +++ b/e-util/e-cell-combo.h @@ -28,10 +28,14 @@ * ECellText or subclass. */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef _E_CELL_COMBO_H_ #define _E_CELL_COMBO_H_ -#include <table/e-cell-popup.h> +#include <e-util/e-cell-popup.h> /* Standard GObject macros */ #define E_TYPE_CELL_COMBO \ diff --git a/widgets/table/e-cell-date-edit.c b/e-util/e-cell-date-edit.c index be834f5686..4f35fbb266 100644 --- a/widgets/table/e-cell-date-edit.c +++ b/e-util/e-cell-date-edit.c @@ -34,18 +34,15 @@ #include <string.h> #include <time.h> -#include <gdk/gdkkeysyms.h> #include <gtk/gtk.h> - -#include "e-table-item.h" -#include "e-cell-text.h" - #include <glib/gi18n.h> +#include <gdk/gdkkeysyms.h> #include <libedataserver/libedataserver.h> -/* This depends on ECalendar which is why I didn't put it in gal. */ -#include <misc/e-calendar.h> +#include "e-calendar.h" +#include "e-cell-text.h" +#include "e-table-item.h" static void e_cell_date_edit_get_property (GObject *object, guint property_id, diff --git a/widgets/table/e-cell-date-edit.h b/e-util/e-cell-date-edit.h index 186302d79a..ea70731457 100644 --- a/widgets/table/e-cell-date-edit.h +++ b/e-util/e-cell-date-edit.h @@ -26,11 +26,16 @@ * window to edit it. */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef _E_CELL_DATE_EDIT_H_ #define _E_CELL_DATE_EDIT_H_ #include <time.h> -#include <table/e-cell-popup.h> + +#include <e-util/e-cell-popup.h> /* Standard GObject macros */ #define E_TYPE_CELL_DATE_EDIT \ diff --git a/widgets/table/e-cell-date.c b/e-util/e-cell-date.c index 79534aff45..b8067f208e 100644 --- a/widgets/table/e-cell-date.c +++ b/e-util/e-cell-date.c @@ -24,17 +24,17 @@ #include <config.h> #endif +#include "e-cell-date.h" + #include <sys/time.h> #include <time.h> #include <unistd.h> #include <string.h> #include <glib/gi18n.h> -#include "e-util/e-util.h" -#include "e-util/e-unicode.h" -#include "e-util/e-datetime-format.h" -#include "e-cell-date.h" +#include "e-datetime-format.h" +#include "e-unicode.h" G_DEFINE_TYPE (ECellDate, e_cell_date, E_TYPE_CELL_TEXT) diff --git a/widgets/table/e-cell-date.h b/e-util/e-cell-date.h index c498095241..a0968b050b 100644 --- a/widgets/table/e-cell-date.h +++ b/e-util/e-cell-date.h @@ -21,10 +21,14 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_CELL_DATE_H #define E_CELL_DATE_H -#include <table/e-cell-text.h> +#include <e-util/e-cell-text.h> /* Standard GObject macros */ #define E_TYPE_CELL_DATE \ diff --git a/widgets/table/e-cell-hbox.c b/e-util/e-cell-hbox.c index 74301a773c..669dd4416c 100644 --- a/widgets/table/e-cell-hbox.c +++ b/e-util/e-cell-hbox.c @@ -36,7 +36,6 @@ /* #include "a11y/gal-a11y-e-cell-registry.h" */ /* #include "a11y/gal-a11y-e-cell-vbox.h" */ -#include "e-util/e-util.h" #include "e-cell-hbox.h" #include "e-table-item.h" diff --git a/widgets/table/e-cell-hbox.h b/e-util/e-cell-hbox.h index 41cc01e6a1..6a0495cf50 100644 --- a/widgets/table/e-cell-hbox.h +++ b/e-util/e-cell-hbox.h @@ -21,11 +21,16 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef _E_CELL_HBOX_H_ #define _E_CELL_HBOX_H_ #include <libgnomecanvas/libgnomecanvas.h> -#include <table/e-cell.h> + +#include <e-util/e-cell.h> /* Standard GObject macros */ #define E_TYPE_CELL_HBOX \ diff --git a/widgets/table/e-cell-number.c b/e-util/e-cell-number.c index 6e2f685a86..5ecccaded1 100644 --- a/widgets/table/e-cell-number.c +++ b/e-util/e-cell-number.c @@ -24,13 +24,14 @@ #include <config.h> #endif +#include "e-cell-number.h" + #include <sys/time.h> #include <unistd.h> #include <glib/gi18n.h> -#include "e-util/e-util.h" -#include "e-cell-number.h" +#include "e-misc-utils.h" G_DEFINE_TYPE (ECellNumber, e_cell_number, E_TYPE_CELL_TEXT) diff --git a/widgets/table/e-cell-number.h b/e-util/e-cell-number.h index 539f27679e..a5ef2ab52f 100644 --- a/widgets/table/e-cell-number.h +++ b/e-util/e-cell-number.h @@ -21,10 +21,14 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_CELL_NUMBER_H #define E_CELL_NUMBER_H -#include <table/e-cell-text.h> +#include <e-util/e-cell-text.h> /* Standard GObject macros */ #define E_TYPE_CELL_NUMBER \ diff --git a/widgets/table/e-cell-percent.c b/e-util/e-cell-percent.c index 81465d5a62..81465d5a62 100644 --- a/widgets/table/e-cell-percent.c +++ b/e-util/e-cell-percent.c diff --git a/widgets/table/e-cell-percent.h b/e-util/e-cell-percent.h index be4fdac9b7..57ce41d1a3 100644 --- a/widgets/table/e-cell-percent.h +++ b/e-util/e-cell-percent.h @@ -26,10 +26,14 @@ * in an ETable. */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_CELL_PERCENT_H #define E_CELL_PERCENT_H -#include <table/e-cell-text.h> +#include <e-util/e-cell-text.h> /* Standard GObject macros */ #define E_TYPE_CELL_PERCENT \ @@ -40,13 +44,13 @@ #define E_CELL_PERCENT_CLASS(cls) \ (G_TYPE_CHECK_CLASS_CAST \ ((cls), E_TYPE_CELL_PERCENT, ECellPercentClass)) -#define E_IS_CELL_NUMBER(obj) \ +#define E_IS_CELL_PERCENT(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE \ ((obj), E_TYPE_CELL_PERCENT)) -#define E_IS_CELL_NUMBER_CLASS(cls) \ +#define E_IS_CELL_PERCENT_CLASS(cls) \ (G_TYPE_CHECK_CLASS_TYPE \ ((cls), E_TYPE_CELL_PERCENT)) -#define E_CELL_NUMBER_GET_CLASS(obj) \ +#define E_CELL_PERCENT_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS \ ((obj), E_TYPE_CELL_PERCENT, ECellPercentClass)) diff --git a/widgets/table/e-cell-pixbuf.c b/e-util/e-cell-pixbuf.c index 41b030ec5a..41b030ec5a 100644 --- a/widgets/table/e-cell-pixbuf.c +++ b/e-util/e-cell-pixbuf.c diff --git a/widgets/table/e-cell-pixbuf.h b/e-util/e-cell-pixbuf.h index f4848f7430..e76fcab2c7 100644 --- a/widgets/table/e-cell-pixbuf.h +++ b/e-util/e-cell-pixbuf.h @@ -22,10 +22,14 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef _E_CELL_PIXBUF_H_ #define _E_CELL_PIXBUF_H_ -#include <table/e-table.h> +#include <e-util/e-table.h> /* Standard GObject macros */ #define E_TYPE_CELL_PIXBUF \ diff --git a/widgets/table/e-cell-popup.c b/e-util/e-cell-popup.c index ce821700f3..19c32a658d 100644 --- a/widgets/table/e-cell-popup.c +++ b/e-util/e-cell-popup.c @@ -37,7 +37,6 @@ #include "gal-a11y-e-cell-popup.h" #include "gal-a11y-e-cell-registry.h" -#include "e-util/e-util.h" #include "e-cell-popup.h" #include "e-table-item.h" diff --git a/widgets/table/e-cell-popup.h b/e-util/e-cell-popup.h index bc99196eaf..0b973d8f18 100644 --- a/widgets/table/e-cell-popup.h +++ b/e-util/e-cell-popup.h @@ -29,11 +29,16 @@ * popup can be provided. */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef _E_CELL_POPUP_H_ #define _E_CELL_POPUP_H_ #include <libgnomecanvas/libgnomecanvas.h> -#include <table/e-cell.h> + +#include <e-util/e-cell.h> /* Standard GObject macros */ #define E_TYPE_CELL_POPUP \ diff --git a/e-util/e-cell-renderer-color.c b/e-util/e-cell-renderer-color.c new file mode 100644 index 0000000000..4bbb1318b3 --- /dev/null +++ b/e-util/e-cell-renderer-color.c @@ -0,0 +1,243 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* e-cell-renderer-color.c + * + * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU Lesser General Public + * License as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include "e-cell-renderer-color.h" + +#include <string.h> +#include <glib/gi18n-lib.h> + +#define E_CELL_RENDERER_COLOR_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE \ + ((obj), E_TYPE_CELL_RENDERER_COLOR, ECellRendererColorPrivate)) + +enum { + PROP_0, + PROP_COLOR +}; + +struct _ECellRendererColorPrivate { + GdkColor *color; +}; + +G_DEFINE_TYPE ( + ECellRendererColor, + e_cell_renderer_color, + GTK_TYPE_CELL_RENDERER) + +static void +cell_renderer_color_get_size (GtkCellRenderer *cell, + GtkWidget *widget, + const GdkRectangle *cell_area, + gint *x_offset, + gint *y_offset, + gint *width, + gint *height) +{ + gint color_width = 16; + gint color_height = 16; + gint calc_width; + gint calc_height; + gfloat xalign; + gfloat yalign; + guint xpad; + guint ypad; + + g_object_get ( + cell, "xalign", &xalign, "yalign", &yalign, + "xpad", &xpad, "ypad", &ypad, NULL); + + calc_width = (gint) xpad * 2 + color_width; + calc_height = (gint) ypad * 2 + color_height; + + if (cell_area && color_width > 0 && color_height > 0) { + if (x_offset) { + *x_offset = (((gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) ? + (1.0 - xalign) : xalign) * + (cell_area->width - calc_width)); + *x_offset = MAX (*x_offset, 0); + } + + if (y_offset) { + *y_offset =(yalign * + (cell_area->height - calc_height)); + *y_offset = MAX (*y_offset, 0); + } + } else { + if (x_offset) *x_offset = 0; + if (y_offset) *y_offset = 0; + } + + if (width) + *width = calc_width; + + if (height) + *height = calc_height; +} + +static void +cell_renderer_color_render (GtkCellRenderer *cell, + cairo_t *cr, + GtkWidget *widget, + const GdkRectangle *background_area, + const GdkRectangle *cell_area, + GtkCellRendererState flags) +{ + ECellRendererColorPrivate *priv; + GdkRectangle pix_rect; + GdkRectangle draw_rect; + GdkRGBA rgba; + guint xpad; + guint ypad; + + priv = E_CELL_RENDERER_COLOR_GET_PRIVATE (cell); + + if (priv->color == NULL) + return; + + cell_renderer_color_get_size ( + cell, widget, cell_area, + &pix_rect.x, &pix_rect.y, + &pix_rect.width, &pix_rect.height); + + g_object_get (cell, "xpad", &xpad, "ypad", &ypad, NULL); + + pix_rect.x += cell_area->x + xpad; + pix_rect.y += cell_area->y + ypad; + pix_rect.width -= xpad * 2; + pix_rect.height -= ypad * 2; + + if (!gdk_rectangle_intersect (cell_area, &pix_rect, &draw_rect)) + return; + + rgba.red = priv->color->red / 65535.0; + rgba.green = priv->color->green / 65535.0; + rgba.blue = priv->color->blue / 65535.0; + rgba.alpha = 1.0; + + gdk_cairo_set_source_rgba (cr, &rgba); + cairo_rectangle (cr, pix_rect.x, pix_rect.y, draw_rect.width, draw_rect.height); + + cairo_fill (cr); +} + +static void +cell_renderer_color_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) +{ + ECellRendererColorPrivate *priv; + + priv = E_CELL_RENDERER_COLOR_GET_PRIVATE (object); + + switch (property_id) { + case PROP_COLOR: + if (priv->color != NULL) + gdk_color_free (priv->color); + priv->color = g_value_dup_boxed (value); + return; + } + + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); +} + +static void +cell_renderer_color_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) +{ + ECellRendererColorPrivate *priv; + + priv = E_CELL_RENDERER_COLOR_GET_PRIVATE (object); + + switch (property_id) { + case PROP_COLOR: + g_value_set_boxed (value, priv->color); + return; + } + + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); +} + +static void +cell_renderer_color_finalize (GObject *object) +{ + ECellRendererColorPrivate *priv; + + priv = E_CELL_RENDERER_COLOR_GET_PRIVATE (object); + + if (priv->color != NULL) + gdk_color_free (priv->color); + + /* Chain up to parent's finalize() method. */ + G_OBJECT_CLASS (e_cell_renderer_color_parent_class)->finalize (object); +} + +static void +e_cell_renderer_color_class_init (ECellRendererColorClass *class) +{ + GObjectClass *object_class; + GtkCellRendererClass *cell_class; + + g_type_class_add_private (class, sizeof (ECellRendererColorPrivate)); + + object_class = G_OBJECT_CLASS (class); + object_class->set_property = cell_renderer_color_set_property; + object_class->get_property = cell_renderer_color_get_property; + object_class->finalize = cell_renderer_color_finalize; + + cell_class = GTK_CELL_RENDERER_CLASS (class); + cell_class->get_size = cell_renderer_color_get_size; + cell_class->render = cell_renderer_color_render; + + g_object_class_install_property ( + object_class, + PROP_COLOR, + g_param_spec_boxed ( + "color", + "Color Info", + "The color to render", + GDK_TYPE_COLOR, + G_PARAM_READWRITE)); +} + +static void +e_cell_renderer_color_init (ECellRendererColor *cellcolor) +{ + cellcolor->priv = E_CELL_RENDERER_COLOR_GET_PRIVATE (cellcolor); + + g_object_set (cellcolor, "xpad", 4, NULL); +} + +/** + * e_cell_renderer_color_new: + * + * Since: 2.22 + **/ +GtkCellRenderer * +e_cell_renderer_color_new (void) +{ + return g_object_new (E_TYPE_CELL_RENDERER_COLOR, NULL); +} diff --git a/e-util/e-cell-renderer-color.h b/e-util/e-cell-renderer-color.h new file mode 100644 index 0000000000..00dd615607 --- /dev/null +++ b/e-util/e-cell-renderer-color.h @@ -0,0 +1,79 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* e-cell-renderer-color.h + * + * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU Lesser General Public + * License as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + +#ifndef _E_CELL_RENDERER_COLOR_H_ +#define _E_CELL_RENDERER_COLOR_H_ + +#include <gtk/gtk.h> + +/* Standard GObject macros */ +#define E_TYPE_CELL_RENDERER_COLOR \ + (e_cell_renderer_color_get_type ()) +#define E_CELL_RENDERER_COLOR(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST \ + ((obj), E_TYPE_CELL_RENDERER_COLOR, ECellRendererColor)) +#define E_CELL_RENDERER_COLOR_CLASS(cls) \ + (G_TYPE_CHECK_CLASS_CAST \ + ((cls), E_TYPE_CELL_RENDERER_COLOR, ECellRendererColorClass)) +#define E_IS_CELL_RENDERER_COLOR(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE \ + ((obj), E_TYPE_CELL_RENDERER_COLOR)) +#define E_IS_CELL_RENDERER_COLOR_CLASS(cls) \ + (G_TYPE_CHECK_CLASS_TYPE ((cls), E_TYPE_CELL_RENDERER_COLOR)) +#define E_CELL_RENDERER_COLOR_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS \ + ((obj), E_TYPE_CELL_RENDERER_COLOR, ECellRendererColorClass)) + +G_BEGIN_DECLS + +typedef struct _ECellRendererColor ECellRendererColor; +typedef struct _ECellRendererColorClass ECellRendererColorClass; +typedef struct _ECellRendererColorPrivate ECellRendererColorPrivate; + +/** + * ECellRendererColor: + * + * Since: 2.22 + **/ +struct _ECellRendererColor { + GtkCellRenderer parent; + ECellRendererColorPrivate *priv; +}; + +struct _ECellRendererColorClass { + GtkCellRendererClass parent_class; + + /* Padding for future expansion */ + void (*_gtk_reserved1) (void); + void (*_gtk_reserved2) (void); + void (*_gtk_reserved3) (void); + void (*_gtk_reserved4) (void); +}; + +GType e_cell_renderer_color_get_type (void); +GtkCellRenderer *e_cell_renderer_color_new (void); + +G_END_DECLS + +#endif /* _E_CELL_RENDERER_COLOR_H_ */ diff --git a/widgets/table/e-cell-size.c b/e-util/e-cell-size.c index 8f01847d7c..02bde88638 100644 --- a/widgets/table/e-cell-size.c +++ b/e-util/e-cell-size.c @@ -27,8 +27,6 @@ #include <sys/time.h> #include <unistd.h> -#include "e-util/e-util.h" - #include "e-cell-size.h" G_DEFINE_TYPE (ECellSize, e_cell_size, E_TYPE_CELL_TEXT) diff --git a/widgets/table/e-cell-size.h b/e-util/e-cell-size.h index 8b52343b8a..b04134cb03 100644 --- a/widgets/table/e-cell-size.h +++ b/e-util/e-cell-size.h @@ -22,10 +22,14 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_CELL_SIZE_H #define E_CELL_SIZE_H -#include <table/e-cell-text.h> +#include <e-util/e-cell-text.h> /* Standard GObject macros */ #define E_TYPE_CELL_SIZE \ diff --git a/widgets/table/e-cell-text.c b/e-util/e-cell-text.c index 6ad47b4c50..577d41ccf2 100644 --- a/widgets/table/e-cell-text.c +++ b/e-util/e-cell-text.c @@ -42,21 +42,20 @@ #include <math.h> #include <string.h> -#include <gdk/gdkkeysyms.h> #include <gtk/gtk.h> -#include <libgnomecanvas/libgnomecanvas.h> - -#include "text/e-text.h" #include <glib/gi18n.h> -#include "e-util/e-text-event-processor.h" -#include "e-util/e-text-event-processor-emacs-like.h" -#include "e-util/e-util.h" -#include "misc/e-canvas.h" -#include "e-util/e-unicode.h" +#include <gdk/gdkkeysyms.h> -#include "e-table.h" +#include <libgnomecanvas/libgnomecanvas.h> + +#include "e-canvas.h" #include "e-cell-text.h" #include "e-table-item.h" +#include "e-table.h" +#include "e-text-event-processor-emacs-like.h" +#include "e-text-event-processor.h" +#include "e-text.h" +#include "e-unicode.h" #define d(x) #define DO_SELECTION 1 diff --git a/widgets/table/e-cell-text.h b/e-util/e-cell-text.h index 850d0caf29..740b87fec7 100644 --- a/widgets/table/e-cell-text.h +++ b/e-util/e-cell-text.h @@ -35,12 +35,17 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_CELL_TEXT_H #define E_CELL_TEXT_H #include <gtk/gtk.h> #include <libgnomecanvas/libgnomecanvas.h> -#include <table/e-cell.h> + +#include <e-util/e-cell.h> /* Standard GObject macros */ #define E_TYPE_CELL_TEXT \ diff --git a/widgets/table/e-cell-toggle.c b/e-util/e-cell-toggle.c index f4de9d6922..2f2bcd359c 100644 --- a/widgets/table/e-cell-toggle.c +++ b/e-util/e-cell-toggle.c @@ -34,7 +34,6 @@ #include "gal-a11y-e-cell-toggle.h" #include "gal-a11y-e-cell-registry.h" -#include "e-util/e-util.h" #include "e-cell-toggle.h" #include "e-table-item.h" diff --git a/widgets/table/e-cell-toggle.h b/e-util/e-cell-toggle.h index 3bc223c229..657836f142 100644 --- a/widgets/table/e-cell-toggle.h +++ b/e-util/e-cell-toggle.h @@ -23,12 +23,17 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_CELL_TOGGLE_H #define E_CELL_TOGGLE_H #include <libgnomecanvas/libgnomecanvas.h> #include <gdk-pixbuf/gdk-pixbuf.h> -#include <table/e-cell.h> + +#include <e-util/e-cell.h> /* Standard GObject macros */ #define E_TYPE_CELL_TOGGLE \ diff --git a/widgets/table/e-cell-tree.c b/e-util/e-cell-tree.c index 00d096f4e6..085fb0cabe 100644 --- a/widgets/table/e-cell-tree.c +++ b/e-util/e-cell-tree.c @@ -42,7 +42,6 @@ #include "gal-a11y-e-cell-registry.h" #include "gal-a11y-e-cell-tree.h" -#include "e-util/e-util.h" #include "e-cell-tree.h" #include "e-table-item.h" diff --git a/widgets/table/e-cell-tree.h b/e-util/e-cell-tree.h index cf43c47a1c..044c14bfed 100644 --- a/widgets/table/e-cell-tree.h +++ b/e-util/e-cell-tree.h @@ -28,11 +28,16 @@ * 02110-1301, USA. */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef _E_CELL_TREE_H_ #define _E_CELL_TREE_H_ #include <libgnomecanvas/libgnomecanvas.h> -#include <table/e-cell.h> + +#include <e-util/e-cell.h> /* Standard GObject macros */ #define E_TYPE_CELL_TREE \ diff --git a/widgets/table/e-cell-vbox.c b/e-util/e-cell-vbox.c index bce40a8a2e..ef34a0a097 100644 --- a/widgets/table/e-cell-vbox.c +++ b/e-util/e-cell-vbox.c @@ -33,7 +33,6 @@ #include "gal-a11y-e-cell-registry.h" #include "gal-a11y-e-cell-vbox.h" -#include "e-util/e-util.h" #include "e-cell-vbox.h" #include "e-table-item.h" diff --git a/widgets/table/e-cell-vbox.h b/e-util/e-cell-vbox.h index 2ab522c4ae..690d78f7d9 100644 --- a/widgets/table/e-cell-vbox.h +++ b/e-util/e-cell-vbox.h @@ -26,11 +26,16 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef _E_CELL_VBOX_H_ #define _E_CELL_VBOX_H_ #include <libgnomecanvas/libgnomecanvas.h> -#include <table/e-cell.h> + +#include <e-util/e-cell.h> /* Standard GObject macros */ #define E_TYPE_CELL_VBOX \ diff --git a/widgets/table/e-cell.c b/e-util/e-cell.c index b9b96eecb0..34046e1b38 100644 --- a/widgets/table/e-cell.c +++ b/e-util/e-cell.c @@ -27,7 +27,6 @@ #endif #include <gtk/gtk.h> -#include "e-util/e-util.h" #include "e-cell.h" diff --git a/widgets/table/e-cell.h b/e-util/e-cell.h index 38fcc68c32..4c1354259c 100644 --- a/widgets/table/e-cell.h +++ b/e-util/e-cell.h @@ -21,11 +21,16 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef _E_CELL_H_ #define _E_CELL_H_ #include <gtk/gtk.h> -#include <table/e-table-model.h> + +#include <e-util/e-table-model.h> /* Standard GObject macros */ #define E_TYPE_CELL \ diff --git a/widgets/misc/e-charset-combo-box.c b/e-util/e-charset-combo-box.c index 01a814ad10..1423a592d8 100644 --- a/widgets/misc/e-charset-combo-box.c +++ b/e-util/e-charset-combo-box.c @@ -27,8 +27,8 @@ #include <glib/gi18n.h> -#include "e-util/e-charset.h" -#include "e-util/e-util.h" +#include "e-charset.h" +#include "e-misc-utils.h" #define E_CHARSET_COMBO_BOX_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ diff --git a/widgets/misc/e-charset-combo-box.h b/e-util/e-charset-combo-box.h index 471dfa6a54..54c5527875 100644 --- a/widgets/misc/e-charset-combo-box.h +++ b/e-util/e-charset-combo-box.h @@ -19,10 +19,14 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_CHARSET_COMBO_BOX_H #define E_CHARSET_COMBO_BOX_H -#include <misc/e-action-combo-box.h> +#include <e-util/e-action-combo-box.h> /* Standard GObject macros */ #define E_TYPE_CHARSET_COMBO_BOX \ diff --git a/e-util/e-charset.h b/e-util/e-charset.h index 57b6976a1f..29bdc508c6 100644 --- a/e-util/e-charset.h +++ b/e-util/e-charset.h @@ -18,6 +18,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_CHARSET_H #define E_CHARSET_H diff --git a/e-util/e-client-utils.c b/e-util/e-client-utils.c new file mode 100644 index 0000000000..ed0688b637 --- /dev/null +++ b/e-util/e-client-utils.c @@ -0,0 +1,445 @@ +/* + * e-client-utils.c + * + * 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/> + * + * + * Copyright (C) 2011 Red Hat, Inc. (www.redhat.com) + * + */ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include <glib/gi18n-lib.h> +#include <gtk/gtk.h> +#include <libsoup/soup.h> + +#include <libebook/libebook.h> +#include <libecal/libecal.h> + +#include "e-client-utils.h" + +/** + * e_client_utils_new: + * + * Proxy function for e_book_client_utils_new() and e_cal_client_utils_new(). + * + * Since: 3.2 + **/ +EClient * +e_client_utils_new (ESource *source, + EClientSourceType source_type, + GError **error) +{ + EClient *res = NULL; + + g_return_val_if_fail (source != NULL, NULL); + g_return_val_if_fail (E_IS_SOURCE (source), NULL); + + switch (source_type) { + case E_CLIENT_SOURCE_TYPE_CONTACTS: + res = E_CLIENT (e_book_client_new (source, error)); + break; + case E_CLIENT_SOURCE_TYPE_EVENTS: + res = E_CLIENT (e_cal_client_new (source, E_CAL_CLIENT_SOURCE_TYPE_EVENTS, error)); + break; + case E_CLIENT_SOURCE_TYPE_MEMOS: + res = E_CLIENT (e_cal_client_new (source, E_CAL_CLIENT_SOURCE_TYPE_MEMOS, error)); + break; + case E_CLIENT_SOURCE_TYPE_TASKS: + res = E_CLIENT (e_cal_client_new (source, E_CAL_CLIENT_SOURCE_TYPE_TASKS, error)); + break; + default: + g_return_val_if_reached (NULL); + break; + } + + return res; +} + +typedef struct _EClientUtilsAsyncOpData { + GAsyncReadyCallback callback; + gpointer user_data; + GCancellable *cancellable; + ESource *source; + EClient *client; + gboolean open_finished; + GError *opened_cb_error; + guint retry_open_id; + gboolean only_if_exists; + guint pending_properties_count; +} EClientUtilsAsyncOpData; + +static void +free_client_utils_async_op_data (EClientUtilsAsyncOpData *async_data) +{ + g_return_if_fail (async_data != NULL); + g_return_if_fail (async_data->cancellable != NULL); + g_return_if_fail (async_data->client != NULL); + + if (async_data->retry_open_id) + g_source_remove (async_data->retry_open_id); + + g_signal_handlers_disconnect_matched (async_data->cancellable, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, async_data); + g_signal_handlers_disconnect_matched (async_data->client, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, async_data); + + if (async_data->opened_cb_error) + g_error_free (async_data->opened_cb_error); + g_object_unref (async_data->cancellable); + g_object_unref (async_data->client); + g_object_unref (async_data->source); + g_free (async_data); +} + +static gboolean +complete_async_op_in_idle_cb (gpointer user_data) +{ + GSimpleAsyncResult *simple = user_data; + gint run_main_depth; + + g_return_val_if_fail (simple != NULL, FALSE); + + run_main_depth = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (simple), "run-main-depth")); + if (run_main_depth < 1) + run_main_depth = 1; + + /* do not receive in higher level than was initially run */ + if (g_main_depth () > run_main_depth) { + return TRUE; + } + + g_simple_async_result_complete (simple); + g_object_unref (simple); + + return FALSE; +} + +#define return_async_error_if_fail(expr, callback, user_data, src, source_tag) G_STMT_START { \ + if (G_LIKELY ((expr))) { } else { \ + GError *error; \ + \ + error = g_error_new (E_CLIENT_ERROR, E_CLIENT_ERROR_INVALID_ARG, \ + "%s: assertion '%s' failed", G_STRFUNC, #expr); \ + \ + return_async_error (error, callback, user_data, src, source_tag); \ + g_error_free (error); \ + return; \ + } \ + } G_STMT_END + +static void +return_async_error (const GError *error, + GAsyncReadyCallback callback, + gpointer user_data, + ESource *source, + gpointer source_tag) +{ + GSimpleAsyncResult *simple; + + g_return_if_fail (error != NULL); + g_return_if_fail (source_tag != NULL); + + simple = g_simple_async_result_new (G_OBJECT (source), callback, user_data, source_tag); + g_simple_async_result_set_from_error (simple, error); + + g_object_set_data (G_OBJECT (simple), "run-main-depth", GINT_TO_POINTER (g_main_depth ())); + g_idle_add (complete_async_op_in_idle_cb, simple); +} + +static void +client_utils_get_backend_property_cb (GObject *source_object, + GAsyncResult *result, + gpointer user_data) +{ + EClient *client = E_CLIENT (source_object); + EClientUtilsAsyncOpData *async_data = user_data; + GSimpleAsyncResult *simple; + + g_return_if_fail (async_data != NULL); + g_return_if_fail (async_data->client != NULL); + g_return_if_fail (async_data->client == client); + + if (result) { + gchar *prop_value = NULL; + + if (e_client_get_backend_property_finish (client, result, &prop_value, NULL)) + g_free (prop_value); + + async_data->pending_properties_count--; + if (async_data->pending_properties_count) + return; + } + + simple = g_simple_async_result_new (G_OBJECT (async_data->source), async_data->callback, async_data->user_data, e_client_utils_open_new); + g_simple_async_result_set_op_res_gpointer (simple, g_object_ref (async_data->client), g_object_unref); + + g_object_set_data (G_OBJECT (simple), "run-main-depth", GINT_TO_POINTER (g_main_depth ())); + g_idle_add (complete_async_op_in_idle_cb, simple); + + free_client_utils_async_op_data (async_data); +} + +static void +client_utils_capabilities_retrieved_cb (GObject *source_object, + GAsyncResult *result, + gpointer user_data) +{ + EClient *client = E_CLIENT (source_object); + EClientUtilsAsyncOpData *async_data = user_data; + gchar *capabilities = NULL; + gboolean caps_res; + + g_return_if_fail (async_data != NULL); + g_return_if_fail (async_data->client != NULL); + g_return_if_fail (async_data->client == client); + + caps_res = e_client_retrieve_capabilities_finish (client, result, &capabilities, NULL); + g_free (capabilities); + + if (caps_res) { + async_data->pending_properties_count = 1; + + /* precache backend properties */ + if (E_IS_CAL_CLIENT (client)) { + async_data->pending_properties_count += 3; + + e_client_get_backend_property (async_data->client, CAL_BACKEND_PROPERTY_CAL_EMAIL_ADDRESS, async_data->cancellable, client_utils_get_backend_property_cb, async_data); + e_client_get_backend_property (async_data->client, CAL_BACKEND_PROPERTY_ALARM_EMAIL_ADDRESS, async_data->cancellable, client_utils_get_backend_property_cb, async_data); + e_client_get_backend_property (async_data->client, CAL_BACKEND_PROPERTY_DEFAULT_OBJECT, async_data->cancellable, client_utils_get_backend_property_cb, async_data); + } else if (E_IS_BOOK_CLIENT (client)) { + async_data->pending_properties_count += 2; + + e_client_get_backend_property (async_data->client, BOOK_BACKEND_PROPERTY_REQUIRED_FIELDS, async_data->cancellable, client_utils_get_backend_property_cb, async_data); + e_client_get_backend_property (async_data->client, BOOK_BACKEND_PROPERTY_SUPPORTED_FIELDS, async_data->cancellable, client_utils_get_backend_property_cb, async_data); + } else { + g_warn_if_reached (); + client_utils_get_backend_property_cb (source_object, NULL, async_data); + return; + } + + e_client_get_backend_property (async_data->client, CLIENT_BACKEND_PROPERTY_CACHE_DIR, async_data->cancellable, client_utils_get_backend_property_cb, async_data); + } else { + client_utils_get_backend_property_cb (source_object, NULL, async_data); + } +} + +static void +client_utils_open_new_done (EClientUtilsAsyncOpData *async_data) +{ + g_return_if_fail (async_data != NULL); + g_return_if_fail (async_data->client != NULL); + + /* retrieve capabilities just to have them cached on #EClient for later use */ + e_client_retrieve_capabilities (async_data->client, async_data->cancellable, client_utils_capabilities_retrieved_cb, async_data); +} + +static gboolean client_utils_retry_open_timeout_cb (gpointer user_data); +static void client_utils_opened_cb (EClient *client, const GError *error, EClientUtilsAsyncOpData *async_data); + +static void +finish_or_retry_open (EClientUtilsAsyncOpData *async_data, + const GError *error) +{ + g_return_if_fail (async_data != NULL); + + if (error && g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_BUSY)) { + /* postpone for 1/2 of a second, backend is busy now */ + async_data->open_finished = FALSE; + async_data->retry_open_id = g_timeout_add (500, client_utils_retry_open_timeout_cb, async_data); + } else if (error) { + return_async_error (error, async_data->callback, async_data->user_data, async_data->source, e_client_utils_open_new); + free_client_utils_async_op_data (async_data); + } else { + client_utils_open_new_done (async_data); + } +} + +static void +client_utils_opened_cb (EClient *client, + const GError *error, + EClientUtilsAsyncOpData *async_data) +{ + g_return_if_fail (client != NULL); + g_return_if_fail (async_data != NULL); + g_return_if_fail (client == async_data->client); + + g_signal_handlers_disconnect_by_func (client, G_CALLBACK (client_utils_opened_cb), async_data); + + if (!async_data->open_finished) { + /* there can happen that the "opened" signal is received + * before the e_client_open () is finished, thus keep detailed + * error for later use, if any */ + if (error) + async_data->opened_cb_error = g_error_copy (error); + } else { + finish_or_retry_open (async_data, error); + } +} + +static void +client_utils_open_new_async_cb (GObject *source_object, + GAsyncResult *result, + gpointer user_data) +{ + EClientUtilsAsyncOpData *async_data = user_data; + GError *error = NULL; + + g_return_if_fail (source_object != NULL); + g_return_if_fail (result != NULL); + g_return_if_fail (async_data != NULL); + g_return_if_fail (async_data->callback != NULL); + g_return_if_fail (async_data->client == E_CLIENT (source_object)); + + async_data->open_finished = TRUE; + + if (!e_client_open_finish (E_CLIENT (source_object), result, &error) + || g_cancellable_set_error_if_cancelled (async_data->cancellable, &error)) { + finish_or_retry_open (async_data, error); + g_error_free (error); + return; + } + + if (async_data->opened_cb_error) { + finish_or_retry_open (async_data, async_data->opened_cb_error); + return; + } + + if (e_client_is_opened (async_data->client)) { + client_utils_open_new_done (async_data); + return; + } + + /* wait for 'opened' signal, which is received in client_utils_opened_cb */ +} + +static gboolean +client_utils_retry_open_timeout_cb (gpointer user_data) +{ + EClientUtilsAsyncOpData *async_data = user_data; + + g_return_val_if_fail (async_data != NULL, FALSE); + + g_signal_handlers_disconnect_matched (async_data->cancellable, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, async_data); + + /* reconnect to the signal */ + g_signal_connect (async_data->client, "opened", G_CALLBACK (client_utils_opened_cb), async_data); + + e_client_open (async_data->client, async_data->only_if_exists, async_data->cancellable, client_utils_open_new_async_cb, async_data); + + async_data->retry_open_id = 0; + + return FALSE; +} + +/** + * e_client_utils_open_new: + * @source: an #ESource to be opened + * @source_type: an #EClientSourceType of the @source + * @only_if_exists: if %TRUE, fail if this client doesn't already exist, otherwise create it first + * @cancellable: a #GCancellable; can be %NULL + * @callback: callback to call when a result is ready + * @user_data: user data for the @callback + * + * Begins asynchronous opening of a new #EClient corresponding + * to the @source of type @source_type. The resulting #EClient + * is fully opened and authenticated client, ready to be used. + * The opened client has also fetched capabilities. + * This call is finished by e_client_utils_open_new_finish() + * from the @callback. + * + * Since: 3.2 + **/ +void +e_client_utils_open_new (ESource *source, + EClientSourceType source_type, + gboolean only_if_exists, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + EClient *client; + GError *error = NULL; + EClientUtilsAsyncOpData *async_data; + + g_return_if_fail (callback != NULL); + return_async_error_if_fail (source != NULL, callback, user_data, source, e_client_utils_open_new); + return_async_error_if_fail (E_IS_SOURCE (source), callback, user_data, source, e_client_utils_open_new); + + client = e_client_utils_new (source, source_type, &error); + if (!client) { + return_async_error (error, callback, user_data, source, e_client_utils_open_new); + g_error_free (error); + return; + } + + async_data = g_new0 (EClientUtilsAsyncOpData, 1); + async_data->callback = callback; + async_data->user_data = user_data; + async_data->source = g_object_ref (source); + async_data->client = client; + async_data->open_finished = FALSE; + async_data->only_if_exists = only_if_exists; + async_data->retry_open_id = 0; + + if (cancellable) + async_data->cancellable = g_object_ref (cancellable); + else + async_data->cancellable = g_cancellable_new (); + + /* wait till backend notifies about its opened state */ + g_signal_connect (client, "opened", G_CALLBACK (client_utils_opened_cb), async_data); + + e_client_open (async_data->client, async_data->only_if_exists, async_data->cancellable, client_utils_open_new_async_cb, async_data); +} + +/** + * e_client_utils_open_new_finish: + * @source: an #ESource on which the e_client_utils_open_new() was invoked + * @result: a #GAsyncResult + * @client: (out): Return value for an #EClient + * @error: (out): a #GError to set an error, if any + * + * Finishes previous call of e_client_utils_open_new() and + * sets @client to a fully opened and authenticated #EClient. + * This @client, if not NULL, should be freed with g_object_unref(). + * + * Returns: %TRUE if successful, %FALSE otherwise. + * + * Since: 3.2 + **/ +gboolean +e_client_utils_open_new_finish (ESource *source, + GAsyncResult *result, + EClient **client, + GError **error) +{ + GSimpleAsyncResult *simple; + + g_return_val_if_fail (source != NULL, FALSE); + g_return_val_if_fail (result != NULL, FALSE); + g_return_val_if_fail (client != NULL, FALSE); + g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (source), e_client_utils_open_new), FALSE); + + *client = NULL; + simple = G_SIMPLE_ASYNC_RESULT (result); + + if (g_simple_async_result_propagate_error (simple, error)) + return FALSE; + + *client = g_object_ref (g_simple_async_result_get_op_res_gpointer (simple)); + + return *client != NULL; +} diff --git a/e-util/e-client-utils.h b/e-util/e-client-utils.h new file mode 100644 index 0000000000..3f81d1f1ff --- /dev/null +++ b/e-util/e-client-utils.h @@ -0,0 +1,64 @@ +/* + * e-client-utils.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/> + * + * + * Copyright (C) 2011 Red Hat, Inc. (www.redhat.com) + * + */ + +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + +#ifndef E_CLIENT_UTILS_H +#define E_CLIENT_UTILS_H + +#include <gtk/gtk.h> +#include <libedataserver/libedataserver.h> + +G_BEGIN_DECLS + +/** + * EClientSourceType: + * + * Since: 3.2 + **/ +typedef enum { + E_CLIENT_SOURCE_TYPE_CONTACTS, + E_CLIENT_SOURCE_TYPE_EVENTS, + E_CLIENT_SOURCE_TYPE_MEMOS, + E_CLIENT_SOURCE_TYPE_TASKS, + E_CLIENT_SOURCE_TYPE_LAST +} EClientSourceType; + +EClient * e_client_utils_new (ESource *source, + EClientSourceType source_type, + GError **error); + +void e_client_utils_open_new (ESource *source, + EClientSourceType source_type, + gboolean only_if_exists, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +gboolean e_client_utils_open_new_finish (ESource *source, + GAsyncResult *result, + EClient **client, + GError **error); + +G_END_DECLS + +#endif /* E_CLIENT_UTILS_H */ diff --git a/e-util/e-config.h b/e-util/e-config.h index 2922a25ddb..a372601cb2 100644 --- a/e-util/e-config.h +++ b/e-util/e-config.h @@ -21,6 +21,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_CONFIG_H #define E_CONFIG_H @@ -324,7 +328,7 @@ void e_config_target_free (EConfig *config, /* To implement a basic config plugin, you just need to subclass * this and initialise the class target type tables */ -#include "e-util/e-plugin.h" +#include <e-util/e-plugin.h> typedef struct _EConfigHookGroup EConfigHookGroup; typedef struct _EConfigHook EConfigHook; diff --git a/widgets/misc/e-contact-map-window.c b/e-util/e-contact-map-window.c index 2e3aec5bcb..2e3aec5bcb 100644 --- a/widgets/misc/e-contact-map-window.c +++ b/e-util/e-contact-map-window.c diff --git a/widgets/misc/e-contact-map-window.h b/e-util/e-contact-map-window.h index 821fe243d2..f18def51c2 100644 --- a/widgets/misc/e-contact-map-window.h +++ b/e-util/e-contact-map-window.h @@ -18,14 +18,20 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_CONTACT_MAP_WINDOW_H #define E_CONTACT_MAP_WINDOW_H +#ifdef WITH_CONTACT_MAPS + #include <gtk/gtk.h> #include <libebook/libebook.h> -#include <e-contact-map.h> +#include <e-util/e-contact-map.h> /* Standard GObject macros */ #define E_TYPE_CONTACT_MAP_WINDOW \ @@ -74,4 +80,6 @@ EContactMap * e_contact_map_window_get_map (EContactMapWindow *window); G_END_DECLS -#endif +#endif /* WITH_CONTACT_MAPS */ + +#endif /* E_CONTACT_MAP_WINDOW_H */ diff --git a/widgets/misc/e-contact-map.c b/e-util/e-contact-map.c index 3ad17b441f..24f5ac121f 100644 --- a/widgets/misc/e-contact-map.c +++ b/e-util/e-contact-map.c @@ -24,9 +24,6 @@ #ifdef WITH_CONTACT_MAPS #include "e-contact-map.h" -#include "e-contact-marker.h" - -#include <e-util/e-marshal.h> #include <champlain/champlain.h> #include <champlain-gtk/champlain-gtk.h> @@ -40,6 +37,9 @@ #include <glib/gi18n.h> #include <math.h> +#include "e-contact-marker.h" +#include "e-marshal.h" + #define E_CONTACT_MAP_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ ((obj), E_TYPE_CONTACT_MAP, EContactMapPrivate)) diff --git a/widgets/misc/e-contact-map.h b/e-util/e-contact-map.h index d9503e2c9b..90b7a6a911 100644 --- a/widgets/misc/e-contact-map.h +++ b/e-util/e-contact-map.h @@ -18,6 +18,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_CONTACT_MAP_H #define E_CONTACT_MAP_H diff --git a/widgets/misc/e-contact-marker.c b/e-util/e-contact-marker.c index 9ac9417c9f..9ac9417c9f 100644 --- a/widgets/misc/e-contact-marker.c +++ b/e-util/e-contact-marker.c diff --git a/widgets/misc/e-contact-marker.h b/e-util/e-contact-marker.h index 791a9c46b5..e6e10db855 100644 --- a/widgets/misc/e-contact-marker.h +++ b/e-util/e-contact-marker.h @@ -20,6 +20,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_CONTACT_MARKER_H #define E_CONTACT_MARKER_H diff --git a/e-util/e-contact-store.c b/e-util/e-contact-store.c new file mode 100644 index 0000000000..4e49399e82 --- /dev/null +++ b/e-util/e-contact-store.c @@ -0,0 +1,1370 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ + +/* e-contact-store.c - Contacts store with GtkTreeModel interface. + * + * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU Lesser General Public + * License as published by the Free Software Foundation. + * + * 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 this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * Authors: Hans Petter Jansson <hpj@novell.com> + */ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#include <string.h> +#include <glib/gi18n-lib.h> + +#include "e-contact-store.h" + +#define ITER_IS_VALID(contact_store, iter) \ + ((iter)->stamp == (contact_store)->priv->stamp) +#define ITER_GET(iter) \ + GPOINTER_TO_INT (iter->user_data) +#define ITER_SET(contact_store, iter, index) \ + G_STMT_START { \ + (iter)->stamp = (contact_store)->priv->stamp; \ + (iter)->user_data = GINT_TO_POINTER (index); \ + } G_STMT_END + +#define E_CONTACT_STORE_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE \ + ((obj), E_TYPE_CONTACT_STORE, EContactStorePrivate)) + +struct _EContactStorePrivate { + gint stamp; + EBookQuery *query; + GArray *contact_sources; +}; + +/* Signals */ + +enum { + START_CLIENT_VIEW, + STOP_CLIENT_VIEW, + LAST_SIGNAL +}; + +static guint signals[LAST_SIGNAL] = { 0 }; + +static void e_contact_store_tree_model_init (GtkTreeModelIface *iface); + +G_DEFINE_TYPE_WITH_CODE ( + EContactStore, e_contact_store, G_TYPE_OBJECT, + G_IMPLEMENT_INTERFACE (GTK_TYPE_TREE_MODEL, e_contact_store_tree_model_init)) + +static GtkTreeModelFlags e_contact_store_get_flags (GtkTreeModel *tree_model); +static gint e_contact_store_get_n_columns (GtkTreeModel *tree_model); +static GType e_contact_store_get_column_type (GtkTreeModel *tree_model, + gint index); +static gboolean e_contact_store_get_iter (GtkTreeModel *tree_model, + GtkTreeIter *iter, + GtkTreePath *path); +static GtkTreePath *e_contact_store_get_path (GtkTreeModel *tree_model, + GtkTreeIter *iter); +static void e_contact_store_get_value (GtkTreeModel *tree_model, + GtkTreeIter *iter, + gint column, + GValue *value); +static gboolean e_contact_store_iter_next (GtkTreeModel *tree_model, + GtkTreeIter *iter); +static gboolean e_contact_store_iter_children (GtkTreeModel *tree_model, + GtkTreeIter *iter, + GtkTreeIter *parent); +static gboolean e_contact_store_iter_has_child (GtkTreeModel *tree_model, + GtkTreeIter *iter); +static gint e_contact_store_iter_n_children (GtkTreeModel *tree_model, + GtkTreeIter *iter); +static gboolean e_contact_store_iter_nth_child (GtkTreeModel *tree_model, + GtkTreeIter *iter, + GtkTreeIter *parent, + gint n); +static gboolean e_contact_store_iter_parent (GtkTreeModel *tree_model, + GtkTreeIter *iter, + GtkTreeIter *child); + +typedef struct +{ + EBookClient *book_client; + + EBookClientView *client_view; + GPtrArray *contacts; + + EBookClientView *client_view_pending; + GPtrArray *contacts_pending; +} +ContactSource; + +static void free_contact_ptrarray (GPtrArray *contacts); +static void clear_contact_source (EContactStore *contact_store, ContactSource *source); +static void stop_view (EContactStore *contact_store, EBookClientView *view); + +static void +contact_store_dispose (GObject *object) +{ + EContactStorePrivate *priv; + gint ii; + + priv = E_CONTACT_STORE_GET_PRIVATE (object); + + /* Free sources and cached contacts */ + for (ii = 0; ii < priv->contact_sources->len; ii++) { + ContactSource *source; + + /* clear from back, because clear_contact_source can later access freed memory */ + source = &g_array_index ( + priv->contact_sources, ContactSource, priv->contact_sources->len - ii - 1); + + clear_contact_source (E_CONTACT_STORE (object), source); + free_contact_ptrarray (source->contacts); + g_object_unref (source->book_client); + } + g_array_set_size (priv->contact_sources, 0); + + if (priv->query != NULL) { + e_book_query_unref (priv->query); + priv->query = NULL; + } + + /* Chain up to parent's dispose() method. */ + G_OBJECT_CLASS (e_contact_store_parent_class)->dispose (object); +} + +static void +contact_store_finalize (GObject *object) +{ + EContactStorePrivate *priv; + + priv = E_CONTACT_STORE_GET_PRIVATE (object); + + g_array_free (priv->contact_sources, TRUE); + + /* Chain up to parent's finalize() method. */ + G_OBJECT_CLASS (e_contact_store_parent_class)->finalize (object); +} + +static void +e_contact_store_class_init (EContactStoreClass *class) +{ + GObjectClass *object_class; + + g_type_class_add_private (class, sizeof (EContactStorePrivate)); + + object_class = G_OBJECT_CLASS (class); + object_class->dispose = contact_store_dispose; + object_class->finalize = contact_store_finalize; + + signals[START_CLIENT_VIEW] = g_signal_new ( + "start-client-view", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (EContactStoreClass, start_client_view), + NULL, NULL, + g_cclosure_marshal_VOID__OBJECT, + G_TYPE_NONE, 1, + E_TYPE_BOOK_CLIENT_VIEW); + + signals[STOP_CLIENT_VIEW] = g_signal_new ( + "stop-client-view", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (EContactStoreClass, stop_client_view), + NULL, NULL, + g_cclosure_marshal_VOID__OBJECT, + G_TYPE_NONE, 1, + E_TYPE_BOOK_CLIENT_VIEW); +} + +static void +e_contact_store_tree_model_init (GtkTreeModelIface *iface) +{ + iface->get_flags = e_contact_store_get_flags; + iface->get_n_columns = e_contact_store_get_n_columns; + iface->get_column_type = e_contact_store_get_column_type; + iface->get_iter = e_contact_store_get_iter; + iface->get_path = e_contact_store_get_path; + iface->get_value = e_contact_store_get_value; + iface->iter_next = e_contact_store_iter_next; + iface->iter_children = e_contact_store_iter_children; + iface->iter_has_child = e_contact_store_iter_has_child; + iface->iter_n_children = e_contact_store_iter_n_children; + iface->iter_nth_child = e_contact_store_iter_nth_child; + iface->iter_parent = e_contact_store_iter_parent; +} + +static void +e_contact_store_init (EContactStore *contact_store) +{ + GArray *contact_sources; + + contact_sources = g_array_new (FALSE, FALSE, sizeof (ContactSource)); + + contact_store->priv = E_CONTACT_STORE_GET_PRIVATE (contact_store); + contact_store->priv->stamp = g_random_int (); + contact_store->priv->contact_sources = contact_sources; +} + +/** + * e_contact_store_new: + * + * Creates a new #EContactStore. + * + * Returns: A new #EContactStore. + **/ +EContactStore * +e_contact_store_new (void) +{ + return g_object_new (E_TYPE_CONTACT_STORE, NULL); +} + +/* ------------------ * + * Row update helpers * + * ------------------ */ + +static void +row_deleted (EContactStore *contact_store, + gint n) +{ + GtkTreePath *path; + + path = gtk_tree_path_new (); + gtk_tree_path_append_index (path, n); + gtk_tree_model_row_deleted (GTK_TREE_MODEL (contact_store), path); + gtk_tree_path_free (path); +} + +static void +row_inserted (EContactStore *contact_store, + gint n) +{ + GtkTreePath *path; + GtkTreeIter iter; + + path = gtk_tree_path_new (); + gtk_tree_path_append_index (path, n); + + if (gtk_tree_model_get_iter (GTK_TREE_MODEL (contact_store), &iter, path)) + gtk_tree_model_row_inserted (GTK_TREE_MODEL (contact_store), path, &iter); + + gtk_tree_path_free (path); +} + +static void +row_changed (EContactStore *contact_store, + gint n) +{ + GtkTreePath *path; + GtkTreeIter iter; + + path = gtk_tree_path_new (); + gtk_tree_path_append_index (path, n); + + if (gtk_tree_model_get_iter (GTK_TREE_MODEL (contact_store), &iter, path)) + gtk_tree_model_row_changed (GTK_TREE_MODEL (contact_store), path, &iter); + + gtk_tree_path_free (path); +} + +/* ---------------------- * + * Contact source helpers * + * ---------------------- */ + +static gint +find_contact_source_by_client (EContactStore *contact_store, + EBookClient *book_client) +{ + GArray *array; + gint i; + + array = contact_store->priv->contact_sources; + + for (i = 0; i < array->len; i++) { + ContactSource *source; + + source = &g_array_index (array, ContactSource, i); + if (source->book_client == book_client) + return i; + } + + return -1; +} + +static gint +find_contact_source_by_view (EContactStore *contact_store, + EBookClientView *client_view) +{ + GArray *array; + gint i; + + array = contact_store->priv->contact_sources; + + for (i = 0; i < array->len; i++) { + ContactSource *source; + + source = &g_array_index (array, ContactSource, i); + if (source->client_view == client_view || + source->client_view_pending == client_view) + return i; + } + + return -1; +} + +static gint +find_contact_source_by_offset (EContactStore *contact_store, + gint offset) +{ + GArray *array; + gint i; + + array = contact_store->priv->contact_sources; + + for (i = 0; i < array->len; i++) { + ContactSource *source; + + source = &g_array_index (array, ContactSource, i); + if (source->contacts->len > offset) + return i; + + offset -= source->contacts->len; + } + + return -1; +} + +static gint +find_contact_source_by_pointer (EContactStore *contact_store, + ContactSource *source) +{ + GArray *array; + gint i; + + array = contact_store->priv->contact_sources; + + i = ((gchar *) source - (gchar *) array->data) / sizeof (ContactSource); + + if (i < 0 || i >= array->len) + return -1; + + return i; +} + +static gint +get_contact_source_offset (EContactStore *contact_store, + gint contact_source_index) +{ + GArray *array; + gint offset = 0; + gint i; + + array = contact_store->priv->contact_sources; + + g_assert (contact_source_index < array->len); + + for (i = 0; i < contact_source_index; i++) { + ContactSource *source; + + source = &g_array_index (array, ContactSource, i); + offset += source->contacts->len; + } + + return offset; +} + +static gint +count_contacts (EContactStore *contact_store) +{ + GArray *array; + gint count = 0; + gint i; + + array = contact_store->priv->contact_sources; + + for (i = 0; i < array->len; i++) { + ContactSource *source; + + source = &g_array_index (array, ContactSource, i); + count += source->contacts->len; + } + + return count; +} + +static gint +find_contact_by_view_and_uid (EContactStore *contact_store, + EBookClientView *find_view, + const gchar *find_uid) +{ + GArray *array; + ContactSource *source; + GPtrArray *contacts; + gint source_index; + gint i; + + g_return_val_if_fail (find_uid != NULL, -1); + + source_index = find_contact_source_by_view (contact_store, find_view); + if (source_index < 0) + return -1; + + array = contact_store->priv->contact_sources; + source = &g_array_index (array, ContactSource, source_index); + + if (find_view == source->client_view) + contacts = source->contacts; /* Current view */ + else + contacts = source->contacts_pending; /* Pending view */ + + for (i = 0; i < contacts->len; i++) { + EContact *contact = g_ptr_array_index (contacts, i); + const gchar *uid = e_contact_get_const (contact, E_CONTACT_UID); + + if (uid && !strcmp (find_uid, uid)) + return i; + } + + return -1; +} + +static gint +find_contact_by_uid (EContactStore *contact_store, + const gchar *find_uid) +{ + GArray *array; + gint i; + + array = contact_store->priv->contact_sources; + + for (i = 0; i < array->len; i++) { + ContactSource *source = &g_array_index (array, ContactSource, i); + gint j; + + for (j = 0; j < source->contacts->len; j++) { + EContact *contact = g_ptr_array_index (source->contacts, j); + const gchar *uid = e_contact_get_const (contact, E_CONTACT_UID); + + if (!strcmp (find_uid, uid)) + return get_contact_source_offset (contact_store, i) + j; + } + } + + return -1; +} + +static EBookClient * +get_book_at_row (EContactStore *contact_store, + gint row) +{ + GArray *array; + ContactSource *source; + gint source_index; + + source_index = find_contact_source_by_offset (contact_store, row); + if (source_index < 0) + return NULL; + + array = contact_store->priv->contact_sources; + source = &g_array_index (array, ContactSource, source_index); + + return source->book_client; +} + +static EContact * +get_contact_at_row (EContactStore *contact_store, + gint row) +{ + GArray *array; + ContactSource *source; + gint source_index; + gint offset; + + source_index = find_contact_source_by_offset (contact_store, row); + if (source_index < 0) + return NULL; + + array = contact_store->priv->contact_sources; + source = &g_array_index (array, ContactSource, source_index); + offset = get_contact_source_offset (contact_store, source_index); + row -= offset; + + g_assert (row < source->contacts->len); + + return g_ptr_array_index (source->contacts, row); +} + +static gboolean +find_contact_source_details_by_view (EContactStore *contact_store, + EBookClientView *client_view, + ContactSource **contact_source, + gint *offset) +{ + GArray *array; + gint source_index; + + source_index = find_contact_source_by_view (contact_store, client_view); + if (source_index < 0) + return FALSE; + + array = contact_store->priv->contact_sources; + *contact_source = &g_array_index (array, ContactSource, source_index); + *offset = get_contact_source_offset (contact_store, source_index); + + return TRUE; +} + +/* ------------------------- * + * EBookView signal handlers * + * ------------------------- */ + +static void +view_contacts_added (EContactStore *contact_store, + const GSList *contacts, + EBookClientView *client_view) +{ + ContactSource *source; + gint offset; + const GSList *l; + + if (!find_contact_source_details_by_view (contact_store, client_view, &source, &offset)) { + g_warning ("EContactStore got 'contacts_added' signal from unknown EBookView!"); + return; + } + + for (l = contacts; l; l = g_slist_next (l)) { + EContact *contact = l->data; + + g_object_ref (contact); + + if (client_view == source->client_view) { + /* Current view */ + g_ptr_array_add (source->contacts, contact); + row_inserted (contact_store, offset + source->contacts->len - 1); + } else { + /* Pending view */ + g_ptr_array_add (source->contacts_pending, contact); + } + } +} + +static void +view_contacts_removed (EContactStore *contact_store, + const GSList *uids, + EBookClientView *client_view) +{ + ContactSource *source; + gint offset; + const GSList *l; + + if (!find_contact_source_details_by_view (contact_store, client_view, &source, &offset)) { + g_warning ("EContactStore got 'contacts_removed' signal from unknown EBookView!"); + return; + } + + for (l = uids; l; l = g_slist_next (l)) { + const gchar *uid = l->data; + gint n = find_contact_by_view_and_uid (contact_store, client_view, uid); + EContact *contact; + + if (n < 0) { + g_warning ("EContactStore got 'contacts_removed' on unknown contact!"); + continue; + } + + if (client_view == source->client_view) { + /* Current view */ + contact = g_ptr_array_index (source->contacts, n); + g_object_unref (contact); + g_ptr_array_remove_index (source->contacts, n); + row_deleted (contact_store, offset + n); + } else { + /* Pending view */ + contact = g_ptr_array_index (source->contacts_pending, n); + g_object_unref (contact); + g_ptr_array_remove_index (source->contacts_pending, n); + } + } +} + +static void +view_contacts_modified (EContactStore *contact_store, + const GSList *contacts, + EBookClientView *client_view) +{ + GPtrArray *cached_contacts; + ContactSource *source; + gint offset; + const GSList *l; + + if (!find_contact_source_details_by_view (contact_store, client_view, &source, &offset)) { + g_warning ("EContactStore got 'contacts_changed' signal from unknown EBookView!"); + return; + } + + if (client_view == source->client_view) + cached_contacts = source->contacts; + else + cached_contacts = source->contacts_pending; + + for (l = contacts; l; l = g_slist_next (l)) { + EContact *cached_contact; + EContact *contact = l->data; + const gchar *uid = e_contact_get_const (contact, E_CONTACT_UID); + gint n = find_contact_by_view_and_uid (contact_store, client_view, uid); + + if (n < 0) { + g_warning ("EContactStore got change notification on unknown contact!"); + continue; + } + + cached_contact = g_ptr_array_index (cached_contacts, n); + + /* Update cached contact */ + if (cached_contact != contact) { + g_object_unref (cached_contact); + cached_contacts->pdata[n] = g_object_ref (contact); + } + + /* Emit changes for current view only */ + if (client_view == source->client_view) + row_changed (contact_store, offset + n); + } +} + +static void +view_complete (EContactStore *contact_store, + const GError *error, + EBookClientView *client_view) +{ + ContactSource *source; + gint offset; + gint i; + + if (!find_contact_source_details_by_view (contact_store, client_view, &source, &offset)) { + g_warning ("EContactStore got 'complete' signal from unknown EBookClientView!"); + return; + } + + /* If current view finished, do nothing */ + if (client_view == source->client_view) { + stop_view (contact_store, source->client_view); + return; + } + + g_assert (client_view == source->client_view_pending); + + /* However, if it was a pending view, calculate and emit the differences between that + * and the current view, and move the pending view up to current. + * + * This is O(m * n), and can be sped up with a temporary hash table if needed. */ + + /* Deletions */ + for (i = 0; i < source->contacts->len; i++) { + EContact *old_contact = g_ptr_array_index (source->contacts, i); + const gchar *old_uid = e_contact_get_const (old_contact, E_CONTACT_UID); + gint result; + + result = find_contact_by_view_and_uid (contact_store, source->client_view_pending, old_uid); + if (result < 0) { + /* Contact is not in new view; removed */ + g_object_unref (old_contact); + g_ptr_array_remove_index (source->contacts, i); + row_deleted (contact_store, offset + i); + i--; /* Stay in place */ + } + } + + /* Insertions */ + for (i = 0; i < source->contacts_pending->len; i++) { + EContact *new_contact = g_ptr_array_index (source->contacts_pending, i); + const gchar *new_uid = e_contact_get_const (new_contact, E_CONTACT_UID); + gint result; + + result = find_contact_by_view_and_uid (contact_store, source->client_view, new_uid); + if (result < 0) { + /* Contact is not in old view; inserted */ + g_ptr_array_add (source->contacts, new_contact); + row_inserted (contact_store, offset + source->contacts->len - 1); + } else { + /* Contact already in old view; drop the new one */ + g_object_unref (new_contact); + } + } + + /* Move pending view up to current */ + stop_view (contact_store, source->client_view); + g_object_unref (source->client_view); + source->client_view = source->client_view_pending; + source->client_view_pending = NULL; + + /* Free array of pending contacts (members have been either moved or unreffed) */ + g_ptr_array_free (source->contacts_pending, TRUE); + source->contacts_pending = NULL; +} + +/* --------------------- * + * View/Query management * + * --------------------- */ + +static void +start_view (EContactStore *contact_store, + EBookClientView *view) +{ + g_signal_emit (contact_store, signals[START_CLIENT_VIEW], 0, view); + + g_signal_connect_swapped ( + view, "objects-added", + G_CALLBACK (view_contacts_added), contact_store); + g_signal_connect_swapped ( + view, "objects-removed", + G_CALLBACK (view_contacts_removed), contact_store); + g_signal_connect_swapped ( + view, "objects-modified", + G_CALLBACK (view_contacts_modified), contact_store); + g_signal_connect_swapped ( + view, "complete", + G_CALLBACK (view_complete), contact_store); + + e_book_client_view_start (view, NULL); +} + +static void +stop_view (EContactStore *contact_store, + EBookClientView *view) +{ + e_book_client_view_stop (view, NULL); + + g_signal_handlers_disconnect_matched ( + view, G_SIGNAL_MATCH_DATA, + 0, 0, NULL, NULL, contact_store); + + g_signal_emit (contact_store, signals[STOP_CLIENT_VIEW], 0, view); +} + +static void +clear_contact_ptrarray (GPtrArray *contacts) +{ + gint i; + + for (i = 0; i < contacts->len; i++) { + EContact *contact = g_ptr_array_index (contacts, i); + g_object_unref (contact); + } + + g_ptr_array_set_size (contacts, 0); +} + +static void +free_contact_ptrarray (GPtrArray *contacts) +{ + clear_contact_ptrarray (contacts); + g_ptr_array_free (contacts, TRUE); +} + +static void +clear_contact_source (EContactStore *contact_store, + ContactSource *source) +{ + gint source_index; + gint offset; + + source_index = find_contact_source_by_pointer (contact_store, source); + g_assert (source_index >= 0); + + offset = get_contact_source_offset (contact_store, source_index); + g_assert (offset >= 0); + + /* Inform listeners that contacts went away */ + + if (source->contacts && source->contacts->len > 0) { + GtkTreePath *path = gtk_tree_path_new (); + gint i; + + gtk_tree_path_append_index (path, source->contacts->len); + + for (i = source->contacts->len - 1; i >= 0; i--) { + EContact *contact = g_ptr_array_index (source->contacts, i); + + g_object_unref (contact); + g_ptr_array_remove_index_fast (source->contacts, i); + + gtk_tree_path_prev (path); + gtk_tree_model_row_deleted (GTK_TREE_MODEL (contact_store), path); + } + + gtk_tree_path_free (path); + } + + /* Free main and pending views, clear cached contacts */ + + if (source->client_view) { + stop_view (contact_store, source->client_view); + g_object_unref (source->client_view); + + source->client_view = NULL; + } + + if (source->client_view_pending) { + stop_view (contact_store, source->client_view_pending); + g_object_unref (source->client_view_pending); + free_contact_ptrarray (source->contacts_pending); + + source->client_view_pending = NULL; + source->contacts_pending = NULL; + } +} + +static void +client_view_ready_cb (GObject *source_object, + GAsyncResult *result, + gpointer user_data) +{ + EContactStore *contact_store = user_data; + gint source_idx; + EBookClient *book_client; + EBookClientView *client_view = NULL; + + g_return_if_fail (contact_store != NULL); + g_return_if_fail (source_object != NULL); + + book_client = E_BOOK_CLIENT (source_object); + g_return_if_fail (book_client != NULL); + + if (!e_book_client_get_view_finish (book_client, result, &client_view, NULL)) + client_view = NULL; + + source_idx = find_contact_source_by_client (contact_store, book_client); + if (source_idx >= 0) { + ContactSource *source; + + source = &g_array_index (contact_store->priv->contact_sources, ContactSource, source_idx); + + if (source->client_view) { + if (source->client_view_pending) { + stop_view (contact_store, source->client_view_pending); + g_object_unref (source->client_view_pending); + free_contact_ptrarray (source->contacts_pending); + } + + source->client_view_pending = client_view; + + if (source->client_view_pending) { + source->contacts_pending = g_ptr_array_new (); + start_view (contact_store, client_view); + } else { + source->contacts_pending = NULL; + } + } else { + source->client_view = client_view; + + if (source->client_view) { + start_view (contact_store, client_view); + } + } + } + + g_object_unref (contact_store); +} + +static void +query_contact_source (EContactStore *contact_store, + ContactSource *source) +{ + gboolean is_opened; + + g_assert (source->book_client != NULL); + + if (!contact_store->priv->query) { + clear_contact_source (contact_store, source); + return; + } + + is_opened = e_client_is_opened (E_CLIENT (source->book_client)); + + if (source->client_view) { + if (source->client_view_pending) { + stop_view (contact_store, source->client_view_pending); + g_object_unref (source->client_view_pending); + free_contact_ptrarray (source->contacts_pending); + source->client_view_pending = NULL; + source->contacts_pending = NULL; + } + } + + if (is_opened) { + gchar *query_str; + + query_str = e_book_query_to_string (contact_store->priv->query); + e_book_client_get_view (source->book_client, query_str, NULL, client_view_ready_cb, g_object_ref (contact_store)); + g_free (query_str); + } +} + +/* ----------------- * + * EContactStore API * + * ----------------- */ + +/** + * e_contact_store_get_client: + * @contact_store: an #EContactStore + * @iter: a #GtkTreeIter from @contact_store + * + * Gets the #EBookClient that provided the contact at @iter. + * + * Returns: An #EBookClient. + * + * Since: 3.2 + **/ +EBookClient * +e_contact_store_get_client (EContactStore *contact_store, + GtkTreeIter *iter) +{ + gint index; + + g_return_val_if_fail (E_IS_CONTACT_STORE (contact_store), NULL); + g_return_val_if_fail (ITER_IS_VALID (contact_store, iter), NULL); + + index = ITER_GET (iter); + + return get_book_at_row (contact_store, index); +} + +/** + * e_contact_store_get_contact: + * @contact_store: an #EContactStore + * @iter: a #GtkTreeIter from @contact_store + * + * Gets the #EContact at @iter. + * + * Returns: An #EContact. + **/ +EContact * +e_contact_store_get_contact (EContactStore *contact_store, + GtkTreeIter *iter) +{ + gint index; + + g_return_val_if_fail (E_IS_CONTACT_STORE (contact_store), NULL); + g_return_val_if_fail (ITER_IS_VALID (contact_store, iter), NULL); + + index = ITER_GET (iter); + + return get_contact_at_row (contact_store, index); +} + +/** + * e_contact_store_find_contact: + * @contact_store: an #EContactStore + * @uid: a unique contact identifier + * @iter: a destination #GtkTreeIter to set + * + * Sets @iter to point to the contact row matching @uid. + * + * Returns: %TRUE if the contact was found, and @iter was set. %FALSE otherwise. + **/ +gboolean +e_contact_store_find_contact (EContactStore *contact_store, + const gchar *uid, + GtkTreeIter *iter) +{ + gint index; + + g_return_val_if_fail (E_IS_CONTACT_STORE (contact_store), FALSE); + g_return_val_if_fail (uid != NULL, FALSE); + + index = find_contact_by_uid (contact_store, uid); + if (index < 0) + return FALSE; + + ITER_SET (contact_store, iter, index); + return TRUE; +} + +/** + * e_contact_store_get_clients: + * @contact_store: an #EContactStore + * + * Gets the list of book clients that provide contacts for @contact_store. + * + * Returns: A #GSList of pointers to #EBookClient. The caller owns the list, + * but not the book clients. + * + * Since: 3.2 + **/ +GSList * +e_contact_store_get_clients (EContactStore *contact_store) +{ + GArray *array; + GSList *client_list = NULL; + gint i; + + g_return_val_if_fail (E_IS_CONTACT_STORE (contact_store), NULL); + + array = contact_store->priv->contact_sources; + + for (i = 0; i < array->len; i++) { + ContactSource *source; + + source = &g_array_index (array, ContactSource, i); + client_list = g_slist_prepend (client_list, source->book_client); + } + + return client_list; +} + +/** + * e_contact_store_add_client: + * @contact_store: an #EContactStore + * @book_client: an #EBookClient + * + * Adds @book_client to the list of book clients that provide contacts for @contact_store. + * The @contact_store adds a reference to @book_client, if added. + * + * Since: 3.2 + **/ +void +e_contact_store_add_client (EContactStore *contact_store, + EBookClient *book_client) +{ + GArray *array; + ContactSource source; + ContactSource *indexed_source; + + g_return_if_fail (E_IS_CONTACT_STORE (contact_store)); + g_return_if_fail (E_IS_BOOK_CLIENT (book_client)); + + if (find_contact_source_by_client (contact_store, book_client) >= 0) { + g_warning ("Same book client added more than once to EContactStore!"); + return; + } + + array = contact_store->priv->contact_sources; + + memset (&source, 0, sizeof (ContactSource)); + source.book_client = g_object_ref (book_client); + source.contacts = g_ptr_array_new (); + g_array_append_val (array, source); + + indexed_source = &g_array_index (array, ContactSource, array->len - 1); + + query_contact_source (contact_store, indexed_source); +} + +/** + * e_contact_store_remove_client: + * @contact_store: an #EContactStore + * @book_client: an #EBookClient + * + * Removes @book from the list of book clients that provide contacts for @contact_store. + * + * Since: 3.2 + **/ +void +e_contact_store_remove_client (EContactStore *contact_store, + EBookClient *book_client) +{ + GArray *array; + ContactSource *source; + gint source_index; + + g_return_if_fail (E_IS_CONTACT_STORE (contact_store)); + g_return_if_fail (E_IS_BOOK_CLIENT (book_client)); + + source_index = find_contact_source_by_client (contact_store, book_client); + if (source_index < 0) { + g_warning ("Tried to remove unknown book client from EContactStore!"); + return; + } + + array = contact_store->priv->contact_sources; + + source = &g_array_index (array, ContactSource, source_index); + clear_contact_source (contact_store, source); + free_contact_ptrarray (source->contacts); + g_object_unref (book_client); + + g_array_remove_index (array, source_index); /* Preserve order */ +} + +/** + * e_contact_store_set_query: + * @contact_store: an #EContactStore + * @book_query: an #EBookQuery + * + * Sets @book_query to be the query used to fetch contacts from the books + * assigned to @contact_store. + **/ +void +e_contact_store_set_query (EContactStore *contact_store, + EBookQuery *book_query) +{ + GArray *array; + gint i; + + g_return_if_fail (E_IS_CONTACT_STORE (contact_store)); + + if (book_query == contact_store->priv->query) + return; + + if (contact_store->priv->query) + e_book_query_unref (contact_store->priv->query); + + contact_store->priv->query = book_query; + if (book_query) + e_book_query_ref (book_query); + + /* Query books */ + array = contact_store->priv->contact_sources; + for (i = 0; i < array->len; i++) { + ContactSource *contact_source; + + contact_source = &g_array_index (array, ContactSource, i); + query_contact_source (contact_store, contact_source); + } +} + +/** + * e_contact_store_peek_query: + * @contact_store: an #EContactStore + * + * Gets the query that's being used to fetch contacts from the books + * assigned to @contact_store. + * + * Returns: The #EBookQuery being used. + **/ +EBookQuery * +e_contact_store_peek_query (EContactStore *contact_store) +{ + g_return_val_if_fail (E_IS_CONTACT_STORE (contact_store), NULL); + + return contact_store->priv->query; +} + +/* ---------------- * + * GtkTreeModel API * + * ---------------- */ + +static GtkTreeModelFlags +e_contact_store_get_flags (GtkTreeModel *tree_model) +{ + g_return_val_if_fail (E_IS_CONTACT_STORE (tree_model), 0); + + return GTK_TREE_MODEL_LIST_ONLY; +} + +static gint +e_contact_store_get_n_columns (GtkTreeModel *tree_model) +{ + g_return_val_if_fail (E_IS_CONTACT_STORE (tree_model), 0); + + return E_CONTACT_FIELD_LAST; +} + +static GType +get_column_type (EContactStore *contact_store, + gint column) +{ + const gchar *field_name; + GObjectClass *contact_class; + GParamSpec *param_spec; + GType value_type; + + /* Silently suppress requests for columns lower than the first EContactField. + * GtkTreeView automatically queries the type of all columns up to the maximum + * provided, and we have to return a valid value type, so let it be a generic + * pointer. */ + if (column < E_CONTACT_FIELD_FIRST) { + return G_TYPE_POINTER; + } + + field_name = e_contact_field_name (column); + contact_class = g_type_class_ref (E_TYPE_CONTACT); + param_spec = g_object_class_find_property (contact_class, field_name); + value_type = G_PARAM_SPEC_VALUE_TYPE (param_spec); + g_type_class_unref (contact_class); + + return value_type; +} + +static GType +e_contact_store_get_column_type (GtkTreeModel *tree_model, + gint index) +{ + EContactStore *contact_store = E_CONTACT_STORE (tree_model); + + g_return_val_if_fail (E_IS_CONTACT_STORE (tree_model), G_TYPE_INVALID); + g_return_val_if_fail (index >= 0 && index < E_CONTACT_FIELD_LAST, G_TYPE_INVALID); + + return get_column_type (contact_store, index); +} + +static gboolean +e_contact_store_get_iter (GtkTreeModel *tree_model, + GtkTreeIter *iter, + GtkTreePath *path) +{ + EContactStore *contact_store = E_CONTACT_STORE (tree_model); + gint index; + + g_return_val_if_fail (E_IS_CONTACT_STORE (tree_model), FALSE); + g_return_val_if_fail (gtk_tree_path_get_depth (path) > 0, FALSE); + + index = gtk_tree_path_get_indices (path)[0]; + if (index >= count_contacts (contact_store)) + return FALSE; + + ITER_SET (contact_store, iter, index); + return TRUE; +} + +static GtkTreePath * +e_contact_store_get_path (GtkTreeModel *tree_model, + GtkTreeIter *iter) +{ + EContactStore *contact_store = E_CONTACT_STORE (tree_model); + GtkTreePath *path; + gint index; + + g_return_val_if_fail (E_IS_CONTACT_STORE (tree_model), NULL); + g_return_val_if_fail (ITER_IS_VALID (contact_store, iter), NULL); + + index = ITER_GET (iter); + path = gtk_tree_path_new (); + gtk_tree_path_append_index (path, index); + + return path; +} + +static gboolean +e_contact_store_iter_next (GtkTreeModel *tree_model, + GtkTreeIter *iter) +{ + EContactStore *contact_store = E_CONTACT_STORE (tree_model); + gint index; + + g_return_val_if_fail (E_IS_CONTACT_STORE (tree_model), FALSE); + g_return_val_if_fail (ITER_IS_VALID (contact_store, iter), FALSE); + + index = ITER_GET (iter); + + if (index + 1 < count_contacts (contact_store)) { + ITER_SET (contact_store, iter, index + 1); + return TRUE; + } + + return FALSE; +} + +static gboolean +e_contact_store_iter_children (GtkTreeModel *tree_model, + GtkTreeIter *iter, + GtkTreeIter *parent) +{ + EContactStore *contact_store = E_CONTACT_STORE (tree_model); + + g_return_val_if_fail (E_IS_CONTACT_STORE (tree_model), FALSE); + + /* This is a list, nodes have no children. */ + if (parent) + return FALSE; + + /* But if parent == NULL we return the list itself as children of the root. */ + if (count_contacts (contact_store) <= 0) + return FALSE; + + ITER_SET (contact_store, iter, 0); + return TRUE; +} + +static gboolean +e_contact_store_iter_has_child (GtkTreeModel *tree_model, + GtkTreeIter *iter) +{ + g_return_val_if_fail (E_IS_CONTACT_STORE (tree_model), FALSE); + + if (iter == NULL) + return TRUE; + + return FALSE; +} + +static gint +e_contact_store_iter_n_children (GtkTreeModel *tree_model, + GtkTreeIter *iter) +{ + EContactStore *contact_store = E_CONTACT_STORE (tree_model); + + g_return_val_if_fail (E_IS_CONTACT_STORE (tree_model), -1); + + if (iter == NULL) + return count_contacts (contact_store); + + g_return_val_if_fail (ITER_IS_VALID (contact_store, iter), -1); + return 0; +} + +static gboolean +e_contact_store_iter_nth_child (GtkTreeModel *tree_model, + GtkTreeIter *iter, + GtkTreeIter *parent, + gint n) +{ + EContactStore *contact_store = E_CONTACT_STORE (tree_model); + + g_return_val_if_fail (E_IS_CONTACT_STORE (tree_model), FALSE); + + if (parent) + return FALSE; + + if (n < count_contacts (contact_store)) { + ITER_SET (contact_store, iter, n); + return TRUE; + } + + return FALSE; +} + +static gboolean +e_contact_store_iter_parent (GtkTreeModel *tree_model, + GtkTreeIter *iter, + GtkTreeIter *child) +{ + return FALSE; +} + +static void +e_contact_store_get_value (GtkTreeModel *tree_model, + GtkTreeIter *iter, + gint column, + GValue *value) +{ + EContactStore *contact_store = E_CONTACT_STORE (tree_model); + EContact *contact; + const gchar *field_name; + gint row; + + g_return_if_fail (E_IS_CONTACT_STORE (tree_model)); + g_return_if_fail (column < E_CONTACT_FIELD_LAST); + g_return_if_fail (ITER_IS_VALID (contact_store, iter)); + + g_value_init (value, get_column_type (contact_store, column)); + + row = ITER_GET (iter); + contact = get_contact_at_row (contact_store, row); + if (!contact || column < E_CONTACT_FIELD_FIRST) + return; + + field_name = e_contact_field_name (column); + g_object_get_property (G_OBJECT (contact), field_name, value); +} diff --git a/e-util/e-contact-store.h b/e-util/e-contact-store.h new file mode 100644 index 0000000000..c0754afab0 --- /dev/null +++ b/e-util/e-contact-store.h @@ -0,0 +1,94 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ + +/* e-contact-store.h - Contacts store with GtkTreeModel interface. + * + * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU Lesser General Public + * License as published by the Free Software Foundation. + * + * 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 this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * Authors: Hans Petter Jansson <hpj@novell.com> + */ + +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + +#ifndef E_CONTACT_STORE_H +#define E_CONTACT_STORE_H + +#include <gtk/gtk.h> +#include <libebook/libebook.h> + +/* Standard GObject macros */ +#define E_TYPE_CONTACT_STORE \ + (e_contact_store_get_type ()) +#define E_CONTACT_STORE(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST \ + ((obj), E_TYPE_CONTACT_STORE, EContactStore)) +#define E_CONTACT_STORE_CLASS(cls) \ + (G_TYPE_CHECK_CLASS_CAST \ + ((cls), E_TYPE_CONTACT_STORE, EContactStoreClass)) +#define E_IS_CONTACT_STORE(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE \ + ((obj), E_TYPE_CONTACT_STORE)) +#define E_IS_CONTACT_STORE_CLASS(cls) \ + (G_TYPE_CHECK_CLASS_TYPE \ + ((cls), E_TYPE_CONTACT_STORE)) +#define E_CONTACT_STORE_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS \ + ((obj), E_TYPE_CONTACT_STORE, EContactStoreClass)) + +G_BEGIN_DECLS + +typedef struct _EContactStore EContactStore; +typedef struct _EContactStoreClass EContactStoreClass; +typedef struct _EContactStorePrivate EContactStorePrivate; + +struct _EContactStore { + GObject parent; + EContactStorePrivate *priv; +}; + +struct _EContactStoreClass { + GObjectClass parent_class; + + /* signals */ + void (*start_client_view) (EContactStore *contact_store, EBookClientView *client_view); + void (*stop_client_view) (EContactStore *contact_store, EBookClientView *client_view); +}; + +GType e_contact_store_get_type (void); +EContactStore * e_contact_store_new (void); + +EBookClient * e_contact_store_get_client (EContactStore *contact_store, + GtkTreeIter *iter); +EContact * e_contact_store_get_contact (EContactStore *contact_store, + GtkTreeIter *iter); +gboolean e_contact_store_find_contact (EContactStore *contact_store, + const gchar *uid, + GtkTreeIter *iter); + +/* Returns a shallow copy; free the list when done, but don't unref elements */ +GSList * e_contact_store_get_clients (EContactStore *contact_store); +void e_contact_store_add_client (EContactStore *contact_store, + EBookClient *book_client); +void e_contact_store_remove_client (EContactStore *contact_store, + EBookClient *book_client); +void e_contact_store_set_query (EContactStore *contact_store, + EBookQuery *book_query); +EBookQuery * e_contact_store_peek_query (EContactStore *contact_store); + +G_END_DECLS + +#endif /* E_CONTACT_STORE_H */ diff --git a/widgets/misc/e-dateedit.c b/e-util/e-dateedit.c index fd2676a6b4..ab6085f44b 100644 --- a/widgets/misc/e-dateedit.c +++ b/e-util/e-dateedit.c @@ -40,7 +40,6 @@ #include <libebackend/libebackend.h> -#include <e-util/e-util.h> #include "e-calendar.h" #define E_DATE_EDIT_GET_PRIVATE(obj) \ diff --git a/widgets/misc/e-dateedit.h b/e-util/e-dateedit.h index 7da72ec975..b415847b23 100644 --- a/widgets/misc/e-dateedit.h +++ b/e-util/e-dateedit.h @@ -38,6 +38,10 @@ * focus to another widget, or you call one of the _get_time/date functions. */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_DATE_EDIT_H #define E_DATE_EDIT_H diff --git a/e-util/e-datetime-format.c b/e-util/e-datetime-format.c index fcd93ebfc6..d0066fbc70 100644 --- a/e-util/e-datetime-format.c +++ b/e-util/e-datetime-format.c @@ -26,7 +26,10 @@ #include <gtk/gtk.h> #include "e-datetime-format.h" -#include "e-util.h" + +#include <libedataserver/libedataserver.h> + +#include "e-misc-utils.h" #define KEYS_FILENAME "datetime-formats.ini" #define KEYS_GROUPNAME "formats" diff --git a/e-util/e-datetime-format.h b/e-util/e-datetime-format.h index 28eed151b3..5974349e06 100644 --- a/e-util/e-datetime-format.h +++ b/e-util/e-datetime-format.h @@ -20,6 +20,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef __E_DATETIME_FORMAT__ #define __E_DATETIME_FORMAT__ diff --git a/e-util/e-destination-store.c b/e-util/e-destination-store.c new file mode 100644 index 0000000000..82801f2091 --- /dev/null +++ b/e-util/e-destination-store.c @@ -0,0 +1,751 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ + +/* e-destination-store.c - EDestination store with GtkTreeModel interface. + * + * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU Lesser General Public + * License as published by the Free Software Foundation. + * + * 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 this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * Authors: Hans Petter Jansson <hpj@novell.com> + */ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#include <string.h> +#include <glib/gi18n-lib.h> + +#include "e-destination-store.h" + +#define ITER_IS_VALID(destination_store, iter) \ + ((iter)->stamp == (destination_store)->priv->stamp) +#define ITER_GET(iter) \ + GPOINTER_TO_INT (iter->user_data) +#define ITER_SET(destination_store, iter, index) \ + G_STMT_START { \ + (iter)->stamp = (destination_store)->priv->stamp; \ + (iter)->user_data = GINT_TO_POINTER (index); \ + } G_STMT_END + +#define E_DESTINATION_STORE_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE \ + ((obj), E_TYPE_DESTINATION_STORE, EDestinationStorePrivate)) + +struct _EDestinationStorePrivate { + GPtrArray *destinations; + gint stamp; +}; + +static GType column_types[E_DESTINATION_STORE_NUM_COLUMNS]; + +static void e_destination_store_tree_model_init (GtkTreeModelIface *iface); + +G_DEFINE_TYPE_EXTENDED ( + EDestinationStore, e_destination_store, G_TYPE_OBJECT, 0, + G_IMPLEMENT_INTERFACE (GTK_TYPE_TREE_MODEL, e_destination_store_tree_model_init); + column_types[E_DESTINATION_STORE_COLUMN_NAME] = G_TYPE_STRING; + column_types[E_DESTINATION_STORE_COLUMN_EMAIL] = G_TYPE_STRING; + column_types[E_DESTINATION_STORE_COLUMN_ADDRESS] = G_TYPE_STRING; +) + +static GtkTreeModelFlags e_destination_store_get_flags (GtkTreeModel *tree_model); +static gint e_destination_store_get_n_columns (GtkTreeModel *tree_model); +static GType e_destination_store_get_column_type (GtkTreeModel *tree_model, + gint index); +static gboolean e_destination_store_get_iter (GtkTreeModel *tree_model, + GtkTreeIter *iter, + GtkTreePath *path); +static void e_destination_store_get_value (GtkTreeModel *tree_model, + GtkTreeIter *iter, + gint column, + GValue *value); +static gboolean e_destination_store_iter_next (GtkTreeModel *tree_model, + GtkTreeIter *iter); +static gboolean e_destination_store_iter_children (GtkTreeModel *tree_model, + GtkTreeIter *iter, + GtkTreeIter *parent); +static gboolean e_destination_store_iter_has_child (GtkTreeModel *tree_model, + GtkTreeIter *iter); +static gint e_destination_store_iter_n_children (GtkTreeModel *tree_model, + GtkTreeIter *iter); +static gboolean e_destination_store_iter_nth_child (GtkTreeModel *tree_model, + GtkTreeIter *iter, + GtkTreeIter *parent, + gint n); +static gboolean e_destination_store_iter_parent (GtkTreeModel *tree_model, + GtkTreeIter *iter, + GtkTreeIter *child); + +static void destination_changed (EDestinationStore *destination_store, EDestination *destination); +static void stop_destination (EDestinationStore *destination_store, EDestination *destination); + +static void +destination_store_dispose (GObject *object) +{ + EDestinationStorePrivate *priv; + gint ii; + + priv = E_DESTINATION_STORE_GET_PRIVATE (object); + + for (ii = 0; ii < priv->destinations->len; ii++) { + EDestination *destination; + + destination = g_ptr_array_index (priv->destinations, ii); + stop_destination (E_DESTINATION_STORE (object), destination); + g_object_unref (destination); + } + g_ptr_array_set_size (priv->destinations, 0); + + /* Chain up to parent's dispose() method. */ + G_OBJECT_CLASS (e_destination_store_parent_class)->dispose (object); +} + +static void +destination_store_finalize (GObject *object) +{ + EDestinationStorePrivate *priv; + + priv = E_DESTINATION_STORE_GET_PRIVATE (object); + + g_ptr_array_free (priv->destinations, TRUE); + + /* Chain up to parent's finalize() method. */ + G_OBJECT_CLASS (e_destination_store_parent_class)->finalize (object); +} + +static void +e_destination_store_class_init (EDestinationStoreClass *class) +{ + GObjectClass *object_class; + + g_type_class_add_private (class, sizeof (EDestinationStorePrivate)); + + object_class = G_OBJECT_CLASS (class); + object_class->dispose = destination_store_dispose; + object_class->finalize = destination_store_finalize; +} + +static void +e_destination_store_tree_model_init (GtkTreeModelIface *iface) +{ + iface->get_flags = e_destination_store_get_flags; + iface->get_n_columns = e_destination_store_get_n_columns; + iface->get_column_type = e_destination_store_get_column_type; + iface->get_iter = e_destination_store_get_iter; + iface->get_path = e_destination_store_get_path; + iface->get_value = e_destination_store_get_value; + iface->iter_next = e_destination_store_iter_next; + iface->iter_children = e_destination_store_iter_children; + iface->iter_has_child = e_destination_store_iter_has_child; + iface->iter_n_children = e_destination_store_iter_n_children; + iface->iter_nth_child = e_destination_store_iter_nth_child; + iface->iter_parent = e_destination_store_iter_parent; +} + +static void +e_destination_store_init (EDestinationStore *destination_store) +{ + destination_store->priv = + E_DESTINATION_STORE_GET_PRIVATE (destination_store); + + destination_store->priv->destinations = g_ptr_array_new (); + destination_store->priv->stamp = g_random_int (); +} + +/** + * e_destination_store_new: + * + * Creates a new #EDestinationStore. + * + * Returns: A new #EDestinationStore. + **/ +EDestinationStore * +e_destination_store_new (void) +{ + return g_object_new (E_TYPE_DESTINATION_STORE, NULL); +} + +/* ------------------ * + * Row update helpers * + * ------------------ */ + +static void +row_deleted (EDestinationStore *destination_store, + gint n) +{ + GtkTreePath *path; + + path = gtk_tree_path_new (); + gtk_tree_path_append_index (path, n); + gtk_tree_model_row_deleted (GTK_TREE_MODEL (destination_store), path); + gtk_tree_path_free (path); +} + +static void +row_inserted (EDestinationStore *destination_store, + gint n) +{ + GtkTreePath *path; + GtkTreeIter iter; + + path = gtk_tree_path_new (); + gtk_tree_path_append_index (path, n); + + if (gtk_tree_model_get_iter (GTK_TREE_MODEL (destination_store), &iter, path)) + gtk_tree_model_row_inserted (GTK_TREE_MODEL (destination_store), path, &iter); + + gtk_tree_path_free (path); +} + +static void +row_changed (EDestinationStore *destination_store, + gint n) +{ + GtkTreePath *path; + GtkTreeIter iter; + + path = gtk_tree_path_new (); + gtk_tree_path_append_index (path, n); + + if (gtk_tree_model_get_iter (GTK_TREE_MODEL (destination_store), &iter, path)) + gtk_tree_model_row_changed (GTK_TREE_MODEL (destination_store), path, &iter); + + gtk_tree_path_free (path); +} + +/* ------------------- * + * Destination helpers * + * ------------------- */ + +static gint +find_destination_by_pointer (EDestinationStore *destination_store, + EDestination *destination) +{ + GPtrArray *array; + gint i; + + array = destination_store->priv->destinations; + + for (i = 0; i < array->len; i++) { + EDestination *destination_here; + + destination_here = g_ptr_array_index (array, i); + + if (destination_here == destination) + return i; + } + + return -1; +} + +static gint +find_destination_by_email (EDestinationStore *destination_store, + EDestination *destination) +{ + GPtrArray *array; + gint i; + const gchar *e_mail = e_destination_get_email (destination); + + array = destination_store->priv->destinations; + + for (i = 0; i < array->len; i++) { + EDestination *destination_here; + const gchar *mail; + + destination_here = g_ptr_array_index (array, i); + mail = e_destination_get_email (destination_here); + + if (g_str_equal (e_mail, mail)) + return i; + } + + return -1; +} + +static void +start_destination (EDestinationStore *destination_store, + EDestination *destination) +{ + g_signal_connect_swapped ( + destination, "changed", + G_CALLBACK (destination_changed), destination_store); +} + +static void +stop_destination (EDestinationStore *destination_store, + EDestination *destination) +{ + g_signal_handlers_disconnect_matched ( + destination, G_SIGNAL_MATCH_DATA, + 0, 0, NULL, NULL, destination_store); +} + +/* --------------- * + * Signal handlers * + * --------------- */ + +static void +destination_changed (EDestinationStore *destination_store, + EDestination *destination) +{ + gint n; + + n = find_destination_by_pointer (destination_store, destination); + if (n < 0) { + g_warning ("EDestinationStore got change from unknown EDestination!"); + return; + } + + row_changed (destination_store, n); +} + +/* --------------------- * + * EDestinationStore API * + * --------------------- */ + +/** + * e_destination_store_get_destination: + * @destination_store: an #EDestinationStore + * @iter: a #GtkTreeIter + * + * Gets the #EDestination from @destination_store at @iter. + * + * Returns: An #EDestination. + **/ +EDestination * +e_destination_store_get_destination (EDestinationStore *destination_store, + GtkTreeIter *iter) +{ + GPtrArray *array; + gint index; + + g_return_val_if_fail (E_IS_DESTINATION_STORE (destination_store), NULL); + g_return_val_if_fail (ITER_IS_VALID (destination_store, iter), NULL); + + array = destination_store->priv->destinations; + index = ITER_GET (iter); + + return g_ptr_array_index (array, index); +} + +/** + * e_destination_store_list_destinations: + * @destination_store: an #EDestinationStore + * + * Gets a list of all the #EDestinations in @destination_store. + * + * Returns: A #GList of pointers to #EDestination. The list is owned + * by the caller, but the #EDestination elements aren't. + **/ +GList * +e_destination_store_list_destinations (EDestinationStore *destination_store) +{ + GList *destination_list = NULL; + GPtrArray *array; + gint i; + + g_return_val_if_fail (E_IS_DESTINATION_STORE (destination_store), NULL); + + array = destination_store->priv->destinations; + + for (i = 0; i < array->len; i++) { + EDestination *destination; + + destination = g_ptr_array_index (array, i); + destination_list = g_list_prepend (destination_list, destination); + } + + destination_list = g_list_reverse (destination_list); + + return destination_list; +} + +/** + * e_destination_store_insert_destination: + * @destination_store: an #EDestinationStore + * @index: the index at which to insert + * @destination: an #EDestination to insert + * + * Inserts @destination into @destination_store at the position + * indicated by @index. @destination_store will ref @destination. + **/ +void +e_destination_store_insert_destination (EDestinationStore *destination_store, + gint index, + EDestination *destination) +{ + GPtrArray *array; + + g_return_if_fail (E_IS_DESTINATION_STORE (destination_store)); + g_return_if_fail (index >= 0); + + if (find_destination_by_pointer (destination_store, destination) >= 0) { + g_warning ("Same destination added more than once to EDestinationStore!"); + return; + } + + g_object_ref (destination); + + array = destination_store->priv->destinations; + index = MIN (index, array->len); + + g_ptr_array_set_size (array, array->len + 1); + + if (array->len - 1 - index > 0) { + memmove ( + array->pdata + index + 1, + array->pdata + index, + (array->len - 1 - index) * sizeof (gpointer)); + } + + array->pdata[index] = destination; + start_destination (destination_store, destination); + row_inserted (destination_store, index); +} + +/** + * e_destination_store_append_destination: + * @destination_store: an #EDestinationStore + * @destination: an #EDestination + * + * Appends @destination to the list of destinations in @destination_store. + * @destination_store will ref @destination. + **/ +void +e_destination_store_append_destination (EDestinationStore *destination_store, + EDestination *destination) +{ + GPtrArray *array; + + g_return_if_fail (E_IS_DESTINATION_STORE (destination_store)); + + if (find_destination_by_email (destination_store, destination) >= 0 && !e_destination_is_evolution_list (destination)) { + g_warning ("Same destination added more than once to EDestinationStore!"); + return; + } + + array = destination_store->priv->destinations; + g_object_ref (destination); + + g_ptr_array_add (array, destination); + start_destination (destination_store, destination); + row_inserted (destination_store, array->len - 1); +} + +/** + * e_destination_store_remove_destination: + * @destination_store: an #EDestinationStore + * @destination: an #EDestination to remove + * + * Removes @destination from @destination_store. @destination_store will + * unref @destination. + **/ +void +e_destination_store_remove_destination (EDestinationStore *destination_store, + EDestination *destination) +{ + GPtrArray *array; + gint n; + + g_return_if_fail (E_IS_DESTINATION_STORE (destination_store)); + + n = find_destination_by_pointer (destination_store, destination); + if (n < 0) { + g_warning ("Tried to remove unknown destination from EDestinationStore!"); + return; + } + + stop_destination (destination_store, destination); + g_object_unref (destination); + + array = destination_store->priv->destinations; + g_ptr_array_remove_index (array, n); + row_deleted (destination_store, n); +} + +void +e_destination_store_remove_destination_nth (EDestinationStore *destination_store, + gint n) +{ + EDestination *destination; + GPtrArray *array; + + g_return_if_fail (n >= 0); + + array = destination_store->priv->destinations; + destination = g_ptr_array_index (array, n); + stop_destination (destination_store, destination); + g_object_unref (destination); + + g_ptr_array_remove_index (array, n); + row_deleted (destination_store, n); +} + +guint +e_destination_store_get_destination_count (EDestinationStore *destination_store) +{ + return destination_store->priv->destinations->len; +} + +/* ---------------- * + * GtkTreeModel API * + * ---------------- */ + +static GtkTreeModelFlags +e_destination_store_get_flags (GtkTreeModel *tree_model) +{ + g_return_val_if_fail (E_IS_DESTINATION_STORE (tree_model), 0); + + return GTK_TREE_MODEL_LIST_ONLY; +} + +static gint +e_destination_store_get_n_columns (GtkTreeModel *tree_model) +{ + g_return_val_if_fail (E_IS_DESTINATION_STORE (tree_model), 0); + + return E_CONTACT_FIELD_LAST; +} + +static GType +e_destination_store_get_column_type (GtkTreeModel *tree_model, + gint index) +{ + g_return_val_if_fail (E_IS_DESTINATION_STORE (tree_model), G_TYPE_INVALID); + g_return_val_if_fail (index >= 0 && index < E_DESTINATION_STORE_NUM_COLUMNS, G_TYPE_INVALID); + + return column_types[index]; +} + +static gboolean +e_destination_store_get_iter (GtkTreeModel *tree_model, + GtkTreeIter *iter, + GtkTreePath *path) +{ + EDestinationStore *destination_store; + GPtrArray *array; + gint index; + + g_return_val_if_fail (E_IS_DESTINATION_STORE (tree_model), FALSE); + g_return_val_if_fail (gtk_tree_path_get_depth (path) > 0, FALSE); + + destination_store = E_DESTINATION_STORE (tree_model); + + index = gtk_tree_path_get_indices (path)[0]; + array = destination_store->priv->destinations; + + if (index >= array->len) + return FALSE; + + ITER_SET (destination_store, iter, index); + return TRUE; +} + +GtkTreePath * +e_destination_store_get_path (GtkTreeModel *tree_model, + GtkTreeIter *iter) +{ + EDestinationStore *destination_store = E_DESTINATION_STORE (tree_model); + GtkTreePath *path; + gint index; + + g_return_val_if_fail (E_IS_DESTINATION_STORE (tree_model), NULL); + g_return_val_if_fail (ITER_IS_VALID (destination_store, iter), NULL); + + index = ITER_GET (iter); + path = gtk_tree_path_new (); + gtk_tree_path_append_index (path, index); + + return path; +} + +static gboolean +e_destination_store_iter_next (GtkTreeModel *tree_model, + GtkTreeIter *iter) +{ + EDestinationStore *destination_store = E_DESTINATION_STORE (tree_model); + gint index; + + g_return_val_if_fail (E_IS_DESTINATION_STORE (tree_model), FALSE); + g_return_val_if_fail (ITER_IS_VALID (destination_store, iter), FALSE); + + index = ITER_GET (iter); + + if (index + 1 < destination_store->priv->destinations->len) { + ITER_SET (destination_store, iter, index + 1); + return TRUE; + } + + return FALSE; +} + +static gboolean +e_destination_store_iter_children (GtkTreeModel *tree_model, + GtkTreeIter *iter, + GtkTreeIter *parent) +{ + EDestinationStore *destination_store = E_DESTINATION_STORE (tree_model); + + g_return_val_if_fail (E_IS_DESTINATION_STORE (tree_model), FALSE); + + /* This is a list, nodes have no children. */ + if (parent) + return FALSE; + + /* But if parent == NULL we return the list itself as children of the root. */ + if (destination_store->priv->destinations->len <= 0) + return FALSE; + + ITER_SET (destination_store, iter, 0); + return TRUE; +} + +static gboolean +e_destination_store_iter_has_child (GtkTreeModel *tree_model, + GtkTreeIter *iter) +{ + g_return_val_if_fail (E_IS_DESTINATION_STORE (tree_model), FALSE); + + if (iter == NULL) + return TRUE; + + return FALSE; +} + +static gint +e_destination_store_iter_n_children (GtkTreeModel *tree_model, + GtkTreeIter *iter) +{ + EDestinationStore *destination_store = E_DESTINATION_STORE (tree_model); + + g_return_val_if_fail (E_IS_DESTINATION_STORE (tree_model), -1); + + if (iter == NULL) + return destination_store->priv->destinations->len; + + g_return_val_if_fail (ITER_IS_VALID (destination_store, iter), -1); + return 0; +} + +static gboolean +e_destination_store_iter_nth_child (GtkTreeModel *tree_model, + GtkTreeIter *iter, + GtkTreeIter *parent, + gint n) +{ + EDestinationStore *destination_store = E_DESTINATION_STORE (tree_model); + + g_return_val_if_fail (E_IS_DESTINATION_STORE (tree_model), FALSE); + + if (parent) + return FALSE; + + if (n < destination_store->priv->destinations->len) { + ITER_SET (destination_store, iter, n); + return TRUE; + } + + return FALSE; +} + +static gboolean +e_destination_store_iter_parent (GtkTreeModel *tree_model, + GtkTreeIter *iter, + GtkTreeIter *child) +{ + return FALSE; +} + +static void +e_destination_store_get_value (GtkTreeModel *tree_model, + GtkTreeIter *iter, + gint column, + GValue *value) +{ + EDestinationStore *destination_store = E_DESTINATION_STORE (tree_model); + EDestination *destination; + GString *string_new; + EContact *contact; + GPtrArray *array; + const gchar *string; + gint row; + + g_return_if_fail (E_IS_DESTINATION_STORE (tree_model)); + g_return_if_fail (column < E_DESTINATION_STORE_NUM_COLUMNS); + g_return_if_fail (ITER_IS_VALID (destination_store, iter)); + + g_value_init (value, column_types[column]); + + array = destination_store->priv->destinations; + + row = ITER_GET (iter); + if (row >= array->len) + return; + + destination = g_ptr_array_index (array, row); + g_assert (destination); + + switch (column) { + case E_DESTINATION_STORE_COLUMN_NAME: + string = e_destination_get_name (destination); + g_value_set_string (value, string); + break; + + case E_DESTINATION_STORE_COLUMN_EMAIL: + string = e_destination_get_email (destination); + g_value_set_string (value, string); + break; + + case E_DESTINATION_STORE_COLUMN_ADDRESS: + contact = e_destination_get_contact (destination); + if (contact && E_IS_CONTACT (contact)) { + if (e_contact_get (contact, E_CONTACT_IS_LIST)) { + string = e_destination_get_name (destination); + string_new = g_string_new (string); + string_new = g_string_append (string_new, " mailing list"); + g_value_set_string (value, string_new->str); + g_string_free (string_new, TRUE); + } + else { + string = e_destination_get_address (destination); + g_value_set_string (value, string); + } + } + else { + string = e_destination_get_address (destination); + g_value_set_string (value, string); + + } + break; + + default: + g_assert_not_reached (); + break; + } +} + +/** + * e_destination_store_get_stamp: + * @destination_store: an #EDestinationStore + * + * Since: 2.32 + **/ +gint +e_destination_store_get_stamp (EDestinationStore *destination_store) +{ + g_return_val_if_fail (E_IS_DESTINATION_STORE (destination_store), 0); + + return destination_store->priv->stamp; +} diff --git a/e-util/e-destination-store.h b/e-util/e-destination-store.h new file mode 100644 index 0000000000..630db11f58 --- /dev/null +++ b/e-util/e-destination-store.h @@ -0,0 +1,106 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ + +/* e-destination-store.h - EDestination store with GtkTreeModel interface. + * + * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU Lesser General Public + * License as published by the Free Software Foundation. + * + * 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 this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * Authors: Hans Petter Jansson <hpj@novell.com> + */ + +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + +#ifndef E_DESTINATION_STORE_H +#define E_DESTINATION_STORE_H + +#include <gtk/gtk.h> +#include <libebook/libebook.h> + +/* Standard GObject macros */ +#define E_TYPE_DESTINATION_STORE \ + (e_destination_store_get_type ()) +#define E_DESTINATION_STORE(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST \ + ((obj), E_TYPE_DESTINATION_STORE, EDestinationStore)) +#define E_DESTINATION_STORE_CLASS(cls) \ + (G_TYPE_CHECK_CLASS_CAST \ + ((cls), E_TYPE_DESTINATION_STORE, EDestinationStoreClass)) +#define E_IS_DESTINATION_STORE(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE \ + ((obj), E_TYPE_DESTINATION_STORE)) +#define E_IS_DESTINATION_STORE_CLASS(cls) \ + (G_TYPE_CHECK_CLASS_TYPE \ + ((cls), E_TYPE_DESTINATION_STORE)) +#define E_DESTINATION_STORE_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS \ + ((obj), E_TYPE_DESTINATION_STORE, EDestinationStoreClass)) + +G_BEGIN_DECLS + +typedef struct _EDestinationStore EDestinationStore; +typedef struct _EDestinationStoreClass EDestinationStoreClass; +typedef struct _EDestinationStorePrivate EDestinationStorePrivate; + +struct _EDestinationStore { + GObject parent; + EDestinationStorePrivate *priv; +}; + +struct _EDestinationStoreClass { + GObjectClass parent_class; +}; + +typedef enum { + E_DESTINATION_STORE_COLUMN_NAME, + E_DESTINATION_STORE_COLUMN_EMAIL, + E_DESTINATION_STORE_COLUMN_ADDRESS, + E_DESTINATION_STORE_NUM_COLUMNS +} EDestinationStoreColumnType; + +GType e_destination_store_get_type (void); +EDestinationStore * + e_destination_store_new (void); +EDestination * e_destination_store_get_destination + (EDestinationStore *destination_store, + GtkTreeIter *iter); + +/* Returns a shallow copy; free the list when done, but don't unref elements */ +GList * e_destination_store_list_destinations + (EDestinationStore *destination_store); + +void e_destination_store_insert_destination + (EDestinationStore *destination_store, + gint index, + EDestination *destination); +void e_destination_store_append_destination + (EDestinationStore *destination_store, + EDestination *destination); +void e_destination_store_remove_destination + (EDestinationStore *destination_store, + EDestination *destination); +void e_destination_store_remove_destination_nth + (EDestinationStore *destination_store, + gint n); +guint e_destination_store_get_destination_count + (EDestinationStore *destination_store); +GtkTreePath * e_destination_store_get_path (GtkTreeModel *tree_model, + GtkTreeIter *iter); +gint e_destination_store_get_stamp (EDestinationStore *destination_store); + +G_END_DECLS + +#endif /* E_DESTINATION_STORE_H */ diff --git a/e-util/e-dialog-utils.h b/e-util/e-dialog-utils.h index f4f04b0eac..36c1730a09 100644 --- a/e-util/e-dialog-utils.h +++ b/e-util/e-dialog-utils.h @@ -20,6 +20,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_DIALOG_UTILS_H #define E_DIALOG_UTILS_H diff --git a/e-util/e-dialog-widgets.h b/e-util/e-dialog-widgets.h index 5b3f650ed2..4c8ade4426 100644 --- a/e-util/e-dialog-widgets.h +++ b/e-util/e-dialog-widgets.h @@ -22,6 +22,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_DIALOG_WIDGETS_H #define E_DIALOG_WIDGETS_H diff --git a/e-util/e-event.h b/e-util/e-event.h index 0b834c879d..28caded6fe 100644 --- a/e-util/e-event.h +++ b/e-util/e-event.h @@ -21,6 +21,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + /* This a bit 'whipped together', so is likely to change mid-term */ #ifndef E_EVENT_H @@ -197,7 +201,7 @@ void e_event_target_free (EEvent *event, /* For events, the plugin item talks to a specific instance, rather than * a set of instances of the hook handler */ -#include "e-util/e-plugin.h" +#include <e-util/e-plugin.h> /* Standard GObject macros */ #define E_TYPE_EVENT_HOOK \ diff --git a/e-util/e-file-request.c b/e-util/e-file-request.c index 724680a280..4ec56d2829 100644 --- a/e-util/e-file-request.c +++ b/e-util/e-file-request.c @@ -22,8 +22,6 @@ #include <libsoup/soup.h> -#include <e-util/e-util.h> - #include <string.h> #define d(x) diff --git a/e-util/e-file-request.h b/e-util/e-file-request.h index b8dd278c87..5d1cb3a8d6 100644 --- a/e-util/e-file-request.h +++ b/e-util/e-file-request.h @@ -16,6 +16,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_FILE_REQUEST_H #define E_FILE_REQUEST_H diff --git a/e-util/e-file-utils.h b/e-util/e-file-utils.h index e1e8b29872..5d5df061e3 100644 --- a/e-util/e-file-utils.h +++ b/e-util/e-file-utils.h @@ -20,6 +20,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_FILE_UTILS_H #define E_FILE_UTILS_H diff --git a/filter/e-filter-code.c b/e-util/e-filter-code.c index 0352703638..0352703638 100644 --- a/filter/e-filter-code.c +++ b/e-util/e-filter-code.c diff --git a/filter/e-filter-code.h b/e-util/e-filter-code.h index 6a903a5dcb..45e1922ba4 100644 --- a/filter/e-filter-code.h +++ b/e-util/e-filter-code.h @@ -21,10 +21,14 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_FILTER_CODE_H #define E_FILTER_CODE_H -#include "e-filter-input.h" +#include <e-util/e-filter-input.h> /* Standard GObject macros */ #define E_TYPE_FILTER_CODE \ diff --git a/filter/e-filter-color.c b/e-util/e-filter-color.c index 213530fbb2..213530fbb2 100644 --- a/filter/e-filter-color.c +++ b/e-util/e-filter-color.c diff --git a/filter/e-filter-color.h b/e-util/e-filter-color.h index cf75bc13ce..acecf7d08c 100644 --- a/filter/e-filter-color.h +++ b/e-util/e-filter-color.h @@ -21,10 +21,14 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_FILTER_COLOR_H #define E_FILTER_COLOR_H -#include "e-filter-element.h" +#include <e-util/e-filter-element.h> /* Standard GObject macros */ #define E_TYPE_FILTER_COLOR \ diff --git a/filter/e-filter-datespec.c b/e-util/e-filter-datespec.c index 8cf01d664f..d135358e2b 100644 --- a/filter/e-filter-datespec.c +++ b/e-util/e-filter-datespec.c @@ -33,11 +33,9 @@ #include <gtk/gtk.h> #include <glib/gi18n.h> -#include "libevolution-utils/e-alert.h" -#include "libevolution-utils/evolution-util.h" - #include "e-filter-datespec.h" #include "e-filter-part.h" +#include "e-misc-utils.h" #ifdef G_OS_WIN32 #ifdef localtime_r diff --git a/filter/e-filter-datespec.h b/e-util/e-filter-datespec.h index aed978a09a..ecc15bfdc9 100644 --- a/filter/e-filter-datespec.h +++ b/e-util/e-filter-datespec.h @@ -21,11 +21,15 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_FILTER_DATESPEC_H #define E_FILTER_DATESPEC_H #include <time.h> -#include "e-filter-element.h" +#include <e-util/e-filter-element.h> /* Standard GObject types */ #define E_TYPE_FILTER_DATESPEC \ diff --git a/filter/e-filter-element.c b/e-util/e-filter-element.c index e00651ec03..e00651ec03 100644 --- a/filter/e-filter-element.c +++ b/e-util/e-filter-element.c diff --git a/filter/e-filter-element.h b/e-util/e-filter-element.h index 694efa2de6..ecec9db7b9 100644 --- a/filter/e-filter-element.h +++ b/e-util/e-filter-element.h @@ -21,6 +21,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_FILTER_ELEMENT_H #define E_FILTER_ELEMENT_H @@ -28,7 +32,8 @@ #include <camel/camel.h> #include <libxml/parser.h> #include <libxml/xmlmemory.h> -#include <libevolution-utils/e-alert.h> + +#include <e-util/e-alert.h> #define E_TYPE_FILTER_ELEMENT \ (e_filter_element_get_type ()) @@ -93,7 +98,7 @@ struct _EFilterElementClass { }; GType e_filter_element_get_type (void); -EFilterElement *e_filter_element_new (void); +EFilterElement *e_filter_element_new (void); void e_filter_element_set_data (EFilterElement *element, gpointer data); gboolean e_filter_element_validate (EFilterElement *element, diff --git a/filter/e-filter-file.c b/e-util/e-filter-file.c index 4be1a10fda..8e46b52a97 100644 --- a/filter/e-filter-file.c +++ b/e-util/e-filter-file.c @@ -31,8 +31,7 @@ #include <glib/gi18n.h> #include <glib/gstdio.h> -#include "libevolution-utils/e-alert.h" - +#include "e-alert.h" #include "e-filter-file.h" #include "e-filter-part.h" diff --git a/filter/e-filter-file.h b/e-util/e-filter-file.h index 6f7946e8e7..c78062b4e0 100644 --- a/filter/e-filter-file.h +++ b/e-util/e-filter-file.h @@ -21,10 +21,14 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_FILTER_FILE_H #define E_FILTER_FILE_H -#include "e-filter-element.h" +#include <e-util/e-filter-element.h> /* Standard GObject macros */ #define E_TYPE_FILTER_FILE \ diff --git a/filter/e-filter-input.c b/e-util/e-filter-input.c index b13f910048..424363e2dd 100644 --- a/filter/e-filter-input.c +++ b/e-util/e-filter-input.c @@ -32,8 +32,7 @@ #include <gtk/gtk.h> #include <glib/gi18n.h> -#include "libevolution-utils/e-alert.h" - +#include "e-alert.h" #include "e-filter-input.h" G_DEFINE_TYPE ( diff --git a/filter/e-filter-input.h b/e-util/e-filter-input.h index 07239c92cb..782be404e9 100644 --- a/filter/e-filter-input.h +++ b/e-util/e-filter-input.h @@ -21,10 +21,14 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_FILTER_INPUT_H #define E_FILTER_INPUT_H -#include "e-filter-element.h" +#include <e-util/e-filter-element.h> /* Standard GObject macros */ #define E_TYPE_FILTER_INPUT \ diff --git a/filter/e-filter-int.c b/e-util/e-filter-int.c index ba4eacde2e..ba4eacde2e 100644 --- a/filter/e-filter-int.c +++ b/e-util/e-filter-int.c diff --git a/filter/e-filter-int.h b/e-util/e-filter-int.h index be0aa4e65a..40b0c9e7a4 100644 --- a/filter/e-filter-int.h +++ b/e-util/e-filter-int.h @@ -20,10 +20,14 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_FILTER_INT_H #define E_FILTER_INT_H -#include "e-filter-element.h" +#include <e-util/e-filter-element.h> /* Standard GObject macros */ #define E_TYPE_FILTER_INT \ diff --git a/filter/e-filter-option.c b/e-util/e-filter-option.c index 630ab31916..630ab31916 100644 --- a/filter/e-filter-option.c +++ b/e-util/e-filter-option.c diff --git a/filter/e-filter-option.h b/e-util/e-filter-option.h index f241f09250..9bd7543ba6 100644 --- a/filter/e-filter-option.h +++ b/e-util/e-filter-option.h @@ -21,10 +21,14 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_FILTER_OPTION_H #define E_FILTER_OPTION_H -#include "e-filter-element.h" +#include <e-util/e-filter-element.h> /* Standard GObject macros */ #define E_TYPE_FILTER_OPTION \ diff --git a/filter/e-filter-part.c b/e-util/e-filter-part.c index c9e14e30c6..c9e14e30c6 100644 --- a/filter/e-filter-part.c +++ b/e-util/e-filter-part.c diff --git a/filter/e-filter-part.h b/e-util/e-filter-part.h index da377f3b75..b5ee2c46f2 100644 --- a/filter/e-filter-part.h +++ b/e-util/e-filter-part.h @@ -21,14 +21,19 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_FILTER_PART_H #define E_FILTER_PART_H #include <gtk/gtk.h> #include <libxml/parser.h> #include <libxml/xmlmemory.h> -#include "libevolution-utils/e-alert.h" -#include "e-filter-element.h" + +#include <e-util/e-alert.h> +#include <e-util/e-filter-element.h> /* Standard GObject macros */ #define E_TYPE_FILTER_PART \ diff --git a/filter/e-filter-rule.c b/e-util/e-filter-rule.c index 548fe4cc87..111073bbad 100644 --- a/filter/e-filter-rule.c +++ b/e-util/e-filter-rule.c @@ -30,8 +30,7 @@ #include <gtk/gtk.h> #include <glib/gi18n.h> -#include "libevolution-utils/e-alert-dialog.h" - +#include "e-alert-dialog.h" #include "e-filter-rule.h" #include "e-rule-context.h" diff --git a/filter/e-filter-rule.h b/e-util/e-filter-rule.h index 29ba21c451..8670265d88 100644 --- a/filter/e-filter-rule.h +++ b/e-util/e-filter-rule.h @@ -21,10 +21,14 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_FILTER_RULE_H #define E_FILTER_RULE_H -#include "e-filter-part.h" +#include <e-util/e-filter-part.h> /* Standard GObject macros */ #define E_TYPE_FILTER_RULE \ diff --git a/widgets/misc/e-focus-tracker.c b/e-util/e-focus-tracker.c index 505d991a2f..a610605987 100644 --- a/widgets/misc/e-focus-tracker.c +++ b/e-util/e-focus-tracker.c @@ -27,7 +27,7 @@ #include <glib/gi18n-lib.h> -#include <misc/e-selectable.h> +#include "e-selectable.h" #define E_FOCUS_TRACKER_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ diff --git a/widgets/misc/e-focus-tracker.h b/e-util/e-focus-tracker.h index 86b206e240..e633d0f57c 100644 --- a/widgets/misc/e-focus-tracker.h +++ b/e-util/e-focus-tracker.h @@ -19,6 +19,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_FOCUS_TRACKER_H #define E_FOCUS_TRACKER_H diff --git a/e-util/e-html-utils.h b/e-util/e-html-utils.h index f87e82f9b1..2fe67fffd5 100644 --- a/e-util/e-html-utils.h +++ b/e-util/e-html-utils.h @@ -20,6 +20,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef __E_HTML_UTILS__ #define __E_HTML_UTILS__ diff --git a/e-util/e-icon-factory.h b/e-util/e-icon-factory.h index 89a7d5a6a4..c75c72fec7 100644 --- a/e-util/e-icon-factory.h +++ b/e-util/e-icon-factory.h @@ -21,6 +21,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef _E_ICON_FACTORY_H_ #define _E_ICON_FACTORY_H_ diff --git a/widgets/misc/e-image-chooser.c b/e-util/e-image-chooser.c index 5fe6941d58..20c2f0e473 100644 --- a/widgets/misc/e-image-chooser.c +++ b/e-util/e-image-chooser.c @@ -29,8 +29,8 @@ #include <glib/gi18n.h> #include "e-image-chooser.h" -#include "e-util/e-util.h" -#include "e-util/e-icon-factory.h" + +#include "e-icon-factory.h" #define E_IMAGE_CHOOSER_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ diff --git a/widgets/misc/e-image-chooser.h b/e-util/e-image-chooser.h index cf983c641d..d9bfb34b71 100644 --- a/widgets/misc/e-image-chooser.h +++ b/e-util/e-image-chooser.h @@ -19,6 +19,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_IMAGE_CHOOSER_H #define E_IMAGE_CHOOSER_H diff --git a/widgets/misc/e-import-assistant.c b/e-util/e-import-assistant.c index 9e06324ab6..ae48e5c217 100644 --- a/widgets/misc/e-import-assistant.c +++ b/e-util/e-import-assistant.c @@ -34,8 +34,8 @@ #include <gdk/gdkkeysyms.h> #include <libebackend/libebackend.h> -#include <e-util/e-import.h> -#include <e-util/e-util-private.h> +#include "e-import.h" +#include "e-util-private.h" #define E_IMPORT_ASSISTANT_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ diff --git a/widgets/misc/e-import-assistant.h b/e-util/e-import-assistant.h index e120844dfd..0ee580e31e 100644 --- a/widgets/misc/e-import-assistant.h +++ b/e-util/e-import-assistant.h @@ -19,6 +19,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_IMPORT_ASSISTANT_H #define E_IMPORT_ASSISTANT_H diff --git a/e-util/e-import.h b/e-util/e-import.h index 9d0eb5127a..69d40cfced 100644 --- a/e-util/e-import.h +++ b/e-util/e-import.h @@ -21,6 +21,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_IMPORT_H #define E_IMPORT_H @@ -244,7 +248,7 @@ EImportTargetHome * /* To implement a basic import plugin, you just need to subclass * this and initialise the class target type tables */ -#include "e-util/e-plugin.h" +#include <e-util/e-plugin.h> /* Standard GObject macros */ #define E_TYPE_IMPORT_HOOK \ diff --git a/widgets/misc/e-interval-chooser.c b/e-util/e-interval-chooser.c index 5a2b4e04ad..70e90bdf92 100644 --- a/widgets/misc/e-interval-chooser.c +++ b/e-util/e-interval-chooser.c @@ -21,7 +21,7 @@ #include <config.h> #include <glib/gi18n-lib.h> -#include <e-util/e-util.h> +#include "e-util-enums.h" #define E_INTERVAL_CHOOSER_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ diff --git a/widgets/misc/e-interval-chooser.h b/e-util/e-interval-chooser.h index 351cbbe336..477ae1895c 100644 --- a/widgets/misc/e-interval-chooser.h +++ b/e-util/e-interval-chooser.h @@ -16,6 +16,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_INTERVAL_CHOOSER_H #define E_INTERVAL_CHOOSER_H diff --git a/widgets/misc/e-mail-identity-combo-box.c b/e-util/e-mail-identity-combo-box.c index b76e0ee6bc..b76e0ee6bc 100644 --- a/widgets/misc/e-mail-identity-combo-box.c +++ b/e-util/e-mail-identity-combo-box.c diff --git a/widgets/misc/e-mail-identity-combo-box.h b/e-util/e-mail-identity-combo-box.h index 691d69bde2..8c395b362f 100644 --- a/widgets/misc/e-mail-identity-combo-box.h +++ b/e-util/e-mail-identity-combo-box.h @@ -16,6 +16,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_MAIL_IDENTITY_COMBO_BOX_H #define E_MAIL_IDENTITY_COMBO_BOX_H diff --git a/widgets/misc/e-mail-signature-combo-box.c b/e-util/e-mail-signature-combo-box.c index 275c2538b9..275c2538b9 100644 --- a/widgets/misc/e-mail-signature-combo-box.c +++ b/e-util/e-mail-signature-combo-box.c diff --git a/widgets/misc/e-mail-signature-combo-box.h b/e-util/e-mail-signature-combo-box.h index d3ddaa9694..d39ba96e75 100644 --- a/widgets/misc/e-mail-signature-combo-box.h +++ b/e-util/e-mail-signature-combo-box.h @@ -16,6 +16,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_MAIL_SIGNATURE_COMBO_BOX_H #define E_MAIL_SIGNATURE_COMBO_BOX_H diff --git a/widgets/misc/e-mail-signature-editor.c b/e-util/e-mail-signature-editor.c index 5e5910b013..961edf14ca 100644 --- a/widgets/misc/e-mail-signature-editor.c +++ b/e-util/e-mail-signature-editor.c @@ -21,10 +21,10 @@ #include <string.h> #include <glib/gi18n.h> -#include <libevolution-utils/e-alert-dialog.h> -#include <libevolution-utils/e-alert-sink.h> -#include <misc/e-alert-bar.h> -#include <misc/e-web-view-gtkhtml.h> +#include "e-alert-bar.h" +#include "e-alert-dialog.h" +#include "e-alert-sink.h" +#include "e-web-view-gtkhtml.h" #define E_MAIL_SIGNATURE_EDITOR_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ diff --git a/widgets/misc/e-mail-signature-editor.h b/e-util/e-mail-signature-editor.h index 8f1be2dd0f..c525d5a8a4 100644 --- a/widgets/misc/e-mail-signature-editor.h +++ b/e-util/e-mail-signature-editor.h @@ -16,13 +16,18 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_MAIL_SIGNATURE_EDITOR_H #define E_MAIL_SIGNATURE_EDITOR_H #include <gtkhtml-editor.h> -#include <misc/e-focus-tracker.h> #include <libedataserver/libedataserver.h> +#include <e-util/e-focus-tracker.h> + /* Standard GObject macros */ #define E_TYPE_MAIL_SIGNATURE_EDITOR \ (e_mail_signature_editor_get_type ()) diff --git a/widgets/misc/e-mail-signature-manager.c b/e-util/e-mail-signature-manager.c index 66463336ea..66463336ea 100644 --- a/widgets/misc/e-mail-signature-manager.c +++ b/e-util/e-mail-signature-manager.c diff --git a/widgets/misc/e-mail-signature-manager.h b/e-util/e-mail-signature-manager.h index a627bd57fa..4b749c14a6 100644 --- a/widgets/misc/e-mail-signature-manager.h +++ b/e-util/e-mail-signature-manager.h @@ -16,12 +16,17 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_MAIL_SIGNATURE_MANAGER_H #define E_MAIL_SIGNATURE_MANAGER_H #include <gtk/gtk.h> -#include <misc/e-mail-signature-editor.h> -#include <misc/e-mail-signature-tree-view.h> + +#include <e-util/e-mail-signature-editor.h> +#include <e-util/e-mail-signature-tree-view.h> /* Standard GObject macros */ #define E_TYPE_MAIL_SIGNATURE_MANAGER \ diff --git a/widgets/misc/e-mail-signature-preview.c b/e-util/e-mail-signature-preview.c index 0e7500c5ae..8bf27fdb52 100644 --- a/widgets/misc/e-mail-signature-preview.c +++ b/e-util/e-mail-signature-preview.c @@ -23,7 +23,7 @@ #include <unistd.h> #include <glib/gstdio.h> -#include <libevolution-utils/e-alert-sink.h> +#include "e-alert-sink.h" #define E_MAIL_SIGNATURE_PREVIEW_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ diff --git a/widgets/misc/e-mail-signature-preview.h b/e-util/e-mail-signature-preview.h index fff4c64d3d..e7b0302e52 100644 --- a/widgets/misc/e-mail-signature-preview.h +++ b/e-util/e-mail-signature-preview.h @@ -16,12 +16,17 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_MAIL_SIGNATURE_PREVIEW_H #define E_MAIL_SIGNATURE_PREVIEW_H -#include <misc/e-web-view.h> #include <libedataserver/libedataserver.h> +#include <e-util/e-web-view.h> + /* Standard GObject macros */ #define E_TYPE_MAIL_SIGNATURE_PREVIEW \ (e_mail_signature_preview_get_type ()) diff --git a/widgets/misc/e-mail-signature-script-dialog.c b/e-util/e-mail-signature-script-dialog.c index 58e8c43157..58e8c43157 100644 --- a/widgets/misc/e-mail-signature-script-dialog.c +++ b/e-util/e-mail-signature-script-dialog.c diff --git a/widgets/misc/e-mail-signature-script-dialog.h b/e-util/e-mail-signature-script-dialog.h index b28521e488..6a266b557d 100644 --- a/widgets/misc/e-mail-signature-script-dialog.h +++ b/e-util/e-mail-signature-script-dialog.h @@ -16,6 +16,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_MAIL_SIGNATURE_SCRIPT_DIALOG_H #define E_MAIL_SIGNATURE_SCRIPT_DIALOG_H diff --git a/widgets/misc/e-mail-signature-tree-view.c b/e-util/e-mail-signature-tree-view.c index 05a2580d78..05a2580d78 100644 --- a/widgets/misc/e-mail-signature-tree-view.c +++ b/e-util/e-mail-signature-tree-view.c diff --git a/widgets/misc/e-mail-signature-tree-view.h b/e-util/e-mail-signature-tree-view.h index ba2615f6d8..4da53291a2 100644 --- a/widgets/misc/e-mail-signature-tree-view.h +++ b/e-util/e-mail-signature-tree-view.h @@ -16,6 +16,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_MAIL_SIGNATURE_TREE_VIEW_H #define E_MAIL_SIGNATURE_TREE_VIEW_H diff --git a/widgets/misc/e-map.c b/e-util/e-map.c index b9f83d811d..a419626b8d 100644 --- a/widgets/misc/e-map.c +++ b/e-util/e-map.c @@ -31,11 +31,10 @@ #include <gdk/gdkkeysyms.h> #include <glib/gi18n.h> -#include "e-util/e-util-private.h" -#include "e-util/e-util.h" - #include "e-map.h" +#include "e-util-private.h" + #define E_MAP_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ ((obj), E_TYPE_MAP, EMapPrivate)) diff --git a/widgets/misc/e-map.h b/e-util/e-map.h index 059da7c2a5..cb2923d3fb 100644 --- a/widgets/misc/e-map.h +++ b/e-util/e-map.h @@ -21,6 +21,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_MAP_H #define E_MAP_H diff --git a/widgets/misc/e-menu-tool-action.c b/e-util/e-menu-tool-action.c index 3ed37cb008..3ed37cb008 100644 --- a/widgets/misc/e-menu-tool-action.c +++ b/e-util/e-menu-tool-action.c diff --git a/widgets/misc/e-menu-tool-action.h b/e-util/e-menu-tool-action.h index e642edf958..aee47686e2 100644 --- a/widgets/misc/e-menu-tool-action.h +++ b/e-util/e-menu-tool-action.h @@ -22,6 +22,10 @@ /* This is a trivial GtkAction subclass that sets the toolbar * item type to GtkMenuToolButton instead of GtkToolButton. */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_MENU_TOOL_ACTION_H #define E_MENU_TOOL_ACTION_H diff --git a/widgets/misc/e-menu-tool-button.c b/e-util/e-menu-tool-button.c index c2a68d0c05..c2a68d0c05 100644 --- a/widgets/misc/e-menu-tool-button.c +++ b/e-util/e-menu-tool-button.c diff --git a/widgets/misc/e-menu-tool-button.h b/e-util/e-menu-tool-button.h index 803ec8ff58..04519958d2 100644 --- a/widgets/misc/e-menu-tool-button.h +++ b/e-util/e-menu-tool-button.h @@ -23,6 +23,10 @@ * button icon always reflects the first menu item, and clicking * the button activates the first menu item. */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_MENU_TOOL_BUTTON_H #define E_MENU_TOOL_BUTTON_H diff --git a/e-util/e-util.c b/e-util/e-misc-utils.c index 8d47da2186..7d1a0c6028 100644 --- a/e-util/e-util.c +++ b/e-util/e-misc-utils.c @@ -20,15 +20,12 @@ * */ -/** - * SECTION: e-util - * @include: e-util/e-util.h - **/ - #ifdef HAVE_CONFIG_H #include <config.h> #endif +#include "e-misc-utils.h" + #include <stdlib.h> #include <stdio.h> #include <errno.h> @@ -53,9 +50,7 @@ #include <camel/camel.h> #include <libedataserver/libedataserver.h> -#include "filter/e-filter-option.h" - -#include "e-util.h" +#include "e-filter-option.h" #include "e-util-private.h" typedef struct _WindowData WindowData; @@ -648,6 +643,73 @@ e_action_group_add_actions_localized (GtkActionGroup *action_group, g_object_unref (tmp_group); } +/** + * e_builder_get_widget: + * @builder: a #GtkBuilder + * @widget_name: name of a widget in @builder + * + * Gets the widget named @widget_name. Note that this function does not + * increment the reference count of the returned widget. If @widget_name + * could not be found in the @builder<!-- -->'s object tree, a run-time + * warning is emitted since this usually indicates a programming error. + * + * This is a convenience function to work around the awkwardness of + * #GtkBuilder returning #GObject pointers, when the vast majority of + * the time you want a #GtkWidget pointer. + * + * If you need something from @builder other than a #GtkWidget, or you + * want to test for the existence of some widget name without incurring + * a run-time warning, use gtk_builder_get_object(). + * + * Returns: the widget named @widget_name, or %NULL + **/ +GtkWidget * +e_builder_get_widget (GtkBuilder *builder, + const gchar *widget_name) +{ + GObject *object; + + g_return_val_if_fail (GTK_IS_BUILDER (builder), NULL); + g_return_val_if_fail (widget_name != NULL, NULL); + + object = gtk_builder_get_object (builder, widget_name); + if (object == NULL) { + g_warning ("Could not find widget '%s'", widget_name); + return NULL; + } + + return GTK_WIDGET (object); +} + +/** + * e_load_ui_builder_definition: + * @builder: a #GtkBuilder + * @basename: basename of the UI definition file + * + * Loads a UI definition into @builder from Evolution's UI directory. + * Failure here is fatal, since the application can't function without + * its UI definitions. + **/ +void +e_load_ui_builder_definition (GtkBuilder *builder, + const gchar *basename) +{ + gchar *filename; + GError *error = NULL; + + g_return_if_fail (GTK_IS_BUILDER (builder)); + g_return_if_fail (basename != NULL); + + filename = g_build_filename (EVOLUTION_UIDIR, basename, NULL); + gtk_builder_add_from_file (builder, filename, &error); + g_free (filename); + + if (error != NULL) { + g_error ("%s: %s", basename, error->message); + g_assert_not_reached (); + } +} + /* Helper for e_categories_add_change_hook() */ static void categories_changed_cb (GObject *useless_opaque_object, @@ -719,6 +781,233 @@ e_categories_add_change_hook (GHookFunc func, } /** + * e_flexible_strtod: + * @nptr: the string to convert to a numeric value. + * @endptr: if non-NULL, it returns the character after + * the last character used in the conversion. + * + * Converts a string to a gdouble value. This function detects + * strings either in the standard C locale or in the current locale. + * + * This function is typically used when reading configuration files or + * other non-user input that should not be locale dependent, but may + * have been in the past. To handle input from the user you should + * normally use the locale-sensitive system strtod function. + * + * To convert from a double to a string in a locale-insensitive way, use + * @g_ascii_dtostr. + * + * Returns: the gdouble value + **/ +gdouble +e_flexible_strtod (const gchar *nptr, + gchar **endptr) +{ + gchar *fail_pos; + gdouble val; + struct lconv *locale_data; + const gchar *decimal_point; + gint decimal_point_len; + const gchar *p, *decimal_point_pos; + const gchar *end = NULL; /* Silence gcc */ + gchar *copy, *c; + + g_return_val_if_fail (nptr != NULL, 0); + + fail_pos = NULL; + + locale_data = localeconv (); + decimal_point = locale_data->decimal_point; + decimal_point_len = strlen (decimal_point); + + g_return_val_if_fail (decimal_point_len != 0, 0); + + decimal_point_pos = NULL; + if (!strcmp (decimal_point, ".")) + return strtod (nptr, endptr); + + p = nptr; + + /* Skip leading space */ + while (isspace ((guchar) * p)) + p++; + + /* Skip leading optional sign */ + if (*p == '+' || *p == '-') + p++; + + if (p[0] == '0' && + (p[1] == 'x' || p[1] == 'X')) { + p += 2; + /* HEX - find the (optional) decimal point */ + + while (isxdigit ((guchar) * p)) + p++; + + if (*p == '.') { + decimal_point_pos = p++; + + while (isxdigit ((guchar) * p)) + p++; + + if (*p == 'p' || *p == 'P') + p++; + if (*p == '+' || *p == '-') + p++; + while (isdigit ((guchar) * p)) + p++; + end = p; + } else if (strncmp (p, decimal_point, decimal_point_len) == 0) { + return strtod (nptr, endptr); + } + } else { + while (isdigit ((guchar) * p)) + p++; + + if (*p == '.') { + decimal_point_pos = p++; + + while (isdigit ((guchar) * p)) + p++; + + if (*p == 'e' || *p == 'E') + p++; + if (*p == '+' || *p == '-') + p++; + while (isdigit ((guchar) * p)) + p++; + end = p; + } else if (strncmp (p, decimal_point, decimal_point_len) == 0) { + return strtod (nptr, endptr); + } + } + /* For the other cases, we need not convert the decimal point */ + + if (!decimal_point_pos) + return strtod (nptr, endptr); + + /* We need to convert the '.' to the locale specific decimal point */ + copy = g_malloc (end - nptr + 1 + decimal_point_len); + + c = copy; + memcpy (c, nptr, decimal_point_pos - nptr); + c += decimal_point_pos - nptr; + memcpy (c, decimal_point, decimal_point_len); + c += decimal_point_len; + memcpy (c, decimal_point_pos + 1, end - (decimal_point_pos + 1)); + c += end - (decimal_point_pos + 1); + *c = 0; + + val = strtod (copy, &fail_pos); + + if (fail_pos) { + if (fail_pos > decimal_point_pos) + fail_pos = + (gchar *) nptr + (fail_pos - copy) - + (decimal_point_len - 1); + else + fail_pos = (gchar *) nptr + (fail_pos - copy); + } + + g_free (copy); + + if (endptr) + *endptr = fail_pos; + + return val; +} + +/** + * e_ascii_dtostr: + * @buffer: A buffer to place the resulting string in + * @buf_len: The length of the buffer. + * @format: The printf-style format to use for the + * code to use for converting. + * @d: The double to convert + * + * Converts a double to a string, using the '.' as + * decimal_point. To format the number you pass in + * a printf-style formating string. Allowed conversion + * specifiers are eEfFgG. + * + * If you want to generates enough precision that converting + * the string back using @g_strtod gives the same machine-number + * (on machines with IEEE compatible 64bit doubles) use the format + * string "%.17g". If you do this it is guaranteed that the size + * of the resulting string will never be larger than + * @G_ASCII_DTOSTR_BUF_SIZE bytes. + * + * Returns: the pointer to the buffer with the converted string + **/ +gchar * +e_ascii_dtostr (gchar *buffer, + gint buf_len, + const gchar *format, + gdouble d) +{ + struct lconv *locale_data; + const gchar *decimal_point; + gint decimal_point_len; + gchar *p; + gint rest_len; + gchar format_char; + + g_return_val_if_fail (buffer != NULL, NULL); + g_return_val_if_fail (format[0] == '%', NULL); + g_return_val_if_fail (strpbrk (format + 1, "'l%") == NULL, NULL); + + format_char = format[strlen (format) - 1]; + + g_return_val_if_fail (format_char == 'e' || format_char == 'E' || + format_char == 'f' || format_char == 'F' || + format_char == 'g' || format_char == 'G', + NULL); + + if (format[0] != '%') + return NULL; + + if (strpbrk (format + 1, "'l%")) + return NULL; + + if (!(format_char == 'e' || format_char == 'E' || + format_char == 'f' || format_char == 'F' || + format_char == 'g' || format_char == 'G')) + return NULL; + + g_snprintf (buffer, buf_len, format, d); + + locale_data = localeconv (); + decimal_point = locale_data->decimal_point; + decimal_point_len = strlen (decimal_point); + + g_return_val_if_fail (decimal_point_len != 0, NULL); + + if (strcmp (decimal_point, ".")) { + p = buffer; + + if (*p == '+' || *p == '-') + p++; + + while (isdigit ((guchar) * p)) + p++; + + if (strncmp (p, decimal_point, decimal_point_len) == 0) { + *p = '.'; + p++; + if (decimal_point_len > 1) { + rest_len = strlen (p + (decimal_point_len - 1)); + memmove ( + p, p + (decimal_point_len - 1), + rest_len); + p[rest_len] = 0; + } + } + } + + return buffer; +} + +/** * e_str_without_underscores: * @string: the string to strip underscores from * @@ -1318,7 +1607,6 @@ e_util_guess_mime_type (const gchar *filename, return mime_type; } -/* XXX: Should e-util/ really depend on filter/ ?? */ GSList * e_util_get_category_filter_options (void) { diff --git a/e-util/e-misc-utils.h b/e-util/e-misc-utils.h new file mode 100644 index 0000000000..0bd465e7d1 --- /dev/null +++ b/e-util/e-misc-utils.h @@ -0,0 +1,175 @@ +/* + * 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: + * Chris Lahey <clahey@ximian.com> + * + * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) + * + */ + +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + +#ifndef E_MISC_UTILS_H +#define E_MISC_UTILS_H + +#include <sys/types.h> +#include <gtk/gtk.h> +#include <limits.h> + +#include <libedataserver/libedataserver.h> + +#include "e-marshal.h" +#include "e-util-enums.h" + +G_BEGIN_DECLS + +typedef enum { + E_FOCUS_NONE, + E_FOCUS_CURRENT, + E_FOCUS_START, + E_FOCUS_END +} EFocus; + +typedef enum { + E_RESTORE_WINDOW_SIZE = 1 << 0, + E_RESTORE_WINDOW_POSITION = 1 << 1 +} ERestoreWindowFlags; + +const gchar * e_get_accels_filename (void); +void e_show_uri (GtkWindow *parent, + const gchar *uri); +void e_display_help (GtkWindow *parent, + const gchar *link_id); +void e_restore_window (GtkWindow *window, + const gchar *settings_path, + ERestoreWindowFlags flags); +GtkAction * e_lookup_action (GtkUIManager *ui_manager, + const gchar *action_name); +GtkActionGroup *e_lookup_action_group (GtkUIManager *ui_manager, + const gchar *group_name); +gint e_action_compare_by_label (GtkAction *action1, + GtkAction *action2); +void e_action_group_remove_all_actions + (GtkActionGroup *action_group); +GtkRadioAction *e_radio_action_get_current_action + (GtkRadioAction *radio_action); +void e_action_group_add_actions_localized + (GtkActionGroup *action_group, + const gchar *translation_domain, + const GtkActionEntry *entries, + guint n_entries, + gpointer user_data); +GtkWidget * e_builder_get_widget (GtkBuilder *builder, + const gchar *widget_name); +void e_load_ui_builder_definition (GtkBuilder *builder, + const gchar *basename); +void e_categories_add_change_hook (GHookFunc func, + gpointer object); + +/* String to/from double conversion functions */ +gdouble e_flexible_strtod (const gchar *nptr, + gchar **endptr); + +/* 29 bytes should enough for all possible values that + * g_ascii_dtostr can produce with the %.17g format. + * Then add 10 for good measure */ +#define E_ASCII_DTOSTR_BUF_SIZE (DBL_DIG + 12 + 10) +gchar * e_ascii_dtostr (gchar *buffer, + gint buf_len, + const gchar *format, + gdouble d); + +gchar * e_str_without_underscores (const gchar *string); +gint e_str_compare (gconstpointer x, + gconstpointer y); +gint e_str_case_compare (gconstpointer x, + gconstpointer y); +gint e_collate_compare (gconstpointer x, + gconstpointer y); +gint e_int_compare (gconstpointer x, + gconstpointer y); +guint32 e_color_to_value (GdkColor *color); + +guint32 e_rgba_to_value (GdkRGBA *rgba); + +/* This only makes a filename safe for usage as a filename. + * It still may have shell meta-characters in it. */ +gchar * e_format_number (gint number); + +typedef gint (*ESortCompareFunc) (gconstpointer first, + gconstpointer second, + gpointer closure); + +void e_bsearch (gconstpointer key, + gconstpointer base, + gsize nmemb, + gsize size, + ESortCompareFunc compare, + gpointer closure, + gsize *start, + gsize *end); + +gsize e_strftime_fix_am_pm (gchar *str, + gsize max, + const gchar *fmt, + const struct tm *tm); +gsize e_utf8_strftime_fix_am_pm (gchar *str, + gsize max, + const gchar *fmt, + const struct tm *tm); +const gchar * e_get_month_name (GDateMonth month, + gboolean abbreviated); +const gchar * e_get_weekday_name (GDateWeekday weekday, + gboolean abbreviated); + +gboolean e_file_lock_create (void); +void e_file_lock_destroy (void); +gboolean e_file_lock_exists (void); + +gchar * e_util_guess_mime_type (const gchar *filename, + gboolean localfile); + +GSList * e_util_get_category_filter_options + (void); +GList * e_util_get_searchable_categories (void); + +/* Useful GBinding transform functions */ +gboolean e_binding_transform_color_to_string + (GBinding *binding, + const GValue *source_value, + GValue *target_value, + gpointer not_used); +gboolean e_binding_transform_string_to_color + (GBinding *binding, + const GValue *source_value, + GValue *target_value, + gpointer not_used); +gboolean e_binding_transform_source_to_uid + (GBinding *binding, + const GValue *source_value, + GValue *target_value, + ESourceRegistry *registry); +gboolean e_binding_transform_uid_to_source + (GBinding *binding, + const GValue *source_value, + GValue *target_value, + ESourceRegistry *registry); + +G_END_DECLS + +#endif /* E_MISC_UTILS_H */ diff --git a/e-util/e-mktemp.c b/e-util/e-mktemp.c index 9b68ccc473..f5042fa6a2 100644 --- a/e-util/e-mktemp.c +++ b/e-util/e-mktemp.c @@ -35,7 +35,8 @@ #include <stdio.h> #include <time.h> -#include "e-util.h" +#include <libedataserver/libedataserver.h> + #include "e-mktemp.h" #define d(x) diff --git a/e-util/e-mktemp.h b/e-util/e-mktemp.h index 08f75ea67e..6c05541611 100644 --- a/e-util/e-mktemp.h +++ b/e-util/e-mktemp.h @@ -20,6 +20,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef __E_MKTEMP_H__ #define __E_MKTEMP_H__ diff --git a/e-util/e-name-selector-dialog.c b/e-util/e-name-selector-dialog.c new file mode 100644 index 0000000000..ece556b0a9 --- /dev/null +++ b/e-util/e-name-selector-dialog.c @@ -0,0 +1,1863 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ + +/* e-name-selector-dialog.c - Dialog that lets user pick EDestinations. + * + * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU Lesser General Public + * License as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + * + * Author: Hans Petter Jansson <hpj@novell.com> + */ + +#ifdef GTK_DISABLE_DEPRECATED +#undef GTK_DISABLE_DEPRECATED +#endif + +#include <config.h> +#include <string.h> +#include <gdk/gdkkeysyms.h> +#include <glib/gi18n-lib.h> + +#include <libebook/libebook.h> +#include <libebackend/libebackend.h> + +#include "e-source-combo-box.h" +#include "e-destination-store.h" +#include "e-contact-store.h" +#include "e-client-utils.h" +#include "e-name-selector-dialog.h" +#include "e-name-selector-entry.h" + +#define E_NAME_SELECTOR_DIALOG_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE \ + ((obj), E_TYPE_NAME_SELECTOR_DIALOG, ENameSelectorDialogPrivate)) + +typedef struct { + gchar *name; + + GtkGrid *section_grid; + GtkLabel *label; + GtkButton *transfer_button; + GtkButton *remove_button; + GtkTreeView *destination_view; +} +Section; + +typedef struct { + GtkTreeView *view; + GtkButton *button; + ENameSelectorDialog *dlg_ptr; +} SelData; + +struct _ENameSelectorDialogPrivate { + ESourceRegistry *registry; + ENameSelectorModel *name_selector_model; + GtkTreeModelSort *contact_sort; + GCancellable *cancellable; + + GtkTreeView *contact_view; + GtkLabel *status_label; + GtkGrid *destination_vgrid; + GtkEntry *search_entry; + GtkSizeGroup *button_size_group; + GtkWidget *category_combobox; + GtkWidget *contact_window; + + GArray *sections; + + guint destination_index; + GSList *user_query_fields; + GtkSizeGroup *dest_label_size_group; +}; + +enum { + PROP_0, + PROP_REGISTRY +}; + +static void search_changed (ENameSelectorDialog *name_selector_dialog); +static void source_changed (ENameSelectorDialog *name_selector_dialog, ESourceComboBox *source_combo_box); +static void transfer_button_clicked (ENameSelectorDialog *name_selector_dialog, GtkButton *transfer_button); +static void contact_selection_changed (ENameSelectorDialog *name_selector_dialog); +static void setup_name_selector_model (ENameSelectorDialog *name_selector_dialog); +static void shutdown_name_selector_model (ENameSelectorDialog *name_selector_dialog); +static void contact_activated (ENameSelectorDialog *name_selector_dialog, GtkTreePath *path); +static void destination_activated (ENameSelectorDialog *name_selector_dialog, GtkTreePath *path, + GtkTreeViewColumn *column, GtkTreeView *tree_view); +static gboolean destination_key_press (ENameSelectorDialog *name_selector_dialog, GdkEventKey *event, GtkTreeView *tree_view); +static void remove_button_clicked (GtkButton *button, SelData *data); +static void remove_books (ENameSelectorDialog *name_selector_dialog); +static void contact_column_formatter (GtkTreeViewColumn *column, GtkCellRenderer *cell, + GtkTreeModel *model, GtkTreeIter *iter, + ENameSelectorDialog *name_selector_dialog); +static void destination_column_formatter (GtkTreeViewColumn *column, GtkCellRenderer *cell, + GtkTreeModel *model, GtkTreeIter *iter, + ENameSelectorDialog *name_selector_dialog); + +/* ------------------ * + * Class/object setup * + * ------------------ */ + +G_DEFINE_TYPE_WITH_CODE ( + ENameSelectorDialog, + e_name_selector_dialog, + GTK_TYPE_DIALOG, + G_IMPLEMENT_INTERFACE ( + E_TYPE_EXTENSIBLE, NULL)) + +static void +name_selector_dialog_populate_categories (ENameSelectorDialog *name_selector_dialog) +{ + GtkWidget *combo_box; + GList *category_list, *iter; + + /* "Any Category" is preloaded. */ + combo_box = name_selector_dialog->priv->category_combobox; + if (gtk_combo_box_get_active (GTK_COMBO_BOX (combo_box)) == -1) + gtk_combo_box_set_active (GTK_COMBO_BOX (combo_box), 0); + + /* Categories are already sorted. */ + category_list = e_categories_get_list (); + for (iter = category_list; iter != NULL; iter = iter->next) { + /* Only add user-visible categories. */ + if (!e_categories_is_searchable (iter->data)) + continue; + + gtk_combo_box_text_append_text ( + GTK_COMBO_BOX_TEXT (combo_box), iter->data); + } + + g_list_free (category_list); + + g_signal_connect_swapped ( + combo_box, "changed", + G_CALLBACK (search_changed), name_selector_dialog); +} + +static void +name_selector_dialog_set_registry (ENameSelectorDialog *name_selector_dialog, + ESourceRegistry *registry) +{ + g_return_if_fail (E_IS_SOURCE_REGISTRY (registry)); + g_return_if_fail (name_selector_dialog->priv->registry == NULL); + + name_selector_dialog->priv->registry = g_object_ref (registry); +} + +static void +name_selector_dialog_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) +{ + switch (property_id) { + case PROP_REGISTRY: + name_selector_dialog_set_registry ( + E_NAME_SELECTOR_DIALOG (object), + g_value_get_object (value)); + return; + } + + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); +} + +static void +name_selector_dialog_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) +{ + switch (property_id) { + case PROP_REGISTRY: + g_value_set_object ( + value, + e_name_selector_dialog_get_registry ( + E_NAME_SELECTOR_DIALOG (object))); + return; + } + + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); +} + +static void +name_selector_dialog_dispose (GObject *object) +{ + ENameSelectorDialogPrivate *priv; + + priv = E_NAME_SELECTOR_DIALOG_GET_PRIVATE (object); + + remove_books (E_NAME_SELECTOR_DIALOG (object)); + shutdown_name_selector_model (E_NAME_SELECTOR_DIALOG (object)); + + if (priv->registry != NULL) { + g_object_unref (priv->registry); + priv->registry = NULL; + } + + /* Chain up to parent's dispose() method. */ + G_OBJECT_CLASS (e_name_selector_dialog_parent_class)->dispose (object); +} + +static void +name_selector_dialog_finalize (GObject *object) +{ + ENameSelectorDialogPrivate *priv; + + priv = E_NAME_SELECTOR_DIALOG_GET_PRIVATE (object); + + g_slist_foreach (priv->user_query_fields, (GFunc) g_free, NULL); + g_slist_free (priv->user_query_fields); + + g_array_free (priv->sections, TRUE); + g_object_unref (priv->button_size_group); + g_object_unref (priv->dest_label_size_group); + + /* Chain up to parent's finalize() method. */ + G_OBJECT_CLASS (e_name_selector_dialog_parent_class)->finalize (object); +} + +static void +name_selector_dialog_constructed (GObject *object) +{ + ENameSelectorDialogPrivate *priv; + GtkTreeSelection *contact_selection; + GtkTreeViewColumn *column; + GtkCellRenderer *cell_renderer; + GtkTreeSelection *selection; + ESource *source; + gchar *tmp_str; + GtkWidget *name_selector_grid; + GtkWidget *show_contacts_label; + GtkWidget *hgrid; + GtkWidget *label; + GtkWidget *show_contacts_grid; + GtkWidget *AddressBookLabel; + GtkWidget *label_category; + GtkWidget *search; + AtkObject *atko; + GtkWidget *label_search; + GtkWidget *source_menu_hgrid; + GtkWidget *combobox_category; + GtkWidget *label_contacts; + GtkWidget *scrolledwindow0; + GtkWidget *scrolledwindow1; + AtkRelationSet *tmp_relation_set; + AtkRelationType tmp_relationship; + AtkRelation *tmp_relation; + AtkObject *scrolledwindow1_relation_targets[1]; + GtkWidget *source_tree_view; + GtkWidget *destination_vgrid; + GtkWidget *status_message; + GtkWidget *source_combo; + const gchar *extension_name; + + priv = E_NAME_SELECTOR_DIALOG_GET_PRIVATE (object); + + /* Chain up to parent's constructed() method. */ + G_OBJECT_CLASS (e_name_selector_dialog_parent_class)->constructed (object); + + name_selector_grid = g_object_new (GTK_TYPE_GRID, + "orientation", GTK_ORIENTATION_VERTICAL, + "column-homogeneous", FALSE, + "row-spacing", 6, + NULL); + gtk_widget_show (name_selector_grid); + gtk_container_set_border_width (GTK_CONTAINER (name_selector_grid), 0); + + tmp_str = g_strconcat ("<b>", _("Show Contacts"), "</b>", NULL); + show_contacts_label = gtk_label_new (tmp_str); + gtk_widget_show (show_contacts_label); + gtk_container_add (GTK_CONTAINER (name_selector_grid), show_contacts_label); + gtk_label_set_use_markup (GTK_LABEL (show_contacts_label), TRUE); + gtk_misc_set_alignment (GTK_MISC (show_contacts_label), 0, 0.5); + g_free (tmp_str); + + hgrid = g_object_new (GTK_TYPE_GRID, + "orientation", GTK_ORIENTATION_HORIZONTAL, + "row-homogeneous", FALSE, + "column-spacing", 12, + NULL); + gtk_widget_show (hgrid); + gtk_container_add (GTK_CONTAINER (name_selector_grid), hgrid); + + label = gtk_label_new (""); + gtk_widget_show (label); + gtk_container_add (GTK_CONTAINER (hgrid), label); + + show_contacts_grid = gtk_grid_new (); + gtk_widget_show (show_contacts_grid); + gtk_container_add (GTK_CONTAINER (hgrid), show_contacts_grid); + g_object_set (G_OBJECT (show_contacts_grid), + "column-spacing", 12, + "row-spacing", 6, + "hexpand", TRUE, + "halign", GTK_ALIGN_FILL, + NULL); + + AddressBookLabel = gtk_label_new_with_mnemonic (_("Address B_ook:")); + gtk_widget_show (AddressBookLabel); + gtk_grid_attach (GTK_GRID (show_contacts_grid), AddressBookLabel, 0, 0, 1, 1); + gtk_widget_set_halign (AddressBookLabel, GTK_ALIGN_FILL); + gtk_label_set_justify (GTK_LABEL (AddressBookLabel), GTK_JUSTIFY_CENTER); + gtk_misc_set_alignment (GTK_MISC (AddressBookLabel), 0, 0.5); + + label_category = gtk_label_new_with_mnemonic (_("Cat_egory:")); + gtk_widget_show (label_category); + gtk_grid_attach (GTK_GRID (show_contacts_grid), label_category, 0, 1, 1, 1); + gtk_widget_set_halign (label_category, GTK_ALIGN_FILL); + gtk_label_set_justify (GTK_LABEL (label_category), GTK_JUSTIFY_CENTER); + gtk_misc_set_alignment (GTK_MISC (label_category), 0, 0.5); + + hgrid = g_object_new (GTK_TYPE_GRID, + "orientation", GTK_ORIENTATION_HORIZONTAL, + "row-homogeneous", FALSE, + "column-spacing", 12, + "hexpand", TRUE, + "halign", GTK_ALIGN_FILL, + NULL); + gtk_widget_show (hgrid); + gtk_grid_attach (GTK_GRID (show_contacts_grid), hgrid, 1, 2, 1, 1); + + search = gtk_entry_new (); + gtk_widget_show (search); + gtk_widget_set_hexpand (search, TRUE); + gtk_widget_set_halign (search, GTK_ALIGN_FILL); + gtk_container_add (GTK_CONTAINER (hgrid), search); + + label_search = gtk_label_new_with_mnemonic (_("_Search:")); + gtk_widget_show (label_search); + gtk_grid_attach (GTK_GRID (show_contacts_grid), label_search, 0, 2, 1, 1); + gtk_widget_set_halign (label_search, GTK_ALIGN_FILL); + gtk_misc_set_alignment (GTK_MISC (label_search), 0, 0.5); + + source_menu_hgrid = g_object_new (GTK_TYPE_GRID, + "orientation", GTK_ORIENTATION_HORIZONTAL, + "row-homogeneous", FALSE, + "column-spacing", 0, + "halign", GTK_ALIGN_FILL, + "valign", GTK_ALIGN_FILL, + NULL); + gtk_widget_show (source_menu_hgrid); + gtk_grid_attach (GTK_GRID (show_contacts_grid), source_menu_hgrid, 1, 0, 1, 1); + + combobox_category = gtk_combo_box_text_new (); + gtk_widget_show (combobox_category); + g_object_set (G_OBJECT (combobox_category), + "halign", GTK_ALIGN_FILL, + "valign", GTK_ALIGN_FILL, + NULL); + gtk_grid_attach (GTK_GRID (show_contacts_grid), combobox_category, 1, 1, 1, 1); + gtk_combo_box_text_append_text ( + GTK_COMBO_BOX_TEXT (combobox_category), _("Any Category")); + + tmp_str = g_strconcat ("<b>", _("Co_ntacts"), "</b>", NULL); + label_contacts = gtk_label_new_with_mnemonic (tmp_str); + gtk_widget_show (label_contacts); + gtk_container_add (GTK_CONTAINER (name_selector_grid), label_contacts); + gtk_label_set_use_markup (GTK_LABEL (label_contacts), TRUE); + gtk_misc_set_alignment (GTK_MISC (label_contacts), 0, 0.5); + g_free (tmp_str); + + scrolledwindow0 = gtk_scrolled_window_new (NULL, NULL); + priv->contact_window = scrolledwindow0; + gtk_widget_show (scrolledwindow0); + gtk_widget_set_vexpand (scrolledwindow0, TRUE); + gtk_widget_set_valign (scrolledwindow0, GTK_ALIGN_FILL); + gtk_container_add (GTK_CONTAINER (name_selector_grid), scrolledwindow0); + gtk_scrolled_window_set_policy ( + GTK_SCROLLED_WINDOW (scrolledwindow0), + GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); + + hgrid = g_object_new (GTK_TYPE_GRID, + "orientation", GTK_ORIENTATION_HORIZONTAL, + "row-homogeneous", FALSE, + "column-spacing", 12, + NULL); + gtk_widget_show (hgrid); + gtk_scrolled_window_add_with_viewport ( + GTK_SCROLLED_WINDOW (scrolledwindow0), hgrid); + + label = gtk_label_new (""); + gtk_widget_show (label); + gtk_container_add (GTK_CONTAINER (hgrid), label); + + scrolledwindow1 = gtk_scrolled_window_new (NULL, NULL); + gtk_widget_show (scrolledwindow1); + gtk_container_add (GTK_CONTAINER (hgrid), scrolledwindow1); + gtk_widget_set_hexpand (scrolledwindow1, TRUE); + gtk_widget_set_halign (scrolledwindow1, GTK_ALIGN_FILL); + gtk_scrolled_window_set_policy ( + GTK_SCROLLED_WINDOW (scrolledwindow1), + GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); + gtk_scrolled_window_set_shadow_type ( + GTK_SCROLLED_WINDOW (scrolledwindow1), GTK_SHADOW_IN); + + source_tree_view = gtk_tree_view_new (); + gtk_widget_show (source_tree_view); + gtk_container_add (GTK_CONTAINER (scrolledwindow1), source_tree_view); + gtk_tree_view_set_headers_visible ( + GTK_TREE_VIEW (source_tree_view), FALSE); + gtk_tree_view_set_enable_search ( + GTK_TREE_VIEW (source_tree_view), FALSE); + + destination_vgrid = g_object_new (GTK_TYPE_GRID, + "orientation", GTK_ORIENTATION_VERTICAL, + "column-homogeneous", TRUE, + "row-spacing", 6, + "hexpand", TRUE, + "halign", GTK_ALIGN_FILL, + "vexpand", TRUE, + "valign", GTK_ALIGN_FILL, + NULL); + gtk_widget_show (destination_vgrid); + gtk_container_add (GTK_CONTAINER (hgrid), destination_vgrid); + + status_message = gtk_label_new (""); + gtk_widget_show (status_message); + gtk_container_add (GTK_CONTAINER (name_selector_grid), status_message); + gtk_label_set_use_markup (GTK_LABEL (status_message), TRUE); + gtk_misc_set_alignment (GTK_MISC (status_message), 0, 0.5); + gtk_misc_set_padding (GTK_MISC (status_message), 0, 3); + + gtk_label_set_mnemonic_widget (GTK_LABEL (AddressBookLabel), source_menu_hgrid); + gtk_label_set_mnemonic_widget (GTK_LABEL (label_category), combobox_category); + gtk_label_set_mnemonic_widget (GTK_LABEL (label_search), search); + gtk_label_set_mnemonic_widget (GTK_LABEL (label_contacts), source_tree_view); + + atko = gtk_widget_get_accessible (search); + atk_object_set_name (atko, _("Search")); + + atko = gtk_widget_get_accessible (source_menu_hgrid); + atk_object_set_name (atko, _("Address Book")); + + atko = gtk_widget_get_accessible (scrolledwindow1); + atk_object_set_name (atko, _("Contacts")); + tmp_relation_set = atk_object_ref_relation_set (atko); + scrolledwindow1_relation_targets[0] = gtk_widget_get_accessible (label_contacts); + tmp_relationship = atk_relation_type_for_name ("labelled-by"); + tmp_relation = atk_relation_new (scrolledwindow1_relation_targets, 1, tmp_relationship); + atk_relation_set_add (tmp_relation_set, tmp_relation); + g_object_unref (G_OBJECT (tmp_relation)); + g_object_unref (G_OBJECT (tmp_relation_set)); + + gtk_box_pack_start ( + GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (object))), + name_selector_grid, TRUE, TRUE, 0); + + /* Store pointers to relevant widgets */ + + priv->contact_view = GTK_TREE_VIEW (source_tree_view); + priv->status_label = GTK_LABEL (status_message); + priv->destination_vgrid = GTK_GRID (destination_vgrid); + priv->search_entry = GTK_ENTRY (search); + priv->category_combobox = combobox_category; + + /* Create size group for transfer buttons */ + + priv->button_size_group = + gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL); + + /* Create size group for destination labels */ + + priv->dest_label_size_group = + gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL); + + /* Set up contacts view */ + + column = gtk_tree_view_column_new (); + cell_renderer = GTK_CELL_RENDERER (gtk_cell_renderer_text_new ()); + gtk_tree_view_column_pack_start (column, cell_renderer, TRUE); + gtk_tree_view_column_set_cell_data_func ( + column, cell_renderer, (GtkTreeCellDataFunc) + contact_column_formatter, object, NULL); + + selection = gtk_tree_view_get_selection (priv->contact_view); + gtk_tree_selection_set_mode (selection, GTK_SELECTION_MULTIPLE); + gtk_tree_view_append_column (priv->contact_view, column); + g_signal_connect_swapped ( + priv->contact_view, "row-activated", + G_CALLBACK (contact_activated), object); + + /* Listen for changes to the contact selection */ + + contact_selection = gtk_tree_view_get_selection (priv->contact_view); + g_signal_connect_swapped ( + contact_selection, "changed", + G_CALLBACK (contact_selection_changed), object); + + /* Set up our data structures */ + + priv->name_selector_model = e_name_selector_model_new (); + priv->sections = g_array_new (FALSE, FALSE, sizeof (Section)); + + setup_name_selector_model (E_NAME_SELECTOR_DIALOG (object)); + + /* Create source menu */ + + extension_name = E_SOURCE_EXTENSION_ADDRESS_BOOK; + source_combo = e_source_combo_box_new (priv->registry, extension_name); + g_signal_connect_swapped ( + source_combo, "changed", + G_CALLBACK (source_changed), object); + + source_changed (E_NAME_SELECTOR_DIALOG (object), E_SOURCE_COMBO_BOX (source_combo)); + + gtk_label_set_mnemonic_widget (GTK_LABEL (AddressBookLabel), source_combo); + gtk_widget_show (source_combo); + gtk_widget_set_hexpand (source_combo, TRUE); + gtk_widget_set_halign (source_combo, GTK_ALIGN_FILL); + gtk_container_add (GTK_CONTAINER (source_menu_hgrid), source_combo); + + name_selector_dialog_populate_categories ( + E_NAME_SELECTOR_DIALOG (object)); + + /* Set up search-as-you-type signal */ + + g_signal_connect_swapped ( + search, "changed", + G_CALLBACK (search_changed), object); + + /* Display initial source */ + + source = e_source_registry_ref_default_address_book (priv->registry); + e_source_combo_box_set_active ( + E_SOURCE_COMBO_BOX (source_combo), source); + g_object_unref (source); + + /* Set up dialog defaults */ + + gtk_dialog_add_buttons ( + GTK_DIALOG (object), + GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, + NULL); + + /* Try to figure out a sane default size for the dialog. We used to hard + * code this to 512 so keep using 512 if the screen is big enough, + * otherwise use -1 (use as little as possible, use the + * GtkScrolledWindow's scrollbars). + * + * This should allow scrolling on tiny netbook resolutions and let + * others see as much of the dialog as possible. + * + * 600 pixels seems to be a good lower bound resolution to allow room + * above or below for other UI (window manager's?) + */ + gtk_window_set_default_size ( + GTK_WINDOW (object), 700, + gdk_screen_height () >= 600 ? 512 : -1); + + gtk_dialog_set_default_response ( + GTK_DIALOG (object), GTK_RESPONSE_CLOSE); + gtk_window_set_modal (GTK_WINDOW (object), TRUE); + gtk_window_set_resizable (GTK_WINDOW (object), TRUE); + gtk_container_set_border_width (GTK_CONTAINER (object), 4); + gtk_window_set_title ( + GTK_WINDOW (object), + _("Select Contacts from Address Book")); + gtk_widget_grab_focus (search); + + e_extensible_load_extensions (E_EXTENSIBLE (object)); +} + +static void +e_name_selector_dialog_class_init (ENameSelectorDialogClass *class) +{ + GObjectClass *object_class; + + g_type_class_add_private (class, sizeof (ENameSelectorDialogPrivate)); + + object_class = G_OBJECT_CLASS (class); + object_class->set_property = name_selector_dialog_set_property; + object_class->get_property = name_selector_dialog_get_property; + object_class->dispose = name_selector_dialog_dispose; + object_class->finalize = name_selector_dialog_finalize; + object_class->constructed = name_selector_dialog_constructed; + + g_object_class_install_property ( + object_class, + PROP_REGISTRY, + g_param_spec_object ( + "registry", + "Registry", + "Data source registry", + E_TYPE_SOURCE_REGISTRY, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_STRINGS)); +} + +static void +e_name_selector_dialog_init (ENameSelectorDialog *name_selector_dialog) +{ + name_selector_dialog->priv = + E_NAME_SELECTOR_DIALOG_GET_PRIVATE (name_selector_dialog); +} + +/** + * e_name_selector_dialog_new: + * @registry: an #ESourceRegistry + * + * Creates a new #ENameSelectorDialog. + * + * Returns: A new #ENameSelectorDialog. + **/ +ENameSelectorDialog * +e_name_selector_dialog_new (ESourceRegistry *registry) +{ + g_return_val_if_fail (E_IS_SOURCE_REGISTRY (registry), NULL); + + return g_object_new ( + E_TYPE_NAME_SELECTOR_DIALOG, + "registry", registry, NULL); +} + +/** + * e_name_selector_dialog_get_registry: + * @name_selector_dialog: an #ENameSelectorDialog + * + * Returns the #ESourceRegistry that was passed to + * e_name_selector_dialog_new(). + * + * Returns: the #ESourceRegistry + * + * Since: 3.6 + **/ +ESourceRegistry * +e_name_selector_dialog_get_registry (ENameSelectorDialog *name_selector_dialog) +{ + g_return_val_if_fail ( + E_IS_NAME_SELECTOR_DIALOG (name_selector_dialog), NULL); + + return name_selector_dialog->priv->registry; +} + +/* --------- * + * Utilities * + * --------- */ + +static gchar * +escape_sexp_string (const gchar *string) +{ + GString *gstring; + gchar *encoded_string; + + gstring = g_string_new (""); + e_sexp_encode_string (gstring, string); + + encoded_string = gstring->str; + g_string_free (gstring, FALSE); + + return encoded_string; +} + +static void +sort_iter_to_contact_store_iter (ENameSelectorDialog *name_selector_dialog, + GtkTreeIter *iter, + gint *email_n) +{ + ETreeModelGenerator *contact_filter; + GtkTreeIter child_iter; + gint email_n_local; + + contact_filter = e_name_selector_model_peek_contact_filter ( + name_selector_dialog->priv->name_selector_model); + + gtk_tree_model_sort_convert_iter_to_child_iter ( + name_selector_dialog->priv->contact_sort, &child_iter, iter); + e_tree_model_generator_convert_iter_to_child_iter ( + contact_filter, iter, &email_n_local, &child_iter); + + if (email_n) + *email_n = email_n_local; +} + +static void +add_destination (ENameSelectorModel *name_selector_model, + EDestinationStore *destination_store, + EContact *contact, + gint email_n, + EBookClient *client) +{ + EDestination *destination; + GList *email_list, *nth; + + /* get the correct index of an email in the contact */ + email_list = e_name_selector_model_get_contact_emails_without_used (name_selector_model, contact, FALSE); + while (nth = g_list_nth (email_list, email_n), nth && nth->data == NULL) { + email_n++; + } + e_name_selector_model_free_emails_list (email_list); + + /* Transfer (actually, copy into a destination and let the model filter out the + * source automatically) */ + + destination = e_destination_new (); + e_destination_set_contact (destination, contact, email_n); + if (client) + e_destination_set_client (destination, client); + e_destination_store_append_destination (destination_store, destination); + g_object_unref (destination); +} + +static void +remove_books (ENameSelectorDialog *name_selector_dialog) +{ + EContactStore *contact_store; + GSList *clients, *l; + + if (!name_selector_dialog->priv->name_selector_model) + return; + + contact_store = e_name_selector_model_peek_contact_store ( + name_selector_dialog->priv->name_selector_model); + + /* Remove books (should be just one) being viewed */ + clients = e_contact_store_get_clients (contact_store); + for (l = clients; l; l = g_slist_next (l)) { + EBookClient *client = l->data; + e_contact_store_remove_client (contact_store, client); + } + g_slist_free (clients); + + /* See if we have a book pending; stop loading it if so */ + if (name_selector_dialog->priv->cancellable != NULL) { + g_cancellable_cancel (name_selector_dialog->priv->cancellable); + g_object_unref (name_selector_dialog->priv->cancellable); + name_selector_dialog->priv->cancellable = NULL; + } +} + +/* ------------------ * + * Section management * + * ------------------ */ + +static gint +find_section_by_transfer_button (ENameSelectorDialog *name_selector_dialog, + GtkButton *transfer_button) +{ + gint i; + + for (i = 0; i < name_selector_dialog->priv->sections->len; i++) { + Section *section = &g_array_index ( + name_selector_dialog->priv->sections, Section, i); + + if (section->transfer_button == transfer_button) + return i; + } + + return -1; +} + +static gint +find_section_by_tree_view (ENameSelectorDialog *name_selector_dialog, + GtkTreeView *tree_view) +{ + gint i; + + for (i = 0; i < name_selector_dialog->priv->sections->len; i++) { + Section *section = &g_array_index ( + name_selector_dialog->priv->sections, Section, i); + + if (section->destination_view == tree_view) + return i; + } + + return -1; +} + +static gint +find_section_by_name (ENameSelectorDialog *name_selector_dialog, + const gchar *name) +{ + gint i; + + for (i = 0; i < name_selector_dialog->priv->sections->len; i++) { + Section *section = &g_array_index ( + name_selector_dialog->priv->sections, Section, i); + + if (!strcmp (name, section->name)) + return i; + } + + return -1; +} + +static void +selection_changed (GtkTreeSelection *selection, + SelData *data) +{ + GtkTreeSelection *contact_selection; + gboolean have_selection = FALSE; + + contact_selection = gtk_tree_view_get_selection (data->view); + if (gtk_tree_selection_count_selected_rows (contact_selection) > 0) + have_selection = TRUE; + gtk_widget_set_sensitive (GTK_WIDGET (data->button), have_selection); +} + +static GtkTreeView * +make_tree_view_for_section (ENameSelectorDialog *name_selector_dialog, + EDestinationStore *destination_store) +{ + GtkTreeView *tree_view; + GtkTreeViewColumn *column; + GtkCellRenderer *cell_renderer; + + tree_view = GTK_TREE_VIEW (gtk_tree_view_new ()); + + column = gtk_tree_view_column_new (); + cell_renderer = GTK_CELL_RENDERER (gtk_cell_renderer_text_new ()); + gtk_tree_view_column_pack_start (column, cell_renderer, TRUE); + gtk_tree_view_column_set_cell_data_func ( + column, cell_renderer, + (GtkTreeCellDataFunc) destination_column_formatter, + name_selector_dialog, NULL); + gtk_tree_view_append_column (tree_view, column); + gtk_tree_view_set_headers_visible (tree_view, FALSE); + gtk_tree_view_set_model (tree_view, GTK_TREE_MODEL (destination_store)); + + return tree_view; +} + +static void +setup_section_button (ENameSelectorDialog *name_selector_dialog, + GtkButton *button, + double halign, + const gchar *label_text, + const gchar *icon_name, + gboolean icon_before_label) +{ + GtkWidget *alignment; + GtkWidget *hgrid; + GtkWidget *label; + GtkWidget *image; + + gtk_size_group_add_widget ( + name_selector_dialog->priv->button_size_group, + GTK_WIDGET (button)); + + alignment = gtk_alignment_new (halign, 0.5, 0.0, 0.0); + gtk_container_add (GTK_CONTAINER (button), GTK_WIDGET (alignment)); + + hgrid = g_object_new (GTK_TYPE_GRID, + "orientation", GTK_ORIENTATION_HORIZONTAL, + "row-homogeneous", FALSE, + "column-spacing", 2, + NULL); + gtk_widget_show (hgrid); + gtk_container_add (GTK_CONTAINER (alignment), hgrid); + + label = gtk_label_new_with_mnemonic (label_text); + gtk_widget_show (label); + + image = gtk_image_new_from_stock (icon_name, GTK_ICON_SIZE_BUTTON); + gtk_widget_show (image); + + if (icon_before_label) { + gtk_container_add (GTK_CONTAINER (hgrid), image); + gtk_container_add (GTK_CONTAINER (hgrid), label); + } else { + gtk_container_add (GTK_CONTAINER (hgrid), label); + gtk_container_add (GTK_CONTAINER (hgrid), image); + } +} + +static gint +add_section (ENameSelectorDialog *name_selector_dialog, + const gchar *name, + const gchar *pretty_name, + EDestinationStore *destination_store) +{ + ENameSelectorDialogPrivate *priv; + Section section; + GtkWidget *vgrid; + GtkWidget *alignment; + GtkWidget *scrollwin; + SelData *data; + GtkTreeSelection *selection; + gchar *text; + GtkWidget *hgrid; + + g_assert (name != NULL); + g_assert (pretty_name != NULL); + g_assert (E_IS_DESTINATION_STORE (destination_store)); + + priv = E_NAME_SELECTOR_DIALOG_GET_PRIVATE (name_selector_dialog); + + memset (§ion, 0, sizeof (Section)); + + section.name = g_strdup (name); + section.section_grid = g_object_new (GTK_TYPE_GRID, + "orientation", GTK_ORIENTATION_HORIZONTAL, + "row-homogeneous", FALSE, + "column-spacing", 12, + "vexpand", TRUE, + "valign", GTK_ALIGN_FILL, + NULL); + section.label = GTK_LABEL (gtk_label_new_with_mnemonic (pretty_name)); + section.transfer_button = GTK_BUTTON (gtk_button_new ()); + section.remove_button = GTK_BUTTON (gtk_button_new ()); + section.destination_view = make_tree_view_for_section (name_selector_dialog, destination_store); + + gtk_label_set_mnemonic_widget (GTK_LABEL (section.label), GTK_WIDGET (section.destination_view)); + + if (pango_parse_markup (pretty_name, -1, '_', NULL, + &text, NULL, NULL)) { + atk_object_set_name (gtk_widget_get_accessible ( + GTK_WIDGET (section.destination_view)), text); + g_free (text); + } + + /* Set up transfer button */ + g_signal_connect_swapped ( + section.transfer_button, "clicked", + G_CALLBACK (transfer_button_clicked), name_selector_dialog); + + /*data for the remove callback*/ + data = g_malloc0 (sizeof (SelData)); + data->view = section.destination_view; + data->dlg_ptr = name_selector_dialog; + + /*Associate to an object destroy so that it gets freed*/ + g_object_set_data_full ((GObject *) section.destination_view, "sel-remove-data", data, g_free); + + g_signal_connect ( + section.remove_button, "clicked", + G_CALLBACK (remove_button_clicked), data); + + /* Alignment and vgrid for the add/remove buttons */ + + alignment = gtk_alignment_new (0.5, 0.0, 0.0, 0.0); + gtk_container_add (GTK_CONTAINER (section.section_grid), alignment); + + vgrid = g_object_new (GTK_TYPE_GRID, + "orientation", GTK_ORIENTATION_VERTICAL, + "column-homogeneous", TRUE, + "row-spacing", 6, + NULL); + + gtk_container_add (GTK_CONTAINER (alignment), vgrid); + + /* "Add" button */ + gtk_container_add (GTK_CONTAINER (vgrid), GTK_WIDGET (section.transfer_button)); + setup_section_button (name_selector_dialog, section.transfer_button, 0.7, _("_Add"), "gtk-go-forward", FALSE); + + /* "Remove" button */ + gtk_container_add (GTK_CONTAINER (vgrid), GTK_WIDGET (section.remove_button)); + setup_section_button (name_selector_dialog, section.remove_button, 0.5, _("_Remove"), "gtk-go-back", TRUE); + gtk_widget_set_sensitive (GTK_WIDGET (section.remove_button), FALSE); + + /* hgrid for label and scrolled window. This is a separate hgrid, instead + * of just using the section.section_grid directly, as it has a different + * spacing. + */ + + hgrid = g_object_new (GTK_TYPE_GRID, + "orientation", GTK_ORIENTATION_HORIZONTAL, + "row-homogeneous", FALSE, + "column-spacing", 6, + "vexpand", TRUE, + "valign", GTK_ALIGN_FILL, + NULL); + gtk_container_add (GTK_CONTAINER (section.section_grid), hgrid); + + /* Title label */ + + gtk_size_group_add_widget (priv->dest_label_size_group, GTK_WIDGET (section.label)); + + gtk_misc_set_alignment (GTK_MISC (section.label), 0.0, 0.0); + gtk_container_add (GTK_CONTAINER (hgrid), GTK_WIDGET (section.label)); + + /* Treeview in a scrolled window */ + scrollwin = gtk_scrolled_window_new (NULL, NULL); + gtk_container_add (GTK_CONTAINER (hgrid), scrollwin); + gtk_widget_set_hexpand (scrollwin, TRUE); + gtk_widget_set_halign (scrollwin, GTK_ALIGN_FILL); + gtk_widget_set_vexpand (scrollwin, TRUE); + gtk_widget_set_valign (scrollwin, GTK_ALIGN_FILL); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrollwin), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); + gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrollwin), GTK_SHADOW_IN); + gtk_container_add (GTK_CONTAINER (scrollwin), GTK_WIDGET (section.destination_view)); + + /*data for 'changed' callback*/ + data = g_malloc0 (sizeof (SelData)); + data->view = section.destination_view; + data->button = section.remove_button; + g_object_set_data_full ((GObject *) section.destination_view, "sel-change-data", data, g_free); + selection = gtk_tree_view_get_selection (section.destination_view); + gtk_tree_selection_set_mode (selection, GTK_SELECTION_MULTIPLE); + + g_signal_connect ( + selection, "changed", + G_CALLBACK (selection_changed), data); + + g_signal_connect_swapped ( + section.destination_view, "row-activated", + G_CALLBACK (destination_activated), name_selector_dialog); + g_signal_connect_swapped ( + section.destination_view, "key-press-event", + G_CALLBACK (destination_key_press), name_selector_dialog); + + /* Done! */ + + gtk_widget_show_all (GTK_WIDGET (section.section_grid)); + + /* Pack this section's box into the dialog */ + gtk_container_add (GTK_CONTAINER (name_selector_dialog->priv->destination_vgrid), GTK_WIDGET (section.section_grid)); + g_object_set (G_OBJECT (section.section_grid), + "vexpand", TRUE, + "valign", GTK_ALIGN_FILL, + NULL); + + g_array_append_val (name_selector_dialog->priv->sections, section); + + /* Make sure UI is consistent */ + contact_selection_changed (name_selector_dialog); + + return name_selector_dialog->priv->sections->len - 1; +} + +static void +free_section (ENameSelectorDialog *name_selector_dialog, + gint n) +{ + Section *section; + + g_assert (n >= 0); + g_assert (n < name_selector_dialog->priv->sections->len); + + section = &g_array_index ( + name_selector_dialog->priv->sections, Section, n); + + g_free (section->name); + gtk_widget_destroy (GTK_WIDGET (section->section_grid)); +} + +static void +model_section_added (ENameSelectorDialog *name_selector_dialog, + const gchar *name) +{ + gchar *pretty_name; + EDestinationStore *destination_store; + + e_name_selector_model_peek_section ( + name_selector_dialog->priv->name_selector_model, + name, &pretty_name, &destination_store); + add_section (name_selector_dialog, name, pretty_name, destination_store); + g_free (pretty_name); +} + +static void +model_section_removed (ENameSelectorDialog *name_selector_dialog, + const gchar *name) +{ + gint section_index; + + section_index = find_section_by_name (name_selector_dialog, name); + g_assert (section_index >= 0); + + free_section (name_selector_dialog, section_index); + g_array_remove_index ( + name_selector_dialog->priv->sections, section_index); +} + +/* -------------------- * + * Addressbook selector * + * -------------------- */ + +static void +view_progress (EBookClientView *view, + guint percent, + const gchar *message, + ENameSelectorDialog *dialog) +{ + if (message == NULL) + gtk_label_set_text (dialog->priv->status_label, ""); + else + gtk_label_set_text (dialog->priv->status_label, message); +} + +static void +view_complete (EBookClientView *view, + const GError *error, + ENameSelectorDialog *dialog) +{ + view_progress (view, -1, NULL, dialog); +} + +static void +start_client_view_cb (EContactStore *store, + EBookClientView *client_view, + ENameSelectorDialog *name_selector_dialog) +{ + g_signal_connect ( + client_view, "progress", + G_CALLBACK (view_progress), name_selector_dialog); + + g_signal_connect ( + client_view, "complete", + G_CALLBACK (view_complete), name_selector_dialog); +} + +static void +stop_client_view_cb (EContactStore *store, + EBookClientView *client_view, + ENameSelectorDialog *name_selector_dialog) +{ + g_signal_handlers_disconnect_by_func (client_view, view_progress, name_selector_dialog); + g_signal_handlers_disconnect_by_func (client_view, view_complete, name_selector_dialog); +} + +static void +book_loaded_cb (GObject *source_object, + GAsyncResult *result, + gpointer user_data) +{ + ENameSelectorDialog *name_selector_dialog = user_data; + EClient *client = NULL; + EBookClient *book_client; + EContactStore *store; + ENameSelectorModel *model; + GError *error = NULL; + + e_client_utils_open_new_finish (E_SOURCE (source_object), result, &client, &error); + + if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) { + g_warn_if_fail (client == NULL); + g_error_free (error); + goto exit; + } + + if (error != NULL) { + gchar *message; + + message = g_strdup_printf ( + _("Error loading address book: %s"), error->message); + gtk_label_set_text ( + name_selector_dialog->priv->status_label, message); + g_free (message); + + g_warn_if_fail (client == NULL); + g_error_free (error); + goto exit; + } + + book_client = E_BOOK_CLIENT (client); + if (!book_client) { + g_warn_if_fail (book_client != NULL); + goto exit; + } + + model = name_selector_dialog->priv->name_selector_model; + store = e_name_selector_model_peek_contact_store (model); + e_contact_store_add_client (store, book_client); + g_object_unref (book_client); + + exit: + g_object_unref (name_selector_dialog); +} + +static void +source_changed (ENameSelectorDialog *name_selector_dialog, + ESourceComboBox *source_combo_box) +{ + GCancellable *cancellable; + ESource *source; + gpointer parent; + + source = e_source_combo_box_ref_active (source_combo_box); + + parent = gtk_widget_get_toplevel (GTK_WIDGET (name_selector_dialog)); + parent = gtk_widget_is_toplevel (parent) ? parent : NULL; + + /* Remove any previous books being shown or loaded */ + remove_books (name_selector_dialog); + + if (source == NULL) + return; + + cancellable = g_cancellable_new (); + name_selector_dialog->priv->cancellable = cancellable; + + /* Start loading selected book */ + e_client_utils_open_new ( + source, E_CLIENT_SOURCE_TYPE_CONTACTS, TRUE, cancellable, + book_loaded_cb, g_object_ref (name_selector_dialog)); + + g_object_unref (source); +} + +/* --------------- * + * Other UI events * + * --------------- */ + +static void +search_changed (ENameSelectorDialog *name_selector_dialog) +{ + ENameSelectorDialogPrivate *priv = E_NAME_SELECTOR_DIALOG_GET_PRIVATE (name_selector_dialog); + EContactStore *contact_store; + EBookQuery *book_query; + GtkWidget *combo_box; + const gchar *text; + gchar *text_escaped; + gchar *query_string; + gchar *category; + gchar *category_escaped; + gchar *user_fields_str; + + combo_box = priv->category_combobox; + if (gtk_combo_box_get_active (GTK_COMBO_BOX (combo_box)) == -1) + gtk_combo_box_set_active (GTK_COMBO_BOX (combo_box), 0); + + category = gtk_combo_box_text_get_active_text (GTK_COMBO_BOX_TEXT (combo_box)); + category_escaped = escape_sexp_string (category); + + text = gtk_entry_get_text (name_selector_dialog->priv->search_entry); + text_escaped = escape_sexp_string (text); + + user_fields_str = ens_util_populate_user_query_fields (priv->user_query_fields, text, text_escaped); + + if (g_strcmp0 (category, _("Any Category")) == 0) + query_string = g_strdup_printf ( + "(or (beginswith \"file_as\" %s) " + " (beginswith \"full_name\" %s) " + " (beginswith \"email\" %s) " + " (beginswith \"nickname\" %s)%s))", + text_escaped, text_escaped, + text_escaped, text_escaped, + user_fields_str ? user_fields_str : ""); + else + query_string = g_strdup_printf ( + "(and (is \"category_list\" %s) " + "(or (beginswith \"file_as\" %s) " + " (beginswith \"full_name\" %s) " + " (beginswith \"email\" %s) " + " (beginswith \"nickname\" %s)%s))", + category_escaped, text_escaped, text_escaped, + text_escaped, text_escaped, + user_fields_str ? user_fields_str : ""); + + book_query = e_book_query_from_string (query_string); + + contact_store = e_name_selector_model_peek_contact_store ( + name_selector_dialog->priv->name_selector_model); + e_contact_store_set_query (contact_store, book_query); + e_book_query_unref (book_query); + + g_free (query_string); + g_free (text_escaped); + g_free (category_escaped); + g_free (category); + g_free (user_fields_str); +} + +static void +contact_selection_changed (ENameSelectorDialog *name_selector_dialog) +{ + GtkTreeSelection *contact_selection; + gboolean have_selection = FALSE; + gint i; + + contact_selection = gtk_tree_view_get_selection ( + name_selector_dialog->priv->contact_view); + if (gtk_tree_selection_count_selected_rows (contact_selection)) + have_selection = TRUE; + + for (i = 0; i < name_selector_dialog->priv->sections->len; i++) { + Section *section = &g_array_index ( + name_selector_dialog->priv->sections, Section, i); + gtk_widget_set_sensitive (GTK_WIDGET (section->transfer_button), have_selection); + } +} + +static void +contact_activated (ENameSelectorDialog *name_selector_dialog, + GtkTreePath *path) +{ + EContactStore *contact_store; + EDestinationStore *destination_store; + EContact *contact; + GtkTreeIter iter; + Section *section; + gint email_n; + + /* When a contact is activated, we transfer it to the first destination on our list */ + + contact_store = e_name_selector_model_peek_contact_store ( + name_selector_dialog->priv->name_selector_model); + + /* If we have no sections, we can't transfer */ + if (name_selector_dialog->priv->sections->len == 0) + return; + + /* Get the contact to be transferred */ + + if (!gtk_tree_model_get_iter ( + GTK_TREE_MODEL (name_selector_dialog->priv->contact_sort), + &iter, path)) + g_assert_not_reached (); + + sort_iter_to_contact_store_iter (name_selector_dialog, &iter, &email_n); + + contact = e_contact_store_get_contact (contact_store, &iter); + if (!contact) { + g_warning ("ENameSelectorDialog could not get selected contact!"); + return; + } + + section = &g_array_index ( + name_selector_dialog->priv->sections, + Section, name_selector_dialog->priv->destination_index); + if (!e_name_selector_model_peek_section ( + name_selector_dialog->priv->name_selector_model, + section->name, NULL, &destination_store)) { + g_warning ("ENameSelectorDialog has a section unknown to the model!"); + return; + } + + add_destination ( + name_selector_dialog->priv->name_selector_model, + destination_store, contact, email_n, + e_contact_store_get_client (contact_store, &iter)); +} + +static void +destination_activated (ENameSelectorDialog *name_selector_dialog, + GtkTreePath *path, + GtkTreeViewColumn *column, + GtkTreeView *tree_view) +{ + gint section_index; + EDestinationStore *destination_store; + EDestination *destination; + Section *section; + GtkTreeIter iter; + + /* When a destination is activated, we remove it from the section */ + + section_index = find_section_by_tree_view ( + name_selector_dialog, tree_view); + if (section_index < 0) { + g_warning ("ENameSelectorDialog got activation from unknown view!"); + return; + } + + section = &g_array_index ( + name_selector_dialog->priv->sections, Section, section_index); + if (!e_name_selector_model_peek_section ( + name_selector_dialog->priv->name_selector_model, + section->name, NULL, &destination_store)) { + g_warning ("ENameSelectorDialog has a section unknown to the model!"); + return; + } + + if (!gtk_tree_model_get_iter ( + GTK_TREE_MODEL (destination_store), &iter, path)) + g_assert_not_reached (); + + destination = e_destination_store_get_destination ( + destination_store, &iter); + g_assert (destination); + + e_destination_store_remove_destination ( + destination_store, destination); +} + +static gboolean +remove_selection (ENameSelectorDialog *name_selector_dialog, + GtkTreeView *tree_view) +{ + gint section_index; + EDestinationStore *destination_store; + EDestination *destination; + Section *section; + GtkTreeSelection *selection; + GList *rows, *l; + + section_index = find_section_by_tree_view ( + name_selector_dialog, tree_view); + if (section_index < 0) { + g_warning ("ENameSelectorDialog got key press from unknown view!"); + return FALSE; + } + + section = &g_array_index ( + name_selector_dialog->priv->sections, Section, section_index); + if (!e_name_selector_model_peek_section ( + name_selector_dialog->priv->name_selector_model, + section->name, NULL, &destination_store)) { + g_warning ("ENameSelectorDialog has a section unknown to the model!"); + return FALSE; + } + + selection = gtk_tree_view_get_selection (tree_view); + if (!gtk_tree_selection_count_selected_rows (selection)) { + g_warning ("ENameSelectorDialog remove button clicked, but no selection!"); + return FALSE; + } + + rows = gtk_tree_selection_get_selected_rows (selection, NULL); + rows = g_list_reverse (rows); + + for (l = rows; l; l = g_list_next (l)) { + GtkTreeIter iter; + GtkTreePath *path = l->data; + + if (!gtk_tree_model_get_iter (GTK_TREE_MODEL (destination_store), + &iter, path)) + g_assert_not_reached (); + + gtk_tree_path_free (path); + + destination = e_destination_store_get_destination ( + destination_store, &iter); + g_assert (destination); + + e_destination_store_remove_destination ( + destination_store, destination); + } + g_list_free (rows); + + return TRUE; +} + +static void +remove_button_clicked (GtkButton *button, + SelData *data) +{ + GtkTreeView *view; + ENameSelectorDialog *name_selector_dialog; + + view = data->view; + name_selector_dialog = data->dlg_ptr; + remove_selection (name_selector_dialog, view); +} + +static gboolean +destination_key_press (ENameSelectorDialog *name_selector_dialog, + GdkEventKey *event, + GtkTreeView *tree_view) +{ + + /* we only care about DEL key */ + if (event->keyval != GDK_KEY_Delete) + return FALSE; + return remove_selection (name_selector_dialog, tree_view); + +} + +static void +transfer_button_clicked (ENameSelectorDialog *name_selector_dialog, + GtkButton *transfer_button) +{ + EContactStore *contact_store; + EDestinationStore *destination_store; + GtkTreeSelection *selection; + EContact *contact; + gint section_index; + Section *section; + gint email_n; + GList *rows, *l; + + /* Get the contact to be transferred */ + + contact_store = e_name_selector_model_peek_contact_store ( + name_selector_dialog->priv->name_selector_model); + selection = gtk_tree_view_get_selection ( + name_selector_dialog->priv->contact_view); + + if (!gtk_tree_selection_count_selected_rows (selection)) { + g_warning ("ENameSelectorDialog transfer button clicked, but no selection!"); + return; + } + + /* Get the target section */ + section_index = find_section_by_transfer_button ( + name_selector_dialog, transfer_button); + if (section_index < 0) { + g_warning ("ENameSelectorDialog got click from unknown button!"); + return; + } + + section = &g_array_index ( + name_selector_dialog->priv->sections, Section, section_index); + if (!e_name_selector_model_peek_section ( + name_selector_dialog->priv->name_selector_model, + section->name, NULL, &destination_store)) { + g_warning ("ENameSelectorDialog has a section unknown to the model!"); + return; + } + + rows = gtk_tree_selection_get_selected_rows (selection, NULL); + rows = g_list_reverse (rows); + + for (l = rows; l; l = g_list_next (l)) { + GtkTreeIter iter; + GtkTreePath *path = l->data; + + if (!gtk_tree_model_get_iter ( + GTK_TREE_MODEL (name_selector_dialog->priv->contact_sort), + &iter, path)) { + gtk_tree_path_free (path); + return; + } + + gtk_tree_path_free (path); + sort_iter_to_contact_store_iter (name_selector_dialog, &iter, &email_n); + + contact = e_contact_store_get_contact (contact_store, &iter); + if (!contact) { + g_warning ("ENameSelectorDialog could not get selected contact!"); + g_list_free (rows); + return; + } + + add_destination ( + name_selector_dialog->priv->name_selector_model, + destination_store, contact, email_n, + e_contact_store_get_client (contact_store, &iter)); + } + g_list_free (rows); +} + +/* --------------------- * + * Main model management * + * --------------------- */ + +static void +setup_name_selector_model (ENameSelectorDialog *name_selector_dialog) +{ + ETreeModelGenerator *contact_filter; + EContactStore *contact_store; + GList *new_sections; + GList *l; + + /* Create new destination sections in UI */ + + new_sections = e_name_selector_model_list_sections ( + name_selector_dialog->priv->name_selector_model); + + for (l = new_sections; l; l = g_list_next (l)) { + gchar *name = l->data; + gchar *pretty_name; + EDestinationStore *destination_store; + + e_name_selector_model_peek_section ( + name_selector_dialog->priv->name_selector_model, + name, &pretty_name, &destination_store); + + add_section (name_selector_dialog, name, pretty_name, destination_store); + + g_free (pretty_name); + g_free (name); + } + + g_list_free (new_sections); + + /* Connect to section add/remove signals */ + + g_signal_connect_swapped ( + name_selector_dialog->priv->name_selector_model, "section-added", + G_CALLBACK (model_section_added), name_selector_dialog); + g_signal_connect_swapped ( + name_selector_dialog->priv->name_selector_model, "section-removed", + G_CALLBACK (model_section_removed), name_selector_dialog); + + /* Get contact store and its filter wrapper */ + + contact_filter = e_name_selector_model_peek_contact_filter ( + name_selector_dialog->priv->name_selector_model); + + /* Create sorting model on top of filter, assign it to view */ + + name_selector_dialog->priv->contact_sort = GTK_TREE_MODEL_SORT ( + gtk_tree_model_sort_new_with_model (GTK_TREE_MODEL (contact_filter))); + + /* sort on full name as we display full name in name selector dialog */ + gtk_tree_sortable_set_sort_column_id ( + GTK_TREE_SORTABLE (name_selector_dialog->priv->contact_sort), + E_CONTACT_FULL_NAME, GTK_SORT_ASCENDING); + + gtk_tree_view_set_model ( + name_selector_dialog->priv->contact_view, + GTK_TREE_MODEL (name_selector_dialog->priv->contact_sort)); + + contact_store = e_name_selector_model_peek_contact_store (name_selector_dialog->priv->name_selector_model); + if (contact_store) { + g_signal_connect (contact_store, "start-client-view", G_CALLBACK (start_client_view_cb), name_selector_dialog); + g_signal_connect (contact_store, "stop-client-view", G_CALLBACK (stop_client_view_cb), name_selector_dialog); + } + + /* Make sure UI is consistent */ + + search_changed (name_selector_dialog); + contact_selection_changed (name_selector_dialog); +} + +static void +shutdown_name_selector_model (ENameSelectorDialog *name_selector_dialog) +{ + gint i; + + /* Rid UI of previous destination sections */ + + for (i = 0; i < name_selector_dialog->priv->sections->len; i++) + free_section (name_selector_dialog, i); + + g_array_set_size (name_selector_dialog->priv->sections, 0); + + /* Free sorting model */ + + if (name_selector_dialog->priv->contact_sort) { + g_object_unref (name_selector_dialog->priv->contact_sort); + name_selector_dialog->priv->contact_sort = NULL; + } + + /* Free backend model */ + + if (name_selector_dialog->priv->name_selector_model) { + EContactStore *contact_store; + + contact_store = e_name_selector_model_peek_contact_store (name_selector_dialog->priv->name_selector_model); + if (contact_store) { + g_signal_handlers_disconnect_by_func (contact_store, start_client_view_cb, name_selector_dialog); + g_signal_handlers_disconnect_by_func (contact_store, stop_client_view_cb, name_selector_dialog); + } + + g_signal_handlers_disconnect_matched ( + name_selector_dialog->priv->name_selector_model, + G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, name_selector_dialog); + + g_object_unref (name_selector_dialog->priv->name_selector_model); + name_selector_dialog->priv->name_selector_model = NULL; + } +} + +static void +contact_column_formatter (GtkTreeViewColumn *column, + GtkCellRenderer *cell, + GtkTreeModel *model, + GtkTreeIter *iter, + ENameSelectorDialog *name_selector_dialog) +{ + EContactStore *contact_store; + EContact *contact; + GtkTreeIter contact_store_iter; + GList *email_list; + gchar *string; + gchar *full_name_str; + gchar *email_str; + gint email_n; + + contact_store_iter = *iter; + sort_iter_to_contact_store_iter ( + name_selector_dialog, &contact_store_iter, &email_n); + + contact_store = e_name_selector_model_peek_contact_store ( + name_selector_dialog->priv->name_selector_model); + contact = e_contact_store_get_contact ( + contact_store, &contact_store_iter); + email_list = e_name_selector_model_get_contact_emails_without_used ( + name_selector_dialog->priv->name_selector_model, contact, TRUE); + email_str = g_list_nth_data (email_list, email_n); + full_name_str = e_contact_get (contact, E_CONTACT_FULL_NAME); + + if (e_contact_get (contact, E_CONTACT_IS_LIST)) { + if (!full_name_str) + full_name_str = e_contact_get (contact, E_CONTACT_FILE_AS); + string = g_strdup_printf ("%s", full_name_str ? full_name_str : "?"); + } else { + string = g_strdup_printf ( + "%s%s<%s>", full_name_str ? full_name_str : "", + full_name_str ? " " : "", + email_str ? email_str : ""); + } + + g_free (full_name_str); + e_name_selector_model_free_emails_list (email_list); + + g_object_set (cell, "text", string, NULL); + g_free (string); +} + +static void +destination_column_formatter (GtkTreeViewColumn *column, + GtkCellRenderer *cell, + GtkTreeModel *model, + GtkTreeIter *iter, + ENameSelectorDialog *name_selector_dialog) +{ + EDestinationStore *destination_store = E_DESTINATION_STORE (model); + EDestination *destination; + GString *buffer; + + destination = e_destination_store_get_destination (destination_store, iter); + g_assert (destination); + + buffer = g_string_new (e_destination_get_name (destination)); + + if (!e_destination_is_evolution_list (destination)) { + const gchar *email; + + email = e_destination_get_email (destination); + if (email == NULL || *email == '\0') + email = "?"; + g_string_append_printf (buffer, " <%s>", email); + } + + g_object_set (cell, "text", buffer->str, NULL); + g_string_free (buffer, TRUE); +} + +/* ----------------------- * + * ENameSelectorDialog API * + * ----------------------- */ + +/** + * e_name_selector_dialog_peek_model: + * @name_selector_dialog: an #ENameSelectorDialog + * + * Gets the #ENameSelectorModel used by @name_selector_model. + * + * Returns: The #ENameSelectorModel being used. + **/ +ENameSelectorModel * +e_name_selector_dialog_peek_model (ENameSelectorDialog *name_selector_dialog) +{ + g_return_val_if_fail (E_IS_NAME_SELECTOR_DIALOG (name_selector_dialog), NULL); + + return name_selector_dialog->priv->name_selector_model; +} + +/** + * e_name_selector_dialog_set_model: + * @name_selector_dialog: an #ENameSelectorDialog + * @model: an #ENameSelectorModel + * + * Sets the model being used by @name_selector_dialog to @model. + **/ +void +e_name_selector_dialog_set_model (ENameSelectorDialog *name_selector_dialog, + ENameSelectorModel *model) +{ + g_return_if_fail (E_IS_NAME_SELECTOR_DIALOG (name_selector_dialog)); + g_return_if_fail (E_IS_NAME_SELECTOR_MODEL (model)); + + if (model == name_selector_dialog->priv->name_selector_model) + return; + + shutdown_name_selector_model (name_selector_dialog); + name_selector_dialog->priv->name_selector_model = g_object_ref (model); + + setup_name_selector_model (name_selector_dialog); +} + +/** + * e_name_selector_dialog_set_destination_index: + * @name_selector_dialog: an #ENameSelectorDialog + * @index: index of the destination section, starting from 0. + * + * Sets the index number of the destination section. + **/ +void +e_name_selector_dialog_set_destination_index (ENameSelectorDialog *name_selector_dialog, + guint index) +{ + g_return_if_fail (E_IS_NAME_SELECTOR_DIALOG (name_selector_dialog)); + + if (index >= name_selector_dialog->priv->sections->len) + return; + + name_selector_dialog->priv->destination_index = index; +} + +/** + * e_name_selector_dialog_set_scrolling_policy: + * @name_selector_dialog: an #ENameSelectorDialog + * @hscrollbar_policy: scrolling policy for horizontal bar of the contacts window. + * @vscrollbar_policy: scrolling policy for vertical bar of the contacts window. + * + * Sets the scrolling policy for the contacts section. + * + * Since: 3.2 + **/ +void +e_name_selector_dialog_set_scrolling_policy (ENameSelectorDialog *name_selector_dialog, + GtkPolicyType hscrollbar_policy, + GtkPolicyType vscrollbar_policy) +{ + GtkScrolledWindow *win = GTK_SCROLLED_WINDOW (name_selector_dialog->priv->contact_window); + + gtk_scrolled_window_set_policy (win, hscrollbar_policy, vscrollbar_policy); +} + +/** + * e_name_selector_dialog_get_section_visible: + * @name_selector_dialog: an #ENameSelectorDialog + * @name: name of the section + * + * Returns: whether section named @name is visible in the dialog. + * + * Since: 3.8 + **/ +gboolean +e_name_selector_dialog_get_section_visible (ENameSelectorDialog *name_selector_dialog, + const gchar *name) +{ + Section *section; + gint index; + + g_return_val_if_fail (E_IS_NAME_SELECTOR_DIALOG (name_selector_dialog), FALSE); + g_return_val_if_fail (name != NULL, FALSE); + + index = find_section_by_name (name_selector_dialog, name); + g_return_val_if_fail (index != -1, FALSE); + + section = &g_array_index (name_selector_dialog->priv->sections, Section, index); + return gtk_widget_get_visible (GTK_WIDGET (section->section_grid)); +} + +/** + * e_name_selector_dialog_set_section_visible: + * @name_selector_dialog: an #ENameSelectorDialog + * @name: name of the section + * @visible: whether to show or hide the section + * + * Shows or hides section named @name in the dialog. + * + * Since: 3.8 + **/ +void +e_name_selector_dialog_set_section_visible (ENameSelectorDialog *name_selector_dialog, + const gchar *name, + gboolean visible) +{ + Section *section; + gint index; + + g_return_if_fail (E_IS_NAME_SELECTOR_DIALOG (name_selector_dialog)); + g_return_if_fail (name != NULL); + + index = find_section_by_name (name_selector_dialog, name); + g_return_if_fail (index != -1); + + section = &g_array_index (name_selector_dialog->priv->sections, Section, index); + + if (visible) + gtk_widget_show (GTK_WIDGET (section->section_grid)); + else + gtk_widget_hide (GTK_WIDGET (section->section_grid)); +} + diff --git a/e-util/e-name-selector-dialog.h b/e-util/e-name-selector-dialog.h new file mode 100644 index 0000000000..fe10544bb5 --- /dev/null +++ b/e-util/e-name-selector-dialog.h @@ -0,0 +1,100 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ + +/* e-name-selector-dialog.c - Dialog that lets user pick EDestinations. + * + * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU Lesser General Public + * License as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + * + * Authors: Hans Petter Jansson <hpj@novell.com> + */ + +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + +#ifndef E_NAME_SELECTOR_DIALOG_H +#define E_NAME_SELECTOR_DIALOG_H + +#include <gtk/gtk.h> +#include <libedataserver/libedataserver.h> + +#include <e-util/e-contact-store.h> +#include <e-util/e-name-selector-model.h> + +/* Standard GObject macros */ +#define E_TYPE_NAME_SELECTOR_DIALOG \ + (e_name_selector_dialog_get_type ()) +#define E_NAME_SELECTOR_DIALOG(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST \ + ((obj), E_TYPE_NAME_SELECTOR_DIALOG, ENameSelectorDialog)) +#define E_NAME_SELECTOR_DIALOG_CLASS(cls) \ + (G_TYPE_CHECK_CLASS_CAST \ + ((cls), E_TYPE_NAME_SELECTOR_DIALOG, ENameSelectorDialogClass)) +#define E_IS_NAME_SELECTOR_DIALOG(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE \ + (obj, E_TYPE_NAME_SELECTOR_DIALOG)) +#define E_IS_NAME_SELECTOR_DIALOG_CLASS(cls) \ + (G_TYPE_CHECK_CLASS_TYPE \ + ((cls), E_TYPE_NAME_SELECTOR_DIALOG)) +#define E_NAME_SELECTOR_DIALOG_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS \ + ((obj), E_TYPE_NAME_SELECTOR_DIALOG, ENameSelectorDialogClass)) + +G_BEGIN_DECLS + +typedef struct _ENameSelectorDialog ENameSelectorDialog; +typedef struct _ENameSelectorDialogClass ENameSelectorDialogClass; +typedef struct _ENameSelectorDialogPrivate ENameSelectorDialogPrivate; + +struct _ENameSelectorDialog { + GtkDialog parent; + ENameSelectorDialogPrivate *priv; +}; + +struct _ENameSelectorDialogClass { + GtkDialogClass parent_class; +}; + +GType e_name_selector_dialog_get_type (void); +ENameSelectorDialog * + e_name_selector_dialog_new (ESourceRegistry *registry); +ESourceRegistry * + e_name_selector_dialog_get_registry + (ENameSelectorDialog *name_selector_dialog); +ENameSelectorModel * + e_name_selector_dialog_peek_model + (ENameSelectorDialog *name_selector_dialog); +void e_name_selector_dialog_set_model + (ENameSelectorDialog *name_selector_dialog, + ENameSelectorModel *model); +void e_name_selector_dialog_set_destination_index + (ENameSelectorDialog *name_selector_dialog, + guint index); +void e_name_selector_dialog_set_scrolling_policy + (ENameSelectorDialog *name_selector_dialog, + GtkPolicyType hscrollbar_policy, + GtkPolicyType vscrollbar_policy); +gboolean e_name_selector_dialog_get_section_visible + (ENameSelectorDialog *name_selector_dialog, + const gchar *name); +void e_name_selector_dialog_set_section_visible + (ENameSelectorDialog *name_selector_dialog, + const gchar *name, + gboolean visible); + +G_END_DECLS + +#endif /* E_NAME_SELECTOR_DIALOG_H */ diff --git a/e-util/e-name-selector-entry.c b/e-util/e-name-selector-entry.c new file mode 100644 index 0000000000..ea7e2ef383 --- /dev/null +++ b/e-util/e-name-selector-entry.c @@ -0,0 +1,3541 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ + +/* e-name-selector-entry.c - Single-line text entry widget for EDestinations. + * + * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU Lesser General Public + * License as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + * + * Authors: Hans Petter Jansson <hpj@novell.com> + */ + +#include <config.h> +#include <string.h> +#include <glib/gi18n-lib.h> + +#include <camel/camel.h> +#include <libebackend/libebackend.h> + +#include "e-client-utils.h" +#include "e-name-selector-entry.h" + +#define E_NAME_SELECTOR_ENTRY_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE \ + ((obj), E_TYPE_NAME_SELECTOR_ENTRY, ENameSelectorEntryPrivate)) + +struct _ENameSelectorEntryPrivate { + + ESourceRegistry *registry; + gint minimum_query_length; + gboolean show_address; + + PangoAttrList *attr_list; + EContactStore *contact_store; + ETreeModelGenerator *email_generator; + EDestinationStore *destination_store; + GtkEntryCompletion *entry_completion; + + guint type_ahead_complete_cb_id; + guint update_completions_cb_id; + + EDestination *popup_destination; + + gpointer (*contact_editor_func) (EBookClient *, + EContact *, + gboolean, + gboolean); + gpointer (*contact_list_editor_func) + (EBookClient *, + EContact *, + gboolean, + gboolean); + + gboolean is_completing; + GSList *user_query_fields; + + /* For asynchronous operations. */ + GQueue cancellables; +}; + +enum { + PROP_0, + PROP_REGISTRY, + PROP_MINIMUM_QUERY_LENGTH, + PROP_SHOW_ADDRESS +}; + +enum { + UPDATED, + LAST_SIGNAL +}; + +static guint signals[LAST_SIGNAL] = { 0 }; +#define ENS_DEBUG(x) + +G_DEFINE_TYPE_WITH_CODE ( + ENameSelectorEntry, + e_name_selector_entry, + GTK_TYPE_ENTRY, + G_IMPLEMENT_INTERFACE ( + E_TYPE_EXTENSIBLE, NULL)) + +/* 1/3 of the second to wait until invoking autocomplete lookup */ +#define AUTOCOMPLETE_TIMEOUT 333 + +#define re_set_timeout(id,func,ptr) \ + if (id) \ + g_source_remove (id); \ + id = g_timeout_add (AUTOCOMPLETE_TIMEOUT, \ + (GSourceFunc) func, ptr); + +static void destination_row_inserted (ENameSelectorEntry *name_selector_entry, GtkTreePath *path, GtkTreeIter *iter); +static void destination_row_changed (ENameSelectorEntry *name_selector_entry, GtkTreePath *path, GtkTreeIter *iter); +static void destination_row_deleted (ENameSelectorEntry *name_selector_entry, GtkTreePath *path); + +static void user_insert_text (ENameSelectorEntry *name_selector_entry, gchar *new_text, gint new_text_length, gint *position, gpointer user_data); +static void user_delete_text (ENameSelectorEntry *name_selector_entry, gint start_pos, gint end_pos, gpointer user_data); + +static void setup_default_contact_store (ENameSelectorEntry *name_selector_entry); +static void deep_free_list (GList *list); + +static void +name_selector_entry_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) +{ + switch (property_id) { + case PROP_REGISTRY: + e_name_selector_entry_set_registry ( + E_NAME_SELECTOR_ENTRY (object), + g_value_get_object (value)); + return; + + case PROP_MINIMUM_QUERY_LENGTH: + e_name_selector_entry_set_minimum_query_length ( + E_NAME_SELECTOR_ENTRY (object), + g_value_get_int (value)); + return; + + case PROP_SHOW_ADDRESS: + e_name_selector_entry_set_show_address ( + E_NAME_SELECTOR_ENTRY (object), + g_value_get_boolean (value)); + return; + } + + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); +} + +static void +name_selector_entry_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) +{ + switch (property_id) { + case PROP_REGISTRY: + g_value_set_object ( + value, + e_name_selector_entry_get_registry ( + E_NAME_SELECTOR_ENTRY (object))); + return; + + case PROP_MINIMUM_QUERY_LENGTH: + g_value_set_int ( + value, + e_name_selector_entry_get_minimum_query_length ( + E_NAME_SELECTOR_ENTRY (object))); + return; + + case PROP_SHOW_ADDRESS: + g_value_set_boolean ( + value, + e_name_selector_entry_get_show_address ( + E_NAME_SELECTOR_ENTRY (object))); + return; + } + + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); +} + +static void +name_selector_entry_dispose (GObject *object) +{ + ENameSelectorEntryPrivate *priv; + + priv = E_NAME_SELECTOR_ENTRY_GET_PRIVATE (object); + + if (priv->registry != NULL) { + g_object_unref (priv->registry); + priv->registry = NULL; + } + + if (priv->attr_list != NULL) { + pango_attr_list_unref (priv->attr_list); + priv->attr_list = NULL; + } + + if (priv->entry_completion) { + g_object_unref (priv->entry_completion); + priv->entry_completion = NULL; + } + + if (priv->destination_store) { + g_object_unref (priv->destination_store); + priv->destination_store = NULL; + } + + if (priv->email_generator) { + g_object_unref (priv->email_generator); + priv->email_generator = NULL; + } + + if (priv->contact_store) { + g_object_unref (priv->contact_store); + priv->contact_store = NULL; + } + + g_slist_foreach (priv->user_query_fields, (GFunc) g_free, NULL); + g_slist_free (priv->user_query_fields); + priv->user_query_fields = NULL; + + /* Cancel any stuck book loading operations. */ + while (!g_queue_is_empty (&priv->cancellables)) { + GCancellable *cancellable; + + cancellable = g_queue_pop_head (&priv->cancellables); + g_cancellable_cancel (cancellable); + g_object_unref (cancellable); + } + + /* Chain up to parent's dispose() method. */ + G_OBJECT_CLASS (e_name_selector_entry_parent_class)->dispose (object); +} + +static void +name_selector_entry_constructed (GObject *object) +{ + /* Chain up to parent's constructed() method. */ + G_OBJECT_CLASS (e_name_selector_entry_parent_class)-> + constructed (object); + + e_extensible_load_extensions (E_EXTENSIBLE (object)); +} + +static void +name_selector_entry_realize (GtkWidget *widget) +{ + ENameSelectorEntryPrivate *priv; + + priv = E_NAME_SELECTOR_ENTRY_GET_PRIVATE (widget); + + /* Chain up to parent's realize() method. */ + GTK_WIDGET_CLASS (e_name_selector_entry_parent_class)->realize (widget); + + if (priv->contact_store == NULL) + setup_default_contact_store (E_NAME_SELECTOR_ENTRY (widget)); +} + +static void +name_selector_entry_drag_data_received (GtkWidget *widget, + GdkDragContext *context, + gint x, + gint y, + GtkSelectionData *selection_data, + guint info, + guint time) +{ + CamelInternetAddress *address; + gint n_addresses = 0; + gchar *text; + + address = camel_internet_address_new (); + text = (gchar *) gtk_selection_data_get_text (selection_data); + + /* See if Camel can parse a valid email address from the text. */ + if (text != NULL && *text != '\0') { + camel_url_decode (text); + if (g_ascii_strncasecmp (text, "mailto:", 7) == 0) + n_addresses = camel_address_decode ( + CAMEL_ADDRESS (address), text + 7); + else + n_addresses = camel_address_decode ( + CAMEL_ADDRESS (address), text); + } + + if (n_addresses > 0) { + GtkEditable *editable; + GdkDragAction action; + gboolean delete; + gint position; + + editable = GTK_EDITABLE (widget); + gtk_editable_set_position (editable, -1); + position = gtk_editable_get_position (editable); + + g_free (text); + + text = camel_address_format (CAMEL_ADDRESS (address)); + gtk_editable_insert_text (editable, text, -1, &position); + + action = gdk_drag_context_get_selected_action (context); + delete = (action == GDK_ACTION_MOVE); + gtk_drag_finish (context, TRUE, delete, time); + } + + g_object_unref (address); + g_free (text); + + if (n_addresses <= 0) + /* Chain up to parent's drag_data_received() method. */ + GTK_WIDGET_CLASS (e_name_selector_entry_parent_class)-> + drag_data_received ( + widget, context, x, y, + selection_data, info, time); +} + +static void +e_name_selector_entry_class_init (ENameSelectorEntryClass *class) +{ + GObjectClass *object_class; + GtkWidgetClass *widget_class; + + g_type_class_add_private (class, sizeof (ENameSelectorEntryPrivate)); + + object_class = G_OBJECT_CLASS (class); + object_class->set_property = name_selector_entry_set_property; + object_class->get_property = name_selector_entry_get_property; + object_class->dispose = name_selector_entry_dispose; + object_class->constructed = name_selector_entry_constructed; + + widget_class = GTK_WIDGET_CLASS (class); + widget_class->realize = name_selector_entry_realize; + widget_class->drag_data_received = name_selector_entry_drag_data_received; + + g_object_class_install_property ( + object_class, + PROP_REGISTRY, + g_param_spec_object ( + "registry", + "Registry", + "Data source registry", + E_TYPE_SOURCE_REGISTRY, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT | + G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property ( + object_class, + PROP_MINIMUM_QUERY_LENGTH, + g_param_spec_int ( + "minimum-query-length", + "Minimum Query Length", + NULL, + 1, G_MAXINT, + 3, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property ( + object_class, + PROP_SHOW_ADDRESS, + g_param_spec_boolean ( + "show-address", + "Show Address", + NULL, + FALSE, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); + + signals[UPDATED] = g_signal_new ( + "updated", + E_TYPE_NAME_SELECTOR_ENTRY, + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (ENameSelectorEntryClass, updated), + NULL, NULL, + g_cclosure_marshal_VOID__POINTER, + G_TYPE_NONE, 1, G_TYPE_POINTER); +} + +/* Remove unquoted commas and control characters from string */ +static gchar * +sanitize_string (const gchar *string) +{ + GString *gstring; + gboolean quoted = FALSE; + const gchar *p; + + gstring = g_string_new (""); + + if (!string) + return g_string_free (gstring, FALSE); + + for (p = string; *p; p = g_utf8_next_char (p)) { + gunichar c = g_utf8_get_char (p); + + if (c == '"') + quoted = ~quoted; + else if (c == ',' && !quoted) + continue; + else if (c == '\t' || c == '\n') + continue; + + g_string_append_unichar (gstring, c); + } + + return g_string_free (gstring, FALSE); +} + +/* Called for each list store entry whenever the user types (but not on cut/paste) */ +static gboolean +completion_match_cb (GtkEntryCompletion *completion, + const gchar *key, + GtkTreeIter *iter, + gpointer user_data) +{ + ENS_DEBUG (g_print ("completion_match_cb, key=%s\n", key)); + + return TRUE; +} + +/* Gets context of n_unichars total (n_unicars / 2, before and after position) + * and places them in array. If any positions would be outside the string, the + * corresponding unichars are set to zero. */ +static void +get_utf8_string_context (const gchar *string, + gint position, + gunichar *unichars, + gint n_unichars) +{ + gchar *p = NULL; + gint len; + gint gap; + gint i; + + /* n_unichars must be even */ + g_assert (n_unichars % 2 == 0); + + len = g_utf8_strlen (string, -1); + gap = n_unichars / 2; + + for (i = 0; i < n_unichars; i++) { + gint char_pos = position - gap + i; + + if (char_pos < 0 || char_pos >= len) { + unichars[i] = '\0'; + continue; + } + + if (p) + p = g_utf8_next_char (p); + else + p = g_utf8_offset_to_pointer (string, char_pos); + + unichars[i] = g_utf8_get_char (p); + } +} + +static gboolean +get_range_at_position (const gchar *string, + gint pos, + gint *start_pos, + gint *end_pos) +{ + const gchar *p; + gboolean quoted = FALSE; + gint local_start_pos = 0; + gint local_end_pos = 0; + gint i; + + if (!string || !*string) + return FALSE; + + for (p = string, i = 0; *p; p = g_utf8_next_char (p), i++) { + gunichar c = g_utf8_get_char (p); + + if (c == '"') { + quoted = ~quoted; + } else if (c == ',' && !quoted) { + if (i < pos) { + /* Start right after comma */ + local_start_pos = i + 1; + } else { + /* Stop right before comma */ + local_end_pos = i; + break; + } + } else if (c == ' ' && local_start_pos == i) { + /* Adjust start to skip space after first comma */ + local_start_pos++; + } + } + + /* If we didn't hit a comma, we must've hit NULL, and ours was the last element. */ + if (!local_end_pos) + local_end_pos = i; + + if (start_pos) + *start_pos = local_start_pos; + if (end_pos) + *end_pos = local_end_pos; + + return TRUE; +} + +static gboolean +is_quoted_at (const gchar *string, + gint pos) +{ + const gchar *p; + gboolean quoted = FALSE; + gint i; + + for (p = string, i = 0; *p && i < pos; p = g_utf8_next_char (p), i++) { + gunichar c = g_utf8_get_char (p); + + if (c == '"') + quoted = ~quoted; + } + + return quoted ? TRUE : FALSE; +} + +static gint +get_index_at_position (const gchar *string, + gint pos) +{ + const gchar *p; + gboolean quoted = FALSE; + gint n = 0; + gint i; + + for (p = string, i = 0; *p && i < pos; p = g_utf8_next_char (p), i++) { + gunichar c = g_utf8_get_char (p); + + if (c == '"') + quoted = ~quoted; + else if (c == ',' && !quoted) + n++; + } + + return n; +} + +static gboolean +get_range_by_index (const gchar *string, + gint index, + gint *start_pos, + gint *end_pos) +{ + const gchar *p; + gboolean quoted = FALSE; + gint i; + gint n = 0; + + for (p = string, i = 0; *p && n < index; p = g_utf8_next_char (p), i++) { + gunichar c = g_utf8_get_char (p); + + if (c == '"') + quoted = ~quoted; + if (c == ',' && !quoted) + n++; + } + + if (n < index) + return FALSE; + + return get_range_at_position (string, i, start_pos, end_pos); +} + +static gchar * +get_address_at_position (const gchar *string, + gint pos) +{ + gint start_pos; + gint end_pos; + const gchar *start_p; + const gchar *end_p; + + if (!get_range_at_position (string, pos, &start_pos, &end_pos)) + return NULL; + + start_p = g_utf8_offset_to_pointer (string, start_pos); + end_p = g_utf8_offset_to_pointer (string, end_pos); + + return g_strndup (start_p, end_p - start_p); +} + +/* Finds the destination in model */ +static EDestination * +find_destination_by_index (ENameSelectorEntry *name_selector_entry, + gint index) +{ + GtkTreePath *path; + GtkTreeIter iter; + + path = gtk_tree_path_new_from_indices (index, -1); + if (!gtk_tree_model_get_iter (GTK_TREE_MODEL (name_selector_entry->priv->destination_store), + &iter, path)) { + /* If we have zero destinations, getting a NULL destination at index 0 + * is valid. */ + if (index > 0) + g_warning ("ENameSelectorEntry is out of sync with model!"); + gtk_tree_path_free (path); + return NULL; + } + gtk_tree_path_free (path); + + return e_destination_store_get_destination (name_selector_entry->priv->destination_store, &iter); +} + +/* Finds the destination in model */ +static EDestination * +find_destination_at_position (ENameSelectorEntry *name_selector_entry, + gint pos) +{ + const gchar *text; + gint index; + + text = gtk_entry_get_text (GTK_ENTRY (name_selector_entry)); + index = get_index_at_position (text, pos); + + return find_destination_by_index (name_selector_entry, index); +} + +/* Builds destination from our text */ +static EDestination * +build_destination_at_position (const gchar *string, + gint pos) +{ + EDestination *destination; + gchar *address; + + address = get_address_at_position (string, pos); + if (!address) + return NULL; + + destination = e_destination_new (); + e_destination_set_raw (destination, address); + + g_free (address); + return destination; +} + +static gchar * +name_style_query (const gchar *field, + const gchar *value) +{ + gchar *spaced_str; + gchar *comma_str; + GString *out = g_string_new (""); + gchar **strv; + gchar *query; + + spaced_str = sanitize_string (value); + g_strstrip (spaced_str); + + strv = g_strsplit (spaced_str, " ", 0); + + if (strv[0] && strv[1]) { + g_string_append (out, "(or "); + comma_str = g_strjoinv (", ", strv); + } else { + comma_str = NULL; + } + + g_string_append (out, " (beginswith "); + e_sexp_encode_string (out, field); + e_sexp_encode_string (out, spaced_str); + g_string_append (out, ")"); + + if (comma_str) { + g_string_append (out, " (beginswith "); + + e_sexp_encode_string (out, field); + g_strstrip (comma_str); + e_sexp_encode_string (out, comma_str); + g_string_append (out, "))"); + } + + query = g_string_free (out, FALSE); + + g_free (spaced_str); + g_free (comma_str); + g_strfreev (strv); + + return query; +} + +static gchar * +escape_sexp_string (const gchar *string) +{ + GString *gstring; + gchar *encoded_string; + + gstring = g_string_new (""); + e_sexp_encode_string (gstring, string); + + encoded_string = gstring->str; + g_string_free (gstring, FALSE); + + return encoded_string; +} + +/** + * ens_util_populate_user_query_fields: + * + * Populates list of user query fields to string usable in query string. + * Returned pointer is either newly allocated string, supposed to be freed with g_free, + * or NULL if no fields defined. + * + * Since: 2.24 + **/ +gchar * +ens_util_populate_user_query_fields (GSList *user_query_fields, + const gchar *cue_str, + const gchar *encoded_cue_str) +{ + GString *user_fields; + GSList *s; + + g_return_val_if_fail (cue_str != NULL, NULL); + g_return_val_if_fail (encoded_cue_str != NULL, NULL); + + user_fields = g_string_new (""); + + for (s = user_query_fields; s; s = s->next) { + const gchar *field = s->data; + + if (!field || !*field) + continue; + + if (*field == '$') { + g_string_append_printf (user_fields, " (beginswith \"%s\" %s) ", field + 1, encoded_cue_str); + } else if (*field == '@') { + g_string_append_printf (user_fields, " (is \"%s\" %s) ", field + 1, encoded_cue_str); + } else { + gchar *tmp = name_style_query (field, cue_str); + + g_string_append (user_fields, " "); + g_string_append (user_fields, tmp); + g_string_append (user_fields, " "); + g_free (tmp); + } + } + + return g_string_free (user_fields, !user_fields->str || !*user_fields->str); +} + +static void +set_completion_query (ENameSelectorEntry *name_selector_entry, + const gchar *cue_str) +{ + ENameSelectorEntryPrivate *priv; + EBookQuery *book_query; + gchar *query_str; + gchar *encoded_cue_str; + gchar *full_name_query_str; + gchar *file_as_query_str; + gchar *user_fields_str; + + priv = E_NAME_SELECTOR_ENTRY_GET_PRIVATE (name_selector_entry); + + if (!name_selector_entry->priv->contact_store) + return; + + if (!cue_str) { + /* Clear the store */ + e_contact_store_set_query (name_selector_entry->priv->contact_store, NULL); + return; + } + + encoded_cue_str = escape_sexp_string (cue_str); + full_name_query_str = name_style_query ("full_name", cue_str); + file_as_query_str = name_style_query ("file_as", cue_str); + user_fields_str = ens_util_populate_user_query_fields (priv->user_query_fields, cue_str, encoded_cue_str); + + query_str = g_strdup_printf ( + "(or " + " (beginswith \"nickname\" %s) " + " (beginswith \"email\" %s) " + " %s " + " %s " + " %s " + ")", + encoded_cue_str, encoded_cue_str, + full_name_query_str, file_as_query_str, + user_fields_str ? user_fields_str : ""); + + g_free (user_fields_str); + g_free (file_as_query_str); + g_free (full_name_query_str); + g_free (encoded_cue_str); + + ENS_DEBUG (g_print ("%s\n", query_str)); + + book_query = e_book_query_from_string (query_str); + e_contact_store_set_query (name_selector_entry->priv->contact_store, book_query); + e_book_query_unref (book_query); + + g_free (query_str); +} + +static gchar * +get_entry_substring (ENameSelectorEntry *name_selector_entry, + gint range_start, + gint range_end) +{ + const gchar *entry_text; + gchar *p0, *p1; + + entry_text = gtk_entry_get_text (GTK_ENTRY (name_selector_entry)); + + p0 = g_utf8_offset_to_pointer (entry_text, range_start); + p1 = g_utf8_offset_to_pointer (entry_text, range_end); + + return g_strndup (p0, p1 - p0); +} + +static gint +utf8_casefold_collate_len (const gchar *str1, + const gchar *str2, + gint len) +{ + gchar *s1 = g_utf8_casefold (str1, len); + gchar *s2 = g_utf8_casefold (str2, len); + gint rv; + + rv = g_utf8_collate (s1, s2); + + g_free (s1); + g_free (s2); + + return rv; +} + +static gchar * +build_textrep_for_contact (EContact *contact, + EContactField cue_field) +{ + gchar *name = NULL; + gchar *email = NULL; + gchar *textrep; + + switch (cue_field) { + case E_CONTACT_FULL_NAME: + case E_CONTACT_NICKNAME: + case E_CONTACT_FILE_AS: + name = e_contact_get (contact, cue_field); + email = e_contact_get (contact, E_CONTACT_EMAIL_1); + break; + + case E_CONTACT_EMAIL_1: + case E_CONTACT_EMAIL_2: + case E_CONTACT_EMAIL_3: + case E_CONTACT_EMAIL_4: + name = NULL; + email = e_contact_get (contact, cue_field); + break; + + default: + g_assert_not_reached (); + break; + } + + g_assert (email); + g_assert (strlen (email) > 0); + + if (name) + textrep = g_strdup_printf ("%s <%s>", name, email); + else + textrep = g_strdup_printf ("%s", email); + + g_free (name); + g_free (email); + return textrep; +} + +static gboolean +contact_match_cue (ENameSelectorEntry *name_selector_entry, + EContact *contact, + const gchar *cue_str, + EContactField *matched_field, + gint *matched_field_rank) +{ + EContactField fields[] = { E_CONTACT_FULL_NAME, E_CONTACT_NICKNAME, E_CONTACT_FILE_AS, + E_CONTACT_EMAIL_1, E_CONTACT_EMAIL_2, E_CONTACT_EMAIL_3, + E_CONTACT_EMAIL_4 }; + gchar *email; + gboolean result = FALSE; + gint cue_len; + gint i; + + g_assert (contact); + g_assert (cue_str); + + if (g_utf8_strlen (cue_str, -1) < name_selector_entry->priv->minimum_query_length) + return FALSE; + + cue_len = strlen (cue_str); + + /* Make sure contact has an email address */ + email = e_contact_get (contact, E_CONTACT_EMAIL_1); + if (!email || !*email) { + g_free (email); + return FALSE; + } + g_free (email); + + for (i = 0; i < G_N_ELEMENTS (fields); i++) { + gchar *value; + gchar *value_sane; + + /* Don't match e-mail addresses in contact lists */ + if (e_contact_get (contact, E_CONTACT_IS_LIST) && + fields[i] >= E_CONTACT_FIRST_EMAIL_ID && + fields[i] <= E_CONTACT_LAST_EMAIL_ID) + continue; + + value = e_contact_get (contact, fields[i]); + if (!value) + continue; + + value_sane = sanitize_string (value); + g_free (value); + + ENS_DEBUG (g_print ("Comparing '%s' to '%s'\n", value, cue_str)); + + if (!utf8_casefold_collate_len (value_sane, cue_str, cue_len)) { + if (matched_field) + *matched_field = fields [i]; + if (matched_field_rank) + *matched_field_rank = i; + + result = TRUE; + g_free (value_sane); + break; + } + g_free (value_sane); + } + + return result; +} + +static gboolean +find_existing_completion (ENameSelectorEntry *name_selector_entry, + const gchar *cue_str, + EContact **contact, + gchar **text, + EContactField *matched_field, + EBookClient **book_client) +{ + GtkTreeIter iter; + EContact *best_contact = NULL; + gint best_field_rank = G_MAXINT; + EContactField best_field = 0; + EBookClient *best_book_client = NULL; + + g_assert (cue_str); + + if (!name_selector_entry->priv->contact_store) + return FALSE; + + ENS_DEBUG (g_print ("Completing '%s'\n", cue_str)); + + if (!gtk_tree_model_get_iter_first (GTK_TREE_MODEL (name_selector_entry->priv->contact_store), &iter)) + return FALSE; + + do { + EContact *current_contact; + gint current_field_rank; + EContactField current_field; + gboolean matches; + + current_contact = e_contact_store_get_contact (name_selector_entry->priv->contact_store, &iter); + if (!current_contact) + continue; + + matches = contact_match_cue (name_selector_entry, current_contact, cue_str, ¤t_field, ¤t_field_rank); + if (matches && current_field_rank < best_field_rank) { + best_contact = current_contact; + best_field_rank = current_field_rank; + best_field = current_field; + best_book_client = e_contact_store_get_client (name_selector_entry->priv->contact_store, &iter); + } + } while (gtk_tree_model_iter_next (GTK_TREE_MODEL (name_selector_entry->priv->contact_store), &iter)); + + if (!best_contact) + return FALSE; + + if (contact) + *contact = best_contact; + if (text) + *text = build_textrep_for_contact (best_contact, best_field); + if (matched_field) + *matched_field = best_field; + if (book_client) + *book_client = best_book_client; + + return TRUE; +} + +static void +generate_attribute_list (ENameSelectorEntry *name_selector_entry) +{ + PangoLayout *layout; + PangoAttrList *attr_list; + const gchar *text; + gint i; + + text = gtk_entry_get_text (GTK_ENTRY (name_selector_entry)); + layout = gtk_entry_get_layout (GTK_ENTRY (name_selector_entry)); + + /* Set up the attribute list */ + + attr_list = pango_attr_list_new (); + + if (name_selector_entry->priv->attr_list) + pango_attr_list_unref (name_selector_entry->priv->attr_list); + + name_selector_entry->priv->attr_list = attr_list; + + /* Parse the entry's text and apply attributes to real contacts */ + + for (i = 0; ; i++) { + EDestination *destination; + PangoAttribute *attr; + gint start_pos; + gint end_pos; + + if (!get_range_by_index (text, i, &start_pos, &end_pos)) + break; + + destination = find_destination_at_position (name_selector_entry, start_pos); + + /* Destination will be NULL if we have no entries */ + if (!destination || !e_destination_get_contact (destination)) + continue; + + attr = pango_attr_underline_new (PANGO_UNDERLINE_SINGLE); + attr->start_index = g_utf8_offset_to_pointer (text, start_pos) - text; + attr->end_index = g_utf8_offset_to_pointer (text, end_pos) - text; + pango_attr_list_insert (attr_list, attr); + } + + pango_layout_set_attributes (layout, attr_list); +} + +static gboolean +draw_event (ENameSelectorEntry *name_selector_entry) +{ + PangoLayout *layout; + + layout = gtk_entry_get_layout (GTK_ENTRY (name_selector_entry)); + pango_layout_set_attributes (layout, name_selector_entry->priv->attr_list); + + return FALSE; +} + +static void +type_ahead_complete (ENameSelectorEntry *name_selector_entry) +{ + EContact *contact; + EBookClient *book_client = NULL; + EContactField matched_field; + EDestination *destination; + gint cursor_pos; + gint range_start = 0; + gint range_end = 0; + gint pos = 0; + gchar *textrep; + gint textrep_len; + gint range_len; + const gchar *text; + gchar *cue_str; + gchar *temp_str; + ENameSelectorEntryPrivate *priv; + + priv = E_NAME_SELECTOR_ENTRY_GET_PRIVATE (name_selector_entry); + + cursor_pos = gtk_editable_get_position (GTK_EDITABLE (name_selector_entry)); + if (cursor_pos < 0) + return; + + text = gtk_entry_get_text (GTK_ENTRY (name_selector_entry)); + get_range_at_position (text, cursor_pos, &range_start, &range_end); + range_len = range_end - range_start; + if (range_len < priv->minimum_query_length) + return; + + destination = find_destination_at_position (name_selector_entry, cursor_pos); + + cue_str = get_entry_substring (name_selector_entry, range_start, range_end); + if (!find_existing_completion (name_selector_entry, cue_str, &contact, + &textrep, &matched_field, &book_client)) { + g_free (cue_str); + return; + } + + temp_str = sanitize_string (textrep); + g_free (textrep); + textrep = temp_str; + + textrep_len = g_utf8_strlen (textrep, -1); + pos = range_start; + + g_signal_handlers_block_by_func ( + name_selector_entry, + user_insert_text, name_selector_entry); + g_signal_handlers_block_by_func ( + name_selector_entry, + user_delete_text, name_selector_entry); + g_signal_handlers_block_by_func ( + name_selector_entry->priv->destination_store, + destination_row_changed, name_selector_entry); + + if (textrep_len > range_len) { + gint i; + + /* keep character's case as user types */ + for (i = 0; textrep[i] && cue_str[i]; i++) + textrep[i] = cue_str[i]; + + gtk_editable_delete_text ( + GTK_EDITABLE (name_selector_entry), + range_start, range_end); + gtk_editable_insert_text ( + GTK_EDITABLE (name_selector_entry), + textrep, -1, &pos); + gtk_editable_select_region ( + GTK_EDITABLE (name_selector_entry), + range_end, range_start + textrep_len); + priv->is_completing = TRUE; + } + g_free (cue_str); + + if (contact && destination) { + gint email_n = 0; + + if (matched_field >= E_CONTACT_FIRST_EMAIL_ID && matched_field <= E_CONTACT_LAST_EMAIL_ID) + email_n = matched_field - E_CONTACT_FIRST_EMAIL_ID; + + e_destination_set_contact (destination, contact, email_n); + if (book_client) + e_destination_set_client (destination, book_client); + generate_attribute_list (name_selector_entry); + } + + g_signal_handlers_unblock_by_func ( + name_selector_entry->priv->destination_store, + destination_row_changed, name_selector_entry); + g_signal_handlers_unblock_by_func (name_selector_entry, user_delete_text, name_selector_entry); + g_signal_handlers_unblock_by_func (name_selector_entry, user_insert_text, name_selector_entry); + + g_free (textrep); +} + +static void +clear_completion_model (ENameSelectorEntry *name_selector_entry) +{ + ENameSelectorEntryPrivate *priv; + + priv = E_NAME_SELECTOR_ENTRY_GET_PRIVATE (name_selector_entry); + + if (!name_selector_entry->priv->contact_store) + return; + + e_contact_store_set_query (name_selector_entry->priv->contact_store, NULL); + priv->is_completing = FALSE; +} + +static void +update_completion_model (ENameSelectorEntry *name_selector_entry) +{ + const gchar *text; + gint cursor_pos; + gint range_start = 0; + gint range_end = 0; + + text = gtk_entry_get_text (GTK_ENTRY (name_selector_entry)); + cursor_pos = gtk_editable_get_position (GTK_EDITABLE (name_selector_entry)); + + if (cursor_pos >= 0) + get_range_at_position (text, cursor_pos, &range_start, &range_end); + + if (range_end - range_start >= name_selector_entry->priv->minimum_query_length && cursor_pos == range_end) { + gchar *cue_str; + + cue_str = get_entry_substring (name_selector_entry, range_start, range_end); + set_completion_query (name_selector_entry, cue_str); + g_free (cue_str); + } else { + /* N/A; Clear completion model */ + clear_completion_model (name_selector_entry); + } +} + +static gboolean +type_ahead_complete_on_timeout_cb (ENameSelectorEntry *name_selector_entry) +{ + type_ahead_complete (name_selector_entry); + name_selector_entry->priv->type_ahead_complete_cb_id = 0; + return FALSE; +} + +static gboolean +update_completions_on_timeout_cb (ENameSelectorEntry *name_selector_entry) +{ + update_completion_model (name_selector_entry); + name_selector_entry->priv->update_completions_cb_id = 0; + return FALSE; +} + +static void +insert_destination_at_position (ENameSelectorEntry *name_selector_entry, + gint pos) +{ + EDestination *destination; + const gchar *text; + gint index; + + text = gtk_entry_get_text (GTK_ENTRY (name_selector_entry)); + index = get_index_at_position (text, pos); + + destination = build_destination_at_position (text, pos); + g_assert (destination); + + g_signal_handlers_block_by_func ( + name_selector_entry->priv->destination_store, + destination_row_inserted, name_selector_entry); + e_destination_store_insert_destination ( + name_selector_entry->priv->destination_store, + index, destination); + g_signal_handlers_unblock_by_func ( + name_selector_entry->priv->destination_store, + destination_row_inserted, name_selector_entry); + g_object_unref (destination); +} + +static void +modify_destination_at_position (ENameSelectorEntry *name_selector_entry, + gint pos) +{ + EDestination *destination; + const gchar *text; + gchar *raw_address; + gboolean rebuild_attributes = FALSE; + + destination = find_destination_at_position (name_selector_entry, pos); + if (!destination) + return; + + text = gtk_entry_get_text (GTK_ENTRY (name_selector_entry)); + raw_address = get_address_at_position (text, pos); + g_assert (raw_address); + + if (e_destination_get_contact (destination)) + rebuild_attributes = TRUE; + + g_signal_handlers_block_by_func ( + name_selector_entry->priv->destination_store, + destination_row_changed, name_selector_entry); + e_destination_set_raw (destination, raw_address); + g_signal_handlers_unblock_by_func ( + name_selector_entry->priv->destination_store, + destination_row_changed, name_selector_entry); + + g_free (raw_address); + + if (rebuild_attributes) + generate_attribute_list (name_selector_entry); +} + +static gchar * +get_destination_textrep (ENameSelectorEntry *name_selector_entry, + EDestination *destination) +{ + gboolean show_email = e_name_selector_entry_get_show_address (name_selector_entry); + EContact *contact; + + g_return_val_if_fail (destination != NULL, NULL); + + contact = e_destination_get_contact (destination); + + if (!show_email) { + if (contact && !e_contact_get (contact, E_CONTACT_IS_LIST)) { + GList *email_list; + + email_list = e_contact_get (contact, E_CONTACT_EMAIL); + show_email = g_list_length (email_list) > 1; + deep_free_list (email_list); + } + } + + /* do not show emails for contact lists even user forces it */ + if (show_email && contact && e_contact_get (contact, E_CONTACT_IS_LIST)) + show_email = FALSE; + + return sanitize_string (e_destination_get_textrep (destination, show_email)); +} + +static void +sync_destination_at_position (ENameSelectorEntry *name_selector_entry, + gint range_pos, + gint *cursor_pos) +{ + EDestination *destination; + const gchar *text; + gchar *address; + gint address_len; + gint range_start, range_end; + + /* Get the destination we're looking at. Note that the entry may be empty, and so + * there may not be one. */ + destination = find_destination_at_position (name_selector_entry, range_pos); + if (!destination) + return; + + text = gtk_entry_get_text (GTK_ENTRY (name_selector_entry)); + if (!get_range_at_position (text, range_pos, &range_start, &range_end)) { + g_warning ("ENameSelectorEntry is out of sync with model!"); + return; + } + + address = get_destination_textrep (name_selector_entry, destination); + address_len = g_utf8_strlen (address, -1); + + if (cursor_pos) { + /* Update cursor placement */ + if (*cursor_pos >= range_end) + *cursor_pos += address_len - (range_end - range_start); + else if (*cursor_pos > range_start) + *cursor_pos = range_start + address_len; + } + + g_signal_handlers_block_by_func (name_selector_entry, user_insert_text, name_selector_entry); + g_signal_handlers_block_by_func (name_selector_entry, user_delete_text, name_selector_entry); + + gtk_editable_delete_text (GTK_EDITABLE (name_selector_entry), range_start, range_end); + gtk_editable_insert_text (GTK_EDITABLE (name_selector_entry), address, -1, &range_start); + + g_signal_handlers_unblock_by_func (name_selector_entry, user_delete_text, name_selector_entry); + g_signal_handlers_unblock_by_func (name_selector_entry, user_insert_text, name_selector_entry); + + generate_attribute_list (name_selector_entry); + g_free (address); +} + +static void +remove_destination_by_index (ENameSelectorEntry *name_selector_entry, + gint index) +{ + EDestination *destination; + + destination = find_destination_by_index (name_selector_entry, index); + if (destination) { + g_signal_handlers_block_by_func ( + name_selector_entry->priv->destination_store, + destination_row_deleted, name_selector_entry); + e_destination_store_remove_destination ( + name_selector_entry->priv->destination_store, + destination); + g_signal_handlers_unblock_by_func ( + name_selector_entry->priv->destination_store, + destination_row_deleted, name_selector_entry); + } +} + +static void +post_insert_update (ENameSelectorEntry *name_selector_entry, + gint position) +{ + const gchar *text; + glong length; + + text = gtk_entry_get_text (GTK_ENTRY (name_selector_entry)); + length = g_utf8_strlen (text, -1); + text = g_utf8_next_char (text); + + if (*text == '\0') { + /* First and only character, create initial destination. */ + insert_destination_at_position (name_selector_entry, 0); + } else { + /* Modified an existing destination. */ + modify_destination_at_position (name_selector_entry, position); + } + + /* If editing within the string, regenerate attributes. */ + if (position < length) + generate_attribute_list (name_selector_entry); +} + +/* Returns the number of characters inserted */ +static gint +insert_unichar (ENameSelectorEntry *name_selector_entry, + gint *pos, + gunichar c) +{ + const gchar *text; + gunichar str_context[4]; + gchar buf[7]; + gint len; + + text = gtk_entry_get_text (GTK_ENTRY (name_selector_entry)); + get_utf8_string_context (text, *pos, str_context, 4); + + /* Space is not allowed: + * - Before or after another space. + * - At start of string. */ + + if (c == ' ' && (str_context[1] == ' ' || str_context[1] == '\0' || str_context[2] == ' ')) + return 0; + + /* Comma is not allowed: + * - After another comma. + * - At start of string. */ + + if (c == ',' && !is_quoted_at (text, *pos)) { + gint start_pos; + gint end_pos; + gboolean at_start = FALSE; + gboolean at_end = FALSE; + + if (str_context[1] == ',' || str_context[1] == '\0') + return 0; + + /* We do this so we can avoid disturbing destinations with completed contacts + * either before or after the destination being inserted. */ + get_range_at_position (text, *pos, &start_pos, &end_pos); + if (*pos <= start_pos) + at_start = TRUE; + if (*pos >= end_pos) + at_end = TRUE; + + /* Must insert comma first, so modify_destination_at_position can do its job + * correctly, splitting up the contact if necessary. */ + gtk_editable_insert_text (GTK_EDITABLE (name_selector_entry), ", ", -1, pos); + + /* Update model */ + g_assert (*pos >= 2); + + /* If we inserted the comma at the end of, or in the middle of, an existing + * address, add a new destination for what appears after comma. Else, we + * have to add a destination for what appears before comma (a blank one). */ + if (at_end) { + /* End: Add last, sync first */ + insert_destination_at_position (name_selector_entry, *pos); + sync_destination_at_position (name_selector_entry, *pos - 2, pos); + /* Sync generates the attributes list */ + } else if (at_start) { + /* Start: Add first */ + insert_destination_at_position (name_selector_entry, *pos - 2); + generate_attribute_list (name_selector_entry); + } else { + /* Middle: */ + insert_destination_at_position (name_selector_entry, *pos); + modify_destination_at_position (name_selector_entry, *pos - 2); + generate_attribute_list (name_selector_entry); + } + + return 2; + } + + /* Generic case. Allowed spaces also end up here. */ + + len = g_unichar_to_utf8 (c, buf); + buf[len] = '\0'; + + gtk_editable_insert_text (GTK_EDITABLE (name_selector_entry), buf, -1, pos); + + post_insert_update (name_selector_entry, *pos); + + return 1; +} + +static void +user_insert_text (ENameSelectorEntry *name_selector_entry, + gchar *new_text, + gint new_text_length, + gint *position, + gpointer user_data) +{ + gint chars_inserted = 0; + gboolean fast_insert; + + g_signal_handlers_block_by_func (name_selector_entry, user_insert_text, name_selector_entry); + g_signal_handlers_block_by_func (name_selector_entry, user_delete_text, name_selector_entry); + + fast_insert = + (g_utf8_strchr (new_text, new_text_length, ' ') == NULL) && + (g_utf8_strchr (new_text, new_text_length, ',') == NULL); + + /* If the text to insert does not contain spaces or commas, + * insert all of it at once. This avoids confusing on-going + * input method behavior. */ + if (fast_insert) { + gint old_position = *position; + + gtk_editable_insert_text ( + GTK_EDITABLE (name_selector_entry), + new_text, new_text_length, position); + + chars_inserted = *position - old_position; + if (chars_inserted > 0) + post_insert_update (name_selector_entry, *position); + + /* Otherwise, apply some rules as to where spaces and commas + * can be inserted, and insert a trailing space after comma. */ + } else { + const gchar *cp; + + for (cp = new_text; *cp; cp = g_utf8_next_char (cp)) { + gunichar uc = g_utf8_get_char (cp); + insert_unichar (name_selector_entry, position, uc); + chars_inserted++; + } + } + + if (chars_inserted >= 1) { + /* If the user inserted one character, kick off completion */ + re_set_timeout (name_selector_entry->priv->update_completions_cb_id, update_completions_on_timeout_cb, name_selector_entry); + re_set_timeout (name_selector_entry->priv->type_ahead_complete_cb_id, type_ahead_complete_on_timeout_cb, name_selector_entry); + } + + g_signal_handlers_unblock_by_func (name_selector_entry, user_delete_text, name_selector_entry); + g_signal_handlers_unblock_by_func (name_selector_entry, user_insert_text, name_selector_entry); + + g_signal_stop_emission_by_name (name_selector_entry, "insert_text"); +} + +static void +user_delete_text (ENameSelectorEntry *name_selector_entry, + gint start_pos, + gint end_pos, + gpointer user_data) +{ + const gchar *text; + gint index_start, index_end; + gint selection_start, selection_end; + gunichar str_context[2], str_b_context[2]; + gint len; + gint i; + gboolean del_space = FALSE, del_comma = FALSE; + + if (start_pos == end_pos) + return; + + text = gtk_entry_get_text (GTK_ENTRY (name_selector_entry)); + len = g_utf8_strlen (text, -1); + + if (end_pos == -1) + end_pos = len; + + gtk_editable_get_selection_bounds ( + GTK_EDITABLE (name_selector_entry), + &selection_start, &selection_end); + + get_utf8_string_context (text, start_pos, str_context, 2); + get_utf8_string_context (text, end_pos, str_b_context, 2); + + g_signal_handlers_block_by_func (name_selector_entry, user_delete_text, name_selector_entry); + + if (end_pos - start_pos == 1) { + /* Might be backspace; update completion model so dropdown is accurate */ + re_set_timeout (name_selector_entry->priv->update_completions_cb_id, update_completions_on_timeout_cb, name_selector_entry); + } + + index_start = get_index_at_position (text, start_pos); + index_end = get_index_at_position (text, end_pos); + + g_signal_stop_emission_by_name (name_selector_entry, "delete_text"); + + /* If the deletion touches more than one destination, the first one is changed + * and the rest are removed. If the last destination wasn't completely deleted, + * it becomes part of the first one, since the separator between them was + * removed. + * + * Here, we let the model know about removals. */ + for (i = index_end; i > index_start; i--) { + EDestination *destination = find_destination_by_index (name_selector_entry, i); + gint range_start, range_end; + gchar *ttext; + const gchar *email = NULL; + gboolean sel = FALSE; + + if (destination) + email = e_destination_get_textrep (destination, TRUE); + + if (!email || !*email) + continue; + + if (!get_range_by_index (text, i, &range_start, &range_end)) { + g_warning ("ENameSelectorEntry is out of sync with model!"); + return; + } + + if ((selection_start < range_start && selection_end > range_start) || + (selection_end > range_start && selection_end < range_end)) + sel = TRUE; + + if (!sel) { + g_signal_handlers_block_by_func (name_selector_entry, user_insert_text, name_selector_entry); + g_signal_handlers_block_by_func (name_selector_entry, user_delete_text, name_selector_entry); + + gtk_editable_delete_text (GTK_EDITABLE (name_selector_entry), range_start, range_end); + + ttext = sanitize_string (email); + gtk_editable_insert_text (GTK_EDITABLE (name_selector_entry), ttext, -1, &range_start); + g_free (ttext); + + g_signal_handlers_unblock_by_func (name_selector_entry, user_delete_text, name_selector_entry); + g_signal_handlers_unblock_by_func (name_selector_entry, user_insert_text, name_selector_entry); + + } + + remove_destination_by_index (name_selector_entry, i); + } + + /* Do the actual deletion */ + + if (end_pos == start_pos +1 && index_end == index_start) { + /* We could be just deleting the empty text */ + gchar *c; + + /* Get the actual deleted text */ + c = gtk_editable_get_chars (GTK_EDITABLE (name_selector_entry), start_pos, start_pos + 1); + + if ( c[0] == ' ') { + /* If we are at the beginning or removing junk space, let us ignore it */ + del_space = TRUE; + } + g_free (c); + } else if (end_pos == start_pos +1 && index_end == index_start + 1) { + /* We could be just deleting the empty text */ + gchar *c; + + /* Get the actual deleted text */ + c = gtk_editable_get_chars (GTK_EDITABLE (name_selector_entry), start_pos, start_pos + 1); + + if ( c[0] == ',' && !is_quoted_at (text, start_pos)) { + /* If we are at the beginning or removing junk space, let us ignore it */ + del_comma = TRUE; + } + g_free (c); + } + + if (del_comma) { + gint range_start=-1, range_end; + EDestination *dest = find_destination_by_index (name_selector_entry, index_end); + /* If we have deleted the last comma, let us autocomplete normally + */ + + if (dest && len - end_pos != 0) { + + EDestination *destination1 = find_destination_by_index (name_selector_entry, index_start); + gchar *ttext; + const gchar *email = NULL; + + if (destination1) + email = e_destination_get_textrep (destination1, TRUE); + + if (email && *email) { + + if (!get_range_by_index (text, i, &range_start, &range_end)) { + g_warning ("ENameSelectorEntry is out of sync with model!"); + return; + } + + g_signal_handlers_block_by_func (name_selector_entry, user_insert_text, name_selector_entry); + g_signal_handlers_block_by_func (name_selector_entry, user_delete_text, name_selector_entry); + + gtk_editable_delete_text (GTK_EDITABLE (name_selector_entry), range_start, range_end); + + ttext = sanitize_string (email); + gtk_editable_insert_text (GTK_EDITABLE (name_selector_entry), ttext, -1, &range_start); + g_free (ttext); + + g_signal_handlers_unblock_by_func (name_selector_entry, user_delete_text, name_selector_entry); + g_signal_handlers_unblock_by_func (name_selector_entry, user_insert_text, name_selector_entry); + } + + if (range_start != -1) { + start_pos = range_start; + end_pos = start_pos + 1; + gtk_editable_set_position (GTK_EDITABLE (name_selector_entry),start_pos); + } + } + } + gtk_editable_delete_text ( + GTK_EDITABLE (name_selector_entry), + start_pos, end_pos); + + /*If the user is deleting a '"' new destinations have to be created for ',' between the quoted text + Like "fd,ty,uy" is a one entity, but if you remove the quotes it has to be broken doan into 3 seperate + addresses. + */ + + if (str_b_context[1] == '"') { + const gchar *p; + gint j; + p = text + end_pos; + for (p = text + (end_pos - 1), j = end_pos - 1; *p && *p != '"' ; p = g_utf8_next_char (p), j++) { + gunichar c = g_utf8_get_char (p); + if (c == ',') { + insert_destination_at_position (name_selector_entry, j + 1); + } + } + + } + + /* Let model know about changes */ + text = gtk_entry_get_text (GTK_ENTRY (name_selector_entry)); + if (!*text || strlen (text) <= 0) { + /* If the entry was completely cleared, remove the initial destination too */ + remove_destination_by_index (name_selector_entry, 0); + generate_attribute_list (name_selector_entry); + } else if (!del_space) { + modify_destination_at_position (name_selector_entry, start_pos); + } + + /* If editing within the string, we need to regenerate attributes */ + if (end_pos < len) + generate_attribute_list (name_selector_entry); + + /* Prevent type-ahead completion */ + if (name_selector_entry->priv->type_ahead_complete_cb_id) { + g_source_remove (name_selector_entry->priv->type_ahead_complete_cb_id); + name_selector_entry->priv->type_ahead_complete_cb_id = 0; + } + + g_signal_handlers_unblock_by_func (name_selector_entry, user_delete_text, name_selector_entry); +} + +static gboolean +completion_match_selected (ENameSelectorEntry *name_selector_entry, + ETreeModelGenerator *email_generator_model, + GtkTreeIter *generator_iter) +{ + EContact *contact; + EBookClient *book_client; + EDestination *destination; + gint cursor_pos; + GtkTreeIter contact_iter; + gint email_n; + + if (!name_selector_entry->priv->contact_store) + return FALSE; + + g_return_val_if_fail (name_selector_entry->priv->email_generator == email_generator_model, FALSE); + + e_tree_model_generator_convert_iter_to_child_iter ( + email_generator_model, + &contact_iter, &email_n, + generator_iter); + + contact = e_contact_store_get_contact (name_selector_entry->priv->contact_store, &contact_iter); + book_client = e_contact_store_get_client (name_selector_entry->priv->contact_store, &contact_iter); + cursor_pos = gtk_editable_get_position (GTK_EDITABLE (name_selector_entry)); + + /* Set the contact in the model's destination */ + + destination = find_destination_at_position (name_selector_entry, cursor_pos); + e_destination_set_contact (destination, contact, email_n); + if (book_client) + e_destination_set_client (destination, book_client); + sync_destination_at_position (name_selector_entry, cursor_pos, &cursor_pos); + + g_signal_handlers_block_by_func (name_selector_entry, user_insert_text, name_selector_entry); + gtk_editable_insert_text (GTK_EDITABLE (name_selector_entry), ", ", -1, &cursor_pos); + g_signal_handlers_unblock_by_func (name_selector_entry, user_insert_text, name_selector_entry); + + /*Add destination at end for next entry*/ + insert_destination_at_position (name_selector_entry, cursor_pos); + /* Place cursor at end of address */ + + gtk_editable_set_position (GTK_EDITABLE (name_selector_entry), cursor_pos); + g_signal_emit (name_selector_entry, signals[UPDATED], 0, destination, NULL); + return TRUE; +} + +static void +entry_activate (ENameSelectorEntry *name_selector_entry) +{ + gint cursor_pos; + gint range_start, range_end; + ENameSelectorEntryPrivate *priv; + EDestination *destination; + gint range_len; + const gchar *text; + gchar *cue_str; + + cursor_pos = gtk_editable_get_position (GTK_EDITABLE (name_selector_entry)); + if (cursor_pos < 0) + return; + + priv = E_NAME_SELECTOR_ENTRY_GET_PRIVATE (name_selector_entry); + + text = gtk_entry_get_text (GTK_ENTRY (name_selector_entry)); + if (!get_range_at_position (text, cursor_pos, &range_start, &range_end)) + return; + + range_len = range_end - range_start; + if (range_len < priv->minimum_query_length) + return; + + destination = find_destination_at_position (name_selector_entry, cursor_pos); + if (!destination) + return; + + cue_str = get_entry_substring (name_selector_entry, range_start, range_end); +#if 0 + if (!find_existing_completion (name_selector_entry, cue_str, &contact, + &textrep, &matched_field)) { + g_free (cue_str); + return; + } +#endif + g_free (cue_str); + sync_destination_at_position (name_selector_entry, cursor_pos, &cursor_pos); + + /* Place cursor at end of address */ + text = gtk_entry_get_text (GTK_ENTRY (name_selector_entry)); + get_range_at_position (text, cursor_pos, &range_start, &range_end); + + if (priv->is_completing) { + gchar *str_context = NULL; + + str_context = gtk_editable_get_chars (GTK_EDITABLE (name_selector_entry), range_end, range_end + 1); + + if (str_context[0] != ',') { + /* At the end*/ + gtk_editable_insert_text (GTK_EDITABLE (name_selector_entry), ", ", -1, &range_end); + } else { + /* In the middle */ + gint newpos = strlen (text); + + /* Doing this we can make sure that It wont ask for completion again. */ + gtk_editable_insert_text (GTK_EDITABLE (name_selector_entry), ", ", -1, &newpos); + g_signal_handlers_block_by_func (name_selector_entry, user_delete_text, name_selector_entry); + gtk_editable_delete_text (GTK_EDITABLE (name_selector_entry), newpos - 2, newpos); + g_signal_handlers_unblock_by_func (name_selector_entry, user_delete_text, name_selector_entry); + + /* Move it close to next destination*/ + range_end = range_end + 2; + + } + g_free (str_context); + } + + gtk_editable_set_position (GTK_EDITABLE (name_selector_entry), range_end); + g_signal_emit (name_selector_entry, signals[UPDATED], 0, destination, NULL); + + if (priv->is_completing) + clear_completion_model (name_selector_entry); +} + +static void +update_text (ENameSelectorEntry *name_selector_entry, + const gchar *text) +{ + gint start = 0, end = 0; + gboolean has_selection; + + has_selection = gtk_editable_get_selection_bounds (GTK_EDITABLE (name_selector_entry), &start, &end); + + gtk_entry_set_text (GTK_ENTRY (name_selector_entry), text); + + if (has_selection) + gtk_editable_select_region (GTK_EDITABLE (name_selector_entry), start, end); +} + +static void +sanitize_entry (ENameSelectorEntry *name_selector_entry) +{ + gint n; + GList *l, *known, *del = NULL; + GString *str = g_string_new (""); + + g_signal_handlers_block_matched (name_selector_entry, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, name_selector_entry); + g_signal_handlers_block_matched (name_selector_entry->priv->destination_store, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, name_selector_entry); + + known = e_destination_store_list_destinations (name_selector_entry->priv->destination_store); + for (l = known, n = 0; l != NULL; l = l->next, n++) { + EDestination *dest = l->data; + + if (!dest || !e_destination_get_address (dest)) + del = g_list_prepend (del, GINT_TO_POINTER (n)); + else { + gchar *text; + + text = get_destination_textrep (name_selector_entry, dest); + if (text) { + if (str->str && str->str[0]) + g_string_append (str, ", "); + + g_string_append (str, text); + } + g_free (text); + } + } + g_list_free (known); + + for (l = del; l != NULL; l = l->next) { + e_destination_store_remove_destination_nth (name_selector_entry->priv->destination_store, GPOINTER_TO_INT (l->data)); + } + g_list_free (del); + + update_text (name_selector_entry, str->str); + + g_string_free (str, TRUE); + + g_signal_handlers_unblock_matched (name_selector_entry->priv->destination_store, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, name_selector_entry); + g_signal_handlers_unblock_matched (name_selector_entry, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, name_selector_entry); + + generate_attribute_list (name_selector_entry); +} + +static gboolean +user_focus_in (ENameSelectorEntry *name_selector_entry, + GdkEventFocus *event_focus) +{ + gint n; + GList *l, *known; + GString *str = g_string_new (""); + EDestination *dest_dummy = e_destination_new (); + + g_signal_handlers_block_matched (name_selector_entry, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, name_selector_entry); + g_signal_handlers_block_matched (name_selector_entry->priv->destination_store, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, name_selector_entry); + + known = e_destination_store_list_destinations (name_selector_entry->priv->destination_store); + for (l = known, n = 0; l != NULL; l = l->next, n++) { + EDestination *dest = l->data; + + if (dest) { + gchar *text; + + text = get_destination_textrep (name_selector_entry, dest); + if (text) { + if (str->str && str->str[0]) + g_string_append (str, ", "); + + g_string_append (str, text); + } + g_free (text); + } + } + g_list_free (known); + + /* Add a blank destination */ + e_destination_store_append_destination (name_selector_entry->priv->destination_store, dest_dummy); + if (str->str && str->str[0]) + g_string_append (str, ", "); + + gtk_entry_set_text (GTK_ENTRY (name_selector_entry), str->str); + + g_string_free (str, TRUE); + + g_signal_handlers_unblock_matched (name_selector_entry->priv->destination_store, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, name_selector_entry); + g_signal_handlers_unblock_matched (name_selector_entry, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, name_selector_entry); + + generate_attribute_list (name_selector_entry); + + return FALSE; +} + +static gboolean +user_focus_out (ENameSelectorEntry *name_selector_entry, + GdkEventFocus *event_focus) +{ + if (!event_focus->in) { + entry_activate (name_selector_entry); + } + + if (name_selector_entry->priv->type_ahead_complete_cb_id) { + g_source_remove (name_selector_entry->priv->type_ahead_complete_cb_id); + name_selector_entry->priv->type_ahead_complete_cb_id = 0; + } + + if (name_selector_entry->priv->update_completions_cb_id) { + g_source_remove (name_selector_entry->priv->update_completions_cb_id); + name_selector_entry->priv->update_completions_cb_id = 0; + } + + clear_completion_model (name_selector_entry); + + if (!event_focus->in) { + sanitize_entry (name_selector_entry); + } + + return FALSE; +} + +static void +deep_free_list (GList *list) +{ + GList *l; + + for (l = list; l; l = g_list_next (l)) + g_free (l->data); + + g_list_free (list); +} + +/* Given a widget, determines the height that text will normally be drawn. */ +static guint +entry_height (GtkWidget *widget) +{ + PangoLayout *layout; + gint bound; + + g_return_val_if_fail (widget != NULL, 0); + + layout = gtk_widget_create_pango_layout (widget, NULL); + + pango_layout_get_pixel_size (layout, NULL, &bound); + + return bound; +} + +static void +contact_layout_pixbuffer (GtkCellLayout *cell_layout, + GtkCellRenderer *cell, + GtkTreeModel *model, + GtkTreeIter *iter, + ENameSelectorEntry *name_selector_entry) +{ + EContact *contact; + GtkTreeIter generator_iter; + GtkTreeIter contact_store_iter; + gint email_n; + EContactPhoto *photo; + GdkPixbuf *pixbuf = NULL; + + if (!name_selector_entry->priv->contact_store) + return; + + gtk_tree_model_filter_convert_iter_to_child_iter ( + GTK_TREE_MODEL_FILTER (model), + &generator_iter, iter); + e_tree_model_generator_convert_iter_to_child_iter ( + name_selector_entry->priv->email_generator, + &contact_store_iter, &email_n, + &generator_iter); + + contact = e_contact_store_get_contact (name_selector_entry->priv->contact_store, &contact_store_iter); + if (!contact) { + g_object_set (cell, "pixbuf", pixbuf, NULL); + return; + } + + photo = e_contact_get (contact, E_CONTACT_PHOTO); + if (photo && photo->type == E_CONTACT_PHOTO_TYPE_INLINED) { + guint max_height = entry_height (GTK_WIDGET (name_selector_entry)); + GdkPixbufLoader *loader; + + loader = gdk_pixbuf_loader_new (); + if (gdk_pixbuf_loader_write (loader, (guchar *) photo->data.inlined.data, photo->data.inlined.length, NULL) && + gdk_pixbuf_loader_close (loader, NULL)) { + pixbuf = gdk_pixbuf_loader_get_pixbuf (loader); + if (pixbuf) + g_object_ref (pixbuf); + } + g_object_unref (loader); + + if (pixbuf) { + gint w, h; + gdouble scale = 1.0; + + w = gdk_pixbuf_get_width (pixbuf); + h = gdk_pixbuf_get_height (pixbuf); + + if (h > w) + scale = max_height / (double) h; + else + scale = max_height / (double) w; + + if (scale < 1.0) { + GdkPixbuf *tmp; + + tmp = gdk_pixbuf_scale_simple (pixbuf, w * scale, h * scale, GDK_INTERP_BILINEAR); + g_object_unref (pixbuf); + pixbuf = tmp; + } + + } + } + + e_contact_photo_free (photo); + + g_object_set (cell, "pixbuf", pixbuf, NULL); + + if (pixbuf) + g_object_unref (pixbuf); +} + +static void +contact_layout_formatter (GtkCellLayout *cell_layout, + GtkCellRenderer *cell, + GtkTreeModel *model, + GtkTreeIter *iter, + ENameSelectorEntry *name_selector_entry) +{ + EContact *contact; + GtkTreeIter generator_iter; + GtkTreeIter contact_store_iter; + GList *email_list; + gchar *string; + gchar *file_as_str; + gchar *email_str; + gint email_n; + + if (!name_selector_entry->priv->contact_store) + return; + + gtk_tree_model_filter_convert_iter_to_child_iter ( + GTK_TREE_MODEL_FILTER (model), + &generator_iter, iter); + e_tree_model_generator_convert_iter_to_child_iter ( + name_selector_entry->priv->email_generator, + &contact_store_iter, &email_n, + &generator_iter); + + contact = e_contact_store_get_contact (name_selector_entry->priv->contact_store, &contact_store_iter); + email_list = e_contact_get (contact, E_CONTACT_EMAIL); + email_str = g_list_nth_data (email_list, email_n); + file_as_str = e_contact_get (contact, E_CONTACT_FILE_AS); + + if (e_contact_get (contact, E_CONTACT_IS_LIST)) { + string = g_strdup_printf ("%s", file_as_str ? file_as_str : "?"); + } else { + string = g_strdup_printf ( + "%s%s<%s>", file_as_str ? file_as_str : "", + file_as_str ? " " : "", + email_str ? email_str : ""); + } + + g_free (file_as_str); + deep_free_list (email_list); + + g_object_set (cell, "text", string, NULL); + g_free (string); +} + +static gint +generate_contact_rows (EContactStore *contact_store, + GtkTreeIter *iter, + ENameSelectorEntry *name_selector_entry) +{ + EContact *contact; + const gchar *contact_uid; + GList *email_list; + gint n_rows; + + contact = e_contact_store_get_contact (contact_store, iter); + g_assert (contact != NULL); + + contact_uid = e_contact_get_const (contact, E_CONTACT_UID); + if (!contact_uid) + return 0; /* Can happen with broken databases */ + + if (e_contact_get (contact, E_CONTACT_IS_LIST)) + return 1; + + email_list = e_contact_get (contact, E_CONTACT_EMAIL); + n_rows = g_list_length (email_list); + deep_free_list (email_list); + + return n_rows; +} + +static void +ensure_type_ahead_complete_on_timeout (ENameSelectorEntry *name_selector_entry) +{ + re_set_timeout ( + name_selector_entry->priv->type_ahead_complete_cb_id, + type_ahead_complete_on_timeout_cb, name_selector_entry); +} + +static void +setup_contact_store (ENameSelectorEntry *name_selector_entry) +{ + if (name_selector_entry->priv->email_generator) { + g_object_unref (name_selector_entry->priv->email_generator); + name_selector_entry->priv->email_generator = NULL; + } + + if (name_selector_entry->priv->contact_store) { + name_selector_entry->priv->email_generator = + e_tree_model_generator_new ( + GTK_TREE_MODEL ( + name_selector_entry->priv->contact_store)); + + e_tree_model_generator_set_generate_func ( + name_selector_entry->priv->email_generator, + (ETreeModelGeneratorGenerateFunc) generate_contact_rows, + name_selector_entry, NULL); + + /* Assign the store to the entry completion */ + + gtk_entry_completion_set_model ( + name_selector_entry->priv->entry_completion, + GTK_TREE_MODEL ( + name_selector_entry->priv->email_generator)); + + /* Set up callback for incoming matches */ + g_signal_connect_swapped ( + name_selector_entry->priv->contact_store, "row-inserted", + G_CALLBACK (ensure_type_ahead_complete_on_timeout), name_selector_entry); + } else { + /* Remove the store from the entry completion */ + + gtk_entry_completion_set_model (name_selector_entry->priv->entry_completion, NULL); + } +} + +static void +book_loaded_cb (GObject *source_object, + GAsyncResult *result, + gpointer user_data) +{ + EContactStore *contact_store = user_data; + ESource *source = E_SOURCE (source_object); + EBookClient *book_client; + EClient *client = NULL; + GError *error = NULL; + + e_client_utils_open_new_finish (source, result, &client, &error); + + if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) { + g_warn_if_fail (client == NULL); + g_error_free (error); + goto exit; + } + + if (error != NULL) { + g_warning ("%s", error->message); + g_warn_if_fail (client == NULL); + g_error_free (error); + goto exit; + } + + book_client = E_BOOK_CLIENT (client); + + g_return_if_fail (E_IS_BOOK_CLIENT (book_client)); + e_contact_store_add_client (contact_store, book_client); + g_object_unref (book_client); + + exit: + g_object_unref (contact_store); +} + +static void +setup_default_contact_store (ENameSelectorEntry *name_selector_entry) +{ + ESourceRegistry *registry; + EContactStore *contact_store; + GList *list, *iter; + const gchar *extension_name; + + g_return_if_fail (name_selector_entry->priv->contact_store == NULL); + + /* Create a book for each completion source, and assign them to the contact store */ + + contact_store = e_contact_store_new (); + name_selector_entry->priv->contact_store = contact_store; + + extension_name = E_SOURCE_EXTENSION_ADDRESS_BOOK; + registry = e_name_selector_entry_get_registry (name_selector_entry); + + /* An ESourceRegistry should have been set by now. */ + g_return_if_fail (registry != NULL); + + list = e_source_registry_list_sources (registry, extension_name); + + for (iter = list; iter != NULL; iter = g_list_next (iter)) { + ESource *source = E_SOURCE (iter->data); + ESourceAutocomplete *extension; + GCancellable *cancellable; + const gchar *extension_name; + + extension_name = E_SOURCE_EXTENSION_AUTOCOMPLETE; + extension = e_source_get_extension (source, extension_name); + + /* Skip disabled address books. */ + if (!e_source_registry_check_enabled (registry, source)) + continue; + + /* Skip non-completion address books. */ + if (!e_source_autocomplete_get_include_me (extension)) + continue; + + cancellable = g_cancellable_new (); + + g_queue_push_tail ( + &name_selector_entry->priv->cancellables, + cancellable); + + e_client_utils_open_new ( + source, E_CLIENT_SOURCE_TYPE_CONTACTS, TRUE, cancellable, + book_loaded_cb, g_object_ref (contact_store)); + } + + g_list_free_full (list, (GDestroyNotify) g_object_unref); + + setup_contact_store (name_selector_entry); +} + +static void +destination_row_changed (ENameSelectorEntry *name_selector_entry, + GtkTreePath *path, + GtkTreeIter *iter) +{ + EDestination *destination; + const gchar *entry_text; + gchar *text; + gint range_start, range_end; + gint n; + + n = gtk_tree_path_get_indices (path)[0]; + destination = e_destination_store_get_destination (name_selector_entry->priv->destination_store, iter); + + if (!destination) + return; + + g_assert (n >= 0); + + entry_text = gtk_entry_get_text (GTK_ENTRY (name_selector_entry)); + if (!get_range_by_index (entry_text, n, &range_start, &range_end)) { + g_warning ("ENameSelectorEntry is out of sync with model!"); + return; + } + + g_signal_handlers_block_by_func (name_selector_entry, user_insert_text, name_selector_entry); + g_signal_handlers_block_by_func (name_selector_entry, user_delete_text, name_selector_entry); + + gtk_editable_delete_text (GTK_EDITABLE (name_selector_entry), range_start, range_end); + + text = get_destination_textrep (name_selector_entry, destination); + gtk_editable_insert_text (GTK_EDITABLE (name_selector_entry), text, -1, &range_start); + g_free (text); + + g_signal_handlers_unblock_by_func (name_selector_entry, user_delete_text, name_selector_entry); + g_signal_handlers_unblock_by_func (name_selector_entry, user_insert_text, name_selector_entry); + + clear_completion_model (name_selector_entry); + generate_attribute_list (name_selector_entry); +} + +static void +destination_row_inserted (ENameSelectorEntry *name_selector_entry, + GtkTreePath *path, + GtkTreeIter *iter) +{ + EDestination *destination; + const gchar *entry_text; + gchar *text; + gboolean comma_before = FALSE; + gboolean comma_after = FALSE; + gint range_start, range_end; + gint insert_pos; + gint n; + + n = gtk_tree_path_get_indices (path)[0]; + destination = e_destination_store_get_destination (name_selector_entry->priv->destination_store, iter); + + g_assert (n >= 0); + g_assert (destination != NULL); + + entry_text = gtk_entry_get_text (GTK_ENTRY (name_selector_entry)); + + if (get_range_by_index (entry_text, n, &range_start, &range_end) && range_start != range_end) { + /* Another destination comes after us */ + insert_pos = range_start; + comma_after = TRUE; + } else if (n > 0 && get_range_by_index (entry_text, n - 1, &range_start, &range_end)) { + /* Another destination comes before us */ + insert_pos = range_end; + comma_before = TRUE; + } else if (n == 0) { + /* We're the sole destination */ + insert_pos = 0; + } else { + g_warning ("ENameSelectorEntry is out of sync with model!"); + return; + } + + g_signal_handlers_block_by_func (name_selector_entry, user_insert_text, name_selector_entry); + + if (comma_before) + gtk_editable_insert_text (GTK_EDITABLE (name_selector_entry), ", ", -1, &insert_pos); + + text = get_destination_textrep (name_selector_entry, destination); + gtk_editable_insert_text (GTK_EDITABLE (name_selector_entry), text, -1, &insert_pos); + g_free (text); + + if (comma_after) + gtk_editable_insert_text (GTK_EDITABLE (name_selector_entry), ", ", -1, &insert_pos); + + g_signal_handlers_unblock_by_func (name_selector_entry, user_insert_text, name_selector_entry); + + clear_completion_model (name_selector_entry); + generate_attribute_list (name_selector_entry); +} + +static void +destination_row_deleted (ENameSelectorEntry *name_selector_entry, + GtkTreePath *path) +{ + const gchar *text; + gboolean deleted_comma = FALSE; + gint range_start, range_end; + gchar *p0; + gint n; + + n = gtk_tree_path_get_indices (path)[0]; + g_assert (n >= 0); + + text = gtk_entry_get_text (GTK_ENTRY (name_selector_entry)); + + if (!get_range_by_index (text, n, &range_start, &range_end)) { + g_warning ("ENameSelectorEntry is out of sync with model!"); + return; + } + + /* Expand range for deletion forwards */ + for (p0 = g_utf8_offset_to_pointer (text, range_end); *p0; + p0 = g_utf8_next_char (p0), range_end++) { + gunichar c = g_utf8_get_char (p0); + + /* Gobble spaces directly after comma */ + if (c != ' ' && deleted_comma) { + range_end--; + break; + } + + if (c == ',') { + deleted_comma = TRUE; + range_end++; + } + } + + /* Expand range for deletion backwards */ + for (p0 = g_utf8_offset_to_pointer (text, range_start); range_start > 0; + p0 = g_utf8_prev_char (p0), range_start--) { + gunichar c = g_utf8_get_char (p0); + + if (c == ',') { + if (!deleted_comma) { + deleted_comma = TRUE; + break; + } + + range_start++; + + /* Leave a space in front; we deleted the comma and spaces before the + * following destination */ + p0 = g_utf8_next_char (p0); + c = g_utf8_get_char (p0); + if (c == ' ') + range_start++; + + break; + } + } + + g_signal_handlers_block_by_func (name_selector_entry, user_delete_text, name_selector_entry); + gtk_editable_delete_text (GTK_EDITABLE (name_selector_entry), range_start, range_end); + g_signal_handlers_unblock_by_func (name_selector_entry, user_delete_text, name_selector_entry); + + clear_completion_model (name_selector_entry); + generate_attribute_list (name_selector_entry); +} + +static void +setup_destination_store (ENameSelectorEntry *name_selector_entry) +{ + GtkTreeIter iter; + + g_signal_connect_swapped ( + name_selector_entry->priv->destination_store, "row-changed", + G_CALLBACK (destination_row_changed), name_selector_entry); + g_signal_connect_swapped ( + name_selector_entry->priv->destination_store, "row-deleted", + G_CALLBACK (destination_row_deleted), name_selector_entry); + g_signal_connect_swapped ( + name_selector_entry->priv->destination_store, "row-inserted", + G_CALLBACK (destination_row_inserted), name_selector_entry); + + if (!gtk_tree_model_get_iter_first (GTK_TREE_MODEL (name_selector_entry->priv->destination_store), &iter)) + return; + + do { + GtkTreePath *path; + + path = gtk_tree_model_get_path (GTK_TREE_MODEL (name_selector_entry->priv->destination_store), &iter); + g_assert (path); + + destination_row_inserted (name_selector_entry, path, &iter); + } while (gtk_tree_model_iter_next (GTK_TREE_MODEL (name_selector_entry->priv->destination_store), &iter)); +} + +static gboolean +prepare_popup_destination (ENameSelectorEntry *name_selector_entry, + GdkEventButton *event_button) +{ + EDestination *destination; + PangoLayout *layout; + gint layout_offset_x; + gint layout_offset_y; + gint x, y; + gint index; + + if (event_button->type != GDK_BUTTON_PRESS) + return FALSE; + + if (event_button->button != 3) + return FALSE; + + if (name_selector_entry->priv->popup_destination) { + g_object_unref (name_selector_entry->priv->popup_destination); + name_selector_entry->priv->popup_destination = NULL; + } + + gtk_entry_get_layout_offsets ( + GTK_ENTRY (name_selector_entry), + &layout_offset_x, &layout_offset_y); + x = (event_button->x + 0.5) - layout_offset_x; + y = (event_button->y + 0.5) - layout_offset_y; + + if (x < 0 || y < 0) + return FALSE; + + layout = gtk_entry_get_layout (GTK_ENTRY (name_selector_entry)); + if (!pango_layout_xy_to_index (layout, x * PANGO_SCALE, y * PANGO_SCALE, &index, NULL)) + return FALSE; + + index = gtk_entry_layout_index_to_text_index (GTK_ENTRY (name_selector_entry), index); + destination = find_destination_at_position (name_selector_entry, index); + /* FIXME: Add this to a private variable, in ENameSelectorEntry Class*/ + g_object_set_data ((GObject *) name_selector_entry, "index", GINT_TO_POINTER (index)); + + if (!destination || !e_destination_get_contact (destination)) + return FALSE; + + /* TODO: Unref destination when we finalize */ + name_selector_entry->priv->popup_destination = g_object_ref (destination); + return FALSE; +} + +static EBookClient * +find_client_by_contact (GSList *clients, + const gchar *contact_uid, + const gchar *source_uid) +{ + GSList *l; + + if (source_uid && *source_uid) { + /* this is much quicket than asking each client for an existence */ + for (l = clients; l; l = g_slist_next (l)) { + EBookClient *client = l->data; + ESource *source = e_client_get_source (E_CLIENT (client)); + + if (!source) + continue; + + if (g_strcmp0 (source_uid, e_source_get_uid (source)) == 0) + return client; + } + } + + for (l = clients; l; l = g_slist_next (l)) { + EBookClient *client = l->data; + EContact *contact = NULL; + gboolean result; + + result = e_book_client_get_contact_sync (client, contact_uid, &contact, NULL, NULL); + if (contact) + g_object_unref (contact); + + if (result) + return client; + } + + return NULL; +} + +static void +editor_closed_cb (GtkWidget *editor, + gpointer data) +{ + EContact *contact; + gchar *contact_uid; + EDestination *destination; + GSList *clients; + EBookClient *book_client; + gint email_num; + ENameSelectorEntry *name_selector_entry = E_NAME_SELECTOR_ENTRY (data); + + destination = name_selector_entry->priv->popup_destination; + contact = e_destination_get_contact (destination); + if (!contact) { + g_object_unref (name_selector_entry); + return; + } + + contact_uid = e_contact_get (contact, E_CONTACT_UID); + if (!contact_uid) { + g_object_unref (contact); + g_object_unref (name_selector_entry); + return; + } + + if (name_selector_entry->priv->contact_store) { + clients = e_contact_store_get_clients (name_selector_entry->priv->contact_store); + book_client = find_client_by_contact (clients, contact_uid, e_destination_get_source_uid (destination)); + g_slist_free (clients); + } else { + book_client = NULL; + } + + if (book_client) { + contact = NULL; + + g_warn_if_fail (e_book_client_get_contact_sync (book_client, contact_uid, &contact, NULL, NULL)); + email_num = e_destination_get_email_num (destination); + e_destination_set_contact (destination, contact, email_num); + e_destination_set_client (destination, book_client); + } else { + contact = NULL; + } + + g_free (contact_uid); + if (contact) + g_object_unref (contact); + g_object_unref (name_selector_entry); +} + +/* To parse something like... + * =?UTF-8?Q?=E0=A4=95=E0=A4=95=E0=A4=AC=E0=A5=82=E0=A5=8B=E0=A5=87?=\t\n=?UTF-8?Q?=E0=A4=B0?=\t\n<aa@aa.ccom> + * and return the decoded representation of name & email parts. + * */ +static gboolean +eab_parse_qp_email (const gchar *string, + gchar **name, + gchar **email) +{ + struct _camel_header_address *address; + gboolean res = FALSE; + + address = camel_header_address_decode (string, "UTF-8"); + + if (!address) + return FALSE; + + /* report success only when we have filled both name and email address */ + if (address->type == CAMEL_HEADER_ADDRESS_NAME && address->name && *address->name && address->v.addr && *address->v.addr) { + *name = g_strdup (address->name); + *email = g_strdup (address->v.addr); + res = TRUE; + } + + camel_header_address_unref (address); + + return res; +} + +static void +popup_activate_inline_expand (ENameSelectorEntry *name_selector_entry, + GtkWidget *menu_item) +{ + const gchar *text; + GString *sanitized_text = g_string_new (""); + EDestination *destination = name_selector_entry->priv->popup_destination; + gint position, start, end; + const GList *dests; + + position = GPOINTER_TO_INT (g_object_get_data ((GObject *) name_selector_entry, "index")); + + for (dests = e_destination_list_get_dests (destination); dests; dests = dests->next) { + const EDestination *dest = dests->data; + gchar *sanitized; + gchar *name = NULL, *email = NULL, *tofree = NULL; + + if (!dest) + continue; + + text = e_destination_get_textrep (dest, TRUE); + + if (!text || !*text) + continue; + + if (eab_parse_qp_email (text, &name, &email)) { + tofree = g_strdup_printf ("%s <%s>", name, email); + text = tofree; + g_free (name); + g_free (email); + } + + sanitized = sanitize_string (text); + g_free (tofree); + if (!sanitized) + continue; + + if (*sanitized) { + if (*sanitized_text->str) + g_string_append (sanitized_text, ", "); + + g_string_append (sanitized_text, sanitized); + } + + g_free (sanitized); + } + + text = gtk_entry_get_text (GTK_ENTRY (name_selector_entry)); + get_range_at_position (text, position, &start, &end); + gtk_editable_delete_text (GTK_EDITABLE (name_selector_entry), start, end); + gtk_editable_insert_text (GTK_EDITABLE (name_selector_entry), sanitized_text->str, -1, &start); + g_string_free (sanitized_text, TRUE); + + clear_completion_model (name_selector_entry); + generate_attribute_list (name_selector_entry); +} + +static void +popup_activate_contact (ENameSelectorEntry *name_selector_entry, + GtkWidget *menu_item) +{ + EBookClient *book_client; + GSList *clients; + EDestination *destination; + EContact *contact; + gchar *contact_uid; + + destination = name_selector_entry->priv->popup_destination; + if (!destination) + return; + + contact = e_destination_get_contact (destination); + if (!contact) + return; + + contact_uid = e_contact_get (contact, E_CONTACT_UID); + if (!contact_uid) + return; + + if (name_selector_entry->priv->contact_store) { + clients = e_contact_store_get_clients (name_selector_entry->priv->contact_store); + book_client = find_client_by_contact (clients, contact_uid, e_destination_get_source_uid (destination)); + g_slist_free (clients); + g_free (contact_uid); + } else { + book_client = NULL; + } + + if (!book_client) + return; + + if (e_destination_is_evolution_list (destination)) { + GtkWidget *contact_list_editor; + + if (!name_selector_entry->priv->contact_list_editor_func) + return; + + contact_list_editor = (*name_selector_entry->priv->contact_list_editor_func) (book_client, contact, FALSE, TRUE); + g_object_ref (name_selector_entry); + g_signal_connect ( + contact_list_editor, "editor_closed", + G_CALLBACK (editor_closed_cb), name_selector_entry); + } else { + GtkWidget *contact_editor; + + if (!name_selector_entry->priv->contact_editor_func) + return; + + contact_editor = (*name_selector_entry->priv->contact_editor_func) (book_client, contact, FALSE, TRUE); + g_object_ref (name_selector_entry); + g_signal_connect ( + contact_editor, "editor_closed", + G_CALLBACK (editor_closed_cb), name_selector_entry); + } +} + +static void +popup_activate_email (ENameSelectorEntry *name_selector_entry, + GtkWidget *menu_item) +{ + EDestination *destination; + EContact *contact; + gint email_num; + + destination = name_selector_entry->priv->popup_destination; + if (!destination) + return; + + contact = e_destination_get_contact (destination); + if (!contact) + return; + + email_num = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (menu_item), "order")); + e_destination_set_contact (destination, contact, email_num); +} + +static void +popup_activate_list (EDestination *destination, + GtkWidget *item) +{ + gboolean status = gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (item)); + + e_destination_set_ignored (destination, !status); +} + +static void +popup_activate_cut (ENameSelectorEntry *name_selector_entry, + GtkWidget *menu_item) +{ + EDestination *destination; + const gchar *contact_email; + gchar *pemail = NULL; + GtkClipboard *clipboard; + + destination = name_selector_entry->priv->popup_destination; + contact_email =e_destination_get_textrep (destination, TRUE); + + g_signal_handlers_block_by_func (name_selector_entry, user_insert_text, name_selector_entry); + g_signal_handlers_block_by_func (name_selector_entry, user_delete_text, name_selector_entry); + + clipboard = gtk_clipboard_get (GDK_SELECTION_PRIMARY); + pemail = g_strconcat (contact_email, ",", NULL); + gtk_clipboard_set_text (clipboard, pemail, strlen (pemail)); + + clipboard = gtk_clipboard_get (GDK_SELECTION_CLIPBOARD); + gtk_clipboard_set_text (clipboard, pemail, strlen (pemail)); + + gtk_editable_delete_text (GTK_EDITABLE (name_selector_entry), 0, 0); + e_destination_store_remove_destination (name_selector_entry->priv->destination_store, destination); + + g_free (pemail); + g_signal_handlers_unblock_by_func (name_selector_entry, user_delete_text, name_selector_entry); + g_signal_handlers_unblock_by_func (name_selector_entry, user_insert_text, name_selector_entry); +} + +static void +popup_activate_copy (ENameSelectorEntry *name_selector_entry, + GtkWidget *menu_item) +{ + EDestination *destination; + const gchar *contact_email; + gchar *pemail; + GtkClipboard *clipboard; + + destination = name_selector_entry->priv->popup_destination; + contact_email = e_destination_get_textrep (destination, TRUE); + + g_signal_handlers_block_by_func (name_selector_entry, user_insert_text, name_selector_entry); + g_signal_handlers_block_by_func (name_selector_entry, user_delete_text, name_selector_entry); + + clipboard = gtk_clipboard_get (GDK_SELECTION_PRIMARY); + pemail = g_strconcat (contact_email, ",", NULL); + gtk_clipboard_set_text (clipboard, pemail, strlen (pemail)); + + clipboard = gtk_clipboard_get (GDK_SELECTION_CLIPBOARD); + gtk_clipboard_set_text (clipboard, pemail, strlen (pemail)); + g_free (pemail); + g_signal_handlers_unblock_by_func (name_selector_entry, user_delete_text, name_selector_entry); + g_signal_handlers_unblock_by_func (name_selector_entry, user_insert_text, name_selector_entry); +} + +static void +destination_set_list (GtkWidget *item, + EDestination *destination) +{ + EContact *contact; + gboolean status = gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (item)); + + contact = e_destination_get_contact (destination); + if (!contact) + return; + + e_destination_set_ignored (destination, !status); +} + +static void +destination_set_email (GtkWidget *item, + EDestination *destination) +{ + gint email_num; + EContact *contact; + + if (!gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (item))) + return; + contact = e_destination_get_contact (destination); + if (!contact) + return; + + email_num = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (item), "order")); + e_destination_set_contact (destination, contact, email_num); +} + +static void +populate_popup (ENameSelectorEntry *name_selector_entry, + GtkMenu *menu) +{ + EDestination *destination; + EContact *contact; + GtkWidget *menu_item; + GList *email_list = NULL; + GList *l; + gint i; + gchar *edit_label; + gchar *cut_label; + gchar *copy_label; + gint email_num, len; + GSList *group = NULL; + gboolean is_list; + gboolean show_menu = FALSE; + + destination = name_selector_entry->priv->popup_destination; + if (!destination) + return; + + contact = e_destination_get_contact (destination); + if (!contact) + return; + + /* Prepend the menu items, backwards */ + + /* Separator */ + + menu_item = gtk_separator_menu_item_new (); + gtk_widget_show (menu_item); + gtk_menu_shell_prepend (GTK_MENU_SHELL (menu), menu_item); + email_num = e_destination_get_email_num (destination); + + /* Addresses */ + is_list = e_contact_get (contact, E_CONTACT_IS_LIST) ? TRUE : FALSE; + if (is_list) { + const GList *dests = e_destination_list_get_dests (destination); + GList *iter; + gint length = g_list_length ((GList *) dests); + + for (iter = (GList *) dests; iter; iter = iter->next) { + EDestination *dest = (EDestination *) iter->data; + const gchar *email = e_destination_get_email (dest); + + if (!email || *email == '\0') + continue; + + if (length > 1) { + menu_item = gtk_check_menu_item_new_with_label (email); + g_signal_connect ( + menu_item, "toggled", + G_CALLBACK (destination_set_list), dest); + } else { + menu_item = gtk_menu_item_new_with_label (email); + } + + gtk_widget_show (menu_item); + gtk_menu_shell_prepend (GTK_MENU_SHELL (menu), menu_item); + show_menu = TRUE; + + if (length > 1) { + gtk_check_menu_item_set_active ( + GTK_CHECK_MENU_ITEM (menu_item), + !e_destination_is_ignored (dest)); + g_signal_connect_swapped ( + menu_item, "activate", + G_CALLBACK (popup_activate_list), dest); + } + } + + } else { + email_list = e_contact_get (contact, E_CONTACT_EMAIL); + len = g_list_length (email_list); + + for (l = email_list, i = 0; l; l = g_list_next (l), i++) { + gchar *email = l->data; + + if (!email || *email == '\0') + continue; + + if (len > 1) { + menu_item = gtk_radio_menu_item_new_with_label (group, email); + group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (menu_item)); + g_signal_connect (menu_item, "toggled", G_CALLBACK (destination_set_email), destination); + } else { + menu_item = gtk_menu_item_new_with_label (email); + } + + gtk_widget_show (menu_item); + gtk_menu_shell_prepend (GTK_MENU_SHELL (menu), menu_item); + show_menu = TRUE; + g_object_set_data (G_OBJECT (menu_item), "order", GINT_TO_POINTER (i)); + + if (i == email_num && len > 1) { + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menu_item), TRUE); + g_signal_connect_swapped ( + menu_item, "activate", + G_CALLBACK (popup_activate_email), + name_selector_entry); + } + } + } + + /* Separator */ + + if (show_menu) { + menu_item = gtk_separator_menu_item_new (); + gtk_widget_show (menu_item); + gtk_menu_shell_prepend (GTK_MENU_SHELL (menu), menu_item); + } + + /* Expand a list inline */ + if (is_list) { + /* To Translators: This would be similiar to "Expand MyList Inline" where MyList is a Contact List*/ + edit_label = g_strdup_printf (_("E_xpand %s Inline"), (gchar *) e_contact_get_const (contact, E_CONTACT_FILE_AS)); + menu_item = gtk_menu_item_new_with_mnemonic (edit_label); + g_free (edit_label); + gtk_widget_show (menu_item); + gtk_menu_shell_prepend (GTK_MENU_SHELL (menu), menu_item); + g_signal_connect_swapped ( + menu_item, "activate", G_CALLBACK (popup_activate_inline_expand), + name_selector_entry); + + /* Separator */ + menu_item = gtk_separator_menu_item_new (); + gtk_widget_show (menu_item); + gtk_menu_shell_prepend (GTK_MENU_SHELL (menu), menu_item); + } + + /* Copy Contact Item */ + copy_label = g_strdup_printf (_("Cop_y %s"), (gchar *) e_contact_get_const (contact, E_CONTACT_FILE_AS)); + menu_item = gtk_menu_item_new_with_mnemonic (copy_label); + g_free (copy_label); + gtk_widget_show (menu_item); + gtk_menu_shell_prepend (GTK_MENU_SHELL (menu), menu_item); + + g_signal_connect_swapped ( + menu_item, "activate", G_CALLBACK (popup_activate_copy), + name_selector_entry); + + /* Cut Contact Item */ + cut_label = g_strdup_printf (_("C_ut %s"), (gchar *) e_contact_get_const (contact, E_CONTACT_FILE_AS)); + menu_item = gtk_menu_item_new_with_mnemonic (cut_label); + g_free (cut_label); + gtk_widget_show (menu_item); + gtk_menu_shell_prepend (GTK_MENU_SHELL (menu), menu_item); + + g_signal_connect_swapped ( + menu_item, "activate", G_CALLBACK (popup_activate_cut), + name_selector_entry); + + if (show_menu) { + menu_item = gtk_separator_menu_item_new (); + gtk_widget_show (menu_item); + gtk_menu_shell_prepend (GTK_MENU_SHELL (menu), menu_item); + } + + /* Edit Contact item */ + + edit_label = g_strdup_printf (_("_Edit %s"), (gchar *) e_contact_get_const (contact, E_CONTACT_FILE_AS)); + menu_item = gtk_menu_item_new_with_mnemonic (edit_label); + g_free (edit_label); + gtk_widget_show (menu_item); + gtk_menu_shell_prepend (GTK_MENU_SHELL (menu), menu_item); + + g_signal_connect_swapped ( + menu_item, "activate", G_CALLBACK (popup_activate_contact), + name_selector_entry); + + deep_free_list (email_list); +} + +static void +copy_or_cut_clipboard (ENameSelectorEntry *name_selector_entry, + gboolean is_cut) +{ + GtkClipboard *clipboard; + GtkEditable *editable; + const gchar *text, *cp; + GHashTable *hash; + GHashTableIter iter; + gpointer key, value; + GString *addresses; + gint ii, start, end; + gunichar uc; + + editable = GTK_EDITABLE (name_selector_entry); + text = gtk_entry_get_text (GTK_ENTRY (editable)); + + if (!gtk_editable_get_selection_bounds (editable, &start, &end)) + return; + + g_return_if_fail (end > start); + + hash = g_hash_table_new (g_direct_hash, g_direct_equal); + + ii = end; + cp = g_utf8_offset_to_pointer (text, end); + uc = g_utf8_get_char (cp); + + /* Exclude trailing whitespace and commas. */ + while (ii >= start && (uc == ',' || g_unichar_isspace (uc))) { + cp = g_utf8_prev_char (cp); + uc = g_utf8_get_char (cp); + ii--; + } + + /* Determine the index of each remaining character. */ + while (ii >= start) { + gint index = get_index_at_position (text, ii--); + g_hash_table_insert (hash, GINT_TO_POINTER (index), NULL); + } + + addresses = g_string_new (""); + + g_hash_table_iter_init (&iter, hash); + while (g_hash_table_iter_next (&iter, &key, &value)) { + gint index = GPOINTER_TO_INT (key); + EDestination *dest; + gint rstart, rend; + + if (!get_range_by_index (text, index, &rstart, &rend)) + continue; + + if (rstart < start) { + if (addresses->str && *addresses->str) + g_string_append (addresses, ", "); + + g_string_append_len (addresses, text + start, rend - start); + } else if (rend > end) { + if (addresses->str && *addresses->str) + g_string_append (addresses, ", "); + + g_string_append_len (addresses, text + rstart, end - rstart); + } else { + /* the contact is whole selected */ + dest = find_destination_by_index (name_selector_entry, index); + if (dest && e_destination_get_textrep (dest, TRUE)) { + if (addresses->str && *addresses->str) + g_string_append (addresses, ", "); + + g_string_append (addresses, e_destination_get_textrep (dest, TRUE)); + + /* store the 'dest' as a value for the index */ + g_hash_table_insert (hash, GINT_TO_POINTER (index), dest); + } else + g_string_append_len (addresses, text + rstart, rend - rstart); + } + } + + if (is_cut) + gtk_editable_delete_text (editable, start, end); + + g_hash_table_unref (hash); + + clipboard = gtk_widget_get_clipboard ( + GTK_WIDGET (name_selector_entry), GDK_SELECTION_CLIPBOARD); + gtk_clipboard_set_text (clipboard, addresses->str, -1); + + g_string_free (addresses, TRUE); +} + +static void +copy_clipboard (GtkEntry *entry, + ENameSelectorEntry *name_selector_entry) +{ + copy_or_cut_clipboard (name_selector_entry, FALSE); + g_signal_stop_emission_by_name (entry, "copy-clipboard"); +} + +static void +cut_clipboard (GtkEntry *entry, + ENameSelectorEntry *name_selector_entry) +{ + copy_or_cut_clipboard (name_selector_entry, TRUE); + g_signal_stop_emission_by_name (entry, "cut-clipboard"); +} + +static void +e_name_selector_entry_init (ENameSelectorEntry *name_selector_entry) +{ + GtkCellRenderer *renderer; + + name_selector_entry->priv = + E_NAME_SELECTOR_ENTRY_GET_PRIVATE (name_selector_entry); + + g_queue_init (&name_selector_entry->priv->cancellables); + + name_selector_entry->priv->minimum_query_length = 3; + name_selector_entry->priv->show_address = FALSE; + + /* Edit signals */ + + g_signal_connect ( + name_selector_entry, "insert-text", + G_CALLBACK (user_insert_text), name_selector_entry); + g_signal_connect ( + name_selector_entry, "delete-text", + G_CALLBACK (user_delete_text), name_selector_entry); + g_signal_connect ( + name_selector_entry, "focus-out-event", + G_CALLBACK (user_focus_out), name_selector_entry); + g_signal_connect_after ( + name_selector_entry, "focus-in-event", + G_CALLBACK (user_focus_in), name_selector_entry); + + /* Drawing */ + + g_signal_connect ( + name_selector_entry, "draw", + G_CALLBACK (draw_event), name_selector_entry); + + /* Activation: Complete current entry if possible */ + + g_signal_connect ( + name_selector_entry, "activate", + G_CALLBACK (entry_activate), name_selector_entry); + + /* Pop-up menu */ + + g_signal_connect ( + name_selector_entry, "button-press-event", + G_CALLBACK (prepare_popup_destination), name_selector_entry); + g_signal_connect ( + name_selector_entry, "populate-popup", + G_CALLBACK (populate_popup), name_selector_entry); + + /* Clipboard signals */ + g_signal_connect ( + name_selector_entry, "copy-clipboard", + G_CALLBACK (copy_clipboard), name_selector_entry); + g_signal_connect ( + name_selector_entry, "cut-clipboard", + G_CALLBACK (cut_clipboard), name_selector_entry); + + /* Completion */ + + name_selector_entry->priv->email_generator = NULL; + + name_selector_entry->priv->entry_completion = gtk_entry_completion_new (); + gtk_entry_completion_set_match_func ( + name_selector_entry->priv->entry_completion, + (GtkEntryCompletionMatchFunc) completion_match_cb, NULL, NULL); + g_signal_connect_swapped ( + name_selector_entry->priv->entry_completion, "match-selected", + G_CALLBACK (completion_match_selected), name_selector_entry); + + gtk_entry_set_completion ( + GTK_ENTRY (name_selector_entry), + name_selector_entry->priv->entry_completion); + + renderer = gtk_cell_renderer_pixbuf_new (); + gtk_cell_layout_pack_start ( + GTK_CELL_LAYOUT (name_selector_entry->priv->entry_completion), + renderer, FALSE); + gtk_cell_layout_set_cell_data_func ( + GTK_CELL_LAYOUT (name_selector_entry->priv->entry_completion), + GTK_CELL_RENDERER (renderer), + (GtkCellLayoutDataFunc) contact_layout_pixbuffer, + name_selector_entry, NULL); + + /* Completion list name renderer */ + renderer = gtk_cell_renderer_text_new (); + gtk_cell_layout_pack_start ( + GTK_CELL_LAYOUT (name_selector_entry->priv->entry_completion), + renderer, TRUE); + gtk_cell_layout_set_cell_data_func ( + GTK_CELL_LAYOUT (name_selector_entry->priv->entry_completion), + GTK_CELL_RENDERER (renderer), + (GtkCellLayoutDataFunc) contact_layout_formatter, + name_selector_entry, NULL); + + /* Destination store */ + + name_selector_entry->priv->destination_store = e_destination_store_new (); + setup_destination_store (name_selector_entry); + name_selector_entry->priv->is_completing = FALSE; +} + +/** + * e_name_selector_entry_new: + * + * Creates a new #ENameSelectorEntry. + * + * Returns: A new #ENameSelectorEntry. + **/ +ENameSelectorEntry * +e_name_selector_entry_new (ESourceRegistry *registry) +{ + g_return_val_if_fail (E_IS_SOURCE_REGISTRY (registry), NULL); + + return g_object_new ( + E_TYPE_NAME_SELECTOR_ENTRY, + "registry", registry, NULL); +} + +/** + * e_name_selector_entry_get_registry: + * @name_selector_entry: an #ENameSelectorEntry + * + * Returns the #ESourceRegistry used to query address books. + * + * Returns: the #ESourceRegistry, or %NULL + * + * Since: 3.6 + **/ +ESourceRegistry * +e_name_selector_entry_get_registry (ENameSelectorEntry *name_selector_entry) +{ + g_return_val_if_fail ( + E_IS_NAME_SELECTOR_ENTRY (name_selector_entry), NULL); + + return name_selector_entry->priv->registry; +} + +/** + * e_name_selector_entry_set_registry: + * @name_selector_entry: an #ENameSelectorEntry + * @registry: an #ESourceRegistry + * + * Sets the #ESourceRegistry used to query address books. + * + * This function is intended for cases where @name_selector_entry is + * instantiated by a #GtkBuilder and has to be given an #EsourceRegistry + * after it is fully constructed. + * + * Since: 3.6 + **/ +void +e_name_selector_entry_set_registry (ENameSelectorEntry *name_selector_entry, + ESourceRegistry *registry) +{ + g_return_if_fail (E_IS_NAME_SELECTOR_ENTRY (name_selector_entry)); + + if (name_selector_entry->priv->registry == registry) + return; + + if (registry != NULL) { + g_return_if_fail (E_IS_SOURCE_REGISTRY (registry)); + g_object_ref (registry); + } + + if (name_selector_entry->priv->registry != NULL) + g_object_unref (name_selector_entry->priv->registry); + + name_selector_entry->priv->registry = registry; + + g_object_notify (G_OBJECT (name_selector_entry), "registry"); +} + +/** + * e_name_selector_entry_get_minimum_query_length: + * @name_selector_entry: an #ENameSelectorEntry + * + * Returns: Minimum length of query before completion starts + * + * Since: 3.6 + **/ +gint +e_name_selector_entry_get_minimum_query_length (ENameSelectorEntry *name_selector_entry) +{ + g_return_val_if_fail (E_IS_NAME_SELECTOR_ENTRY (name_selector_entry), -1); + + return name_selector_entry->priv->minimum_query_length; +} + +/** + * e_name_selector_entry_set_minimum_query_length: + * @name_selector_entry: an #ENameSelectorEntry + * @length: minimum query length + * + * Sets minimum length of query before completion starts. + * + * Since: 3.6 + **/ +void +e_name_selector_entry_set_minimum_query_length (ENameSelectorEntry *name_selector_entry, + gint length) +{ + g_return_if_fail (E_IS_NAME_SELECTOR_ENTRY (name_selector_entry)); + g_return_if_fail (length > 0); + + if (name_selector_entry->priv->minimum_query_length == length) + return; + + name_selector_entry->priv->minimum_query_length = length; + + g_object_notify (G_OBJECT (name_selector_entry), "minimum-query-length"); +} + +/** + * e_name_selector_entry_get_show_address: + * @name_selector_entry: an #ENameSelectorEntry + * + * Returns: Whether always show email address for an auto-completed contact. + * + * Since: 3.6 + **/ +gboolean +e_name_selector_entry_get_show_address (ENameSelectorEntry *name_selector_entry) +{ + g_return_val_if_fail (E_IS_NAME_SELECTOR_ENTRY (name_selector_entry), FALSE); + + return name_selector_entry->priv->show_address; +} + +/** + * e_name_selector_entry_set_show_address: + * @name_selector_entry: an #ENameSelectorEntry + * @show: new value to set + * + * Sets whether always show email address for an auto-completed contact. + * + * Since: 3.6 + **/ +void +e_name_selector_entry_set_show_address (ENameSelectorEntry *name_selector_entry, + gboolean show) +{ + g_return_if_fail (E_IS_NAME_SELECTOR_ENTRY (name_selector_entry)); + + if ((name_selector_entry->priv->show_address ? 1 : 0) == (show ? 1 : 0)) + return; + + name_selector_entry->priv->show_address = show; + + sanitize_entry (name_selector_entry); + + g_object_notify (G_OBJECT (name_selector_entry), "show-address"); +} + +/** + * e_name_selector_entry_peek_contact_store: + * @name_selector_entry: an #ENameSelectorEntry + * + * Gets the #EContactStore being used by @name_selector_entry. + * + * Returns: An #EContactStore. + **/ +EContactStore * +e_name_selector_entry_peek_contact_store (ENameSelectorEntry *name_selector_entry) +{ + g_return_val_if_fail (E_IS_NAME_SELECTOR_ENTRY (name_selector_entry), NULL); + + return name_selector_entry->priv->contact_store; +} + +/** + * e_name_selector_entry_set_contact_store: + * @name_selector_entry: an #ENameSelectorEntry + * @contact_store: an #EContactStore to use + * + * Sets the #EContactStore being used by @name_selector_entry to @contact_store. + **/ +void +e_name_selector_entry_set_contact_store (ENameSelectorEntry *name_selector_entry, + EContactStore *contact_store) +{ + g_return_if_fail (E_IS_NAME_SELECTOR_ENTRY (name_selector_entry)); + g_return_if_fail (contact_store == NULL || E_IS_CONTACT_STORE (contact_store)); + + if (contact_store == name_selector_entry->priv->contact_store) + return; + + if (name_selector_entry->priv->contact_store) + g_object_unref (name_selector_entry->priv->contact_store); + name_selector_entry->priv->contact_store = contact_store; + if (name_selector_entry->priv->contact_store) + g_object_ref (name_selector_entry->priv->contact_store); + + setup_contact_store (name_selector_entry); +} + +/** + * e_name_selector_entry_peek_destination_store: + * @name_selector_entry: an #ENameSelectorEntry + * + * Gets the #EDestinationStore being used to store @name_selector_entry's destinations. + * + * Returns: An #EDestinationStore. + **/ +EDestinationStore * +e_name_selector_entry_peek_destination_store (ENameSelectorEntry *name_selector_entry) +{ + g_return_val_if_fail (E_IS_NAME_SELECTOR_ENTRY (name_selector_entry), NULL); + + return name_selector_entry->priv->destination_store; +} + +/** + * e_name_selector_entry_set_destination_store: + * @name_selector_entry: an #ENameSelectorEntry + * @destination_store: an #EDestinationStore to use + * + * Sets @destination_store as the #EDestinationStore to be used to store + * destinations for @name_selector_entry. + **/ +void +e_name_selector_entry_set_destination_store (ENameSelectorEntry *name_selector_entry, + EDestinationStore *destination_store) +{ + g_return_if_fail (E_IS_NAME_SELECTOR_ENTRY (name_selector_entry)); + g_return_if_fail (E_IS_DESTINATION_STORE (destination_store)); + + if (destination_store == name_selector_entry->priv->destination_store) + return; + + g_object_unref (name_selector_entry->priv->destination_store); + name_selector_entry->priv->destination_store = g_object_ref (destination_store); + + setup_destination_store (name_selector_entry); +} + +/** + * e_name_selector_entry_get_popup_destination: + * + * Since: 2.32 + **/ +EDestination * +e_name_selector_entry_get_popup_destination (ENameSelectorEntry *name_selector_entry) +{ + g_return_val_if_fail (E_IS_NAME_SELECTOR_ENTRY (name_selector_entry), NULL); + + return name_selector_entry->priv->popup_destination; +} + +/** + * e_name_selector_entry_set_contact_editor_func: + * + * DO NOT USE. + **/ +void +e_name_selector_entry_set_contact_editor_func (ENameSelectorEntry *name_selector_entry, + gpointer func) +{ + name_selector_entry->priv->contact_editor_func = func; +} + +/** + * e_name_selector_entry_set_contact_list_editor_func: + * + * DO NOT USE. + **/ +void +e_name_selector_entry_set_contact_list_editor_func (ENameSelectorEntry *name_selector_entry, + gpointer func) +{ + name_selector_entry->priv->contact_list_editor_func = func; +} diff --git a/e-util/e-name-selector-entry.h b/e-util/e-name-selector-entry.h new file mode 100644 index 0000000000..63ce9aa437 --- /dev/null +++ b/e-util/e-name-selector-entry.h @@ -0,0 +1,124 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ + +/* e-name-selector-entry.c - Single-line text entry widget for EDestinations. + * + * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU Lesser General Public + * License as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + * + * Authors: Hans Petter Jansson <hpj@novell.com> + */ + +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + +#ifndef E_NAME_SELECTOR_ENTRY_H +#define E_NAME_SELECTOR_ENTRY_H + +#include <gtk/gtk.h> +#include <libebook/libebook.h> + +#include <e-util/e-contact-store.h> +#include <e-util/e-destination-store.h> +#include <e-util/e-tree-model-generator.h> + +/* Standard GObject macros */ +#define E_TYPE_NAME_SELECTOR_ENTRY \ + (e_name_selector_entry_get_type ()) +#define E_NAME_SELECTOR_ENTRY(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST \ + ((obj), E_TYPE_NAME_SELECTOR_ENTRY, ENameSelectorEntry)) +#define E_NAME_SELECTOR_ENTRY_CLASS(cls) \ + (G_TYPE_CHECK_CLASS_CAST \ + ((cls), E_TYPE_NAME_SELECTOR_ENTRY, ENameSelectorEntryClass)) +#define E_IS_NAME_SELECTOR_ENTRY(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE \ + ((obj), E_TYPE_NAME_SELECTOR_ENTRY)) +#define E_IS_NAME_SELECTOR_ENTRY_CLASS(cls) \ + (G_TYPE_CHECK_CLASS_TYPE \ + ((cls), E_TYPE_NAME_SELECTOR_ENTRY)) +#define E_NAME_SELECTOR_ENTRY_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS \ + ((obj), E_TYPE_NAME_SELECTOR_ENTRY, ENameSelectorEntryClass)) + +G_BEGIN_DECLS + +typedef struct _ENameSelectorEntry ENameSelectorEntry; +typedef struct _ENameSelectorEntryClass ENameSelectorEntryClass; +typedef struct _ENameSelectorEntryPrivate ENameSelectorEntryPrivate; + +struct _ENameSelectorEntry { + GtkEntry parent; + ENameSelectorEntryPrivate *priv; +}; + +struct _ENameSelectorEntryClass { + GtkEntryClass parent_class; + + void (*updated) (ENameSelectorEntry *entry, gchar *email); + + gpointer reserved1; + gpointer reserved2; +}; + +GType e_name_selector_entry_get_type (void); +ENameSelectorEntry * + e_name_selector_entry_new (ESourceRegistry *registry); +ESourceRegistry * + e_name_selector_entry_get_registry + (ENameSelectorEntry *name_selector_entry); +void e_name_selector_entry_set_registry + (ENameSelectorEntry *name_selector_entry, + ESourceRegistry *registry); +gint e_name_selector_entry_get_minimum_query_length + (ENameSelectorEntry *name_selector_entry); +void e_name_selector_entry_set_minimum_query_length + (ENameSelectorEntry *name_selector_entry, + gint length); +gboolean e_name_selector_entry_get_show_address + (ENameSelectorEntry *name_selector_entry); +void e_name_selector_entry_set_show_address + (ENameSelectorEntry *name_selector_entry, + gboolean show); +EContactStore * e_name_selector_entry_peek_contact_store + (ENameSelectorEntry *name_selector_entry); +void e_name_selector_entry_set_contact_store + (ENameSelectorEntry *name_selector_entry, + EContactStore *contact_store); +EDestinationStore * + e_name_selector_entry_peek_destination_store + (ENameSelectorEntry *name_selector_entry); +void e_name_selector_entry_set_destination_store + (ENameSelectorEntry *name_selector_entry, + EDestinationStore *destination_store); +EDestination * e_name_selector_entry_get_popup_destination + (ENameSelectorEntry *name_selector_entry); + +/* TEMPORARY API - DO NOT USE */ +void e_name_selector_entry_set_contact_editor_func + (ENameSelectorEntry *name_selector_entry, + gpointer func); +void e_name_selector_entry_set_contact_list_editor_func + (ENameSelectorEntry *name_selector_entry, + gpointer func); +gchar * ens_util_populate_user_query_fields + (GSList *user_query_fields, + const gchar *cue_str, + const gchar *encoded_cue_str); + +G_END_DECLS + +#endif /* E_NAME_SELECTOR_ENTRY_H */ diff --git a/e-util/e-name-selector-list.c b/e-util/e-name-selector-list.c new file mode 100644 index 0000000000..67afb504b3 --- /dev/null +++ b/e-util/e-name-selector-list.c @@ -0,0 +1,790 @@ +/* + * Single-line text entry widget for EDestinations. + * + * 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> + * Devashish Sharma <sdevashish@novell.com> + * + * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) + * + */ + +#include <config.h> +#include <string.h> +#include <gdk/gdkkeysyms.h> +#include <glib/gi18n-lib.h> + +#include "e-name-selector-list.h" +#include "e-name-selector-entry.h" + +#define E_NAME_SELECTOR_LIST_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE \ + ((obj), E_TYPE_NAME_SELECTOR_LIST, ENameSelectorListPrivate)) + +#define MAX_ROW 10 + +struct _ENameSelectorListPrivate { + GtkWindow *popup; + GtkWidget *tree_view; + GtkWidget *menu; + gint rows; + GdkDevice *grab_keyboard; + GdkDevice *grab_pointer; +}; + +G_DEFINE_TYPE (ENameSelectorList, e_name_selector_list, E_TYPE_NAME_SELECTOR_ENTRY) + +/* Signals */ + +static void +enl_popup_size (ENameSelectorList *list) +{ + gint height = 0, count; + GtkAllocation allocation; + GtkTreeViewColumn *column = NULL; + + column = gtk_tree_view_get_column ( GTK_TREE_VIEW (list->priv->tree_view), 0); + if (column) + gtk_tree_view_column_cell_get_size (column, NULL, NULL, NULL, NULL, &height); + + /* Show a maximum of 10 rows in the popup list view */ + count = list->priv->rows; + if (count > MAX_ROW) + count = MAX_ROW; + if (count <= 0) + count = 1; + + gtk_widget_get_allocation (GTK_WIDGET (list), &allocation); + gtk_widget_set_size_request (list->priv->tree_view, allocation.width - 3 , height * count); +} + +static void +enl_popup_position (ENameSelectorList *list) +{ + GtkAllocation allocation; + GdkWindow *window; + gint x,y; + + gtk_widget_get_allocation (GTK_WIDGET (list), &allocation); + + enl_popup_size (list); + window = gtk_widget_get_window (GTK_WIDGET (list)); + gdk_window_get_origin (window, &x, &y); + y = y + allocation.height; + + gtk_window_move (list->priv->popup, x, y); +} + +static gboolean +popup_grab_on_window (GdkWindow *window, + GdkDevice *keyboard, + GdkDevice *pointer, + guint32 activate_time) +{ + if (keyboard && gdk_device_grab (keyboard, window, + GDK_OWNERSHIP_WINDOW, TRUE, + GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK, + NULL, activate_time) != GDK_GRAB_SUCCESS) + return FALSE; + + if (pointer && gdk_device_grab (pointer, window, + GDK_OWNERSHIP_WINDOW, TRUE, + GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | + GDK_POINTER_MOTION_MASK, + NULL, activate_time) != GDK_GRAB_SUCCESS) { + if (keyboard) + gdk_device_ungrab (keyboard, activate_time); + + return FALSE; + } + + return TRUE; +} + +static void +enl_popup_grab (ENameSelectorList *list, + const GdkEvent *event) +{ + EDestinationStore *store; + ENameSelectorEntry *entry; + GdkWindow *window; + GdkDevice *device = NULL; + GdkDevice *keyboard, *pointer; + gint len; + + if (list->priv->grab_pointer && list->priv->grab_keyboard) + return; + + window = gtk_widget_get_window (GTK_WIDGET (list->priv->popup)); + + if (event) + device = gdk_event_get_device (event); + if (!device) + device = gtk_get_current_event_device (); + if (!device) { + GdkDeviceManager *device_manager; + + device_manager = gdk_display_get_device_manager (gtk_widget_get_display (GTK_WIDGET (list))); + device = gdk_device_manager_get_client_pointer (device_manager); + } + + if (gdk_device_get_source (device) == GDK_SOURCE_KEYBOARD) { + keyboard = device; + pointer = gdk_device_get_associated_device (device); + } else { + pointer = device; + keyboard = gdk_device_get_associated_device (device); + } + + if (!popup_grab_on_window (window, keyboard, pointer, gtk_get_current_event_time ())) + return; + + gtk_widget_grab_focus ((GtkWidget *) list); + + /* Build the listview from the model */ + entry = E_NAME_SELECTOR_ENTRY (list); + store = e_name_selector_entry_peek_destination_store (entry); + gtk_tree_view_set_model ( + GTK_TREE_VIEW (list->priv->tree_view), + GTK_TREE_MODEL (store)); + + /* If any selection of text is present, unselect it */ + len = strlen (gtk_entry_get_text (GTK_ENTRY (list))); + gtk_editable_select_region (GTK_EDITABLE (list), len, -1); + + gtk_device_grab_add (GTK_WIDGET (list->priv->popup), pointer, TRUE); + list->priv->grab_keyboard = keyboard; + list->priv->grab_pointer = pointer; +} + +static void +enl_popup_ungrab (ENameSelectorList *list) +{ + if (!list->priv->grab_pointer || + !list->priv->grab_keyboard || + !gtk_widget_has_grab (GTK_WIDGET (list->priv->popup))) + return; + + gtk_device_grab_remove (GTK_WIDGET (list->priv->popup), list->priv->grab_pointer); + gtk_device_grab_remove (GTK_WIDGET (list->priv->popup), list->priv->grab_keyboard); + + list->priv->grab_pointer = NULL; + list->priv->grab_keyboard = NULL; +} + +static gboolean +enl_entry_focus_in (ENameSelectorList *list, + GdkEventFocus *event, + gpointer dummy) +{ + gint len; + + /* FIXME: Dont select every thing by default- Code is there but still it does */ + len = strlen (gtk_entry_get_text (GTK_ENTRY (list))); + gtk_editable_select_region (GTK_EDITABLE (list), len, -1); + + return TRUE; +} + +static gboolean +enl_entry_focus_out (ENameSelectorList *list, + GdkEventFocus *event, + gpointer dummy) +{ + /* When we lose focus and popup is still present hide it. Dont do it, when we click the popup. Look for grab */ + if (gtk_widget_get_visible (GTK_WIDGET (list->priv->popup)) + && !gtk_widget_has_grab (GTK_WIDGET (list->priv->popup))) { + enl_popup_ungrab (list); + gtk_widget_hide ((GtkWidget *) list->priv->popup); + + return FALSE; + } + + return FALSE; +} + +static gboolean +enl_popup_button_press (GtkWidget *widget, + GdkEventButton *event, + ENameSelectorList *list) +{ + if (!gtk_widget_get_mapped (widget)) + return FALSE; + + /* if we come here, it's usually time to popdown */ + gtk_widget_hide ((GtkWidget *) list->priv->popup); + + return TRUE; +} + +static gboolean +enl_popup_focus_out (GtkWidget *w, + GdkEventFocus *event, + ENameSelectorList *list) +{ + /* Just ungrab. We lose focus on button press event */ + enl_popup_ungrab (list); + return TRUE; +} + +static gboolean +enl_popup_enter_notify (GtkWidget *widget, + GdkEventCrossing *event, + ENameSelectorList *list) +{ + if (event->type == GDK_ENTER_NOTIFY && !gtk_widget_has_grab (GTK_WIDGET (list->priv->popup))) + enl_popup_grab (list, (GdkEvent *) event); + + return TRUE; +} + +static void +enl_tree_select_node (ENameSelectorList *list, + gint n) +{ + EDestinationStore *store; + ENameSelectorEntry *entry; + GtkTreeSelection *selection; + GtkTreeViewColumn *column; + GtkTreeView *tree_view; + GtkTreeIter iter; + GtkTreePath *path; + + entry = E_NAME_SELECTOR_ENTRY (list); + tree_view = GTK_TREE_VIEW (list->priv->tree_view); + store = e_name_selector_entry_peek_destination_store (entry); + selection = gtk_tree_view_get_selection (tree_view); + iter.stamp = e_destination_store_get_stamp (store); + iter.user_data = GINT_TO_POINTER (n - 1); + + gtk_tree_selection_unselect_all (selection); + gtk_tree_selection_select_iter (selection, &iter); + + column = gtk_tree_view_get_column (tree_view, 0); + path = e_destination_store_get_path (GTK_TREE_MODEL (store), &iter); + gtk_tree_view_scroll_to_cell (tree_view, path, column, FALSE, 0, 0); + gtk_tree_view_set_cursor (tree_view, path, column, FALSE); + gtk_widget_grab_focus (GTK_WIDGET (tree_view)); + /*Fixme: We should grab the focus to the column. How? */ + + gtk_tree_path_free (path); +} + +static gboolean +enl_entry_key_press_event (ENameSelectorList *list, + GdkEventKey *event, + gpointer dummy) +{ + ENameSelectorEntry *entry; + EDestinationStore *store; + + entry = E_NAME_SELECTOR_ENTRY (list); + store = e_name_selector_entry_peek_destination_store (entry); + + if ( (event->state & GDK_CONTROL_MASK) && (event->keyval == GDK_KEY_Down)) { + enl_popup_position (list); + gtk_widget_show_all (GTK_WIDGET (list->priv->popup)); + enl_popup_grab (list, (GdkEvent *) event); + list->priv->rows = e_destination_store_get_destination_count (store); + enl_popup_size (list); + enl_tree_select_node (list, 1); + return TRUE; + } + return FALSE; +} + +static void +delete_row (GtkTreePath *path, + ENameSelectorList *list) +{ + ENameSelectorEntry *entry; + EDestinationStore *store; + GtkTreeIter iter; + gint n, len; + GtkTreeSelection *selection; + + entry = E_NAME_SELECTOR_ENTRY (list); + store = e_name_selector_entry_peek_destination_store (entry); + + if (!gtk_tree_model_get_iter (GTK_TREE_MODEL (store), &iter, path)) + return; + + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (list->priv->tree_view)); + len = e_destination_store_get_destination_count (store); + n = GPOINTER_TO_INT (iter.user_data); + + e_destination_store_remove_destination_nth (store, n); + + /* If the last one is deleted select the last but one or the deleted +1 */ + if (n == len -1) + n -= 1; + + /* We deleted the last entry */ + if (len == 1) { + enl_popup_ungrab (list); + if (list->priv->menu) + gtk_menu_popdown (GTK_MENU (list->priv->menu)); + gtk_widget_hide (GTK_WIDGET (list->priv->popup)); + return; + } + + iter.stamp = e_destination_store_get_stamp (store); + iter.user_data = GINT_TO_POINTER (n); + + gtk_tree_selection_unselect_all (selection); + gtk_tree_selection_select_iter (selection, &iter); + + gtk_tree_path_free (path); + + list->priv->rows = e_destination_store_get_destination_count (store); + enl_popup_size (list); +} + +static void +popup_activate_email (ENameSelectorEntry *name_selector_entry, + GtkWidget *menu_item) +{ + EDestination *destination; + EContact *contact; + gint email_num; + + destination = e_name_selector_entry_get_popup_destination (name_selector_entry); + if (!destination) + return; + + contact = e_destination_get_contact (destination); + if (!contact) + return; + + email_num = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (menu_item), "order")); + e_destination_set_contact (destination, contact, email_num); +} + +static void +popup_activate_list (EDestination *destination, + GtkWidget *item) +{ + gboolean status = gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (item)); + + e_destination_set_ignored (destination, !status); +} + +static void +destination_set_list (GtkWidget *item, + EDestination *destination) +{ + EContact *contact; + gboolean status = gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (item)); + + contact = e_destination_get_contact (destination); + if (!contact) + return; + + e_destination_set_ignored (destination, !status); +} + +static void +destination_set_email (GtkWidget *item, + EDestination *destination) +{ + gint email_num; + EContact *contact; + + if (!gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (item))) + return; + contact = e_destination_get_contact (destination); + if (!contact) + return; + + email_num = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (item), "order")); + e_destination_set_contact (destination, contact, email_num); +} + +typedef struct { + ENameSelectorList *list; + GtkTreePath *path; +}PopupDeleteRowInfo; + +static void +popup_delete_row (GtkWidget *w, + PopupDeleteRowInfo *row_info) +{ + delete_row (row_info->path, row_info->list); + g_free (row_info); +} + +static void +menu_deactivate (GtkMenuShell *junk, + ENameSelectorList *list) +{ + enl_popup_grab (list, NULL); +} + +static gboolean +enl_tree_button_press_event (GtkWidget *widget, + GdkEventButton *event, + ENameSelectorList *list) +{ + GtkWidget *menu; + EDestination *destination; + ENameSelectorEntry *entry; + EDestinationStore *store; + EContact *contact; + GtkWidget *menu_item; + GList *email_list = NULL, *l; + gint i; + gint email_num, len; + gchar *delete_label; + GSList *group = NULL; + gboolean is_list; + gboolean show_menu = FALSE; + GtkTreeSelection *selection; + GtkTreeView *tree_view; + GtkTreePath *path; + PopupDeleteRowInfo *row_info; + GtkTreeIter iter; + + entry = E_NAME_SELECTOR_ENTRY (list); + tree_view = GTK_TREE_VIEW (list->priv->tree_view); + store = e_name_selector_entry_peek_destination_store (entry); + + if (!gtk_widget_has_grab (GTK_WIDGET (list->priv->popup))) + enl_popup_grab (list, (GdkEvent *) event); + + gtk_tree_view_get_dest_row_at_pos ( + tree_view, event->x, event->y, &path, NULL); + selection = gtk_tree_view_get_selection (tree_view); + if (!gtk_tree_model_get_iter (GTK_TREE_MODEL (store), &iter, path)) + return FALSE; + + gtk_tree_selection_unselect_all (selection); + gtk_tree_selection_select_iter (selection, &iter); + + if (event->button != 3) { + return FALSE; + } + + destination = e_destination_store_get_destination (store, &iter); + + if (!destination) + return FALSE; + + contact = e_destination_get_contact (destination); + if (!contact) + return FALSE; + + if (list->priv->menu) { + gtk_menu_popdown (GTK_MENU (list->priv->menu)); + } + menu = gtk_menu_new (); + g_signal_connect (menu, "deactivate", G_CALLBACK (menu_deactivate), list); + list->priv->menu = menu; + gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL, event->button, gtk_get_current_event_time ()); + + email_num = e_destination_get_email_num (destination); + + /* Addresses */ + is_list = e_contact_get (contact, E_CONTACT_IS_LIST) ? TRUE : FALSE; + if (is_list) { + const GList *dests = e_destination_list_get_dests (destination); + GList *iters; + gint length = g_list_length ((GList *) dests); + + for (iters = (GList *) dests; iters; iters = iters->next) { + EDestination *dest = (EDestination *) iters->data; + const gchar *email = e_destination_get_email (dest); + + if (!email || *email == '\0') + continue; + + if (length > 1) { + menu_item = gtk_check_menu_item_new_with_label (email); + g_signal_connect ( + menu_item, "toggled", + G_CALLBACK (destination_set_list), dest); + } else { + menu_item = gtk_menu_item_new_with_label (email); + } + + gtk_widget_show (menu_item); + gtk_menu_shell_prepend (GTK_MENU_SHELL (menu), menu_item); + show_menu = TRUE; + + if (length > 1) { + gtk_check_menu_item_set_active ( + GTK_CHECK_MENU_ITEM (menu_item), + !e_destination_is_ignored (dest)); + g_signal_connect_swapped ( + menu_item, "activate", + G_CALLBACK (popup_activate_list), dest); + } + } + + } else { + email_list = e_contact_get (contact, E_CONTACT_EMAIL); + len = g_list_length (email_list); + + for (l = email_list, i = 0; l; l = g_list_next (l), i++) { + gchar *email = l->data; + + if (!email || *email == '\0') + continue; + + if (len > 1) { + menu_item = gtk_radio_menu_item_new_with_label (group, email); + group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (menu_item)); + g_signal_connect ( + menu_item, "toggled", + G_CALLBACK (destination_set_email), + destination); + } else { + menu_item = gtk_menu_item_new_with_label (email); + } + + gtk_widget_show (menu_item); + gtk_menu_shell_prepend (GTK_MENU_SHELL (menu), menu_item); + show_menu = TRUE; + g_object_set_data (G_OBJECT (menu_item), "order", GINT_TO_POINTER (i)); + + if (i == email_num && len > 1) { + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menu_item), TRUE); + g_signal_connect_swapped ( + menu_item, "activate", + G_CALLBACK (popup_activate_email), + entry); + } + } + g_list_foreach (email_list, (GFunc) g_free, NULL); + g_list_free (email_list); + } + + /* Separator */ + + if (show_menu) { + menu_item = gtk_separator_menu_item_new (); + gtk_widget_show (menu_item); + gtk_menu_shell_prepend (GTK_MENU_SHELL (menu), menu_item); + } + + delete_label = g_strdup_printf (_("_Delete %s"), (gchar *) e_contact_get_const (contact, E_CONTACT_FILE_AS)); + menu_item = gtk_menu_item_new_with_mnemonic (delete_label); + g_free (delete_label); + gtk_widget_show (menu_item); + gtk_menu_shell_prepend (GTK_MENU_SHELL (menu), menu_item); + + row_info = g_new (PopupDeleteRowInfo, 1); + row_info->list = list; + row_info->path = path; + + g_signal_connect ( + menu_item, "activate", + G_CALLBACK (popup_delete_row), row_info); + + return TRUE; + +} + +static gboolean +enl_tree_key_press_event (GtkWidget *w, + GdkEventKey *event, + ENameSelectorList *list) +{ + if (event->keyval == GDK_KEY_Escape) { + enl_popup_ungrab (list); + gtk_widget_hide ( GTK_WIDGET (list->priv->popup)); + return TRUE; + } else if (event->keyval == GDK_KEY_Delete) { + GtkTreeSelection *selection; + GtkTreeView *tree_view; + GList *paths; + + tree_view = GTK_TREE_VIEW (list->priv->tree_view); + selection = gtk_tree_view_get_selection (tree_view); + paths = gtk_tree_selection_get_selected_rows (selection, NULL); + paths = g_list_reverse (paths); + g_list_foreach (paths, (GFunc) delete_row, list); + g_list_free (paths); + } else if (event->keyval != GDK_KEY_Up && event->keyval != GDK_KEY_Down + && event->keyval != GDK_KEY_Shift_R && event->keyval != GDK_KEY_Shift_L + && event->keyval != GDK_KEY_Control_R && event->keyval != GDK_KEY_Control_L) { + enl_popup_ungrab (list); + gtk_widget_hide ( GTK_WIDGET (list->priv->popup)); + gtk_widget_event (GTK_WIDGET (list), (GdkEvent *) event); + return TRUE; + } + + return FALSE; +} + +void +e_name_selector_list_expand_clicked (ENameSelectorList *list) +{ + ENameSelectorEntry *entry; + EDestinationStore *store; + + entry = E_NAME_SELECTOR_ENTRY (list); + store = e_name_selector_entry_peek_destination_store (entry); + + if (!gtk_widget_get_visible (GTK_WIDGET (list->priv->popup))) { + enl_popup_position (list); + gtk_widget_show_all (GTK_WIDGET (list->priv->popup)); + enl_popup_grab (list, NULL); + list->priv->rows = e_destination_store_get_destination_count (store); + enl_popup_size (list); + enl_tree_select_node (list, 1); + } + else { + enl_popup_ungrab (list); + if (list->priv->menu) + gtk_menu_popdown (GTK_MENU (list->priv->menu)); + gtk_widget_hide (GTK_WIDGET (list->priv->popup)); + } +} + +static void +name_selector_list_realize (GtkWidget *widget) +{ + ENameSelectorList *list; + ENameSelectorEntry *entry; + EDestinationStore *store; + + /* Chain up to parent's realize() method. */ + GTK_WIDGET_CLASS (e_name_selector_list_parent_class)->realize (widget); + + list = E_NAME_SELECTOR_LIST (widget); + entry = E_NAME_SELECTOR_ENTRY (widget); + store = e_name_selector_entry_peek_destination_store (entry); + + gtk_tree_view_set_model ( + GTK_TREE_VIEW (list->priv->tree_view), GTK_TREE_MODEL (store)); +} + +static void +e_name_selector_list_class_init (ENameSelectorListClass *class) +{ + GtkWidgetClass *widget_class; + + g_type_class_add_private (class, sizeof (ENameSelectorListPrivate)); + + widget_class = GTK_WIDGET_CLASS (class); + widget_class->realize = name_selector_list_realize; +} + +static void +e_name_selector_list_init (ENameSelectorList *list) +{ + GtkCellRenderer *renderer; + GtkWidget *scroll, *popup_frame, *vgrid; + GtkTreeSelection *selection; + GtkTreeViewColumn *column; + ENameSelectorEntry *entry; + EDestinationStore *store; + GtkEntryCompletion *completion; + + list->priv = E_NAME_SELECTOR_LIST_GET_PRIVATE (list); + list->priv->menu = NULL; + + entry = E_NAME_SELECTOR_ENTRY (list); + store = e_name_selector_entry_peek_destination_store (entry); + + list->priv->tree_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL (store)); + gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (list->priv->tree_view), FALSE); + gtk_tree_view_set_hover_selection (GTK_TREE_VIEW (list->priv->tree_view), FALSE); + + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (list->priv->tree_view)); + gtk_tree_selection_set_mode (selection, GTK_SELECTION_MULTIPLE); + gtk_tree_selection_unselect_all (selection); + gtk_tree_view_set_enable_search (GTK_TREE_VIEW (list->priv->tree_view), FALSE); + + completion = gtk_entry_get_completion (GTK_ENTRY (list)); + gtk_entry_completion_set_inline_completion (completion, TRUE); + gtk_entry_completion_set_popup_completion (completion, TRUE); + + renderer = gtk_cell_renderer_text_new (); + column = gtk_tree_view_column_new_with_attributes ("Name", renderer, "text", E_DESTINATION_STORE_COLUMN_ADDRESS, NULL); + gtk_tree_view_append_column (GTK_TREE_VIEW (list->priv->tree_view), column); + gtk_tree_view_column_set_clickable (column, TRUE); + + scroll = gtk_scrolled_window_new (NULL, NULL); + gtk_scrolled_window_set_policy ( + GTK_SCROLLED_WINDOW (scroll), + GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); + gtk_scrolled_window_set_shadow_type ( + GTK_SCROLLED_WINDOW (scroll), GTK_SHADOW_NONE); + gtk_widget_set_size_request ( + gtk_scrolled_window_get_vscrollbar ( + GTK_SCROLLED_WINDOW (scroll)), -1, 0); + gtk_widget_set_vexpand (scroll, TRUE); + gtk_widget_set_valign (scroll, GTK_ALIGN_FILL); + + list->priv->popup = GTK_WINDOW (gtk_window_new (GTK_WINDOW_POPUP)); + gtk_window_set_resizable (GTK_WINDOW (list->priv->popup), FALSE); + + popup_frame = gtk_frame_new (NULL); + gtk_frame_set_shadow_type ( + GTK_FRAME (popup_frame), GTK_SHADOW_ETCHED_IN); + + gtk_container_add (GTK_CONTAINER (list->priv->popup), popup_frame); + + vgrid = g_object_new (GTK_TYPE_GRID, + "orientation", GTK_ORIENTATION_VERTICAL, + "column-homogeneous", FALSE, + "row-spacing", 0, + NULL); + gtk_container_add (GTK_CONTAINER (popup_frame), vgrid); + + gtk_container_add (GTK_CONTAINER (scroll), list->priv->tree_view); + gtk_container_add (GTK_CONTAINER (vgrid), scroll); + + g_signal_connect_after ( + GTK_WIDGET (list), "focus-in-event", + G_CALLBACK (enl_entry_focus_in), NULL); + g_signal_connect ( + GTK_WIDGET (list), "focus-out-event", + G_CALLBACK (enl_entry_focus_out), NULL); + g_signal_connect ( + GTK_WIDGET (list), "key-press-event", + G_CALLBACK (enl_entry_key_press_event), NULL); + + g_signal_connect_after ( + list->priv->tree_view, "key-press-event", + G_CALLBACK (enl_tree_key_press_event), list); + g_signal_connect ( + list->priv->tree_view, "button-press-event", + G_CALLBACK (enl_tree_button_press_event), list); + + g_signal_connect ( + list->priv->popup, "button-press-event", + G_CALLBACK (enl_popup_button_press), list); + g_signal_connect ( + list->priv->popup, "focus-out-event", + G_CALLBACK (enl_popup_focus_out), list); + g_signal_connect ( + list->priv->popup, "enter-notify-event", + G_CALLBACK (enl_popup_enter_notify), list); + +} + +ENameSelectorList * +e_name_selector_list_new (ESourceRegistry *registry) +{ + g_return_val_if_fail (E_IS_SOURCE_REGISTRY (registry), NULL); + + return g_object_new ( + E_TYPE_NAME_SELECTOR_LIST, + "registry", registry, NULL); +} diff --git a/e-util/e-name-selector-list.h b/e-util/e-name-selector-list.h new file mode 100644 index 0000000000..7b1d11c0c6 --- /dev/null +++ b/e-util/e-name-selector-list.h @@ -0,0 +1,82 @@ +/* + * Single-line text entry widget for EDestinations. + * + * 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) 1999-2008 Novell, Inc. (www.novell.com) + * + */ + +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + +#ifndef E_NAME_SELECTOR_LIST_H +#define E_NAME_SELECTOR_LIST_H + +#include <gtk/gtk.h> +#include <libebook/libebook.h> + +#include <e-util/e-contact-store.h> +#include <e-util/e-destination-store.h> +#include <e-util/e-tree-model-generator.h> +#include <e-util/e-name-selector-entry.h> + +/* Standard GObject macros */ +#define E_TYPE_NAME_SELECTOR_LIST \ + (e_name_selector_list_get_type ()) +#define E_NAME_SELECTOR_LIST(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST \ + ((obj), E_TYPE_NAME_SELECTOR_LIST, ENameSelectorList)) +#define E_NAME_SELECTOR_LIST_CLASS(cls) \ + (G_TYPE_CHECK_CLASS_CAST \ + ((cls), E_TYPE_NAME_SELECTOR_LIST, ENameSelectorListClass)) +#define E_IS_NAME_SELECTOR_LIST(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE \ + ((obj), E_TYPE_NAME_SELECTOR_LIST)) +#define E_IS_NAME_SELECTOR_LIST_CLASS(cls) \ + (G_TYPE_CHECK_CLASS_TYPE \ + ((cls), E_TYPE_NAME_SELECTOR_LIST)) +#define E_NAME_SELECTOR_LIST_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS \ + ((obj), E_TYPE_NAME_SELECTOR_LIST, ENameSelectorListClass)) + +G_BEGIN_DECLS + +typedef struct _ENameSelectorList ENameSelectorList; +typedef struct _ENameSelectorListClass ENameSelectorListClass; +typedef struct _ENameSelectorListPrivate ENameSelectorListPrivate; + +struct _ENameSelectorList { + ENameSelectorEntry parent; + ENameSelectorListPrivate *priv; +}; + +struct _ENameSelectorListClass { + ENameSelectorEntryClass parent_class; +}; + +GType e_name_selector_list_get_type (void); +ENameSelectorList * + e_name_selector_list_new (ESourceRegistry *registry); +void e_name_selector_list_expand_clicked + (ENameSelectorList *list); + +G_END_DECLS + +#endif /* E_NAME_SELECTOR_LIST_H */ diff --git a/e-util/e-name-selector-model.c b/e-util/e-name-selector-model.c new file mode 100644 index 0000000000..770f51422f --- /dev/null +++ b/e-util/e-name-selector-model.c @@ -0,0 +1,663 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ + +/* e-name-selector-model.c - Model for contact selection. + * + * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU Lesser General Public + * License as published by the Free Software Foundation. + * + * 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 this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * Authors: Hans Petter Jansson <hpj@novell.com> + */ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#include <string.h> +#include <glib/gi18n-lib.h> +#include "e-name-selector-model.h" + +#define E_NAME_SELECTOR_MODEL_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE \ + ((obj), E_TYPE_NAME_SELECTOR_MODEL, ENameSelectorModelPrivate)) + +typedef struct { + gchar *name; + gchar *pretty_name; + + EDestinationStore *destination_store; +} +Section; + +struct _ENameSelectorModelPrivate { + GArray *sections; + EContactStore *contact_store; + ETreeModelGenerator *contact_filter; + GHashTable *destination_uid_hash; +}; + +static gint generate_contact_rows (EContactStore *contact_store, GtkTreeIter *iter, + ENameSelectorModel *name_selector_model); +static void override_email_address (EContactStore *contact_store, GtkTreeIter *iter, + gint permutation_n, gint column, GValue *value, + ENameSelectorModel *name_selector_model); +static void free_section (ENameSelectorModel *name_selector_model, gint n); + +/* ------------------ * + * Class/object setup * + * ------------------ */ + +/* Signals */ + +enum { + SECTION_ADDED, + SECTION_REMOVED, + LAST_SIGNAL +}; + +static guint signals[LAST_SIGNAL] = { 0 }; + +G_DEFINE_TYPE (ENameSelectorModel, e_name_selector_model, G_TYPE_OBJECT) + +static void +e_name_selector_model_init (ENameSelectorModel *name_selector_model) +{ + name_selector_model->priv = + E_NAME_SELECTOR_MODEL_GET_PRIVATE (name_selector_model); + + name_selector_model->priv->sections = g_array_new (FALSE, FALSE, sizeof (Section)); + name_selector_model->priv->contact_store = e_contact_store_new (); + + name_selector_model->priv->contact_filter = + e_tree_model_generator_new (GTK_TREE_MODEL (name_selector_model->priv->contact_store)); + e_tree_model_generator_set_generate_func ( + name_selector_model->priv->contact_filter, + (ETreeModelGeneratorGenerateFunc) generate_contact_rows, + name_selector_model, NULL); + e_tree_model_generator_set_modify_func (name_selector_model->priv->contact_filter, + (ETreeModelGeneratorModifyFunc) override_email_address, + name_selector_model, NULL); + + g_object_unref (name_selector_model->priv->contact_store); + + name_selector_model->priv->destination_uid_hash = NULL; +} + +static void +name_selector_model_finalize (GObject *object) +{ + ENameSelectorModelPrivate *priv; + gint i; + + priv = E_NAME_SELECTOR_MODEL_GET_PRIVATE (object); + + for (i = 0; i < priv->sections->len; i++) + free_section (E_NAME_SELECTOR_MODEL (object), i); + + g_array_free (priv->sections, TRUE); + g_object_unref (priv->contact_filter); + + if (priv->destination_uid_hash) + g_hash_table_destroy (priv->destination_uid_hash); + + /* Chain up to parent's finalize() method. */ + G_OBJECT_CLASS (e_name_selector_model_parent_class)->finalize (object); +} + +static void +e_name_selector_model_class_init (ENameSelectorModelClass *class) +{ + GObjectClass *object_class; + + g_type_class_add_private (class, sizeof (ENameSelectorModelPrivate)); + + object_class = G_OBJECT_CLASS (class); + object_class->finalize = name_selector_model_finalize; + + signals[SECTION_ADDED] = g_signal_new ( + "section-added", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ENameSelectorModelClass, section_added), + NULL, NULL, + g_cclosure_marshal_VOID__STRING, + G_TYPE_NONE, 1, + G_TYPE_STRING); + + signals[SECTION_REMOVED] = g_signal_new ( + "section-removed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ENameSelectorModelClass, section_removed), + NULL, NULL, + g_cclosure_marshal_VOID__STRING, + G_TYPE_NONE, 1, + G_TYPE_STRING); +} + +/** + * e_name_selector_model_new: + * + * Creates a new #ENameSelectorModel. + * + * Returns: A new #ENameSelectorModel. + **/ +ENameSelectorModel * +e_name_selector_model_new (void) +{ + return E_NAME_SELECTOR_MODEL (g_object_new (E_TYPE_NAME_SELECTOR_MODEL, NULL)); +} + +/* ---------------------------- * + * GtkTreeModelFilter filtering * + * ---------------------------- */ + +static void +deep_free_list (GList *list) +{ + GList *l; + + for (l = list; l; l = g_list_next (l)) + g_free (l->data); + + g_list_free (list); +} + +static gint +generate_contact_rows (EContactStore *contact_store, + GtkTreeIter *iter, + ENameSelectorModel *name_selector_model) +{ + EContact *contact; + const gchar *contact_uid; + gint n_rows, used_rows = 0; + gint i; + + contact = e_contact_store_get_contact (contact_store, iter); + g_assert (contact != NULL); + + contact_uid = e_contact_get_const (contact, E_CONTACT_UID); + if (!contact_uid) + return 0; /* Can happen with broken databases */ + + for (i = 0; i < name_selector_model->priv->sections->len; i++) { + Section *section; + GList *destinations; + GList *l; + + section = &g_array_index (name_selector_model->priv->sections, Section, i); + destinations = e_destination_store_list_destinations (section->destination_store); + + for (l = destinations; l; l = g_list_next (l)) { + EDestination *destination = l->data; + const gchar *destination_uid; + + destination_uid = e_destination_get_contact_uid (destination); + if (destination_uid && !strcmp (contact_uid, destination_uid)) { + used_rows++; + } + } + + g_list_free (destinations); + } + + if (e_contact_get (contact, E_CONTACT_IS_LIST)) { + n_rows = 1 - used_rows; + } else { + GList *email_list; + + email_list = e_contact_get (contact, E_CONTACT_EMAIL); + n_rows = g_list_length (email_list) - used_rows; + deep_free_list (email_list); + } + + g_return_val_if_fail (n_rows >= 0, 0); + + return n_rows; +} + +static void +override_email_address (EContactStore *contact_store, + GtkTreeIter *iter, + gint permutation_n, + gint column, + GValue *value, + ENameSelectorModel *name_selector_model) +{ + if (column == E_CONTACT_EMAIL_1) { + EContact *contact; + GList *email_list; + gchar *email; + + contact = e_contact_store_get_contact (contact_store, iter); + email_list = e_name_selector_model_get_contact_emails_without_used (name_selector_model, contact, TRUE); + g_return_if_fail (g_list_length (email_list) <= permutation_n); + email = g_strdup (g_list_nth_data (email_list, permutation_n)); + g_value_set_string (value, email); + e_name_selector_model_free_emails_list (email_list); + } else { + gtk_tree_model_get_value (GTK_TREE_MODEL (contact_store), iter, column, value); + } +} + +/* --------------- * + * Section helpers * + * --------------- */ + +typedef struct +{ + ENameSelectorModel *name_selector_model; + GHashTable *other_hash; +} +HashCompare; + +static void +emit_destination_uid_changes_cb (gchar *uid_num, + gpointer value, + HashCompare *hash_compare) +{ + EContactStore *contact_store = hash_compare->name_selector_model->priv->contact_store; + + if (!hash_compare->other_hash || !g_hash_table_lookup (hash_compare->other_hash, uid_num)) { + GtkTreeIter iter; + GtkTreePath *path; + gchar *sep; + + sep = strrchr (uid_num, ':'); + g_return_if_fail (sep != NULL); + + *sep = '\0'; + if (e_contact_store_find_contact (contact_store, uid_num, &iter)) { + *sep = ':'; + + path = gtk_tree_model_get_path (GTK_TREE_MODEL (contact_store), &iter); + gtk_tree_model_row_changed (GTK_TREE_MODEL (contact_store), path, &iter); + gtk_tree_path_free (path); + } else { + *sep = ':'; + } + } +} + +static void +destinations_changed (ENameSelectorModel *name_selector_model) +{ + GHashTable *destination_uid_hash_new; + GHashTable *destination_uid_hash_old; + HashCompare hash_compare; + gint i; + + destination_uid_hash_new = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); + + for (i = 0; i < name_selector_model->priv->sections->len; i++) { + Section *section = &g_array_index (name_selector_model->priv->sections, Section, i); + GList *destinations; + GList *l; + + destinations = e_destination_store_list_destinations (section->destination_store); + + for (l = destinations; l; l = g_list_next (l)) { + EDestination *destination = l->data; + const gchar *destination_uid; + + destination_uid = e_destination_get_contact_uid (destination); + if (destination_uid) + g_hash_table_insert ( + destination_uid_hash_new, + g_strdup_printf ( + "%s:%d", destination_uid, + e_destination_get_email_num (destination)), + GINT_TO_POINTER (TRUE)); + } + + g_list_free (destinations); + } + + destination_uid_hash_old = name_selector_model->priv->destination_uid_hash; + name_selector_model->priv->destination_uid_hash = destination_uid_hash_new; + + hash_compare.name_selector_model = name_selector_model; + + hash_compare.other_hash = destination_uid_hash_old; + g_hash_table_foreach ( + destination_uid_hash_new, + (GHFunc) emit_destination_uid_changes_cb, + &hash_compare); + + if (destination_uid_hash_old) { + hash_compare.other_hash = destination_uid_hash_new; + g_hash_table_foreach ( + destination_uid_hash_old, + (GHFunc) emit_destination_uid_changes_cb, + &hash_compare); + + g_hash_table_destroy (destination_uid_hash_old); + } +} + +static void +free_section (ENameSelectorModel *name_selector_model, + gint n) +{ + Section *section; + + g_assert (n >= 0); + g_assert (n < name_selector_model->priv->sections->len); + + section = &g_array_index (name_selector_model->priv->sections, Section, n); + + g_signal_handlers_disconnect_matched ( + section->destination_store, G_SIGNAL_MATCH_DATA, + 0, 0, NULL, NULL, name_selector_model); + + g_free (section->name); + g_free (section->pretty_name); + g_object_unref (section->destination_store); +} + +static gint +find_section_by_name (ENameSelectorModel *name_selector_model, + const gchar *name) +{ + gint i; + + g_assert (name != NULL); + + for (i = 0; i < name_selector_model->priv->sections->len; i++) { + Section *section = &g_array_index (name_selector_model->priv->sections, Section, i); + + if (!strcmp (name, section->name)) + return i; + } + + return -1; +} + +/* ---------------------- * + * ENameSelectorModel API * + * ---------------------- */ + +/** + * e_name_selector_model_peek_contact_store: + * @name_selector_model: an #ENameSelectorModel + * + * Gets the #EContactStore associated with @name_selector_model. + * + * Returns: An #EContactStore. + **/ +EContactStore * +e_name_selector_model_peek_contact_store (ENameSelectorModel *name_selector_model) +{ + g_return_val_if_fail (E_IS_NAME_SELECTOR_MODEL (name_selector_model), NULL); + + return name_selector_model->priv->contact_store; +} + +/** + * e_name_selector_model_peek_contact_filter: + * @name_selector_model: an #ENameSelectorModel + * + * Gets the #ETreeModelGenerator being used to filter and/or extend the + * list of contacts in @name_selector_model's #EContactStore. + * + * Returns: An #ETreeModelGenerator. + **/ +ETreeModelGenerator * +e_name_selector_model_peek_contact_filter (ENameSelectorModel *name_selector_model) +{ + g_return_val_if_fail (E_IS_NAME_SELECTOR_MODEL (name_selector_model), NULL); + + return name_selector_model->priv->contact_filter; +} + +/** + * e_name_selector_model_list_sections: + * @name_selector_model: an #ENameSelectorModel + * + * Gets a list of the destination sections in @name_selector_model. + * + * Returns: A #GList of pointers to strings. The #GList and the + * strings belong to the caller, and must be freed when no longer needed. + **/ +GList * +e_name_selector_model_list_sections (ENameSelectorModel *name_selector_model) +{ + GList *section_names = NULL; + gint i; + + g_return_val_if_fail (E_IS_NAME_SELECTOR_MODEL (name_selector_model), NULL); + + /* Do this backwards so we can use g_list_prepend () and get correct order */ + for (i = name_selector_model->priv->sections->len - 1; i >= 0; i--) { + Section *section = &g_array_index (name_selector_model->priv->sections, Section, i); + gchar *name; + + name = g_strdup (section->name); + section_names = g_list_prepend (section_names, name); + } + + return section_names; +} + +/** + * e_name_selector_model_add_section: + * @name_selector_model: an #ENameSelectorModel + * @name: internal name of this section + * @pretty_name: user-visible name of this section + * @destination_store: the #EDestinationStore to use to store the destinations for this + * section, or %NULL if @name_selector_model should create its own. + * + * Adds a destination section to @name_selector_model. + **/ +void +e_name_selector_model_add_section (ENameSelectorModel *name_selector_model, + const gchar *name, + const gchar *pretty_name, + EDestinationStore *destination_store) +{ + Section section; + + g_return_if_fail (E_IS_NAME_SELECTOR_MODEL (name_selector_model)); + g_return_if_fail (name != NULL); + g_return_if_fail (pretty_name != NULL); + + if (find_section_by_name (name_selector_model, name) >= 0) { + g_warning ("ENameSelectorModel already has a section called '%s'!", name); + return; + } + + memset (§ion, 0, sizeof (Section)); + + section.name = g_strdup (name); + section.pretty_name = g_strdup (pretty_name); + + if (destination_store) + section.destination_store = g_object_ref (destination_store); + else + section.destination_store = e_destination_store_new (); + + g_signal_connect_swapped ( + section.destination_store, "row-changed", + G_CALLBACK (destinations_changed), name_selector_model); + g_signal_connect_swapped ( + section.destination_store, "row-deleted", + G_CALLBACK (destinations_changed), name_selector_model); + g_signal_connect_swapped ( + section.destination_store, "row-inserted", + G_CALLBACK (destinations_changed), name_selector_model); + + g_array_append_val (name_selector_model->priv->sections, section); + + destinations_changed (name_selector_model); + g_signal_emit (name_selector_model, signals[SECTION_ADDED], 0, name); +} + +/** + * e_name_selector_model_remove_section: + * @name_selector_model: an #ENameSelectorModel + * @name: internal name of the section to remove + * + * Removes a destination section from @name_selector_model. + **/ +void +e_name_selector_model_remove_section (ENameSelectorModel *name_selector_model, + const gchar *name) +{ + gint n; + + g_return_if_fail (E_IS_NAME_SELECTOR_MODEL (name_selector_model)); + g_return_if_fail (name != NULL); + + n = find_section_by_name (name_selector_model, name); + if (n < 0) { + g_warning ("ENameSelectorModel does not have a section called '%s'!", name); + return; + } + + free_section (name_selector_model, n); + g_array_remove_index_fast (name_selector_model->priv->sections, n); /* Order doesn't matter */ + + destinations_changed (name_selector_model); + g_signal_emit (name_selector_model, signals[SECTION_REMOVED], 0, name); +} + +/** + * e_name_selector_model_peek_section: + * @name_selector_model: an #ENameSelectorModel + * @name: internal name of the section to peek + * @pretty_name: location in which to store a pointer to the user-visible name of the section, + * or %NULL if undesired. + * @destination_store: location in which to store a pointer to the #EDestinationStore being used + * by the section, or %NULL if undesired + * + * Gets the parameters for a destination section. + **/ +gboolean +e_name_selector_model_peek_section (ENameSelectorModel *name_selector_model, + const gchar *name, + gchar **pretty_name, + EDestinationStore **destination_store) +{ + Section *section; + gint n; + + g_return_val_if_fail (E_IS_NAME_SELECTOR_MODEL (name_selector_model), FALSE); + g_return_val_if_fail (name != NULL, FALSE); + + n = find_section_by_name (name_selector_model, name); + if (n < 0) { + g_warning ("ENameSelectorModel does not have a section called '%s'!", name); + return FALSE; + } + + section = &g_array_index (name_selector_model->priv->sections, Section, n); + + if (pretty_name) + *pretty_name = g_strdup (section->pretty_name); + if (destination_store) + *destination_store = section->destination_store; + + return TRUE; +} + +/** + * e_name_selector_model_get_contact_emails_without_used: + * @name_selector_model: an #ENameSelectorModel + * @contact: to get emails from + * @remove_used: set to %TRUE to remove used from a list; or set to %FALSE to + * set used indexes to %NULL and keep them in the returned list + * + * Returns list of all email from @contact, without all used + * in any section. Each item is a string, an email address. + * Returned list should be freed with @e_name_selector_model_free_emails_list. + * + * Since: 2.30 + **/ +GList * +e_name_selector_model_get_contact_emails_without_used (ENameSelectorModel *name_selector_model, + EContact *contact, + gboolean remove_used) +{ + GList *email_list; + gint emails; + gint i; + const gchar *contact_uid; + + g_return_val_if_fail (name_selector_model != NULL, NULL); + g_return_val_if_fail (E_IS_NAME_SELECTOR_MODEL (name_selector_model), NULL); + g_return_val_if_fail (contact != NULL, NULL); + g_return_val_if_fail (E_IS_CONTACT (contact), NULL); + + contact_uid = e_contact_get_const (contact, E_CONTACT_UID); + g_return_val_if_fail (contact_uid != NULL, NULL); + + email_list = e_contact_get (contact, E_CONTACT_EMAIL); + emails = g_list_length (email_list); + + for (i = 0; i < name_selector_model->priv->sections->len; i++) { + Section *section; + GList *destinations; + GList *l; + + section = &g_array_index (name_selector_model->priv->sections, Section, i); + destinations = e_destination_store_list_destinations (section->destination_store); + + for (l = destinations; l; l = g_list_next (l)) { + EDestination *destination = l->data; + const gchar *destination_uid; + + destination_uid = e_destination_get_contact_uid (destination); + if (destination_uid && !strcmp (contact_uid, destination_uid)) { + gint email_num = e_destination_get_email_num (destination); + + if (email_num < 0 || email_num >= emails) { + g_warning ("%s: Destination's email_num %d out of bounds 0..%d", G_STRFUNC, email_num, emails - 1); + } else { + GList *nth = g_list_nth (email_list, email_num); + + g_return_val_if_fail (nth != NULL, NULL); + + g_free (nth->data); + nth->data = NULL; + } + } + } + + g_list_free (destinations); + } + + if (remove_used) { + /* remove all with data NULL, which are those used already */ + do { + emails = g_list_length (email_list); + email_list = g_list_remove (email_list, NULL); + } while (g_list_length (email_list) != emails); + } + + return email_list; +} + +/** + * e_name_selector_model_free_emails_list: + * @email_list: list of emails returned from @e_name_selector_model_get_contact_emails_without_used + * + * Frees a list of emails returned from @e_name_selector_model_get_contact_emails_without_used. + * + * Since: 2.30 + **/ +void +e_name_selector_model_free_emails_list (GList *email_list) +{ + deep_free_list (email_list); +} diff --git a/e-util/e-name-selector-model.h b/e-util/e-name-selector-model.h new file mode 100644 index 0000000000..ed37f2af30 --- /dev/null +++ b/e-util/e-name-selector-model.h @@ -0,0 +1,108 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ + +/* e-name-selector-model.h - Model for contact selection. + * + * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU Lesser General Public + * License as published by the Free Software Foundation. + * + * 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 this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * Authors: Hans Petter Jansson <hpj@novell.com> + */ + +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + +#ifndef E_NAME_SELECTOR_MODEL_H +#define E_NAME_SELECTOR_MODEL_H + +#include <e-util/e-tree-model-generator.h> +#include <e-util/e-contact-store.h> +#include <e-util/e-destination-store.h> + +/* Standard GObject macros */ +#define E_TYPE_NAME_SELECTOR_MODEL \ + (e_name_selector_model_get_type ()) +#define E_NAME_SELECTOR_MODEL(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST \ + ((obj), E_TYPE_NAME_SELECTOR_MODEL, ENameSelectorModel)) +#define E_NAME_SELECTOR_MODEL_CLASS(cls) \ + (G_TYPE_CHECK_CLASS_CAST \ + ((cls), E_TYPE_NAME_SELECTOR_MODEL, ENameSelectorModelClass)) +#define E_IS_NAME_SELECTOR_MODEL(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE \ + ((obj), E_TYPE_NAME_SELECTOR_MODEL)) +#define E_IS_NAME_SELECTOR_MODEL_CLASS(cls) \ + (G_TYPE_CHECK_CLASS_TYPE \ + ((cls), E_TYPE_NAME_SELECTOR_MODEL)) +#define E_NAME_SELECTOR_MODEL_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS \ + ((obj), E_TYPE_NAME_SELECTOR_MODEL, ENameSelectorModelClass)) + +G_BEGIN_DECLS + +typedef struct _ENameSelectorModel ENameSelectorModel; +typedef struct _ENameSelectorModelClass ENameSelectorModelClass; +typedef struct _ENameSelectorModelPrivate ENameSelectorModelPrivate; + +struct _ENameSelectorModel { + GObject parent; + ENameSelectorModelPrivate *priv; +}; + +struct _ENameSelectorModelClass { + GObjectClass parent_class; + + /* Signals */ + void (*section_added) (gchar *name); + void (*section_removed) (gchar *name); +}; + +GType e_name_selector_model_get_type (void); +ENameSelectorModel * + e_name_selector_model_new (void); +EContactStore * e_name_selector_model_peek_contact_store + (ENameSelectorModel *name_selector_model); +ETreeModelGenerator * + e_name_selector_model_peek_contact_filter + (ENameSelectorModel *name_selector_model); + +/* Deep copy of section names; free strings and list when you're done */ +GList * e_name_selector_model_list_sections + (ENameSelectorModel *name_selector_model); + +/* pretty_name will be newly allocated, but destination_store must be reffed if you keep it */ +gboolean e_name_selector_model_peek_section + (ENameSelectorModel *name_selector_model, + const gchar *name, + gchar **pretty_name, + EDestinationStore **destination_store); +void e_name_selector_model_add_section + (ENameSelectorModel *name_selector_model, + const gchar *name, + const gchar *pretty_name, + EDestinationStore *destination_store); +void e_name_selector_model_remove_section + (ENameSelectorModel *name_selector_model, + const gchar *name); +GList * e_name_selector_model_get_contact_emails_without_used + (ENameSelectorModel *name_selector_model, + EContact *contact, + gboolean remove_used); +void e_name_selector_model_free_emails_list + (GList *email_list); + +G_END_DECLS + +#endif /* E_NAME_SELECTOR_MODEL_H */ diff --git a/e-util/e-name-selector.c b/e-util/e-name-selector.c new file mode 100644 index 0000000000..a94b6ff5f3 --- /dev/null +++ b/e-util/e-name-selector.c @@ -0,0 +1,658 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ + +/* e-name-selector.c - Unified context for contact/destination selection UI. + * + * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU Lesser General Public + * License as published by the Free Software Foundation. + * + * 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 this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * Authors: Hans Petter Jansson <hpj@novell.com> + */ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#include <string.h> +#include <gtk/gtk.h> +#include <glib/gi18n-lib.h> + +#include <libebook/libebook.h> + +#include "e-name-selector.h" + +#include "e-client-utils.h" +#include "e-contact-store.h" +#include "e-destination-store.h" + +#define E_NAME_SELECTOR_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE \ + ((obj), E_TYPE_NAME_SELECTOR, ENameSelectorPrivate)) + +typedef struct { + gchar *name; + ENameSelectorEntry *entry; +} Section; + +typedef struct { + EBookClient *client; + guint is_completion_book : 1; +} SourceBook; + +struct _ENameSelectorPrivate { + ESourceRegistry *registry; + ENameSelectorModel *model; + ENameSelectorDialog *dialog; + + GArray *sections; + + gboolean books_loaded; + GCancellable *cancellable; + GArray *source_books; +}; + +enum { + PROP_0, + PROP_REGISTRY +}; + +G_DEFINE_TYPE (ENameSelector, e_name_selector, G_TYPE_OBJECT) + +static void +reset_pointer_cb (gpointer data, + GObject *where_was) +{ + ENameSelector *name_selector = data; + ENameSelectorPrivate *priv; + guint ii; + + g_return_if_fail (E_IS_NAME_SELECTOR (name_selector)); + + priv = E_NAME_SELECTOR_GET_PRIVATE (name_selector); + + for (ii = 0; ii < priv->sections->len; ii++) { + Section *section; + + section = &g_array_index (priv->sections, Section, ii); + if (section->entry == (ENameSelectorEntry *) where_was) + section->entry = NULL; + } +} + +static void +name_selector_book_loaded_cb (GObject *source_object, + GAsyncResult *result, + gpointer user_data) +{ + ENameSelector *name_selector = user_data; + ESource *source = E_SOURCE (source_object); + EBookClient *book_client; + EClient *client = NULL; + GArray *sections; + SourceBook source_book; + guint ii; + GError *error = NULL; + + e_client_utils_open_new_finish (source, result, &client, &error); + + if (error != NULL) { + if (!g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_REPOSITORY_OFFLINE) + && !g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_OFFLINE_UNAVAILABLE) + && !g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_CANCELLED) + && !g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) + g_warning ( + "ENameSelector: Could not load \"%s\": %s", + e_source_get_display_name (source), error->message); + g_error_free (error); + goto exit; + } + + book_client = E_BOOK_CLIENT (client); + g_return_if_fail (E_IS_BOOK_CLIENT (book_client)); + + source_book.client = book_client; + source_book.is_completion_book = TRUE; + + g_array_append_val (name_selector->priv->source_books, source_book); + + sections = name_selector->priv->sections; + + for (ii = 0; ii < sections->len; ii++) { + EContactStore *store; + Section *section; + + section = &g_array_index (sections, Section, ii); + if (section->entry == NULL) + continue; + + store = e_name_selector_entry_peek_contact_store ( + section->entry); + if (store != NULL) + e_contact_store_add_client (store, book_client); + } + + exit: + g_object_unref (name_selector); +} + +/** + * e_name_selector_load_books: + * @name_selector: an #ENameSelector + * + * Loads address books available for the @name_selector. + * This can be called only once and it can be cancelled + * by e_name_selector_cancel_loading(). + * + * Since: 3.2 + **/ +void +e_name_selector_load_books (ENameSelector *name_selector) +{ + ESourceRegistry *registry; + GList *list, *iter; + const gchar *extension_name; + + g_return_if_fail (E_IS_NAME_SELECTOR (name_selector)); + + extension_name = E_SOURCE_EXTENSION_ADDRESS_BOOK; + registry = e_name_selector_get_registry (name_selector); + list = e_source_registry_list_sources (registry, extension_name); + + for (iter = list; iter != NULL; iter = g_list_next (iter)) { + ESource *source = E_SOURCE (iter->data); + ESourceAutocomplete *extension; + const gchar *extension_name; + + extension_name = E_SOURCE_EXTENSION_AUTOCOMPLETE; + extension = e_source_get_extension (source, extension_name); + + /* Skip disabled address books. */ + if (!e_source_registry_check_enabled (registry, source)) + continue; + + /* Only load address books with autocomplete enabled, + * so as to avoid unnecessary authentication prompts. */ + if (!e_source_autocomplete_get_include_me (extension)) + continue; + + e_client_utils_open_new ( + source, E_CLIENT_SOURCE_TYPE_CONTACTS, + TRUE, name_selector->priv->cancellable, + name_selector_book_loaded_cb, + g_object_ref (name_selector)); + } + + g_list_free_full (list, (GDestroyNotify) g_object_unref); +} + +/** + * e_name_selector_cancel_loading: + * @name_selector: an #ENameSelector + * + * Cancels any pending address book load operations. This might be called + * before an owner unrefs this @name_selector. + * + * Since: 3.2 + **/ +void +e_name_selector_cancel_loading (ENameSelector *name_selector) +{ + g_return_if_fail (E_IS_NAME_SELECTOR (name_selector)); + g_return_if_fail (name_selector->priv->cancellable != NULL); + + g_cancellable_cancel (name_selector->priv->cancellable); +} + +static void +name_selector_set_registry (ENameSelector *name_selector, + ESourceRegistry *registry) +{ + g_return_if_fail (E_IS_SOURCE_REGISTRY (registry)); + g_return_if_fail (name_selector->priv->registry == NULL); + + name_selector->priv->registry = g_object_ref (registry); +} + +static void +name_selector_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) +{ + switch (property_id) { + case PROP_REGISTRY: + name_selector_set_registry ( + E_NAME_SELECTOR (object), + g_value_get_object (value)); + return; + } + + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); +} + +static void +name_selector_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) +{ + switch (property_id) { + case PROP_REGISTRY: + g_value_set_object ( + value, + e_name_selector_get_registry ( + E_NAME_SELECTOR (object))); + return; + } + + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); +} + +static void +name_selector_dispose (GObject *object) +{ + ENameSelectorPrivate *priv; + guint ii; + + priv = E_NAME_SELECTOR_GET_PRIVATE (object); + + if (priv->cancellable) { + g_cancellable_cancel (priv->cancellable); + g_object_unref (priv->cancellable); + priv->cancellable = NULL; + } + + for (ii = 0; ii < priv->source_books->len; ii++) { + SourceBook *source_book; + + source_book = &g_array_index ( + priv->source_books, SourceBook, ii); + if (source_book->client != NULL) + g_object_unref (source_book->client); + } + + for (ii = 0; ii < priv->sections->len; ii++) { + Section *section; + + section = &g_array_index (priv->sections, Section, ii); + if (section->entry) + g_object_weak_unref ( + G_OBJECT (section->entry), + reset_pointer_cb, object); + g_free (section->name); + } + + g_array_set_size (priv->source_books, 0); + g_array_set_size (priv->sections, 0); + + /* Chain up to parent's dispose() method. */ + G_OBJECT_CLASS (e_name_selector_parent_class)->dispose (object); +} + +static void +name_selector_finalize (GObject *object) +{ + ENameSelectorPrivate *priv; + + priv = E_NAME_SELECTOR_GET_PRIVATE (object); + + g_array_free (priv->source_books, TRUE); + g_array_free (priv->sections, TRUE); + + /* Chain up to parent's finalize() method. */ + G_OBJECT_CLASS (e_name_selector_parent_class)->finalize (object); +} + +static void +e_name_selector_class_init (ENameSelectorClass *class) +{ + GObjectClass *object_class; + + g_type_class_add_private (class, sizeof (ENameSelectorPrivate)); + + object_class = G_OBJECT_CLASS (class); + object_class->set_property = name_selector_set_property; + object_class->get_property = name_selector_get_property; + object_class->dispose = name_selector_dispose; + object_class->finalize = name_selector_finalize; + + g_object_class_install_property ( + object_class, + PROP_REGISTRY, + g_param_spec_object ( + "registry", + "Registry", + "Data source registry", + E_TYPE_SOURCE_REGISTRY, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_STRINGS)); +} + +static void +e_name_selector_init (ENameSelector *name_selector) +{ + GArray *sections; + GArray *source_books; + + sections = g_array_new (FALSE, FALSE, sizeof (Section)); + source_books = g_array_new (FALSE, FALSE, sizeof (SourceBook)); + + name_selector->priv = E_NAME_SELECTOR_GET_PRIVATE (name_selector); + name_selector->priv->sections = sections; + name_selector->priv->model = e_name_selector_model_new (); + name_selector->priv->source_books = source_books; + name_selector->priv->cancellable = g_cancellable_new (); + name_selector->priv->books_loaded = FALSE; +} + +/** + * e_name_selector_new: + * @registry: an #ESourceRegistry + * + * Creates a new #ENameSelector. + * + * Returns: A new #ENameSelector. + **/ +ENameSelector * +e_name_selector_new (ESourceRegistry *registry) +{ + g_return_val_if_fail (E_IS_SOURCE_REGISTRY (registry), NULL); + + return g_object_new ( + E_TYPE_NAME_SELECTOR, + "registry", registry, NULL); +} + +/** + * e_name_selector_get_registry: + * @name_selector: an #ENameSelector + * + * Returns the #ESourceRegistry passed to e_name_selector_new(). + * + * Returns: the #ESourceRegistry + * + * Since: 3.6 + **/ +ESourceRegistry * +e_name_selector_get_registry (ENameSelector *name_selector) +{ + g_return_val_if_fail (E_IS_NAME_SELECTOR (name_selector), NULL); + + return name_selector->priv->registry; +} + +/* ------- * + * Helpers * + * ------- */ + +static gint +add_section (ENameSelector *name_selector, + const gchar *name) +{ + GArray *array; + Section section; + + g_assert (name != NULL); + + memset (§ion, 0, sizeof (Section)); + section.name = g_strdup (name); + + array = name_selector->priv->sections; + g_array_append_val (array, section); + return array->len - 1; +} + +static gint +find_section_by_name (ENameSelector *name_selector, + const gchar *name) +{ + GArray *array; + gint i; + + g_assert (name != NULL); + + array = name_selector->priv->sections; + + for (i = 0; i < array->len; i++) { + Section *section = &g_array_index (array, Section, i); + + if (!strcmp (name, section->name)) + return i; + } + + return -1; +} + +/* ----------------- * + * ENameSelector API * + * ----------------- */ + +/** + * e_name_selector_peek_model: + * @name_selector: an #ENameSelector + * + * Gets the #ENameSelectorModel used by @name_selector. + * + * Returns: The #ENameSelectorModel used by @name_selector. + **/ +ENameSelectorModel * +e_name_selector_peek_model (ENameSelector *name_selector) +{ + g_return_val_if_fail (E_IS_NAME_SELECTOR (name_selector), NULL); + + return name_selector->priv->model; +} + +/** + * e_name_selector_peek_dialog: + * @name_selector: an #ENameSelector + * + * Gets the #ENameSelectorDialog used by @name_selector. + * + * Returns: The #ENameSelectorDialog used by @name_selector. + **/ +ENameSelectorDialog * +e_name_selector_peek_dialog (ENameSelector *name_selector) +{ + g_return_val_if_fail (E_IS_NAME_SELECTOR (name_selector), NULL); + + if (name_selector->priv->dialog == NULL) { + ESourceRegistry *registry; + ENameSelectorDialog *dialog; + ENameSelectorModel *model; + + registry = e_name_selector_get_registry (name_selector); + dialog = e_name_selector_dialog_new (registry); + name_selector->priv->dialog = dialog; + + model = e_name_selector_peek_model (name_selector); + e_name_selector_dialog_set_model (dialog, model); + + g_signal_connect ( + dialog, "delete-event", + G_CALLBACK (gtk_widget_hide_on_delete), name_selector); + } + + return name_selector->priv->dialog; +} + +/** + * e_name_selector_show_dialog: + * @name_selector: an #ENameSelector + * @for_transient_widget: a widget parent or %NULL + * + * Shows the associated dialog, and sets the transient parent to the + * GtkWindow top-level of "for_transient_widget if set (it should be) + * + * Since: 2.32 + **/ +void +e_name_selector_show_dialog (ENameSelector *name_selector, + GtkWidget *for_transient_widget) +{ + GtkWindow *top = NULL; + ENameSelectorDialog *dialog; + + g_return_if_fail (E_IS_NAME_SELECTOR (name_selector)); + + dialog = e_name_selector_peek_dialog (name_selector); + if (for_transient_widget) + top = GTK_WINDOW (gtk_widget_get_toplevel (for_transient_widget)); + if (top) + gtk_window_set_transient_for (GTK_WINDOW (dialog), top); + + gtk_widget_show (GTK_WIDGET (dialog)); +} + +/** + * e_name_selector_peek_section_entry: + * @name_selector: an #ENameSelector + * @name: the name of the section to peek + * + * Gets the #ENameSelectorEntry for the section specified by @name. + * + * Returns: The #ENameSelectorEntry for the named section, or %NULL if it + * doesn't exist in the #ENameSelectorModel. + **/ +ENameSelectorEntry * +e_name_selector_peek_section_entry (ENameSelector *name_selector, + const gchar *name) +{ + ENameSelectorPrivate *priv; + ENameSelectorModel *model; + EDestinationStore *destination_store; + Section *section; + gint n; + + g_return_val_if_fail (E_IS_NAME_SELECTOR (name_selector), NULL); + g_return_val_if_fail (name != NULL, NULL); + + priv = E_NAME_SELECTOR_GET_PRIVATE (name_selector); + model = e_name_selector_peek_model (name_selector); + + if (!e_name_selector_model_peek_section ( + model, name, NULL, &destination_store)) + return NULL; + + n = find_section_by_name (name_selector, name); + if (n < 0) + n = add_section (name_selector, name); + + section = &g_array_index (name_selector->priv->sections, Section, n); + + if (!section->entry) { + ESourceRegistry *registry; + EContactStore *contact_store; + gchar *text; + gint i; + + registry = e_name_selector_get_registry (name_selector); + section->entry = e_name_selector_entry_new (registry); + g_object_weak_ref (G_OBJECT (section->entry), reset_pointer_cb, name_selector); + if (pango_parse_markup (name, -1, '_', NULL, + &text, NULL, NULL)) { + atk_object_set_name (gtk_widget_get_accessible (GTK_WIDGET (section->entry)), text); + g_free (text); + } + e_name_selector_entry_set_destination_store (section->entry, destination_store); + + /* Create a contact store for the entry and assign our already-open books to it */ + + contact_store = e_contact_store_new (); + + for (i = 0; i < priv->source_books->len; i++) { + SourceBook *source_book = &g_array_index (priv->source_books, SourceBook, i); + + if (source_book->is_completion_book && source_book->client) + e_contact_store_add_client (contact_store, source_book->client); + } + + e_name_selector_entry_set_contact_store (section->entry, contact_store); + g_object_unref (contact_store); + } + + return section->entry; +} + +/** + * e_name_selector_peek_section_list: + * @name_selector: an #ENameSelector + * @name: the name of the section to peek + * + * Gets the #ENameSelectorList for the section specified by @name. + * + * Returns: The #ENameSelectorList for the named section, or %NULL if it + * doesn't exist in the #ENameSelectorModel. + **/ + +ENameSelectorList * +e_name_selector_peek_section_list (ENameSelector *name_selector, + const gchar *name) +{ + ENameSelectorPrivate *priv; + ENameSelectorModel *model; + EDestinationStore *destination_store; + Section *section; + gint n; + + g_return_val_if_fail (E_IS_NAME_SELECTOR (name_selector), NULL); + g_return_val_if_fail (name != NULL, NULL); + + priv = E_NAME_SELECTOR_GET_PRIVATE (name_selector); + model = e_name_selector_peek_model (name_selector); + + if (!e_name_selector_model_peek_section ( + model, name, NULL, &destination_store)) + return NULL; + + n = find_section_by_name (name_selector, name); + if (n < 0) + n = add_section (name_selector, name); + + section = &g_array_index (name_selector->priv->sections, Section, n); + + if (!section->entry) { + EContactStore *contact_store; + ESourceRegistry *registry; + gchar *text; + gint i; + + registry = name_selector->priv->registry; + section->entry = (ENameSelectorEntry *) + e_name_selector_list_new (registry); + g_object_weak_ref (G_OBJECT (section->entry), reset_pointer_cb, name_selector); + if (pango_parse_markup (name, -1, '_', NULL, + &text, NULL, NULL)) { + atk_object_set_name (gtk_widget_get_accessible (GTK_WIDGET (section->entry)), text); + g_free (text); + } + e_name_selector_entry_set_destination_store (section->entry, destination_store); + + /* Create a contact store for the entry and assign our already-open books to it */ + + contact_store = e_contact_store_new (); + for (i = 0; i < priv->source_books->len; i++) { + SourceBook *source_book = &g_array_index (priv->source_books, SourceBook, i); + + if (source_book->is_completion_book && source_book->client) + e_contact_store_add_client (contact_store, source_book->client); + } + + e_name_selector_entry_set_contact_store (section->entry, contact_store); + g_object_unref (contact_store); + } + + return (ENameSelectorList *) section->entry; +} diff --git a/e-util/e-name-selector.h b/e-util/e-name-selector.h new file mode 100644 index 0000000000..1049699d63 --- /dev/null +++ b/e-util/e-name-selector.h @@ -0,0 +1,94 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ + +/* e-name-selector.h - Unified context for contact/destination selection UI. + * + * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU Lesser General Public + * License as published by the Free Software Foundation. + * + * 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 this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * Authors: Hans Petter Jansson <hpj@novell.com> + */ + +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + +#ifndef E_NAME_SELECTOR_H +#define E_NAME_SELECTOR_H + +#include <libedataserver/libedataserver.h> + +#include <e-util/e-name-selector-model.h> +#include <e-util/e-name-selector-dialog.h> +#include <e-util/e-name-selector-entry.h> +#include <e-util/e-name-selector-list.h> + +/* Standard GObject macros */ +#define E_TYPE_NAME_SELECTOR \ + (e_name_selector_get_type ()) +#define E_NAME_SELECTOR(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST \ + ((obj), E_TYPE_NAME_SELECTOR, ENameSelector)) +#define E_NAME_SELECTOR_CLASS(cls) \ + (G_TYPE_CHECK_CLASS_CAST \ + ((cls), E_TYPE_NAME_SELECTOR, ENameSelectorClass)) +#define E_IS_NAME_SELECTOR(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE \ + ((obj), E_TYPE_NAME_SELECTOR)) +#define E_IS_NAME_SELECTOR_CLASS(cls) \ + (G_TYPE_CHECK_CLASS_TYPE \ + ((cls), E_TYPE_NAME_SELECTOR)) +#define E_NAME_SELECTOR_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS \ + ((obj), E_TYPE_NAME_SELECTOR, ENameSelectorClass)) + +G_BEGIN_DECLS + +typedef struct _ENameSelector ENameSelector; +typedef struct _ENameSelectorClass ENameSelectorClass; +typedef struct _ENameSelectorPrivate ENameSelectorPrivate; + +struct _ENameSelector { + GObject parent; + ENameSelectorPrivate *priv; +}; + +struct _ENameSelectorClass { + GObjectClass parent_class; +}; + +GType e_name_selector_get_type (void); +ENameSelector * e_name_selector_new (ESourceRegistry *registry); +ESourceRegistry * + e_name_selector_get_registry (ENameSelector *name_selector); +ENameSelectorModel * + e_name_selector_peek_model (ENameSelector *name_selector); +ENameSelectorDialog * + e_name_selector_peek_dialog (ENameSelector *name_selector); +ENameSelectorEntry * + e_name_selector_peek_section_entry + (ENameSelector *name_selector, + const gchar *name); +ENameSelectorList * + e_name_selector_peek_section_list + (ENameSelector *name_selector, + const gchar *name); +void e_name_selector_show_dialog (ENameSelector *name_selector, + GtkWidget *for_transient_widget); +void e_name_selector_load_books (ENameSelector *name_selector); +void e_name_selector_cancel_loading (ENameSelector *name_selector); + +G_END_DECLS + +#endif /* E_NAME_SELECTOR_H */ diff --git a/widgets/misc/e-online-button.c b/e-util/e-online-button.c index a3921a779f..a3921a779f 100644 --- a/widgets/misc/e-online-button.c +++ b/e-util/e-online-button.c diff --git a/widgets/misc/e-online-button.h b/e-util/e-online-button.h index 03f676d75c..073489fef9 100644 --- a/widgets/misc/e-online-button.h +++ b/e-util/e-online-button.h @@ -15,6 +15,10 @@ * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_ONLINE_BUTTON_H #define E_ONLINE_BUTTON_H diff --git a/widgets/misc/e-paned.c b/e-util/e-paned.c index 3b8f16bbec..3b8f16bbec 100644 --- a/widgets/misc/e-paned.c +++ b/e-util/e-paned.c diff --git a/widgets/misc/e-paned.h b/e-util/e-paned.h index 1867a0439e..79fa3ddfa4 100644 --- a/widgets/misc/e-paned.h +++ b/e-util/e-paned.h @@ -19,6 +19,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_PANED_H #define E_PANED_H diff --git a/e-util/e-passwords-win32.c b/e-util/e-passwords-win32.c new file mode 100644 index 0000000000..51c0cb21bb --- /dev/null +++ b/e-util/e-passwords-win32.c @@ -0,0 +1,1064 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ + +/* + * e-passwords.c + * + * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) + */ + +/* + * This program is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU Lesser General Public + * License as published by the Free Software Foundation. + * + * 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 this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA. + */ + +/* + * This looks a lot more complicated than it is, and than you'd think + * it would need to be. There is however, method to the madness. + * + * The code most cope with being called from any thread at any time, + * recursively from the main thread, and then serialising every + * request so that sane and correct values are always returned, and + * duplicate requests are never made. + * + * To this end, every call is marshalled and queued and a dispatch + * method invoked until that request is satisfied. If mainloop + * recursion occurs, then the sub-call will necessarily return out of + * order, but will not be processed out of order. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <limits.h> +#include <stdlib.h> +#include <string.h> +#include <gtk/gtk.h> +#include <glib/gi18n-lib.h> + +#include "e-passwords.h" +#include "libedataserver/e-data-server-util.h" +#include "libedataserver/e-flag.h" +#include "libedataserver/e-url.h" + +#define d(x) + +typedef struct _EPassMsg EPassMsg; + +struct _EPassMsg { + void (*dispatch) (EPassMsg *); + EFlag *done; + + /* input */ + GtkWindow *parent; + const gchar *component; + const gchar *key; + const gchar *title; + const gchar *prompt; + const gchar *oldpass; + guint32 flags; + + /* output */ + gboolean *remember; + gchar *password; + GError *error; + + /* work variables */ + GtkWidget *entry; + GtkWidget *check; + guint ismain:1; + guint noreply:1; /* supress replies; when calling + * dispatch functions from others */ +}; + +G_LOCK_DEFINE_STATIC (passwords); +static GThread *main_thread = NULL; +static GHashTable *password_cache = NULL; +static GtkDialog *password_dialog = NULL; +static GQueue message_queue = G_QUEUE_INIT; +static gint idle_id; +static gint ep_online_state = TRUE; + +#define KEY_FILE_GROUP_PREFIX "Passwords-" +static GKeyFile *key_file = NULL; + +static gboolean +check_key_file (const gchar *funcname) +{ + if (!key_file) + g_message ("%s: Failed to create key file!", funcname); + + return key_file != NULL; +} + +static gchar * +ep_key_file_get_filename (void) +{ + return g_build_filename ( + e_get_user_config_dir (), "credentials", "Passwords", NULL); +} + +static gchar * +ep_key_file_get_group (const gchar *component) +{ + return g_strconcat (KEY_FILE_GROUP_PREFIX, component, NULL); +} + +static gchar * +ep_key_file_normalize_key (const gchar *key) +{ + /* XXX Previous code converted all slashes and equal signs in the + * key to underscores for use with "gnome-config" functions. While + * it may not be necessary to convert slashes for use with GKeyFile, + * we continue to do the same for backward-compatibility. */ + + gchar *normalized_key, *cp; + + normalized_key = g_strdup (key); + for (cp = normalized_key; *cp != '\0'; cp++) + if (*cp == '/' || *cp == '=') + *cp = '_'; + + return normalized_key; +} + +static void +ep_key_file_load (void) +{ + gchar *filename; + GError *error = NULL; + + if (!check_key_file (G_STRFUNC)) + return; + + filename = ep_key_file_get_filename (); + + if (!g_file_test (filename, G_FILE_TEST_EXISTS)) + goto exit; + + g_key_file_load_from_file ( + key_file, filename, G_KEY_FILE_KEEP_COMMENTS | + G_KEY_FILE_KEEP_TRANSLATIONS, &error); + + if (error != NULL) { + g_warning ("%s: %s", filename, error->message); + g_error_free (error); + } + +exit: + g_free (filename); +} + +static void +ep_key_file_save (void) +{ + gchar *contents; + gchar *filename; + gchar *pathname; + gsize length = 0; + GError *error = NULL; + + if (!check_key_file (G_STRFUNC)) + return; + + filename = ep_key_file_get_filename (); + contents = g_key_file_to_data (key_file, &length, &error); + pathname = g_path_get_dirname (filename); + + if (!error) { + g_mkdir_with_parents (pathname, 0700); + g_file_set_contents (filename, contents, length, &error); + } + + g_free (pathname); + + if (error != NULL) { + g_warning ("%s: %s", filename, error->message); + g_error_free (error); + } + + g_free (contents); + g_free (filename); +} + +static gchar * +ep_password_encode (const gchar *password) +{ + /* XXX The previous Base64 encoding function did not encode the + * password's trailing nul byte. This makes decoding the Base64 + * string into a nul-terminated password more difficult, but we + * continue to do it this way for backward-compatibility. */ + + gsize length = strlen (password); + return g_base64_encode ((const guchar *) password, length); +} + +static gchar * +ep_password_decode (const gchar *encoded_password) +{ + /* XXX The previous Base64 encoding function did not encode the + * password's trailing nul byte, so we have to append a nul byte + * to the decoded data to make it a nul-terminated string. */ + + gchar *password; + gsize length = 0; + + password = (gchar *) g_base64_decode (encoded_password, &length); + password = g_realloc (password, length + 1); + password[length] = '\0'; + + return password; +} + +static gboolean +ep_idle_dispatch (gpointer data) +{ + EPassMsg *msg; + + /* As soon as a password window is up we stop; it will + re-invoke us when it has been closed down */ + G_LOCK (passwords); + while (password_dialog == NULL && (msg = g_queue_pop_head (&message_queue)) != NULL) { + G_UNLOCK (passwords); + + msg->dispatch (msg); + + G_LOCK (passwords); + } + + idle_id = 0; + G_UNLOCK (passwords); + + return FALSE; +} + +static EPassMsg * +ep_msg_new (void (*dispatch) (EPassMsg *)) +{ + EPassMsg *msg; + + e_passwords_init (); + + msg = g_malloc0 (sizeof (*msg)); + msg->dispatch = dispatch; + msg->done = e_flag_new (); + msg->ismain = (g_thread_self () == main_thread); + + return msg; +} + +static void +ep_msg_free (EPassMsg *msg) +{ + /* XXX We really should be passing this back to the caller, but + * doing so will require breaking the password API. */ + if (msg->error != NULL) { + g_warning ("%s", msg->error->message); + g_error_free (msg->error); + } + + e_flag_free (msg->done); + g_free (msg->password); + g_free (msg); +} + +static void +ep_msg_send (EPassMsg *msg) +{ + gint needidle = 0; + + G_LOCK (passwords); + g_queue_push_tail (&message_queue, msg); + if (!idle_id) { + if (!msg->ismain) + idle_id = g_idle_add (ep_idle_dispatch, NULL); + else + needidle = 1; + } + G_UNLOCK (passwords); + + if (msg->ismain) { + if (needidle) + ep_idle_dispatch (NULL); + while (!e_flag_is_set (msg->done)) + g_main_context_iteration (NULL, TRUE); + } else + e_flag_wait (msg->done); +} + +/* the functions that actually do the work */ + +static void +ep_clear_passwords_keyfile (EPassMsg *msg) +{ + gchar *group; + GError *error = NULL; + + if (!check_key_file (G_STRFUNC)) + return; + + group = ep_key_file_get_group (msg->component); + + if (g_key_file_remove_group (key_file, group, &error)) + ep_key_file_save (); + + /* Not finding the requested group is acceptable, but we still + * want to leave an informational message on the terminal. */ + else if (g_error_matches (error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_GROUP_NOT_FOUND)) { + g_message ("%s", error->message); + g_error_free (error); + + } else if (error != NULL) + g_propagate_error (&msg->error, error); + + g_free (group); +} + +static void +ep_clear_passwords (EPassMsg *msg) +{ + ep_clear_passwords_keyfile (msg); + + if (!msg->noreply) + e_flag_set (msg->done); +} + +static void +ep_forget_passwords_keyfile (EPassMsg *msg) +{ + gchar **groups; + gsize length = 0, ii; + + if (!check_key_file (G_STRFUNC)) + return; + + groups = g_key_file_get_groups (key_file, &length); + + if (!groups) + return; + + for (ii = 0; ii < length; ii++) { + GError *error = NULL; + + if (!g_str_has_prefix (groups[ii], KEY_FILE_GROUP_PREFIX)) + continue; + + g_key_file_remove_group (key_file, groups[ii], &error); + + /* Not finding the requested group is acceptable, but we still + * want to leave an informational message on the terminal. */ + if (g_error_matches (error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_GROUP_NOT_FOUND)) { + g_message ("%s", error->message); + g_error_free (error); + + /* Issue a warning if anything else goes wrong. */ + } else if (error != NULL) { + g_warning ("%s", error->message); + g_error_free (error); + } + } + ep_key_file_save (); + g_strfreev (groups); +} + +static void +ep_forget_passwords (EPassMsg *msg) +{ + g_hash_table_remove_all (password_cache); + + ep_forget_passwords_keyfile (msg); + + if (!msg->noreply) + e_flag_set (msg->done); +} + +static void +ep_remember_password_keyfile (EPassMsg *msg) +{ + gchar *group, *key, *password; + + password = g_hash_table_lookup (password_cache, msg->key); + if (password == NULL) { + g_warning ("Password for key \"%s\" not found", msg->key); + return; + } + + group = ep_key_file_get_group (msg->component); + key = ep_key_file_normalize_key (msg->key); + password = ep_password_encode (password); + + g_hash_table_remove (password_cache, msg->key); + if (check_key_file (G_STRFUNC)) { + g_key_file_set_string (key_file, group, key, password); + ep_key_file_save (); + } + + g_free (group); + g_free (key); + g_free (password); +} + +static void +ep_remember_password (EPassMsg *msg) +{ + ep_remember_password_keyfile (msg); + + if (!msg->noreply) + e_flag_set (msg->done); +} + +static void +ep_forget_password_keyfile (EPassMsg *msg) +{ + gchar *group, *key; + GError *error = NULL; + + if (!check_key_file (G_STRFUNC)) + return; + + group = ep_key_file_get_group (msg->component); + key = ep_key_file_normalize_key (msg->key); + + if (g_key_file_remove_key (key_file, group, key, &error)) + ep_key_file_save (); + + /* Not finding the requested key is acceptable, but we still + * want to leave an informational message on the terminal. */ + else if (g_error_matches (error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_KEY_NOT_FOUND)) { + g_message ("%s", error->message); + g_error_free (error); + + /* Not finding the requested group is also acceptable. */ + } else if (g_error_matches (error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_GROUP_NOT_FOUND)) { + g_message ("%s", error->message); + g_error_free (error); + + } else if (error != NULL) + g_propagate_error (&msg->error, error); + + g_free (group); + g_free (key); +} + +static void +ep_forget_password (EPassMsg *msg) +{ + g_hash_table_remove (password_cache, msg->key); + + ep_forget_password_keyfile (msg); + + if (!msg->noreply) + e_flag_set (msg->done); +} + +static void +ep_get_password_keyfile (EPassMsg *msg) +{ + gchar *group, *key, *password; + GError *error = NULL; + + if (!check_key_file (G_STRFUNC)) + return; + + group = ep_key_file_get_group (msg->component); + key = ep_key_file_normalize_key (msg->key); + + password = g_key_file_get_string (key_file, group, key, &error); + if (password != NULL) { + msg->password = ep_password_decode (password); + g_free (password); + + /* Not finding the requested key is acceptable, but we still + * want to leave an informational message on the terminal. */ + } else if (g_error_matches (error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_KEY_NOT_FOUND)) { + g_message ("%s", error->message); + g_error_free (error); + + /* Not finding the requested group is also acceptable. */ + } else if (g_error_matches (error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_GROUP_NOT_FOUND)) { + g_message ("%s", error->message); + g_error_free (error); + + } else if (error != NULL) + g_propagate_error (&msg->error, error); + + g_free (group); + g_free (key); +} + +static void +ep_get_password (EPassMsg *msg) +{ + gchar *password; + + /* Check the in-memory cache first. */ + password = g_hash_table_lookup (password_cache, msg->key); + if (password != NULL) { + msg->password = g_strdup (password); + + } else + ep_get_password_keyfile (msg); + + if (!msg->noreply) + e_flag_set (msg->done); +} + +static void +ep_add_password (EPassMsg *msg) +{ + g_hash_table_insert ( + password_cache, g_strdup (msg->key), + g_strdup (msg->oldpass)); + + if (!msg->noreply) + e_flag_set (msg->done); +} + +static void ep_ask_password (EPassMsg *msg); + +static void +pass_response (GtkDialog *dialog, + gint response, + gpointer data) +{ + EPassMsg *msg = data; + gint type = msg->flags & E_PASSWORDS_REMEMBER_MASK; + GList *iter, *trash = NULL; + + if (response == GTK_RESPONSE_OK) { + msg->password = g_strdup (gtk_entry_get_text ((GtkEntry *)msg->entry)); + + if (type != E_PASSWORDS_REMEMBER_NEVER) { + gint noreply = msg->noreply; + + *msg->remember = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (msg->check)); + + msg->noreply = 1; + + if (*msg->remember || type == E_PASSWORDS_REMEMBER_FOREVER) { + msg->oldpass = msg->password; + ep_add_password (msg); + } + if (*msg->remember && type == E_PASSWORDS_REMEMBER_FOREVER) + ep_remember_password (msg); + + msg->noreply = noreply; + } + } + + gtk_widget_destroy ((GtkWidget *)dialog); + password_dialog = NULL; + + /* ok, here things get interesting, we suck up any pending + * operations on this specific password, and return the same + * result or ignore other operations */ + + G_LOCK (passwords); + for (iter = g_queue_peek_head_link (&message_queue); iter != NULL; iter = iter->next) { + EPassMsg *pending = iter->data; + + if ((pending->dispatch == ep_forget_password + || pending->dispatch == ep_get_password + || pending->dispatch == ep_ask_password) + && (strcmp (pending->component, msg->component) == 0 + && strcmp (pending->key, msg->key) == 0)) { + + /* Satisfy the pending operation. */ + pending->password = g_strdup (msg->password); + e_flag_set (pending->done); + + /* Mark the queue node for deletion. */ + trash = g_list_prepend (trash, iter); + } + } + + /* Expunge the message queue. */ + for (iter = trash; iter != NULL; iter = iter->next) + g_queue_delete_link (&message_queue, iter->data); + g_list_free (trash); + + G_UNLOCK (passwords); + + if (!msg->noreply) + e_flag_set (msg->done); + + ep_idle_dispatch (NULL); +} + +static gboolean +update_capslock_state (GtkDialog *dialog, + GdkEvent *event, + GtkWidget *label) +{ + GdkModifierType mask = 0; + GdkWindow *window; + gchar *markup = NULL; + GdkDeviceManager *device_manager; + GdkDevice *device; + + device_manager = gdk_display_get_device_manager (gtk_widget_get_display (label)); + device = gdk_device_manager_get_client_pointer (device_manager); + window = gtk_widget_get_window (GTK_WIDGET (dialog)); + gdk_window_get_device_position (window, device, NULL, NULL, &mask); + + /* The space acts as a vertical placeholder. */ + markup = g_markup_printf_escaped ( + "<small>%s</small>", (mask & GDK_LOCK_MASK) ? + _("You have the Caps Lock key on.") : " "); + gtk_label_set_markup (GTK_LABEL (label), markup); + g_free (markup); + + return FALSE; +} + +static void +ep_ask_password (EPassMsg *msg) +{ + GtkWidget *widget; + GtkWidget *container; + GtkWidget *action_area; + GtkWidget *content_area; + gint type = msg->flags & E_PASSWORDS_REMEMBER_MASK; + guint noreply = msg->noreply; + gboolean visible; + AtkObject *a11y; + + msg->noreply = 1; + + widget = gtk_dialog_new_with_buttons ( + msg->title, msg->parent, 0, + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, + GTK_STOCK_OK, GTK_RESPONSE_OK, + NULL); +#if !GTK_CHECK_VERSION(2,90,7) + g_object_set (widget, "has-separator", FALSE, NULL); +#endif + gtk_dialog_set_default_response ( + GTK_DIALOG (widget), GTK_RESPONSE_OK); + gtk_window_set_resizable (GTK_WINDOW (widget), FALSE); + gtk_window_set_transient_for (GTK_WINDOW (widget), msg->parent); + gtk_window_set_position (GTK_WINDOW (widget), GTK_WIN_POS_CENTER_ON_PARENT); + gtk_container_set_border_width (GTK_CONTAINER (widget), 12); + password_dialog = GTK_DIALOG (widget); + + action_area = gtk_dialog_get_action_area (password_dialog); + content_area = gtk_dialog_get_content_area (password_dialog); + + /* Override GtkDialog defaults */ + gtk_box_set_spacing (GTK_BOX (action_area), 12); + gtk_container_set_border_width (GTK_CONTAINER (action_area), 0); + gtk_box_set_spacing (GTK_BOX (content_area), 12); + gtk_container_set_border_width (GTK_CONTAINER (content_area), 0); + + /* Grid */ + container = gtk_grid_new (); + gtk_grid_set_column_spacing (GTK_GRID (container), 12); + gtk_grid_set_row_spacing (GTK_GRID (container), 6); + gtk_widget_show (container); + + gtk_box_pack_start ( + GTK_BOX (content_area), container, FALSE, TRUE, 0); + + /* Password Image */ + widget = gtk_image_new_from_icon_name ( + "dialog-password", GTK_ICON_SIZE_DIALOG); + gtk_misc_set_alignment (GTK_MISC (widget), 0.0, 0.0); + g_object_set (G_OBJECT (widget), + "halign", GTK_ALIGN_FILL, + "vexpand", TRUE, + "valign", GTK_ALIGN_FILL, + NULL); + gtk_widget_show (widget); + + gtk_grid_attach (GTK_GRID (container), widget, 0, 0, 1, 3); + + /* Password Label */ + widget = gtk_label_new (NULL); + gtk_label_set_line_wrap (GTK_LABEL (widget), TRUE); + gtk_label_set_markup (GTK_LABEL (widget), msg->prompt); + gtk_misc_set_alignment (GTK_MISC (widget), 0.0, 0.5); + g_object_set (G_OBJECT (widget), + "hexpand", TRUE, + "halign", GTK_ALIGN_FILL, + NULL); + gtk_widget_show (widget); + + gtk_grid_attach (GTK_GRID (container), widget, 1, 0, 1, 1); + + /* Password Entry */ + widget = gtk_entry_new (); + a11y = gtk_widget_get_accessible (widget); + visible = !(msg->flags & E_PASSWORDS_SECRET); + atk_object_set_description (a11y, msg->prompt); + gtk_entry_set_visibility (GTK_ENTRY (widget), visible); + gtk_entry_set_activates_default (GTK_ENTRY (widget), TRUE); + gtk_widget_grab_focus (widget); + g_object_set (G_OBJECT (widget), + "hexpand", TRUE, + "halign", GTK_ALIGN_FILL, + NULL); + gtk_widget_show (widget); + msg->entry = widget; + + if ((msg->flags & E_PASSWORDS_REPROMPT)) { + ep_get_password (msg); + if (msg->password != NULL) { + gtk_entry_set_text (GTK_ENTRY (widget), msg->password); + g_free (msg->password); + msg->password = NULL; + } + } + + gtk_grid_attach (GTK_GRID (container), widget, 1, 1, 1, 1); + + /* Caps Lock Label */ + widget = gtk_label_new (NULL); + g_object_set (G_OBJECT (widget), + "hexpand", TRUE, + "halign", GTK_ALIGN_FILL, + NULL); + gtk_widget_show (widget); + + gtk_grid_attach (GTK_GRID (container), widget, 1, 2, 1, 1); + + g_signal_connect ( + password_dialog, "key-release-event", + G_CALLBACK (update_capslock_state), widget); + g_signal_connect ( + password_dialog, "focus-in-event", + G_CALLBACK (update_capslock_state), widget); + + /* static password, shouldn't be remembered between sessions, + but will be remembered within the session beyond our control */ + if (type != E_PASSWORDS_REMEMBER_NEVER) { + if (msg->flags & E_PASSWORDS_PASSPHRASE) { + widget = gtk_check_button_new_with_mnemonic ( + (type == E_PASSWORDS_REMEMBER_FOREVER) + ? _("_Remember this passphrase") + : _("_Remember this passphrase for" + " the remainder of this session")); + } else { + widget = gtk_check_button_new_with_mnemonic ( + (type == E_PASSWORDS_REMEMBER_FOREVER) + ? _("_Remember this password") + : _("_Remember this password for" + " the remainder of this session")); + } + + gtk_toggle_button_set_active ( + GTK_TOGGLE_BUTTON (widget), *msg->remember); + if (msg->flags & E_PASSWORDS_DISABLE_REMEMBER) + gtk_widget_set_sensitive (widget, FALSE); + g_object_set (G_OBJECT (widget), + "hexpand", TRUE, + "halign", GTK_ALIGN_FILL, + "valign", GTK_ALIGN_FILL, + NULL); + gtk_widget_show (widget); + msg->check = widget; + + gtk_grid_attach (GTK_GRID (container), widget, 1, 3, 1, 1); + } + + msg->noreply = noreply; + + g_signal_connect ( + password_dialog, "response", + G_CALLBACK (pass_response), msg); + + if (msg->parent) { + gtk_dialog_run (GTK_DIALOG (password_dialog)); + } else { + gtk_window_present (GTK_WINDOW (password_dialog)); + /* workaround GTK+ bug (see Gnome's bugzilla bug #624229) */ + gtk_grab_add (GTK_WIDGET (password_dialog)); + } +} + +/** + * e_passwords_init: + * + * Initializes the e_passwords routines. Must be called before any other + * e_passwords_* function. + **/ +void +e_passwords_init (void) +{ + G_LOCK (passwords); + + if (password_cache == NULL) { + password_cache = g_hash_table_new_full ( + g_str_hash, g_str_equal, + (GDestroyNotify) g_free, + (GDestroyNotify) g_free); + main_thread = g_thread_self (); + + /* Load the keyfile even if we're using the keyring. + * We might be able to extract passwords from it. */ + key_file = g_key_file_new (); + ep_key_file_load (); + + } + + G_UNLOCK (passwords); +} + +/** + * e_passwords_cancel: + * + * Cancel any outstanding password operations and close any dialogues + * currently being shown. + **/ +void +e_passwords_cancel (void) +{ + EPassMsg *msg; + + G_LOCK (passwords); + while ((msg = g_queue_pop_head (&message_queue)) != NULL) + e_flag_set (msg->done); + G_UNLOCK (passwords); + + if (password_dialog) + gtk_dialog_response (password_dialog, GTK_RESPONSE_CANCEL); +} + +/** + * e_passwords_shutdown: + * + * Cleanup routine to call before exiting. + **/ +void +e_passwords_shutdown (void) +{ + EPassMsg *msg; + + G_LOCK (passwords); + + while ((msg = g_queue_pop_head (&message_queue)) != NULL) + e_flag_set (msg->done); + + if (password_cache != NULL) { + g_hash_table_destroy (password_cache); + password_cache = NULL; + } + + + G_UNLOCK (passwords); + + if (password_dialog != NULL) + gtk_dialog_response (password_dialog, GTK_RESPONSE_CANCEL); +} + +/** + * e_passwords_set_online: + * @state: + * + * Set the offline-state of the application. This is a work-around + * for having the backends fully offline aware, and returns a + * cancellation response instead of prompting for passwords. + * + * FIXME: This is not a permanent api, review post 2.0. + **/ +void +e_passwords_set_online (gint state) +{ + ep_online_state = state; + /* TODO: we could check that a request is open and close it, or maybe who cares */ +} + +/** + * e_passwords_forget_passwords: + * + * Forgets all cached passwords, in memory and on disk. + **/ +void +e_passwords_forget_passwords (void) +{ + EPassMsg *msg = ep_msg_new (ep_forget_passwords); + + ep_msg_send (msg); + ep_msg_free (msg); +} + +/** + * e_passwords_clear_passwords: + * + * Forgets all disk cached passwords for the component. + **/ +void +e_passwords_clear_passwords (const gchar *component_name) +{ + EPassMsg *msg = ep_msg_new (ep_clear_passwords); + + msg->component = component_name; + ep_msg_send (msg); + ep_msg_free (msg); +} + +/** + * e_passwords_remember_password: + * @key: the key + * + * Saves the password associated with @key to disk. + **/ +void +e_passwords_remember_password (const gchar *component_name, + const gchar *key) +{ + EPassMsg *msg; + + g_return_if_fail (component_name != NULL); + g_return_if_fail (key != NULL); + + msg = ep_msg_new (ep_remember_password); + msg->component = component_name; + msg->key = key; + + ep_msg_send (msg); + ep_msg_free (msg); +} + +/** + * e_passwords_forget_password: + * @key: the key + * + * Forgets the password associated with @key, in memory and on disk. + **/ +void +e_passwords_forget_password (const gchar *component_name, + const gchar *key) +{ + EPassMsg *msg; + + g_return_if_fail (component_name != NULL); + g_return_if_fail (key != NULL); + + msg = ep_msg_new (ep_forget_password); + msg->component = component_name; + msg->key = key; + + ep_msg_send (msg); + ep_msg_free (msg); +} + +/** + * e_passwords_get_password: + * @key: the key + * + * Returns: the password associated with @key, or %NULL. Caller + * must free the returned password. + **/ +gchar * +e_passwords_get_password (const gchar *component_name, + const gchar *key) +{ + EPassMsg *msg; + gchar *passwd; + + g_return_val_if_fail (component_name != NULL, NULL); + g_return_val_if_fail (key != NULL, NULL); + + msg = ep_msg_new (ep_get_password); + msg->component = component_name; + msg->key = key; + + ep_msg_send (msg); + + passwd = msg->password; + msg->password = NULL; + ep_msg_free (msg); + + return passwd; +} + +/** + * e_passwords_add_password: + * @key: a key + * @passwd: the password for @key + * + * This stores the @key/@passwd pair in the current session's password + * hash. + **/ +void +e_passwords_add_password (const gchar *key, + const gchar *passwd) +{ + EPassMsg *msg; + + g_return_if_fail (key != NULL); + g_return_if_fail (passwd != NULL); + + msg = ep_msg_new (ep_add_password); + msg->key = key; + msg->oldpass = passwd; + + ep_msg_send (msg); + ep_msg_free (msg); +} + +/** + * e_passwords_ask_password: + * @title: title for the password dialog + * @component_name: the name of the component for which we're storing + * the password (e.g. Mail, Addressbook, etc.) + * @key: key to store the password under + * @prompt: prompt string + * @type: whether or not to offer to remember the password, + * and for how long. + * @remember: on input, the default state of the remember checkbox. + * on output, the state of the checkbox when the dialog was closed. + * @parent: parent window of the dialog, or %NULL + * + * Asks the user for a password. + * + * Returns: the password, which the caller must free, or %NULL if + * the user cancelled the operation. *@remember will be set if the + * return value is non-%NULL and @remember_type is not + * E_PASSWORDS_DO_NOT_REMEMBER. + **/ +gchar * +e_passwords_ask_password (const gchar *title, + const gchar *component_name, + const gchar *key, + const gchar *prompt, + EPasswordsRememberType type, + gboolean *remember, + GtkWindow *parent) +{ + gchar *passwd; + EPassMsg *msg; + + g_return_val_if_fail (component_name != NULL, NULL); + g_return_val_if_fail (key != NULL, NULL); + + if ((type & E_PASSWORDS_ONLINE) && !ep_online_state) + return NULL; + + msg = ep_msg_new (ep_ask_password); + msg->title = title; + msg->component = component_name; + msg->key = key; + msg->prompt = prompt; + msg->flags = type; + msg->remember = remember; + msg->parent = parent; + + ep_msg_send (msg); + passwd = msg->password; + msg->password = NULL; + ep_msg_free (msg); + + return passwd; +} diff --git a/e-util/e-passwords.c b/e-util/e-passwords.c new file mode 100644 index 0000000000..bf4cfc1e7f --- /dev/null +++ b/e-util/e-passwords.c @@ -0,0 +1,890 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ + +/* + * e-passwords.c + * + * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) + */ + +/* + * This program is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU Lesser General Public + * License as published by the Free Software Foundation. + * + * 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 this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA. + */ + +/* + * This looks a lot more complicated than it is, and than you'd think + * it would need to be. There is however, method to the madness. + * + * The code must cope with being called from any thread at any time, + * recursively from the main thread, and then serialising every + * request so that sane and correct values are always returned, and + * duplicate requests are never made. + * + * To this end, every call is marshalled and queued and a dispatch + * method invoked until that request is satisfied. If mainloop + * recursion occurs, then the sub-call will necessarily return out of + * order, but will not be processed out of order. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <limits.h> +#include <stdlib.h> +#include <string.h> +#include <gtk/gtk.h> +#include <glib/gi18n-lib.h> + +/* XXX Yeah, yeah... */ +#define SECRET_API_SUBJECT_TO_CHANGE + +#include <libsecret/secret.h> + +#include <libedataserver/libedataserver.h> + +#include "e-passwords.h" + +#define d(x) + +typedef struct _EPassMsg EPassMsg; + +struct _EPassMsg { + void (*dispatch) (EPassMsg *); + EFlag *done; + + /* input */ + GtkWindow *parent; + const gchar *key; + const gchar *title; + const gchar *prompt; + const gchar *oldpass; + guint32 flags; + + /* output */ + gboolean *remember; + gchar *password; + GError *error; + + /* work variables */ + GtkWidget *entry; + GtkWidget *check; + guint ismain : 1; + guint noreply:1; /* supress replies; when calling + * dispatch functions from others */ +}; + +/* XXX probably want to share this with evalution-source-registry-migrate-sources.c */ +static const SecretSchema e_passwords_schema = { + "org.gnome.Evolution.Password", + SECRET_SCHEMA_DONT_MATCH_NAME, + { + { "application", SECRET_SCHEMA_ATTRIBUTE_STRING, }, + { "user", SECRET_SCHEMA_ATTRIBUTE_STRING, }, + { "server", SECRET_SCHEMA_ATTRIBUTE_STRING, }, + { "protocol", SECRET_SCHEMA_ATTRIBUTE_STRING, }, + } +}; + +G_LOCK_DEFINE_STATIC (passwords); +static GThread *main_thread = NULL; +static GHashTable *password_cache = NULL; +static GtkDialog *password_dialog = NULL; +static GQueue message_queue = G_QUEUE_INIT; +static gint idle_id; +static gint ep_online_state = TRUE; + +static EUri * +ep_keyring_uri_new (const gchar *string, + GError **error) +{ + EUri *uri; + + uri = e_uri_new (string); + g_return_val_if_fail (uri != NULL, NULL); + + /* LDAP URIs do not have usernames, so use the URI as the username. */ + if (uri->user == NULL && uri->protocol != NULL && + (strcmp (uri->protocol, "ldap") == 0|| strcmp (uri->protocol, "google") == 0)) + uri->user = g_strdelimit (g_strdup (string), "/=", '_'); + + /* Make sure the URI has the required components. */ + if (uri->user == NULL && uri->host == NULL) { + g_set_error_literal ( + error, G_IO_ERROR, + G_IO_ERROR_INVALID_ARGUMENT, + _("Keyring key is unusable: no user or host name")); + e_uri_free (uri); + uri = NULL; + } + + return uri; +} + +static gboolean +ep_idle_dispatch (gpointer data) +{ + EPassMsg *msg; + + /* As soon as a password window is up we stop; it will + * re - invoke us when it has been closed down */ + G_LOCK (passwords); + while (password_dialog == NULL && (msg = g_queue_pop_head (&message_queue)) != NULL) { + G_UNLOCK (passwords); + + msg->dispatch (msg); + + G_LOCK (passwords); + } + + idle_id = 0; + G_UNLOCK (passwords); + + return FALSE; +} + +static EPassMsg * +ep_msg_new (void (*dispatch) (EPassMsg *)) +{ + EPassMsg *msg; + + e_passwords_init (); + + msg = g_malloc0 (sizeof (*msg)); + msg->dispatch = dispatch; + msg->done = e_flag_new (); + msg->ismain = (g_thread_self () == main_thread); + + return msg; +} + +static void +ep_msg_free (EPassMsg *msg) +{ + /* XXX We really should be passing this back to the caller, but + * doing so will require breaking the password API. */ + if (msg->error != NULL) { + g_warning ("%s", msg->error->message); + g_error_free (msg->error); + } + + e_flag_free (msg->done); + g_free (msg->password); + g_free (msg); +} + +static void +ep_msg_send (EPassMsg *msg) +{ + gint needidle = 0; + + G_LOCK (passwords); + g_queue_push_tail (&message_queue, msg); + if (!idle_id) { + if (!msg->ismain) + idle_id = g_idle_add (ep_idle_dispatch, NULL); + else + needidle = 1; + } + G_UNLOCK (passwords); + + if (msg->ismain) { + if (needidle) + ep_idle_dispatch (NULL); + while (!e_flag_is_set (msg->done)) + g_main_context_iteration (NULL, TRUE); + } else + e_flag_wait (msg->done); +} + +/* the functions that actually do the work */ + +static void +ep_clear_passwords (EPassMsg *msg) +{ + GError *error = NULL; + + /* Find all Evolution passwords and delete them. */ + secret_password_clear_sync ( + &e_passwords_schema, NULL, &error, + "application", "Evolution", NULL); + + if (error != NULL) + g_propagate_error (&msg->error, error); + + if (!msg->noreply) + e_flag_set (msg->done); +} + +static void +ep_remember_password (EPassMsg *msg) +{ + gchar *password; + EUri *uri; + GError *error = NULL; + + password = g_hash_table_lookup (password_cache, msg->key); + if (password == NULL) { + g_warning ("Password for key \"%s\" not found", msg->key); + goto exit; + } + + uri = ep_keyring_uri_new (msg->key, &msg->error); + if (uri == NULL) + goto exit; + + secret_password_store_sync ( + &e_passwords_schema, + SECRET_COLLECTION_DEFAULT, + msg->key, password, + NULL, &error, + "application", "Evolution", + "user", uri->user, + "server", uri->host, + "protocol", uri->protocol, + NULL); + + /* Only remove the password from the session hash + * if the keyring insertion was successful. */ + if (error == NULL) + g_hash_table_remove (password_cache, msg->key); + else + g_propagate_error (&msg->error, error); + + e_uri_free (uri); + +exit: + if (!msg->noreply) + e_flag_set (msg->done); +} + +static void +ep_forget_password (EPassMsg *msg) +{ + EUri *uri; + GError *error = NULL; + + g_hash_table_remove (password_cache, msg->key); + + uri = ep_keyring_uri_new (msg->key, &msg->error); + if (uri == NULL) + goto exit; + + /* Find all Evolution passwords matching the URI and delete them. + * + * XXX We didn't always store protocols in the keyring, so for + * backward-compatibility we need to lookup passwords by user + * and host only (no protocol). But we do send the protocol + * to ep_keyring_delete_passwords(), which also knows about + * the backward-compatibility issue and will filter the list + * appropriately. */ + secret_password_clear_sync ( + &e_passwords_schema, NULL, &error, + "application", "Evolution", + "user", uri->user, + "server", uri->host, + NULL); + + if (error != NULL) + g_propagate_error (&msg->error, error); + + e_uri_free (uri); + +exit: + if (!msg->noreply) + e_flag_set (msg->done); +} + +static void +ep_get_password (EPassMsg *msg) +{ + EUri *uri; + gchar *password; + GError *error = NULL; + + /* Check the in-memory cache first. */ + password = g_hash_table_lookup (password_cache, msg->key); + if (password != NULL) { + msg->password = g_strdup (password); + goto exit; + } + + uri = ep_keyring_uri_new (msg->key, &msg->error); + if (uri == NULL) + goto exit; + + msg->password = secret_password_lookup_sync ( + &e_passwords_schema, NULL, &error, + "application", "Evolution", + "user", uri->user, + "server", uri->host, + "protocol", uri->protocol, + NULL); + + if (msg->password != NULL) + goto done; + + /* Clear the previous error, if there was one. + * It's likely to occur again. */ + if (error != NULL) + g_clear_error (&error); + + /* XXX We didn't always store protocols in the keyring, so for + * backward-compatibility we also need to lookup passwords + * by user and host only (no protocol). */ + msg->password = secret_password_lookup_sync ( + &e_passwords_schema, NULL, &error, + "application", "Evolution", + "user", uri->user, + "server", uri->host, + NULL); + +done: + if (error != NULL) + g_propagate_error (&msg->error, error); + + e_uri_free (uri); + +exit: + if (!msg->noreply) + e_flag_set (msg->done); +} + +static void +ep_add_password (EPassMsg *msg) +{ + g_hash_table_insert ( + password_cache, g_strdup (msg->key), + g_strdup (msg->oldpass)); + + if (!msg->noreply) + e_flag_set (msg->done); +} + +static void ep_ask_password (EPassMsg *msg); + +static void +pass_response (GtkDialog *dialog, + gint response, + gpointer data) +{ + EPassMsg *msg = data; + gint type = msg->flags & E_PASSWORDS_REMEMBER_MASK; + GList *iter, *trash = NULL; + + if (response == GTK_RESPONSE_OK) { + msg->password = g_strdup (gtk_entry_get_text ((GtkEntry *) msg->entry)); + + if (type != E_PASSWORDS_REMEMBER_NEVER) { + gint noreply = msg->noreply; + + *msg->remember = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (msg->check)); + + msg->noreply = 1; + + if (*msg->remember || type == E_PASSWORDS_REMEMBER_FOREVER) { + msg->oldpass = msg->password; + ep_add_password (msg); + } + if (*msg->remember && type == E_PASSWORDS_REMEMBER_FOREVER) + ep_remember_password (msg); + + msg->noreply = noreply; + } + } + + gtk_widget_destroy ((GtkWidget *) dialog); + password_dialog = NULL; + + /* ok, here things get interesting, we suck up any pending + * operations on this specific password, and return the same + * result or ignore other operations */ + + G_LOCK (passwords); + for (iter = g_queue_peek_head_link (&message_queue); iter != NULL; iter = iter->next) { + EPassMsg *pending = iter->data; + + if ((pending->dispatch == ep_forget_password + || pending->dispatch == ep_get_password + || pending->dispatch == ep_ask_password) + && strcmp (pending->key, msg->key) == 0) { + + /* Satisfy the pending operation. */ + pending->password = g_strdup (msg->password); + e_flag_set (pending->done); + + /* Mark the queue node for deletion. */ + trash = g_list_prepend (trash, iter); + } + } + + /* Expunge the message queue. */ + for (iter = trash; iter != NULL; iter = iter->next) + g_queue_delete_link (&message_queue, iter->data); + g_list_free (trash); + + G_UNLOCK (passwords); + + if (!msg->noreply) + e_flag_set (msg->done); + + ep_idle_dispatch (NULL); +} + +static gboolean +update_capslock_state (GtkDialog *dialog, + GdkEvent *event, + GtkWidget *label) +{ + GdkModifierType mask = 0; + GdkWindow *window; + gchar *markup = NULL; + GdkDeviceManager *device_manager; + GdkDevice *device; + + device_manager = gdk_display_get_device_manager (gtk_widget_get_display (label)); + device = gdk_device_manager_get_client_pointer (device_manager); + window = gtk_widget_get_window (GTK_WIDGET (dialog)); + gdk_window_get_device_position (window, device, NULL, NULL, &mask); + + /* The space acts as a vertical placeholder. */ + markup = g_markup_printf_escaped ( + "<small>%s</small>", (mask & GDK_LOCK_MASK) ? + _("You have the Caps Lock key on.") : " "); + gtk_label_set_markup (GTK_LABEL (label), markup); + g_free (markup); + + return FALSE; +} + +static void +ep_ask_password (EPassMsg *msg) +{ + GtkWidget *widget; + GtkWidget *container; + GtkWidget *action_area; + GtkWidget *content_area; + gint type = msg->flags & E_PASSWORDS_REMEMBER_MASK; + guint noreply = msg->noreply; + gboolean visible; + AtkObject *a11y; + + msg->noreply = 1; + + widget = gtk_dialog_new_with_buttons ( + msg->title, msg->parent, 0, + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, + GTK_STOCK_OK, GTK_RESPONSE_OK, + NULL); + gtk_dialog_set_default_response ( + GTK_DIALOG (widget), GTK_RESPONSE_OK); + gtk_window_set_resizable (GTK_WINDOW (widget), FALSE); + gtk_window_set_transient_for (GTK_WINDOW (widget), msg->parent); + gtk_window_set_position (GTK_WINDOW (widget), GTK_WIN_POS_CENTER_ON_PARENT); + gtk_container_set_border_width (GTK_CONTAINER (widget), 12); + password_dialog = GTK_DIALOG (widget); + + action_area = gtk_dialog_get_action_area (password_dialog); + content_area = gtk_dialog_get_content_area (password_dialog); + + /* Override GtkDialog defaults */ + gtk_box_set_spacing (GTK_BOX (action_area), 12); + gtk_container_set_border_width (GTK_CONTAINER (action_area), 0); + gtk_box_set_spacing (GTK_BOX (content_area), 12); + gtk_container_set_border_width (GTK_CONTAINER (content_area), 0); + + /* Grid */ + container = gtk_grid_new (); + gtk_grid_set_column_spacing (GTK_GRID (container), 12); + gtk_grid_set_row_spacing (GTK_GRID (container), 6); + gtk_widget_show (container); + + gtk_box_pack_start ( + GTK_BOX (content_area), container, FALSE, TRUE, 0); + + /* Password Image */ + widget = gtk_image_new_from_icon_name ( + "dialog-password", GTK_ICON_SIZE_DIALOG); + gtk_misc_set_alignment (GTK_MISC (widget), 0.0, 0.0); + g_object_set (G_OBJECT (widget), + "halign", GTK_ALIGN_FILL, + "vexpand", TRUE, + "valign", GTK_ALIGN_FILL, + NULL); + gtk_widget_show (widget); + + gtk_grid_attach (GTK_GRID (container), widget, 0, 0, 1, 3); + + /* Password Label */ + widget = gtk_label_new (NULL); + gtk_label_set_line_wrap (GTK_LABEL (widget), TRUE); + gtk_label_set_markup (GTK_LABEL (widget), msg->prompt); + gtk_misc_set_alignment (GTK_MISC (widget), 0.0, 0.5); + g_object_set (G_OBJECT (widget), + "hexpand", TRUE, + "halign", GTK_ALIGN_FILL, + NULL); + gtk_widget_show (widget); + + gtk_grid_attach (GTK_GRID (container), widget, 1, 0, 1, 1); + + /* Password Entry */ + widget = gtk_entry_new (); + a11y = gtk_widget_get_accessible (widget); + visible = !(msg->flags & E_PASSWORDS_SECRET); + atk_object_set_description (a11y, msg->prompt); + gtk_entry_set_visibility (GTK_ENTRY (widget), visible); + gtk_entry_set_activates_default (GTK_ENTRY (widget), TRUE); + gtk_widget_grab_focus (widget); + g_object_set (G_OBJECT (widget), + "hexpand", TRUE, + "halign", GTK_ALIGN_FILL, + NULL); + gtk_widget_show (widget); + msg->entry = widget; + + if ((msg->flags & E_PASSWORDS_REPROMPT)) { + ep_get_password (msg); + if (msg->password != NULL) { + gtk_entry_set_text (GTK_ENTRY (widget), msg->password); + g_free (msg->password); + msg->password = NULL; + } + } + + gtk_grid_attach (GTK_GRID (container), widget, 1, 1, 1, 1); + + /* Caps Lock Label */ + widget = gtk_label_new (NULL); + g_object_set (G_OBJECT (widget), + "hexpand", TRUE, + "halign", GTK_ALIGN_FILL, + NULL); + gtk_widget_show (widget); + + gtk_grid_attach (GTK_GRID (container), widget, 1, 2, 1, 1); + + g_signal_connect ( + password_dialog, "key-release-event", + G_CALLBACK (update_capslock_state), widget); + g_signal_connect ( + password_dialog, "focus-in-event", + G_CALLBACK (update_capslock_state), widget); + + /* static password, shouldn't be remembered between sessions, + * but will be remembered within the session beyond our control */ + if (type != E_PASSWORDS_REMEMBER_NEVER) { + if (msg->flags & E_PASSWORDS_PASSPHRASE) { + widget = gtk_check_button_new_with_mnemonic ( + (type == E_PASSWORDS_REMEMBER_FOREVER) + ? _("_Remember this passphrase") + : _("_Remember this passphrase for" + " the remainder of this session")); + } else { + widget = gtk_check_button_new_with_mnemonic ( + (type == E_PASSWORDS_REMEMBER_FOREVER) + ? _("_Remember this password") + : _("_Remember this password for" + " the remainder of this session")); + } + + gtk_toggle_button_set_active ( + GTK_TOGGLE_BUTTON (widget), *msg->remember); + if (msg->flags & E_PASSWORDS_DISABLE_REMEMBER) + gtk_widget_set_sensitive (widget, FALSE); + g_object_set (G_OBJECT (widget), + "hexpand", TRUE, + "halign", GTK_ALIGN_FILL, + "valign", GTK_ALIGN_FILL, + NULL); + gtk_widget_show (widget); + msg->check = widget; + + gtk_grid_attach (GTK_GRID (container), widget, 1, 3, 1, 1); + } + + msg->noreply = noreply; + + g_signal_connect ( + password_dialog, "response", + G_CALLBACK (pass_response), msg); + + if (msg->parent) { + gtk_dialog_run (GTK_DIALOG (password_dialog)); + } else { + gtk_window_present (GTK_WINDOW (password_dialog)); + /* workaround GTK+ bug (see Gnome's bugzilla bug #624229) */ + gtk_grab_add (GTK_WIDGET (password_dialog)); + } +} + +/** + * e_passwords_init: + * + * Initializes the e_passwords routines. Must be called before any other + * e_passwords_* function. + **/ +void +e_passwords_init (void) +{ + G_LOCK (passwords); + + if (password_cache == NULL) { + password_cache = g_hash_table_new_full ( + g_str_hash, g_str_equal, + (GDestroyNotify) g_free, + (GDestroyNotify) g_free); + main_thread = g_thread_self (); + } + + G_UNLOCK (passwords); +} + +/** + * e_passwords_cancel: + * + * Cancel any outstanding password operations and close any dialogues + * currently being shown. + **/ +void +e_passwords_cancel (void) +{ + EPassMsg *msg; + + G_LOCK (passwords); + while ((msg = g_queue_pop_head (&message_queue)) != NULL) + e_flag_set (msg->done); + G_UNLOCK (passwords); + + if (password_dialog) + gtk_dialog_response (password_dialog, GTK_RESPONSE_CANCEL); +} + +/** + * e_passwords_shutdown: + * + * Cleanup routine to call before exiting. + **/ +void +e_passwords_shutdown (void) +{ + EPassMsg *msg; + + G_LOCK (passwords); + + while ((msg = g_queue_pop_head (&message_queue)) != NULL) + e_flag_set (msg->done); + + if (password_cache != NULL) { + g_hash_table_destroy (password_cache); + password_cache = NULL; + } + + G_UNLOCK (passwords); + + if (password_dialog != NULL) + gtk_dialog_response (password_dialog, GTK_RESPONSE_CANCEL); +} + +/** + * e_passwords_set_online: + * @state: + * + * Set the offline-state of the application. This is a work-around + * for having the backends fully offline aware, and returns a + * cancellation response instead of prompting for passwords. + * + * FIXME: This is not a permanent api, review post 2.0. + **/ +void +e_passwords_set_online (gint state) +{ + ep_online_state = state; + /* TODO: we could check that a request is open and close it, or maybe who cares */ +} + +/** + * e_passwords_forget_passwords: + * + * Forgets all cached passwords, in memory and on disk. + **/ +void +e_passwords_forget_passwords (void) +{ + EPassMsg *msg = ep_msg_new (ep_clear_passwords); + + ep_msg_send (msg); + ep_msg_free (msg); +} + +/** + * e_passwords_clear_passwords: + * + * Forgets all disk cached passwords for the component. + **/ +void +e_passwords_clear_passwords (const gchar *unused) +{ + EPassMsg *msg = ep_msg_new (ep_clear_passwords); + + ep_msg_send (msg); + ep_msg_free (msg); +} + +/** + * e_passwords_remember_password: + * @key: the key + * + * Saves the password associated with @key to disk. + **/ +void +e_passwords_remember_password (const gchar *unused, + const gchar *key) +{ + EPassMsg *msg; + + g_return_if_fail (key != NULL); + + msg = ep_msg_new (ep_remember_password); + msg->key = key; + + ep_msg_send (msg); + ep_msg_free (msg); +} + +/** + * e_passwords_forget_password: + * @key: the key + * + * Forgets the password associated with @key, in memory and on disk. + **/ +void +e_passwords_forget_password (const gchar *unused, + const gchar *key) +{ + EPassMsg *msg; + + g_return_if_fail (key != NULL); + + msg = ep_msg_new (ep_forget_password); + msg->key = key; + + ep_msg_send (msg); + ep_msg_free (msg); +} + +/** + * e_passwords_get_password: + * @key: the key + * + * Returns: the password associated with @key, or %NULL. Caller + * must free the returned password. + **/ +gchar * +e_passwords_get_password (const gchar *unused, + const gchar *key) +{ + EPassMsg *msg; + gchar *passwd; + + g_return_val_if_fail (key != NULL, NULL); + + msg = ep_msg_new (ep_get_password); + msg->key = key; + + ep_msg_send (msg); + + passwd = msg->password; + msg->password = NULL; + ep_msg_free (msg); + + return passwd; +} + +/** + * e_passwords_add_password: + * @key: a key + * @passwd: the password for @key + * + * This stores the @key/@passwd pair in the current session's password + * hash. + **/ +void +e_passwords_add_password (const gchar *key, + const gchar *passwd) +{ + EPassMsg *msg; + + g_return_if_fail (key != NULL); + g_return_if_fail (passwd != NULL); + + msg = ep_msg_new (ep_add_password); + msg->key = key; + msg->oldpass = passwd; + + ep_msg_send (msg); + ep_msg_free (msg); +} + +/** + * e_passwords_ask_password: + * @title: title for the password dialog + * @unused: this argument is no longer used + * @key: key to store the password under + * @prompt: prompt string + * @remember_type: whether or not to offer to remember the password, + * and for how long. + * @remember: on input, the default state of the remember checkbox. + * on output, the state of the checkbox when the dialog was closed. + * @parent: parent window of the dialog, or %NULL + * + * Asks the user for a password. + * + * Returns: the password, which the caller must free, or %NULL if + * the user cancelled the operation. *@remember will be set if the + * return value is non-%NULL and @remember_type is not + * E_PASSWORDS_DO_NOT_REMEMBER. + **/ +gchar * +e_passwords_ask_password (const gchar *title, + const gchar *unused, + const gchar *key, + const gchar *prompt, + EPasswordsRememberType remember_type, + gboolean *remember, + GtkWindow *parent) +{ + gchar *passwd; + EPassMsg *msg; + + g_return_val_if_fail (key != NULL, NULL); + + if ((remember_type & E_PASSWORDS_ONLINE) && !ep_online_state) + return NULL; + + msg = ep_msg_new (ep_ask_password); + msg->title = title; + msg->key = key; + msg->prompt = prompt; + msg->flags = remember_type; + msg->remember = remember; + msg->parent = parent; + + ep_msg_send (msg); + passwd = msg->password; + msg->password = NULL; + ep_msg_free (msg); + + return passwd; +} diff --git a/e-util/e-passwords.h b/e-util/e-passwords.h new file mode 100644 index 0000000000..83a4a7eaec --- /dev/null +++ b/e-util/e-passwords.h @@ -0,0 +1,81 @@ +/* + * e-passwords.h + * + * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) + */ + +/* + * This program is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU Lesser General Public + * License as published by the Free Software Foundation. + * + * 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 this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA. + */ + +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + +#ifndef EDS_DISABLE_DEPRECATED + +#ifndef _E_PASSWORD_H_ +#define _E_PASSWORD_H_ + +#include <gtk/gtk.h> + +G_BEGIN_DECLS + +/* + * initialization is now implicit when you call any of the functions + * below, although this is only correct if the functions are called + * from the main thread. + * + * e_passwords_shutdown should be called at exit time to synch the + * password on-disk storage, and to free up in-memory storage. */ +void e_passwords_init (void); + +void e_passwords_shutdown (void); +void e_passwords_cancel (void); +void e_passwords_set_online (gint state); +void e_passwords_remember_password (const gchar *unused, const gchar *key); +void e_passwords_add_password (const gchar *key, const gchar *passwd); +gchar *e_passwords_get_password (const gchar *unused, const gchar *key); +void e_passwords_forget_password (const gchar *unused, const gchar *key); +void e_passwords_forget_passwords (void); +void e_passwords_clear_passwords (const gchar *unused); + +typedef enum { + E_PASSWORDS_REMEMBER_NEVER, + E_PASSWORDS_REMEMBER_SESSION, + E_PASSWORDS_REMEMBER_FOREVER, + E_PASSWORDS_REMEMBER_MASK = 0xf, + + /* option bits */ + E_PASSWORDS_SECRET = 1 << 8, + E_PASSWORDS_REPROMPT = 1 << 9, + E_PASSWORDS_ONLINE = 1<<10, /* only ask if we're online */ + E_PASSWORDS_DISABLE_REMEMBER = 1<<11, /* disable the 'remember password' checkbox */ + E_PASSWORDS_PASSPHRASE = 1<<12 /* We are asking a passphrase */ +} EPasswordsRememberType; + +gchar * e_passwords_ask_password (const gchar *title, + const gchar *unused, + const gchar *key, + const gchar *prompt, + EPasswordsRememberType remember_type, + gboolean *remember, + GtkWindow *parent); + +G_END_DECLS + +#endif /* _E_PASSWORD_H_ */ + +#endif /* EDS_DISABLE_DEPRECATED */ diff --git a/widgets/misc/e-picture-gallery.c b/e-util/e-picture-gallery.c index 40e621b1ca..d95a0c907c 100644 --- a/widgets/misc/e-picture-gallery.c +++ b/e-util/e-picture-gallery.c @@ -23,10 +23,10 @@ #include <config.h> #endif -#include "e-util/e-icon-factory.h" - #include "e-picture-gallery.h" +#include "e-icon-factory.h" + #define E_PICTURE_GALLERY_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ ((obj), E_TYPE_PICTURE_GALLERY, EPictureGalleryPrivate)) diff --git a/widgets/misc/e-picture-gallery.h b/e-util/e-picture-gallery.h index 6da23294c4..653d9906af 100644 --- a/widgets/misc/e-picture-gallery.h +++ b/e-util/e-picture-gallery.h @@ -19,6 +19,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_PICTURE_GALLERY_H #define E_PICTURE_GALLERY_H diff --git a/e-util/e-plugin-ui.c b/e-util/e-plugin-ui.c index 6e36654061..3ef863c2a3 100644 --- a/e-util/e-plugin-ui.c +++ b/e-util/e-plugin-ui.c @@ -21,7 +21,6 @@ #include "e-plugin-ui.h" -#include "e-util.h" #include "e-ui-manager.h" #include <string.h> diff --git a/e-util/e-plugin-ui.h b/e-util/e-plugin-ui.h index e59b5f5222..f56a6e095c 100644 --- a/e-util/e-plugin-ui.h +++ b/e-util/e-plugin-ui.h @@ -15,6 +15,10 @@ * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_PLUGIN_UI_H #define E_PLUGIN_UI_H diff --git a/e-util/e-plugin.h b/e-util/e-plugin.h index 047d944193..b67bde548c 100644 --- a/e-util/e-plugin.h +++ b/e-util/e-plugin.h @@ -19,6 +19,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef _E_PLUGIN_H #define _E_PLUGIN_H diff --git a/e-util/e-poolv.h b/e-util/e-poolv.h index e3cfb31007..f1b4654127 100644 --- a/e-util/e-poolv.h +++ b/e-util/e-poolv.h @@ -16,6 +16,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_POOLV_H #define E_POOLV_H diff --git a/widgets/misc/e-popup-action.c b/e-util/e-popup-action.c index 27c90f67c3..27c90f67c3 100644 --- a/widgets/misc/e-popup-action.c +++ b/e-util/e-popup-action.c diff --git a/widgets/misc/e-popup-action.h b/e-util/e-popup-action.h index 02469375d5..62e7b8ec0f 100644 --- a/widgets/misc/e-popup-action.h +++ b/e-util/e-popup-action.h @@ -33,6 +33,10 @@ * to e_action_group_add_popup_actions() to add popup actions. */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_POPUP_ACTION_H #define E_POPUP_ACTION_H diff --git a/widgets/table/e-popup-menu.c b/e-util/e-popup-menu.c index 3e82496748..3e82496748 100644 --- a/widgets/table/e-popup-menu.c +++ b/e-util/e-popup-menu.c diff --git a/widgets/table/e-popup-menu.h b/e-util/e-popup-menu.h index 9fd3616eb2..ec0979c576 100644 --- a/widgets/table/e-popup-menu.h +++ b/e-util/e-popup-menu.h @@ -22,6 +22,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_POPUP_MENU_H #define E_POPUP_MENU_H diff --git a/widgets/misc/e-port-entry.c b/e-util/e-port-entry.c index cf857b5d55..cf857b5d55 100644 --- a/widgets/misc/e-port-entry.c +++ b/e-util/e-port-entry.c diff --git a/widgets/misc/e-port-entry.h b/e-util/e-port-entry.h index 2ef9b45cf7..fc0eaa0d90 100644 --- a/widgets/misc/e-port-entry.h +++ b/e-util/e-port-entry.h @@ -20,6 +20,10 @@ * Dan Vratil <dvratil@redhat.com> */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_PORT_ENTRY_H #define E_PORT_ENTRY_H diff --git a/widgets/misc/e-preferences-window.c b/e-util/e-preferences-window.c index 83c5ed0fd6..fbe6c01d21 100644 --- a/widgets/misc/e-preferences-window.c +++ b/e-util/e-preferences-window.c @@ -27,7 +27,8 @@ #include <glib/gi18n.h> #include <gdk/gdkkeysyms.h> -#include <e-util/e-util.h> + +#include "e-misc-utils.h" #define SWITCH_PAGE_INTERVAL 250 diff --git a/widgets/misc/e-preferences-window.h b/e-util/e-preferences-window.h index 72ae63eb7e..f2efa015e6 100644 --- a/widgets/misc/e-preferences-window.h +++ b/e-util/e-preferences-window.h @@ -19,6 +19,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_PREFERENCES_WINDOW_H #define E_PREFERENCES_WINDOW_H diff --git a/widgets/misc/e-preview-pane.c b/e-util/e-preview-pane.c index 92644ec883..27009ab087 100644 --- a/widgets/misc/e-preview-pane.c +++ b/e-util/e-preview-pane.c @@ -27,10 +27,9 @@ #include <gdk/gdkkeysyms.h> -#include <libevolution-utils/e-alert-sink.h> -#include <libevolution-utils/e-alert-dialog.h> - #include "e-alert-bar.h" +#include "e-alert-dialog.h" +#include "e-alert-sink.h" #define E_PREVIEW_PANE_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ diff --git a/widgets/misc/e-preview-pane.h b/e-util/e-preview-pane.h index 01e216c1cc..3720744b6c 100644 --- a/widgets/misc/e-preview-pane.h +++ b/e-util/e-preview-pane.h @@ -19,12 +19,17 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_PREVIEW_PANE_H #define E_PREVIEW_PANE_H #include <gtk/gtk.h> -#include <misc/e-search-bar.h> -#include <misc/e-web-view.h> + +#include <e-util/e-search-bar.h> +#include <e-util/e-web-view.h> /* Standard GObject macros */ #define E_TYPE_PREVIEW_PANE \ diff --git a/e-util/e-print.c b/e-util/e-print.c index e50ffd8647..bc2f4d3608 100644 --- a/e-util/e-print.c +++ b/e-util/e-print.c @@ -32,7 +32,7 @@ #include <gtk/gtk.h> #include <glib/gi18n.h> -#include "e-util.h" +#include <libedataserver/libedataserver.h> /* XXX Would be better if GtkPrint exposed these. */ #define PAGE_SETUP_GROUP_NAME "Page Setup" diff --git a/e-util/e-print.h b/e-util/e-print.h index 9469b63636..ee96e25d2e 100644 --- a/e-util/e-print.h +++ b/e-util/e-print.h @@ -23,6 +23,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef __E_PRINT__ #define __E_PRINT__ diff --git a/widgets/misc/e-printable.c b/e-util/e-printable.c index 2e98143b1a..3f1403f03c 100644 --- a/widgets/misc/e-printable.c +++ b/e-util/e-printable.c @@ -26,10 +26,10 @@ #include <gtk/gtk.h> -#include "e-util/e-util.h" - #include "e-printable.h" +#include "e-marshal.h" + #define EP_CLASS(e) ((EPrintableClass *)((GObject *)e)->class) G_DEFINE_TYPE ( diff --git a/widgets/misc/e-printable.h b/e-util/e-printable.h index b8d9893799..292756076d 100644 --- a/widgets/misc/e-printable.h +++ b/e-util/e-printable.h @@ -21,6 +21,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef _E_PRINTABLE_H_ #define _E_PRINTABLE_H_ diff --git a/widgets/text/e-reflow-model.c b/e-util/e-reflow-model.c index 1f7aa5e105..4f5b219b90 100644 --- a/widgets/text/e-reflow-model.c +++ b/e-util/e-reflow-model.c @@ -25,10 +25,10 @@ #include <config.h> #endif -#include "e-util/e-util.h" - #include "e-reflow-model.h" +#include "e-misc-utils.h" + G_DEFINE_TYPE (EReflowModel, e_reflow_model, G_TYPE_OBJECT) #define d(x) diff --git a/widgets/text/e-reflow-model.h b/e-util/e-reflow-model.h index 33cad68da0..4a5f710084 100644 --- a/widgets/text/e-reflow-model.h +++ b/e-util/e-reflow-model.h @@ -21,6 +21,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef _E_REFLOW_MODEL_H_ #define _E_REFLOW_MODEL_H_ diff --git a/widgets/text/e-reflow.c b/e-util/e-reflow.c index faad196c83..0df0aad5f8 100644 --- a/widgets/text/e-reflow.c +++ b/e-util/e-reflow.c @@ -24,21 +24,21 @@ #include <config.h> #endif +#include "e-reflow.h" + #include <math.h> #include <string.h> -#include <gdk/gdkkeysyms.h> #include <gtk/gtk.h> - -#include "text/e-text.h" #include <glib/gi18n.h> -#include "e-util/e-util.h" -#include "e-util/e-unicode.h" +#include <gdk/gdkkeysyms.h> -#include "misc/e-canvas.h" -#include "misc/e-canvas-utils.h" -#include "e-reflow.h" -#include "misc/e-selection-model-simple.h" +#include "e-canvas-utils.h" +#include "e-canvas.h" +#include "e-marshal.h" +#include "e-selection-model-simple.h" +#include "e-text.h" +#include "e-unicode.h" static gboolean e_reflow_event (GnomeCanvasItem *item, GdkEvent *event); static void e_reflow_realize (GnomeCanvasItem *item); diff --git a/widgets/text/e-reflow.h b/e-util/e-reflow.h index 979857ea5c..a891e98f38 100644 --- a/widgets/text/e-reflow.h +++ b/e-util/e-reflow.h @@ -20,12 +20,17 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #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-reflow-model.h> +#include <e-util/e-selection-model.h> #include <e-util/e-sorter-array.h> /* Standard GObject macros */ diff --git a/filter/e-rule-context.c b/e-util/e-rule-context.c index 714c37f1c9..dc7ce8160d 100644 --- a/filter/e-rule-context.c +++ b/e-util/e-rule-context.c @@ -41,9 +41,7 @@ #include <libedataserver/libedataserver.h> -#include "libevolution-utils/e-alert-dialog.h" -#include "libevolution-utils/e-xml-utils.h" - +#include "e-alert-dialog.h" #include "e-filter-code.h" #include "e-filter-color.h" #include "e-filter-datespec.h" @@ -53,6 +51,7 @@ #include "e-filter-option.h" #include "e-filter-rule.h" #include "e-rule-context.h" +#include "e-xml-utils.h" #define E_RULE_CONTEXT_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ diff --git a/filter/e-rule-context.h b/e-util/e-rule-context.h index a2a2d2df97..f543edd187 100644 --- a/filter/e-rule-context.h +++ b/e-util/e-rule-context.h @@ -22,13 +22,17 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_RULE_CONTEXT_H #define E_RULE_CONTEXT_H #include <libxml/parser.h> -#include "e-filter-part.h" -#include "e-filter-rule.h" +#include <e-util/e-filter-part.h> +#include <e-util/e-filter-rule.h> /* Standard GObject macros */ #define E_TYPE_RULE_CONTEXT \ diff --git a/filter/e-rule-editor.c b/e-util/e-rule-editor.c index d3a92b3693..c063ae41ae 100644 --- a/filter/e-rule-editor.c +++ b/e-util/e-rule-editor.c @@ -25,16 +25,16 @@ #include <config.h> #endif +#include "e-rule-editor.h" + /* for getenv only, remove when getenv need removed */ #include <stdlib.h> #include <string.h> #include <glib/gi18n.h> -#include "libevolution-utils/e-alert-dialog.h" -#include "libevolution-utils/evolution-util.h" - -#include "e-rule-editor.h" +#include "e-alert-dialog.h" +#include "e-misc-utils.h" #define E_RULE_EDITOR_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ diff --git a/filter/e-rule-editor.h b/e-util/e-rule-editor.h index 2b1a4f2bf7..d983b81c27 100644 --- a/filter/e-rule-editor.h +++ b/e-util/e-rule-editor.h @@ -21,13 +21,17 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_RULE_EDITOR_H #define E_RULE_EDITOR_H #include <gtk/gtk.h> -#include "e-rule-context.h" -#include "e-filter-rule.h" +#include <e-util/e-rule-context.h> +#include <e-util/e-filter-rule.h> /* Standard GObject macros */ #define E_TYPE_RULE_EDITOR \ diff --git a/widgets/misc/e-search-bar.c b/e-util/e-search-bar.c index 9ed0c2d1c9..9ed0c2d1c9 100644 --- a/widgets/misc/e-search-bar.c +++ b/e-util/e-search-bar.c diff --git a/widgets/misc/e-search-bar.h b/e-util/e-search-bar.h index 939a476e17..43e16453bd 100644 --- a/widgets/misc/e-search-bar.h +++ b/e-util/e-search-bar.h @@ -19,11 +19,16 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_SEARCH_BAR_H #define E_SEARCH_BAR_H #include <gtk/gtk.h> -#include <misc/e-web-view.h> + +#include <e-util/e-web-view.h> /* Standard GObject macros */ #define E_TYPE_SEARCH_BAR \ diff --git a/widgets/misc/e-selectable.c b/e-util/e-selectable.c index b8e4337fef..b8e4337fef 100644 --- a/widgets/misc/e-selectable.c +++ b/e-util/e-selectable.c diff --git a/widgets/misc/e-selectable.h b/e-util/e-selectable.h index c9a0b6dded..4e7faa8581 100644 --- a/widgets/misc/e-selectable.h +++ b/e-util/e-selectable.h @@ -19,11 +19,16 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_SELECTABLE_H #define E_SELECTABLE_H #include <gtk/gtk.h> -#include <misc/e-focus-tracker.h> + +#include <e-util/e-focus-tracker.h> /* Standard GObject macros */ #define E_TYPE_SELECTABLE \ diff --git a/widgets/misc/e-selection-model-array.c b/e-util/e-selection-model-array.c index f2f5b93379..fe73857a8a 100644 --- a/widgets/misc/e-selection-model-array.c +++ b/e-util/e-selection-model-array.c @@ -28,7 +28,6 @@ #include <gtk/gtk.h> #include <glib/gi18n.h> -#include "e-util/e-util.h" #include "e-selection-model-array.h" diff --git a/widgets/misc/e-selection-model-array.h b/e-util/e-selection-model-array.h index 4e59789d95..7292a3365e 100644 --- a/widgets/misc/e-selection-model-array.h +++ b/e-util/e-selection-model-array.h @@ -21,11 +21,15 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef _E_SELECTION_MODEL_ARRAY_H_ #define _E_SELECTION_MODEL_ARRAY_H_ -#include <misc/e-selection-model.h> #include <e-util/e-bit-array.h> +#include <e-util/e-selection-model.h> G_BEGIN_DECLS diff --git a/widgets/misc/e-selection-model-simple.c b/e-util/e-selection-model-simple.c index e7bd0c2f16..f7123dd09e 100644 --- a/widgets/misc/e-selection-model-simple.c +++ b/e-util/e-selection-model-simple.c @@ -25,8 +25,6 @@ #include <config.h> #endif -#include "e-util/e-util.h" - #include "e-selection-model-array.h" #include "e-selection-model-simple.h" diff --git a/widgets/misc/e-selection-model-simple.h b/e-util/e-selection-model-simple.h index 2433543ade..b4551dd51f 100644 --- a/widgets/misc/e-selection-model-simple.h +++ b/e-util/e-selection-model-simple.h @@ -21,10 +21,14 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef _E_SELECTION_MODEL_SIMPLE_H_ #define _E_SELECTION_MODEL_SIMPLE_H_ -#include <misc/e-selection-model-array.h> +#include <e-util/e-selection-model-array.h> G_BEGIN_DECLS diff --git a/widgets/misc/e-selection-model.c b/e-util/e-selection-model.c index fece615838..4c553f485a 100644 --- a/widgets/misc/e-selection-model.c +++ b/e-util/e-selection-model.c @@ -24,12 +24,12 @@ #include <config.h> #endif -#include <gdk/gdkkeysyms.h> +#include "e-selection-model.h" #include <glib/gi18n.h> -#include "e-util/e-util.h" +#include <gdk/gdkkeysyms.h> -#include "e-selection-model.h" +#include "e-marshal.h" G_DEFINE_TYPE ( ESelectionModel, diff --git a/widgets/misc/e-selection-model.h b/e-util/e-selection-model.h index 355734b6a5..1d59e28fe1 100644 --- a/widgets/misc/e-selection-model.h +++ b/e-util/e-selection-model.h @@ -21,6 +21,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_SELECTION_MODEL_H #define E_SELECTION_MODEL_H diff --git a/e-util/e-selection.c b/e-util/e-selection.c index 041b30c4f2..4092b07cbe 100644 --- a/e-util/e-selection.c +++ b/e-util/e-selection.c @@ -22,7 +22,7 @@ /** * SECTION: e-selection * @short_description: selection and clipboard utilities - * @include: e-util/e-selection.h + * @include: e-util/e-util.h **/ #ifdef HAVE_CONFIG_H diff --git a/e-util/e-selection.h b/e-util/e-selection.h index 5d44cd4839..75089c4bc1 100644 --- a/e-util/e-selection.h +++ b/e-util/e-selection.h @@ -19,6 +19,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_SELECTION_H #define E_SELECTION_H diff --git a/widgets/misc/e-send-options.c b/e-util/e-send-options.c index d84b8659e4..bf50dbefc0 100644 --- a/widgets/misc/e-send-options.c +++ b/e-util/e-send-options.c @@ -26,15 +26,15 @@ #include <config.h> #endif +#include "e-send-options.h" + #include <string.h> #include <glib/gi18n.h> #include <time.h> -#include "e-util/e-util.h" -#include "e-util/e-util-private.h" - #include "e-dateedit.h" -#include "e-send-options.h" +#include "e-misc-utils.h" +#include "e-util-private.h" #define E_SEND_OPTIONS_DIALOG_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ diff --git a/widgets/misc/e-send-options.h b/e-util/e-send-options.h index 2e8ef1d381..2cd8336f3c 100644 --- a/widgets/misc/e-send-options.h +++ b/e-util/e-send-options.h @@ -21,6 +21,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef __E_SEND_OPTIONS_DIALOG_H__ #define __E_SEND_OPTIONS_DIALOG_H__ diff --git a/widgets/misc/e-send-options.ui b/e-util/e-send-options.ui index 681e6e0693..681e6e0693 100644 --- a/widgets/misc/e-send-options.ui +++ b/e-util/e-send-options.ui diff --git a/e-util/e-sorter-array.c b/e-util/e-sorter-array.c index 4caa092704..1c373160df 100644 --- a/e-util/e-sorter-array.c +++ b/e-util/e-sorter-array.c @@ -28,7 +28,8 @@ #include <string.h> #include "e-sorter-array.h" -#include "e-util.h" + +#include "e-misc-utils.h" #define d(x) diff --git a/e-util/e-sorter-array.h b/e-util/e-sorter-array.h index 5fb9c31f6b..07a32b4b82 100644 --- a/e-util/e-sorter-array.h +++ b/e-util/e-sorter-array.h @@ -20,6 +20,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef _E_SORTER_ARRAY_H_ #define _E_SORTER_ARRAY_H_ diff --git a/e-util/e-sorter.c b/e-util/e-sorter.c index b55d985daa..ecb597a832 100644 --- a/e-util/e-sorter.c +++ b/e-util/e-sorter.c @@ -28,7 +28,6 @@ #include <string.h> #include "e-sorter.h" -#include "e-util.h" #define d(x) diff --git a/e-util/e-sorter.h b/e-util/e-sorter.h index 37015e54ae..94b63f3bd4 100644 --- a/e-util/e-sorter.h +++ b/e-util/e-sorter.h @@ -21,6 +21,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef _E_SORTER_H_ #define _E_SORTER_H_ diff --git a/e-util/e-source-combo-box.c b/e-util/e-source-combo-box.c new file mode 100644 index 0000000000..d8d2273527 --- /dev/null +++ b/e-util/e-source-combo-box.c @@ -0,0 +1,701 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* e-source-combo-box.c + * + * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU Lesser General Public + * License as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include "e-source-combo-box.h" +#include "e-cell-renderer-color.h" + +#define E_SOURCE_COMBO_BOX_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE \ + ((obj), E_TYPE_SOURCE_COMBO_BOX, ESourceComboBoxPrivate)) + +struct _ESourceComboBoxPrivate { + ESourceRegistry *registry; + gchar *extension_name; + + gulong source_added_handler_id; + gulong source_removed_handler_id; + gulong source_enabled_handler_id; + gulong source_disabled_handler_id; + + gboolean show_colors; +}; + +enum { + PROP_0, + PROP_EXTENSION_NAME, + PROP_REGISTRY, + PROP_SHOW_COLORS +}; + +enum { + COLUMN_COLOR, /* GDK_TYPE_COLOR */ + COLUMN_NAME, /* G_TYPE_STRING */ + COLUMN_SENSITIVE, /* G_TYPE_BOOLEAN */ + COLUMN_UID, /* G_TYPE_STRING */ + NUM_COLUMNS +}; + +G_DEFINE_TYPE (ESourceComboBox, e_source_combo_box, GTK_TYPE_COMBO_BOX) + +static gboolean +source_combo_box_traverse (GNode *node, + ESourceComboBox *combo_box) +{ + ESource *source; + ESourceSelectable *extension = NULL; + GtkTreeModel *model; + GtkTreeIter iter; + GString *indented; + GdkColor color; + const gchar *ext_name; + const gchar *display_name; + const gchar *uid; + gboolean sensitive = FALSE; + gboolean use_color = FALSE; + guint depth; + + /* Skip the root node. */ + if (G_NODE_IS_ROOT (node)) + return FALSE; + + ext_name = e_source_combo_box_get_extension_name (combo_box); + + model = gtk_combo_box_get_model (GTK_COMBO_BOX (combo_box)); + gtk_list_store_append (GTK_LIST_STORE (model), &iter); + + source = E_SOURCE (node->data); + uid = e_source_get_uid (source); + display_name = e_source_get_display_name (source); + + indented = g_string_new (NULL); + + depth = g_node_depth (node); + g_warn_if_fail (depth > 1); + while (--depth > 1) + g_string_append (indented, " "); + g_string_append (indented, display_name); + + if (ext_name != NULL && e_source_has_extension (source, ext_name)) { + extension = e_source_get_extension (source, ext_name); + sensitive = TRUE; + } + + if (E_IS_SOURCE_SELECTABLE (extension)) { + const gchar *color_spec; + + color_spec = e_source_selectable_get_color (extension); + if (color_spec != NULL && *color_spec != '\0') + use_color = gdk_color_parse (color_spec, &color); + } + + gtk_list_store_set ( + GTK_LIST_STORE (model), &iter, + COLUMN_COLOR, use_color ? &color : NULL, + COLUMN_NAME, indented->str, + COLUMN_SENSITIVE, sensitive, + COLUMN_UID, uid, + -1); + + g_string_free (indented, TRUE); + + return FALSE; +} + +static void +source_combo_box_build_model (ESourceComboBox *combo_box) +{ + ESourceRegistry *registry; + GtkComboBox *gtk_combo_box; + GtkTreeModel *model; + GNode *root; + const gchar *active_id; + const gchar *extension_name; + + registry = e_source_combo_box_get_registry (combo_box); + extension_name = e_source_combo_box_get_extension_name (combo_box); + + gtk_combo_box = GTK_COMBO_BOX (combo_box); + model = gtk_combo_box_get_model (gtk_combo_box); + + /* Constructor properties trigger this function before the + * list store is configured. Detect it and return silently. */ + if (model == NULL) + return; + + /* Remember the active ID so we can try to restore it. */ + active_id = gtk_combo_box_get_active_id (gtk_combo_box); + + gtk_list_store_clear (GTK_LIST_STORE (model)); + + /* If we have no registry, leave the combo box empty. */ + if (registry == NULL) + return; + + /* If we have no extension name, leave the combo box empty. */ + if (extension_name == NULL) + return; + + root = e_source_registry_build_display_tree (registry, extension_name); + + g_node_traverse ( + root, G_PRE_ORDER, G_TRAVERSE_ALL, -1, + (GNodeTraverseFunc) source_combo_box_traverse, + combo_box); + + e_source_registry_free_display_tree (root); + + /* Restore the active ID, or else set it to something reasonable. */ + gtk_combo_box_set_active_id (gtk_combo_box, active_id); + if (gtk_combo_box_get_active_id (gtk_combo_box) == NULL) { + ESource *source; + + source = e_source_registry_ref_default_for_extension_name ( + registry, extension_name); + if (source != NULL) { + e_source_combo_box_set_active (combo_box, source); + g_object_unref (source); + } + } +} + +static void +source_combo_box_source_added_cb (ESourceRegistry *registry, + ESource *source, + ESourceComboBox *combo_box) +{ + source_combo_box_build_model (combo_box); +} + +static void +source_combo_box_source_removed_cb (ESourceRegistry *registry, + ESource *source, + ESourceComboBox *combo_box) +{ + source_combo_box_build_model (combo_box); +} + +static void +source_combo_box_source_enabled_cb (ESourceRegistry *registry, + ESource *source, + ESourceComboBox *combo_box) +{ + source_combo_box_build_model (combo_box); +} + +static void +source_combo_box_source_disabled_cb (ESourceRegistry *registry, + ESource *source, + ESourceComboBox *combo_box) +{ + source_combo_box_build_model (combo_box); +} + +static void +source_combo_box_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) +{ + switch (property_id) { + case PROP_EXTENSION_NAME: + e_source_combo_box_set_extension_name ( + E_SOURCE_COMBO_BOX (object), + g_value_get_string (value)); + return; + + case PROP_REGISTRY: + e_source_combo_box_set_registry ( + E_SOURCE_COMBO_BOX (object), + g_value_get_object (value)); + return; + + case PROP_SHOW_COLORS: + e_source_combo_box_set_show_colors ( + E_SOURCE_COMBO_BOX (object), + g_value_get_boolean (value)); + return; + } + + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); +} + +static void +source_combo_box_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) +{ + switch (property_id) { + case PROP_EXTENSION_NAME: + g_value_set_string ( + value, + e_source_combo_box_get_extension_name ( + E_SOURCE_COMBO_BOX (object))); + return; + + case PROP_REGISTRY: + g_value_set_object ( + value, + e_source_combo_box_get_registry ( + E_SOURCE_COMBO_BOX (object))); + return; + + case PROP_SHOW_COLORS: + g_value_set_boolean ( + value, + e_source_combo_box_get_show_colors ( + E_SOURCE_COMBO_BOX (object))); + return; + } + + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); +} + +static void +source_combo_box_dispose (GObject *object) +{ + ESourceComboBoxPrivate *priv; + + priv = E_SOURCE_COMBO_BOX_GET_PRIVATE (object); + + if (priv->registry != NULL) { + g_signal_handler_disconnect ( + priv->registry, + priv->source_added_handler_id); + g_signal_handler_disconnect ( + priv->registry, + priv->source_removed_handler_id); + g_signal_handler_disconnect ( + priv->registry, + priv->source_enabled_handler_id); + g_signal_handler_disconnect ( + priv->registry, + priv->source_disabled_handler_id); + g_object_unref (priv->registry); + priv->registry = NULL; + } + + /* Chain up to parent's "dispose" method. */ + G_OBJECT_CLASS (e_source_combo_box_parent_class)->dispose (object); +} + +static void +source_combo_box_finalize (GObject *object) +{ + ESourceComboBoxPrivate *priv; + + priv = E_SOURCE_COMBO_BOX_GET_PRIVATE (object); + + g_free (priv->extension_name); + + /* Chain up to parent's "finalize" method. */ + G_OBJECT_CLASS (e_source_combo_box_parent_class)->finalize (object); +} + +static void +source_combo_box_constructed (GObject *object) +{ + ESourceComboBox *combo_box; + GtkCellRenderer *renderer; + GtkCellLayout *layout; + GtkListStore *store; + + combo_box = E_SOURCE_COMBO_BOX (object); + + /* Chain up to parent's constructed() method. */ + G_OBJECT_CLASS (e_source_combo_box_parent_class)->constructed (object); + + store = gtk_list_store_new ( + NUM_COLUMNS, + GDK_TYPE_COLOR, /* COLUMN_COLOR */ + G_TYPE_STRING, /* COLUMN_NAME */ + G_TYPE_BOOLEAN, /* COLUMN_SENSITIVE */ + G_TYPE_STRING); /* COLUMN_UID */ + gtk_combo_box_set_model ( + GTK_COMBO_BOX (combo_box), + GTK_TREE_MODEL (store)); + g_object_unref (store); + + gtk_combo_box_set_id_column (GTK_COMBO_BOX (combo_box), COLUMN_UID); + + layout = GTK_CELL_LAYOUT (combo_box); + + renderer = e_cell_renderer_color_new (); + gtk_cell_layout_pack_start (layout, renderer, FALSE); + gtk_cell_layout_set_attributes ( + layout, renderer, + "color", COLUMN_COLOR, + "sensitive", COLUMN_SENSITIVE, + NULL); + + g_object_bind_property ( + combo_box, "show-colors", + renderer, "visible", + G_BINDING_SYNC_CREATE); + + renderer = gtk_cell_renderer_text_new (); + gtk_cell_layout_pack_start (layout, renderer, TRUE); + gtk_cell_layout_set_attributes ( + layout, renderer, + "text", COLUMN_NAME, + "sensitive", COLUMN_SENSITIVE, + NULL); + + source_combo_box_build_model (combo_box); +} + +static void +e_source_combo_box_class_init (ESourceComboBoxClass *class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + + g_type_class_add_private (class, sizeof (ESourceComboBoxPrivate)); + + object_class->set_property = source_combo_box_set_property; + object_class->get_property = source_combo_box_get_property; + object_class->dispose = source_combo_box_dispose; + object_class->finalize = source_combo_box_finalize; + object_class->constructed = source_combo_box_constructed; + + g_object_class_install_property ( + object_class, + PROP_EXTENSION_NAME, + g_param_spec_string ( + "extension-name", + "Extension Name", + "ESource extension name to filter", + NULL, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT)); + + /* XXX Don't use G_PARAM_CONSTRUCT_ONLY here. We need to allow + * for this class to be instantiated by a GtkBuilder with no + * special construct parameters, and then subsequently give + * it an ESourceRegistry. */ + g_object_class_install_property ( + object_class, + PROP_REGISTRY, + g_param_spec_object ( + "registry", + "Registry", + "Data source registry", + E_TYPE_SOURCE_REGISTRY, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT | + G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property ( + object_class, + PROP_SHOW_COLORS, + g_param_spec_boolean ( + "show-colors", + "Show Colors", + "Whether to show colors next to names", + TRUE, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT | + G_PARAM_STATIC_STRINGS)); +} + +static void +e_source_combo_box_init (ESourceComboBox *combo_box) +{ + combo_box->priv = E_SOURCE_COMBO_BOX_GET_PRIVATE (combo_box); + +} + +/** + * e_source_combo_box_new: + * @registry: an #ESourceRegistry, or %NULL + * @extension_name: an #ESource extension name + * + * Creates a new #ESourceComboBox widget that lets the user pick an #ESource + * from the provided #ESourceRegistry. The displayed sources are restricted + * to those which have an @extension_name extension. + * + * Returns: a new #ESourceComboBox + * + * Since: 2.22 + **/ +GtkWidget * +e_source_combo_box_new (ESourceRegistry *registry, + const gchar *extension_name) +{ + if (registry != NULL) + g_return_val_if_fail (E_IS_SOURCE_REGISTRY (registry), NULL); + + return g_object_new ( + E_TYPE_SOURCE_COMBO_BOX, "registry", registry, + "extension-name", extension_name, NULL); +} + +/** + * e_source_combo_box_get_registry: + * @combo_box: an #ESourceComboBox + * + * Returns the #ESourceRegistry used to populate @combo_box. + * + * Returns: the #ESourceRegistry, or %NULL + * + * Since: 3.6 + **/ +ESourceRegistry * +e_source_combo_box_get_registry (ESourceComboBox *combo_box) +{ + g_return_val_if_fail (E_IS_SOURCE_COMBO_BOX (combo_box), NULL); + + return combo_box->priv->registry; +} + +/** + * e_source_combo_box_set_registry: + * @combo_box: an #ESourceComboBox + * @registry: an #ESourceRegistry + * + * Sets the #ESourceRegistry used to populate @combo_box. + * + * This function is intended for cases where @combo_box is instantiated + * by a #GtkBuilder and has to be given an #ESourceRegistry after it is + * fully constructed. + * + * Since: 3.6 + **/ +void +e_source_combo_box_set_registry (ESourceComboBox *combo_box, + ESourceRegistry *registry) +{ + g_return_if_fail (E_IS_SOURCE_COMBO_BOX (combo_box)); + + if (combo_box->priv->registry == registry) + return; + + if (registry != NULL) { + g_return_if_fail (E_IS_SOURCE_REGISTRY (registry)); + g_object_ref (registry); + } + + if (combo_box->priv->registry != NULL) { + g_signal_handler_disconnect ( + combo_box->priv->registry, + combo_box->priv->source_added_handler_id); + g_signal_handler_disconnect ( + combo_box->priv->registry, + combo_box->priv->source_removed_handler_id); + g_signal_handler_disconnect ( + combo_box->priv->registry, + combo_box->priv->source_enabled_handler_id); + g_signal_handler_disconnect ( + combo_box->priv->registry, + combo_box->priv->source_disabled_handler_id); + g_object_unref (combo_box->priv->registry); + } + + combo_box->priv->registry = registry; + + combo_box->priv->source_added_handler_id = 0; + combo_box->priv->source_removed_handler_id = 0; + combo_box->priv->source_enabled_handler_id = 0; + combo_box->priv->source_disabled_handler_id = 0; + + if (registry != NULL) { + gulong handler_id; + + handler_id = g_signal_connect ( + registry, "source-added", + G_CALLBACK (source_combo_box_source_added_cb), + combo_box); + combo_box->priv->source_added_handler_id = handler_id; + + handler_id = g_signal_connect ( + registry, "source-removed", + G_CALLBACK (source_combo_box_source_removed_cb), + combo_box); + combo_box->priv->source_removed_handler_id = handler_id; + + handler_id = g_signal_connect ( + registry, "source-enabled", + G_CALLBACK (source_combo_box_source_enabled_cb), + combo_box); + combo_box->priv->source_enabled_handler_id = handler_id; + + handler_id = g_signal_connect ( + registry, "source-disabled", + G_CALLBACK (source_combo_box_source_disabled_cb), + combo_box); + combo_box->priv->source_disabled_handler_id = handler_id; + } + + source_combo_box_build_model (combo_box); + + g_object_notify (G_OBJECT (combo_box), "registry"); +} + +/** + * e_source_combo_box_get_extension_name: + * @combo_box: an #ESourceComboBox + * + * Returns the extension name used to filter which data sources are + * shown in @combo_box. + * + * Returns: the #ESource extension name + * + * Since: 3.6 + **/ +const gchar * +e_source_combo_box_get_extension_name (ESourceComboBox *combo_box) +{ + g_return_val_if_fail (E_IS_SOURCE_COMBO_BOX (combo_box), NULL); + + return combo_box->priv->extension_name; +} + +/** + * e_source_combo_box_set_extension_name: + * @combo_box: an #ESourceComboBox + * @extension_name: an #ESource extension name + * + * Sets the extension name used to filter which data sources are shown in + * @combo_box. + * + * Since: 3.6 + **/ +void +e_source_combo_box_set_extension_name (ESourceComboBox *combo_box, + const gchar *extension_name) +{ + g_return_if_fail (E_IS_SOURCE_COMBO_BOX (combo_box)); + + if (g_strcmp0 (combo_box->priv->extension_name, extension_name) == 0) + return; + + g_free (combo_box->priv->extension_name); + combo_box->priv->extension_name = g_strdup (extension_name); + + source_combo_box_build_model (combo_box); + + g_object_notify (G_OBJECT (combo_box), "extension-name"); +} + +/** + * e_source_combo_box_get_show_colors: + * @combo_box: an #ESourceComboBox + * + * Returns whether colors are shown next to data sources. + * + * Returns: %TRUE if colors are being shown + * + * Since: 3.6 + **/ +gboolean +e_source_combo_box_get_show_colors (ESourceComboBox *combo_box) +{ + g_return_val_if_fail (E_IS_SOURCE_COMBO_BOX (combo_box), FALSE); + + return combo_box->priv->show_colors; +} + +/** + * e_source_combo_box_set_show_colors: + * @combo_box: an #ESourceComboBox + * @show_colors: whether to show colors + * + * Sets whether to show colors next to data sources. + * + * Since: 3.6 + **/ +void +e_source_combo_box_set_show_colors (ESourceComboBox *combo_box, + gboolean show_colors) +{ + g_return_if_fail (E_IS_SOURCE_COMBO_BOX (combo_box)); + + if ((show_colors ? 1 : 0) == (combo_box->priv->show_colors ? 1 : 0)) + return; + + combo_box->priv->show_colors = show_colors; + + source_combo_box_build_model (combo_box); + + g_object_notify (G_OBJECT (combo_box), "show-colors"); +} + +/** + * e_source_combo_box_ref_active: + * @combo_box: an #ESourceComboBox + * + * Returns the #ESource corresponding to the currently active item, + * or %NULL if there is no active item. + * + * The returned #ESource is referenced for thread-safety and must be + * unreferenced with g_object_unref() when finished with it. + * + * Returns: an #ESource or %NULL + * + * Since: 3.6 + **/ +ESource * +e_source_combo_box_ref_active (ESourceComboBox *combo_box) +{ + ESourceRegistry *registry; + GtkComboBox *gtk_combo_box; + const gchar *active_id; + + g_return_val_if_fail (E_IS_SOURCE_COMBO_BOX (combo_box), NULL); + + registry = e_source_combo_box_get_registry (combo_box); + + gtk_combo_box = GTK_COMBO_BOX (combo_box); + active_id = gtk_combo_box_get_active_id (gtk_combo_box); + + if (active_id == NULL) + return NULL; + + return e_source_registry_ref_source (registry, active_id); +} + +/** + * e_source_combo_box_set_active: + * @combo_box: an #ESourceComboBox + * @source: an #ESource + * + * Sets the active item to the one corresponding to @source. + * + * Since: 2.22 + **/ +void +e_source_combo_box_set_active (ESourceComboBox *combo_box, + ESource *source) +{ + GtkComboBox *gtk_combo_box; + const gchar *uid; + + g_return_if_fail (E_IS_SOURCE_COMBO_BOX (combo_box)); + g_return_if_fail (E_IS_SOURCE (source)); + + uid = e_source_get_uid (source); + + gtk_combo_box = GTK_COMBO_BOX (combo_box); + gtk_combo_box_set_active_id (gtk_combo_box, uid); +} + diff --git a/e-util/e-source-combo-box.h b/e-util/e-source-combo-box.h new file mode 100644 index 0000000000..d022f4a8ce --- /dev/null +++ b/e-util/e-source-combo-box.h @@ -0,0 +1,90 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* e-source-combo-box.h + * + * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU Lesser General Public + * License as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + +#ifndef E_SOURCE_COMBO_BOX_H +#define E_SOURCE_COMBO_BOX_H + +#include <gtk/gtk.h> +#include <libedataserver/libedataserver.h> + +#define E_TYPE_SOURCE_COMBO_BOX \ + (e_source_combo_box_get_type ()) +#define E_SOURCE_COMBO_BOX(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST \ + ((obj), E_TYPE_SOURCE_COMBO_BOX, ESourceComboBox)) +#define E_SOURCE_COMBO_BOX_CLASS(cls) \ + (G_TYPE_CHECK_CLASS_CAST \ + ((cls), E_TYPE_SOURCE_COMBO_BOX, ESourceComboBoxClass)) +#define E_IS_SOURCE_COMBO_BOX(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_SOURCE_COMBO_BOX)) +#define E_IS_SOURCE_COMBO_BOX_CLASS(cls) \ + (G_TYPE_CHECK_CLASS_TYPE ((cls), E_TYPE_SOURCE_COMBO_BOX)) +#define E_SOURCE_COMBO_BOX_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS \ + ((obj), E_TYPE_SOURCE_COMBO_BOX, ESourceComboBox)) + +G_BEGIN_DECLS + +typedef struct _ESourceComboBox ESourceComboBox; +typedef struct _ESourceComboBoxClass ESourceComboBoxClass; +typedef struct _ESourceComboBoxPrivate ESourceComboBoxPrivate; + +/** + * ESourceComboBox: + * + * Since: 2.22 + **/ +struct _ESourceComboBox { + GtkComboBox parent; + ESourceComboBoxPrivate *priv; +}; + +struct _ESourceComboBoxClass { + GtkComboBoxClass parent_class; +}; + +GType e_source_combo_box_get_type (void); +GtkWidget * e_source_combo_box_new (ESourceRegistry *registry, + const gchar *extension_name); +ESourceRegistry * + e_source_combo_box_get_registry (ESourceComboBox *combo_box); +void e_source_combo_box_set_registry (ESourceComboBox *combo_box, + ESourceRegistry *registry); +const gchar * e_source_combo_box_get_extension_name + (ESourceComboBox *combo_box); +void e_source_combo_box_set_extension_name + (ESourceComboBox *combo_box, + const gchar *extension_name); +gboolean e_source_combo_box_get_show_colors + (ESourceComboBox *combo_box); +void e_source_combo_box_set_show_colors + (ESourceComboBox *combo_box, + gboolean show_colors); +ESource * e_source_combo_box_ref_active (ESourceComboBox *combo_box); +void e_source_combo_box_set_active (ESourceComboBox *combo_box, + ESource *source); + +G_END_DECLS + +#endif /* E_SOURCE_COMBO_BOX_H */ diff --git a/widgets/misc/e-source-config-backend.c b/e-util/e-source-config-backend.c index e6802f99ae..e6802f99ae 100644 --- a/widgets/misc/e-source-config-backend.c +++ b/e-util/e-source-config-backend.c diff --git a/widgets/misc/e-source-config-backend.h b/e-util/e-source-config-backend.h index 8141cea1a5..3191ca1c23 100644 --- a/widgets/misc/e-source-config-backend.h +++ b/e-util/e-source-config-backend.h @@ -16,12 +16,16 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_SOURCE_CONFIG_BACKEND_H #define E_SOURCE_CONFIG_BACKEND_H #include <libebackend/libebackend.h> -#include <misc/e-source-config.h> +#include <e-util/e-source-config.h> /* Standard GObject macros */ #define E_TYPE_SOURCE_CONFIG_BACKEND \ diff --git a/widgets/misc/e-source-config-dialog.c b/e-util/e-source-config-dialog.c index 437027e498..8a311c8ab1 100644 --- a/widgets/misc/e-source-config-dialog.c +++ b/e-util/e-source-config-dialog.c @@ -18,9 +18,9 @@ #include "e-source-config-dialog.h" -#include <libevolution-utils/e-alert-dialog.h> -#include <libevolution-utils/e-alert-sink.h> -#include <misc/e-alert-bar.h> +#include "e-alert-bar.h" +#include "e-alert-dialog.h" +#include "e-alert-sink.h" #define E_SOURCE_CONFIG_DIALOG_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ diff --git a/widgets/misc/e-source-config-dialog.h b/e-util/e-source-config-dialog.h index b4e49efc63..6f01c8a0eb 100644 --- a/widgets/misc/e-source-config-dialog.h +++ b/e-util/e-source-config-dialog.h @@ -16,10 +16,14 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_SOURCE_CONFIG_DIALOG_H #define E_SOURCE_CONFIG_DIALOG_H -#include <misc/e-source-config.h> +#include <e-util/e-source-config.h> /* Standard GObject macros */ #define E_TYPE_SOURCE_CONFIG_DIALOG \ diff --git a/widgets/misc/e-source-config.c b/e-util/e-source-config.c index f5ef35287c..aacb48dd5c 100644 --- a/widgets/misc/e-source-config.c +++ b/e-util/e-source-config.c @@ -23,9 +23,8 @@ #include <libebackend/libebackend.h> -#include <e-util/e-marshal.h> -#include <misc/e-interval-chooser.h> - +#include "e-interval-chooser.h" +#include "e-marshal.h" #include "e-source-config-backend.h" #define E_SOURCE_CONFIG_GET_PRIVATE(obj) \ diff --git a/widgets/misc/e-source-config.h b/e-util/e-source-config.h index 5d9ff7c93a..3868c0309b 100644 --- a/widgets/misc/e-source-config.h +++ b/e-util/e-source-config.h @@ -16,6 +16,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_SOURCE_CONFIG_H #define E_SOURCE_CONFIG_H diff --git a/e-util/e-source-selector-dialog.c b/e-util/e-source-selector-dialog.c new file mode 100644 index 0000000000..68e29fd13c --- /dev/null +++ b/e-util/e-source-selector-dialog.c @@ -0,0 +1,453 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* e-source-selector-dialog.c + * + * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) + * + * 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) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + * + * Author: Rodrigo Moya <rodrigo@novell.com> + */ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include <glib/gi18n-lib.h> +#include "e-source-selector.h" +#include "e-source-selector-dialog.h" + +#define E_SOURCE_SELECTOR_DIALOG_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE \ + ((obj), E_TYPE_SOURCE_SELECTOR_DIALOG, ESourceSelectorDialogPrivate)) + +struct _ESourceSelectorDialogPrivate { + GtkWidget *selector; + ESourceRegistry *registry; + ESource *selected_source; + gchar *extension_name; +}; + +enum { + PROP_0, + PROP_EXTENSION_NAME, + PROP_REGISTRY, + PROP_SELECTOR +}; + +G_DEFINE_TYPE ( + ESourceSelectorDialog, + e_source_selector_dialog, + GTK_TYPE_DIALOG) + +static void +source_selector_dialog_row_activated_cb (GtkTreeView *tree_view, + GtkTreePath *path, + GtkTreeViewColumn *column, + GtkWidget *dialog) +{ + gtk_dialog_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK); +} + +static void +primary_selection_changed_cb (ESourceSelector *selector, + ESourceSelectorDialog *dialog) +{ + ESourceSelectorDialogPrivate *priv = dialog->priv; + + if (priv->selected_source != NULL) + g_object_unref (priv->selected_source); + priv->selected_source = + e_source_selector_ref_primary_selection (selector); + + /* FIXME Add an API for "except-source" or to + * get the ESourceSelector from outside. */ + if (priv->selected_source != NULL) { + ESource *except_source; + + except_source = g_object_get_data ( + G_OBJECT (dialog), "except-source"); + + if (except_source != NULL) + if (e_source_equal (except_source, priv->selected_source)) { + g_object_unref (priv->selected_source); + priv->selected_source = NULL; + } + } + + gtk_dialog_set_response_sensitive ( + GTK_DIALOG (dialog), GTK_RESPONSE_OK, + (priv->selected_source != NULL)); +} + +static void +source_selector_dialog_set_extension_name (ESourceSelectorDialog *dialog, + const gchar *extension_name) +{ + g_return_if_fail (extension_name != NULL); + g_return_if_fail (dialog->priv->extension_name == NULL); + + dialog->priv->extension_name = g_strdup (extension_name); +} + +static void +source_selector_dialog_set_registry (ESourceSelectorDialog *dialog, + ESourceRegistry *registry) +{ + g_return_if_fail (E_IS_SOURCE_REGISTRY (registry)); + g_return_if_fail (dialog->priv->registry == NULL); + + dialog->priv->registry = g_object_ref (registry); +} + +static void +source_selector_dialog_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) +{ + switch (property_id) { + case PROP_EXTENSION_NAME: + source_selector_dialog_set_extension_name ( + E_SOURCE_SELECTOR_DIALOG (object), + g_value_get_string (value)); + return; + + case PROP_REGISTRY: + source_selector_dialog_set_registry ( + E_SOURCE_SELECTOR_DIALOG (object), + g_value_get_object (value)); + return; + } + + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); +} + +static void +source_selector_dialog_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) +{ + switch (property_id) { + case PROP_EXTENSION_NAME: + g_value_set_string ( + value, + e_source_selector_dialog_get_extension_name ( + E_SOURCE_SELECTOR_DIALOG (object))); + return; + + case PROP_REGISTRY: + g_value_set_object ( + value, + e_source_selector_dialog_get_registry ( + E_SOURCE_SELECTOR_DIALOG (object))); + return; + + case PROP_SELECTOR: + g_value_set_object ( + value, + e_source_selector_dialog_get_selector ( + E_SOURCE_SELECTOR_DIALOG (object))); + return; + } + + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); +} + +static void +source_selector_dialog_dispose (GObject *object) +{ + ESourceSelectorDialogPrivate *priv; + + priv = E_SOURCE_SELECTOR_DIALOG_GET_PRIVATE (object); + + if (priv->registry != NULL) { + g_object_unref (priv->registry); + priv->registry = NULL; + } + + if (priv->selected_source != NULL) { + g_object_unref (priv->selected_source); + priv->selected_source = NULL; + } + + /* Chain up to parent's dispose() method. */ + G_OBJECT_CLASS (e_source_selector_dialog_parent_class)->dispose (object); +} + +static void +source_selector_dialog_finalize (GObject *object) +{ + ESourceSelectorDialogPrivate *priv; + + priv = E_SOURCE_SELECTOR_DIALOG_GET_PRIVATE (object); + + g_free (priv->extension_name); + + /* Chain up to parent's finalize() method. */ + G_OBJECT_CLASS (e_source_selector_dialog_parent_class)->finalize (object); +} + +static void +source_selector_dialog_constructed (GObject *object) +{ + ESourceSelectorDialog *dialog; + GtkWidget *label, *hgrid; + GtkWidget *container; + GtkWidget *widget; + gchar *label_text; + + dialog = E_SOURCE_SELECTOR_DIALOG (object); + + container = gtk_dialog_get_content_area (GTK_DIALOG (dialog)); + + widget = g_object_new (GTK_TYPE_GRID, + "orientation", GTK_ORIENTATION_VERTICAL, + "column-homogeneous", FALSE, + "row-spacing", 12, + NULL); + gtk_container_set_border_width (GTK_CONTAINER (widget), 12); + gtk_box_pack_start (GTK_BOX (container), widget, TRUE, TRUE, 0); + gtk_widget_show (widget); + + container = widget; + + label_text = g_strdup_printf ("<b>%s</b>", _("_Destination")); + label = gtk_label_new_with_mnemonic (label_text); + gtk_label_set_use_markup (GTK_LABEL (label), TRUE); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + gtk_container_add (GTK_CONTAINER (container), label); + gtk_widget_show (label); + g_free (label_text); + + hgrid = g_object_new (GTK_TYPE_GRID, + "orientation", GTK_ORIENTATION_HORIZONTAL, + "row-homogeneous", FALSE, + "column-spacing", 12, + "vexpand", TRUE, + "valign", GTK_ALIGN_FILL, + NULL); + gtk_container_add (GTK_CONTAINER (container), hgrid); + gtk_widget_show (hgrid); + + widget = gtk_label_new (""); + gtk_container_add (GTK_CONTAINER (hgrid), widget); + gtk_widget_show (widget); + + widget = gtk_scrolled_window_new (NULL, NULL); + gtk_scrolled_window_set_policy ( + GTK_SCROLLED_WINDOW (widget), + GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); + gtk_scrolled_window_set_shadow_type ( + GTK_SCROLLED_WINDOW (widget), GTK_SHADOW_IN); + gtk_widget_set_hexpand (widget, TRUE); + gtk_widget_set_halign (widget, GTK_ALIGN_FILL); + gtk_widget_set_vexpand (widget, TRUE); + gtk_widget_set_valign (widget, GTK_ALIGN_FILL); + gtk_container_add (GTK_CONTAINER (hgrid), widget); + gtk_widget_show (widget); + + container = widget; + + widget = e_source_selector_new ( + dialog->priv->registry, + dialog->priv->extension_name); + e_source_selector_set_show_toggles (E_SOURCE_SELECTOR (widget), FALSE); + gtk_label_set_mnemonic_widget (GTK_LABEL (label), widget); + gtk_container_add (GTK_CONTAINER (container), widget); + dialog->priv->selector = widget; + gtk_widget_show (widget); + + g_signal_connect ( + widget, "row_activated", + G_CALLBACK (source_selector_dialog_row_activated_cb), dialog); + g_signal_connect ( + widget, "primary_selection_changed", + G_CALLBACK (primary_selection_changed_cb), dialog); +} + +static void +e_source_selector_dialog_class_init (ESourceSelectorDialogClass *class) +{ + GObjectClass *object_class; + + g_type_class_add_private (class, sizeof (ESourceSelectorDialogPrivate)); + + object_class = G_OBJECT_CLASS (class); + object_class->set_property = source_selector_dialog_set_property; + object_class->get_property = source_selector_dialog_get_property; + object_class->dispose = source_selector_dialog_dispose; + object_class->finalize = source_selector_dialog_finalize; + object_class->constructed = source_selector_dialog_constructed; + + g_object_class_install_property ( + object_class, + PROP_EXTENSION_NAME, + g_param_spec_string ( + "extension-name", + NULL, + NULL, + NULL, + G_PARAM_WRITABLE | + G_PARAM_CONSTRUCT_ONLY)); + + g_object_class_install_property ( + object_class, + PROP_REGISTRY, + g_param_spec_object ( + "registry", + NULL, + NULL, + E_TYPE_SOURCE_REGISTRY, + G_PARAM_WRITABLE | + G_PARAM_CONSTRUCT_ONLY)); + + g_object_class_install_property ( + object_class, + PROP_SELECTOR, + g_param_spec_object ( + "selector", + NULL, + NULL, + E_TYPE_SOURCE_SELECTOR, + G_PARAM_READABLE)); +} + +static void +e_source_selector_dialog_init (ESourceSelectorDialog *dialog) +{ + GtkWidget *action_area; + GtkWidget *content_area; + + dialog->priv = E_SOURCE_SELECTOR_DIALOG_GET_PRIVATE (dialog); + + action_area = gtk_dialog_get_action_area (GTK_DIALOG (dialog)); + content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog)); + + gtk_window_set_title (GTK_WINDOW (dialog), _("Select destination")); + gtk_window_set_default_size (GTK_WINDOW (dialog), 320, 240); + + gtk_widget_ensure_style (GTK_WIDGET (dialog)); + gtk_container_set_border_width (GTK_CONTAINER (content_area), 0); + gtk_container_set_border_width (GTK_CONTAINER (action_area), 12); + + gtk_dialog_add_buttons ( + GTK_DIALOG (dialog), + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, + GTK_STOCK_OK, GTK_RESPONSE_OK, NULL); + gtk_dialog_set_default_response ( + GTK_DIALOG (dialog), GTK_RESPONSE_OK); + gtk_dialog_set_response_sensitive ( + GTK_DIALOG (dialog), GTK_RESPONSE_OK, FALSE); +} + +/** + * e_source_selector_dialog_new: + * @parent: a parent window + * @registry: an #ESourceRegistry + * @extension_name: the name of an #ESource extension + * + * Displays a list of sources from @registry having an extension named + * @extension_name in a dialog window. The sources are grouped by backend + * or groupware account, which are described by the parent source. + * + * Returns: a new #ESourceSelectorDialog + **/ +GtkWidget * +e_source_selector_dialog_new (GtkWindow *parent, + ESourceRegistry *registry, + const gchar *extension_name) +{ + g_return_val_if_fail (E_IS_SOURCE_REGISTRY (registry), NULL); + g_return_val_if_fail (extension_name != NULL, NULL); + + return g_object_new ( + E_TYPE_SOURCE_SELECTOR_DIALOG, + "transient-for", parent, + "registry", registry, + "extension-name", extension_name, + NULL); +} + +/** + * e_source_selector_dialog_get_registry: + * @dialog: an #ESourceSelectorDialog + * + * Returns the #ESourceRegistry passed to e_source_selector_dialog_new(). + * + * Returns: the #ESourceRegistry for @dialog + * + * Since: 3.6 + **/ +ESourceRegistry * +e_source_selector_dialog_get_registry (ESourceSelectorDialog *dialog) +{ + g_return_val_if_fail (E_IS_SOURCE_SELECTOR_DIALOG (dialog), NULL); + + return dialog->priv->registry; +} + +/** + * e_source_selector_dialog_get_extension_name: + * @dialog: an #ESourceSelectorDialog + * + * Returns the extension name passed to e_source_selector_dialog_new(). + * + * Returns: the extension name for @dialog + * + * Since: 3.6 + **/ +const gchar * +e_source_selector_dialog_get_extension_name (ESourceSelectorDialog *dialog) +{ + g_return_val_if_fail (E_IS_SOURCE_SELECTOR_DIALOG (dialog), NULL); + + return dialog->priv->extension_name; +} + +/** + * e_source_selector_dialog_get_selector: + * @dialog: an #ESourceSelectorDialog + * + * Returns the #ESourceSelector widget embedded in @dialog. + * + * Returns: the #ESourceSelector widget + * + * Since: 3.6 + **/ +ESourceSelector * +e_source_selector_dialog_get_selector (ESourceSelectorDialog *dialog) +{ + g_return_val_if_fail (E_IS_SOURCE_SELECTOR_DIALOG (dialog), NULL); + + return E_SOURCE_SELECTOR (dialog->priv->selector); +} + +/** + * e_source_selector_dialog_peek_primary_selection: + * @dialog: an #ESourceSelectorDialog + * + * Peek the currently selected source in the given @dialog. + * + * Returns: the selected #ESource + */ +ESource * +e_source_selector_dialog_peek_primary_selection (ESourceSelectorDialog *dialog) +{ + g_return_val_if_fail (E_IS_SOURCE_SELECTOR_DIALOG (dialog), NULL); + + return dialog->priv->selected_source; +} diff --git a/e-util/e-source-selector-dialog.h b/e-util/e-source-selector-dialog.h new file mode 100644 index 0000000000..eae45ba62f --- /dev/null +++ b/e-util/e-source-selector-dialog.h @@ -0,0 +1,85 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* e-source-selector-dialog.h + * + * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) + * + * 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) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + * + * Author: Rodrigo Moya <rodrigo@novell.com> + */ + +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + +#ifndef E_SOURCE_SELECTOR_DIALOG_H +#define E_SOURCE_SELECTOR_DIALOG_H + +#include <gtk/gtk.h> +#include <e-util/e-source-selector.h> + +/* Standard GObject macros */ +#define E_TYPE_SOURCE_SELECTOR_DIALOG \ + (e_source_selector_dialog_get_type ()) +#define E_SOURCE_SELECTOR_DIALOG(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST \ + ((obj), E_TYPE_SOURCE_SELECTOR_DIALOG, ESourceSelectorDialog)) +#define E_SOURCE_SELECTOR_DIALOG_CLASS(cls) \ + (G_TYPE_CHECK_CLASS_CAST \ + ((cls), E_TYPE_SOURCE_SELECTOR_DIALOG, ESourceSelectorDialogClass)) +#define E_IS_SOURCE_SELECTOR_DIALOG(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE \ + ((obj), E_TYPE_SOURCE_SELECTOR_DIALOG)) +#define E_IS_SOURCE_SELECTOR_DIALOG_CLASS(cls) \ + (G_TYPE_CHECK_CLASS_TYPE \ + ((cls), E_TYPE_SOURCE_SELECTOR_DIALOG)) +#define E_SOURCE_SELECTOR_DIALOG_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS \ + ((obj), E_TYPE_SOURCE_SELECTOR_DIALOG, ESourceSelectorDialogClass)) + +G_BEGIN_DECLS + +typedef struct _ESourceSelectorDialog ESourceSelectorDialog; +typedef struct _ESourceSelectorDialogClass ESourceSelectorDialogClass; +typedef struct _ESourceSelectorDialogPrivate ESourceSelectorDialogPrivate; + +struct _ESourceSelectorDialog { + GtkDialog parent; + ESourceSelectorDialogPrivate *priv; +}; + +struct _ESourceSelectorDialogClass { + GtkDialogClass parent_class; +}; + +GType e_source_selector_dialog_get_type (void); +GtkWidget * e_source_selector_dialog_new (GtkWindow *parent, + ESourceRegistry *registry, + const gchar *extension_name); +ESourceRegistry * + e_source_selector_dialog_get_registry + (ESourceSelectorDialog *dialog); +const gchar * e_source_selector_dialog_get_extension_name + (ESourceSelectorDialog *dialog); +ESourceSelector * + e_source_selector_dialog_get_selector + (ESourceSelectorDialog *dialog); +ESource * e_source_selector_dialog_peek_primary_selection + (ESourceSelectorDialog *dialog); + +G_END_DECLS + +#endif /* E_SOURCE_SELECTOR_DIALOG_H */ diff --git a/e-util/e-source-selector.c b/e-util/e-source-selector.c new file mode 100644 index 0000000000..4a75ed10e5 --- /dev/null +++ b/e-util/e-source-selector.c @@ -0,0 +1,2082 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* e-source-selector.c + * + * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) + * + * 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) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + * + * Author: Ettore Perazzoli <ettore@ximian.com> + */ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include <string.h> + +#include "e-cell-renderer-color.h" +#include "e-source-selector.h" + +#define E_SOURCE_SELECTOR_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE \ + ((obj), E_TYPE_SOURCE_SELECTOR, ESourceSelectorPrivate)) + +typedef struct _AsyncContext AsyncContext; + +struct _ESourceSelectorPrivate { + ESourceRegistry *registry; + GHashTable *source_index; + gchar *extension_name; + + GtkTreeRowReference *saved_primary_selection; + + /* ESource -> GSource */ + GHashTable *pending_writes; + GMainContext *main_context; + + gboolean toggled_last; + gboolean select_new; + gboolean show_colors; + gboolean show_toggles; +}; + +struct _AsyncContext { + ESourceSelector *selector; + ESource *source; +}; + +enum { + PROP_0, + PROP_EXTENSION_NAME, + PROP_PRIMARY_SELECTION, + PROP_REGISTRY, + PROP_SHOW_COLORS, + PROP_SHOW_TOGGLES +}; + +enum { + SELECTION_CHANGED, + PRIMARY_SELECTION_CHANGED, + POPUP_EVENT, + DATA_DROPPED, + NUM_SIGNALS +}; + +enum { + COLUMN_NAME, + COLUMN_COLOR, + COLUMN_ACTIVE, + COLUMN_SHOW_COLOR, + COLUMN_SHOW_TOGGLE, + COLUMN_WEIGHT, + COLUMN_SOURCE, + NUM_COLUMNS +}; + +static guint signals[NUM_SIGNALS]; + +G_DEFINE_TYPE (ESourceSelector, e_source_selector, GTK_TYPE_TREE_VIEW) + +/* ESafeToggleRenderer does not emit 'toggled' signal + * on 'activate' when mouse is not over the toggle. */ + +typedef GtkCellRendererToggle ECellRendererSafeToggle; +typedef GtkCellRendererToggleClass ECellRendererSafeToggleClass; + +/* Forward Declarations */ +GType e_cell_renderer_safe_toggle_get_type (void); + +G_DEFINE_TYPE ( + ECellRendererSafeToggle, + e_cell_renderer_safe_toggle, + GTK_TYPE_CELL_RENDERER_TOGGLE) + +static gboolean +safe_toggle_activate (GtkCellRenderer *cell, + GdkEvent *event, + GtkWidget *widget, + const gchar *path, + const GdkRectangle *background_area, + const GdkRectangle *cell_area, + GtkCellRendererState flags) +{ + gboolean point_in_cell_area = TRUE; + + if (event->type == GDK_BUTTON_PRESS && cell_area != NULL) { + cairo_region_t *region; + + region = cairo_region_create_rectangle (cell_area); + point_in_cell_area = cairo_region_contains_point ( + region, event->button.x, event->button.y); + cairo_region_destroy (region); + } + + if (!point_in_cell_area) + return FALSE; + + return GTK_CELL_RENDERER_CLASS ( + e_cell_renderer_safe_toggle_parent_class)->activate ( + cell, event, widget, path, background_area, cell_area, flags); +} + +static void +e_cell_renderer_safe_toggle_class_init (ECellRendererSafeToggleClass *class) +{ + GtkCellRendererClass *cell_renderer_class; + + cell_renderer_class = GTK_CELL_RENDERER_CLASS (class); + cell_renderer_class->activate = safe_toggle_activate; +} + +static void +e_cell_renderer_safe_toggle_init (ECellRendererSafeToggle *obj) +{ +} + +static GtkCellRenderer * +e_cell_renderer_safe_toggle_new (void) +{ + return g_object_new (e_cell_renderer_safe_toggle_get_type (), NULL); +} + +static void +clear_saved_primary_selection (ESourceSelector *selector) +{ + gtk_tree_row_reference_free (selector->priv->saved_primary_selection); + selector->priv->saved_primary_selection = NULL; +} + +static void +async_context_free (AsyncContext *async_context) +{ + if (async_context->selector != NULL) + g_object_unref (async_context->selector); + + if (async_context->source != NULL) + g_object_unref (async_context->source); + + g_slice_free (AsyncContext, async_context); +} + +static void +pending_writes_destroy_source (GSource *source) +{ + g_source_destroy (source); + g_source_unref (source); +} + +static void +source_selector_write_done_cb (GObject *source_object, + GAsyncResult *result, + gpointer user_data) +{ + ESource *source; + ESourceSelector *selector; + GError *error = NULL; + + source = E_SOURCE (source_object); + selector = E_SOURCE_SELECTOR (user_data); + + e_source_write_finish (source, result, &error); + + /* FIXME Display the error in the selector somehow? */ + if (error != NULL) { + g_warning ("%s: %s", G_STRFUNC, error->message); + g_error_free (error); + } + + g_object_unref (selector); +} + +static gboolean +source_selector_write_idle_cb (gpointer user_data) +{ + AsyncContext *async_context = user_data; + GHashTable *pending_writes; + + /* XXX This operation is not cancellable. */ + e_source_write ( + async_context->source, NULL, + source_selector_write_done_cb, + g_object_ref (async_context->selector)); + + pending_writes = async_context->selector->priv->pending_writes; + g_hash_table_remove (pending_writes, async_context->source); + + return FALSE; +} + +static void +source_selector_cancel_write (ESourceSelector *selector, + ESource *source) +{ + GHashTable *pending_writes; + + /* Cancel any pending writes for this ESource so as not + * to overwrite whatever change we're being notified of. */ + pending_writes = selector->priv->pending_writes; + g_hash_table_remove (pending_writes, source); +} + +static void +source_selector_update_row (ESourceSelector *selector, + ESource *source) +{ + GHashTable *source_index; + ESourceExtension *extension = NULL; + GtkTreeRowReference *reference; + GtkTreeModel *model; + GtkTreePath *path; + GtkTreeIter iter; + const gchar *extension_name; + const gchar *display_name; + gboolean selected; + + source_index = selector->priv->source_index; + reference = g_hash_table_lookup (source_index, source); + + /* This function runs when ANY ESource in the registry changes. + * If the ESource is not in our tree model then return silently. */ + if (reference == NULL) + return; + + /* If we do have a row reference, it should be valid. */ + g_return_if_fail (gtk_tree_row_reference_valid (reference)); + + model = gtk_tree_row_reference_get_model (reference); + path = gtk_tree_row_reference_get_path (reference); + gtk_tree_model_get_iter (model, &iter, path); + gtk_tree_path_free (path); + + display_name = e_source_get_display_name (source); + + extension_name = e_source_selector_get_extension_name (selector); + selected = e_source_selector_source_is_selected (selector, source); + + if (e_source_has_extension (source, extension_name)) + extension = e_source_get_extension (source, extension_name); + + if (extension != NULL) { + GdkColor color; + const gchar *color_spec = NULL; + gboolean show_color = FALSE; + gboolean show_toggle; + + show_color = + E_IS_SOURCE_SELECTABLE (extension) && + e_source_selector_get_show_colors (selector); + + if (show_color) + color_spec = e_source_selectable_get_color ( + E_SOURCE_SELECTABLE (extension)); + + if (color_spec != NULL && *color_spec != '\0') + show_color = gdk_color_parse (color_spec, &color); + + show_toggle = e_source_selector_get_show_toggles (selector); + + gtk_tree_store_set ( + GTK_TREE_STORE (model), &iter, + COLUMN_NAME, display_name, + COLUMN_COLOR, show_color ? &color : NULL, + COLUMN_ACTIVE, selected, + COLUMN_SHOW_COLOR, show_color, + COLUMN_SHOW_TOGGLE, show_toggle, + COLUMN_WEIGHT, PANGO_WEIGHT_NORMAL, + COLUMN_SOURCE, source, + -1); + } else { + gtk_tree_store_set ( + GTK_TREE_STORE (model), &iter, + COLUMN_NAME, display_name, + COLUMN_COLOR, NULL, + COLUMN_ACTIVE, FALSE, + COLUMN_SHOW_COLOR, FALSE, + COLUMN_SHOW_TOGGLE, FALSE, + COLUMN_WEIGHT, PANGO_WEIGHT_BOLD, + COLUMN_SOURCE, source, + -1); + } +} + +static gboolean +source_selector_traverse (GNode *node, + ESourceSelector *selector) +{ + ESource *source; + GHashTable *source_index; + GtkTreeRowReference *reference = NULL; + GtkTreeModel *model; + GtkTreePath *path; + GtkTreeIter iter; + + /* Skip the root node. */ + if (G_NODE_IS_ROOT (node)) + return FALSE; + + source_index = selector->priv->source_index; + + model = gtk_tree_view_get_model (GTK_TREE_VIEW (selector)); + + if (node->parent != NULL && node->parent->data != NULL) + reference = g_hash_table_lookup ( + source_index, node->parent->data); + + if (gtk_tree_row_reference_valid (reference)) { + GtkTreeIter parent; + + path = gtk_tree_row_reference_get_path (reference); + gtk_tree_model_get_iter (model, &parent, path); + gtk_tree_path_free (path); + + gtk_tree_store_append (GTK_TREE_STORE (model), &iter, &parent); + } else + gtk_tree_store_append (GTK_TREE_STORE (model), &iter, NULL); + + source = E_SOURCE (node->data); + + path = gtk_tree_model_get_path (model, &iter); + reference = gtk_tree_row_reference_new (model, path); + g_hash_table_insert (source_index, g_object_ref (source), reference); + gtk_tree_path_free (path); + + source_selector_update_row (selector, source); + + return FALSE; +} + +static void +source_selector_save_expanded (GtkTreeView *tree_view, + GtkTreePath *path, + GQueue *queue) +{ + GtkTreeModel *model; + GtkTreeIter iter; + ESource *source; + + model = gtk_tree_view_get_model (tree_view); + gtk_tree_model_get_iter (model, &iter, path); + gtk_tree_model_get (model, &iter, COLUMN_SOURCE, &source, -1); + g_queue_push_tail (queue, source); +} + +static void +source_selector_build_model (ESourceSelector *selector) +{ + ESourceRegistry *registry; + GQueue queue = G_QUEUE_INIT; + GHashTable *source_index; + GtkTreeView *tree_view; + GtkTreeModel *model; + ESource *selected; + const gchar *extension_name; + GNode *root; + + tree_view = GTK_TREE_VIEW (selector); + + registry = e_source_selector_get_registry (selector); + extension_name = e_source_selector_get_extension_name (selector); + + /* Make sure we have what we need to build the model, since + * this can get called early in the initialization phase. */ + if (registry == NULL || extension_name == NULL) + return; + + source_index = selector->priv->source_index; + selected = e_source_selector_ref_primary_selection (selector); + + /* Save expanded sources to restore later. */ + gtk_tree_view_map_expanded_rows ( + tree_view, (GtkTreeViewMappingFunc) + source_selector_save_expanded, &queue); + + model = gtk_tree_view_get_model (tree_view); + gtk_tree_store_clear (GTK_TREE_STORE (model)); + + g_hash_table_remove_all (source_index); + + root = e_source_registry_build_display_tree (registry, extension_name); + + g_node_traverse ( + root, G_PRE_ORDER, G_TRAVERSE_ALL, -1, + (GNodeTraverseFunc) source_selector_traverse, + selector); + + e_source_registry_free_display_tree (root); + + /* Restore previously expanded sources. */ + while (!g_queue_is_empty (&queue)) { + GtkTreeRowReference *reference; + ESource *source; + + source = g_queue_pop_head (&queue); + reference = g_hash_table_lookup (source_index, source); + + if (gtk_tree_row_reference_valid (reference)) { + GtkTreePath *path; + + path = gtk_tree_row_reference_get_path (reference); + gtk_tree_view_expand_to_path (tree_view, path); + gtk_tree_path_free (path); + } + + g_object_unref (source); + } + + /* Restore the primary selection. */ + if (selected != NULL) { + e_source_selector_set_primary_selection (selector, selected); + g_object_unref (selected); + } + + /* Make sure we have a primary selection. If not, pick one. */ + selected = e_source_selector_ref_primary_selection (selector); + if (selected == NULL) { + selected = e_source_registry_ref_default_for_extension_name ( + registry, extension_name); + e_source_selector_set_primary_selection (selector, selected); + } + g_object_unref (selected); +} + +static void +source_selector_expand_to_source (ESourceSelector *selector, + ESource *source) +{ + GHashTable *source_index; + GtkTreeRowReference *reference; + GtkTreePath *path; + + source_index = selector->priv->source_index; + reference = g_hash_table_lookup (source_index, source); + + /* If the ESource is not in our tree model then return silently. */ + if (reference == NULL) + return; + + /* If we do have a row reference, it should be valid. */ + g_return_if_fail (gtk_tree_row_reference_valid (reference)); + + /* Expand the tree view to the path containing the ESource */ + path = gtk_tree_row_reference_get_path (reference); + gtk_tree_view_expand_to_path (GTK_TREE_VIEW (selector), path); + gtk_tree_path_free (path); +} + +static void +source_selector_source_added_cb (ESourceRegistry *registry, + ESource *source, + ESourceSelector *selector) +{ + source_selector_build_model (selector); + + source_selector_expand_to_source (selector, source); +} + +static void +source_selector_source_changed_cb (ESourceRegistry *registry, + ESource *source, + ESourceSelector *selector) +{ + source_selector_cancel_write (selector, source); + + source_selector_update_row (selector, source); +} + +static void +source_selector_source_removed_cb (ESourceRegistry *registry, + ESource *source, + ESourceSelector *selector) +{ + source_selector_build_model (selector); +} + +static void +source_selector_source_enabled_cb (ESourceRegistry *registry, + ESource *source, + ESourceSelector *selector) +{ + source_selector_build_model (selector); + + source_selector_expand_to_source (selector, source); +} + +static void +source_selector_source_disabled_cb (ESourceRegistry *registry, + ESource *source, + ESourceSelector *selector) +{ + source_selector_build_model (selector); +} + +static gboolean +same_source_name_exists (ESourceSelector *selector, + const gchar *display_name) +{ + GHashTable *source_index; + GHashTableIter iter; + gpointer key; + + source_index = selector->priv->source_index; + g_hash_table_iter_init (&iter, source_index); + + while (g_hash_table_iter_next (&iter, &key, NULL)) { + ESource *source = E_SOURCE (key); + const gchar *source_name; + + source_name = e_source_get_display_name (source); + if (g_strcmp0 (display_name, source_name) == 0) + return TRUE; + } + + return FALSE; +} + +static gboolean +selection_func (GtkTreeSelection *selection, + GtkTreeModel *model, + GtkTreePath *path, + gboolean path_currently_selected, + ESourceSelector *selector) +{ + ESource *source; + GtkTreeIter iter; + const gchar *extension_name; + + if (selector->priv->toggled_last) { + selector->priv->toggled_last = FALSE; + return FALSE; + } + + if (path_currently_selected) + return TRUE; + + if (!gtk_tree_model_get_iter (model, &iter, path)) + return FALSE; + + extension_name = e_source_selector_get_extension_name (selector); + gtk_tree_model_get (model, &iter, COLUMN_SOURCE, &source, -1); + + if (!e_source_has_extension (source, extension_name)) { + g_object_unref (source); + return FALSE; + } + + clear_saved_primary_selection (selector); + + g_object_unref (source); + + return TRUE; +} + +static void +text_cell_edited_cb (ESourceSelector *selector, + const gchar *path_string, + const gchar *new_name) +{ + GtkTreeView *tree_view; + GtkTreeModel *model; + GtkTreePath *path; + GtkTreeIter iter; + ESource *source; + + tree_view = GTK_TREE_VIEW (selector); + model = gtk_tree_view_get_model (tree_view); + path = gtk_tree_path_new_from_string (path_string); + + gtk_tree_model_get_iter (model, &iter, path); + gtk_tree_model_get (model, &iter, COLUMN_SOURCE, &source, -1); + gtk_tree_path_free (path); + + if (new_name == NULL || *new_name == '\0') + return; + + if (same_source_name_exists (selector, new_name)) + return; + + e_source_set_display_name (source, new_name); + + e_source_selector_queue_write (selector, source); +} + +static void +cell_toggled_callback (GtkCellRendererToggle *renderer, + const gchar *path_string, + ESourceSelector *selector) +{ + ESource *source; + GtkTreeModel *model; + GtkTreePath *path; + GtkTreeIter iter; + + model = gtk_tree_view_get_model (GTK_TREE_VIEW (selector)); + path = gtk_tree_path_new_from_string (path_string); + + if (!gtk_tree_model_get_iter (model, &iter, path)) { + gtk_tree_path_free (path); + return; + } + + gtk_tree_model_get (model, &iter, COLUMN_SOURCE, &source, -1); + + if (e_source_selector_source_is_selected (selector, source)) + e_source_selector_unselect_source (selector, source); + else + e_source_selector_select_source (selector, source); + + selector->priv->toggled_last = TRUE; + + gtk_tree_path_free (path); + + g_object_unref (source); +} + +static void +selection_changed_callback (GtkTreeSelection *selection, + ESourceSelector *selector) +{ + g_signal_emit (selector, signals[PRIMARY_SELECTION_CHANGED], 0); + g_object_notify (G_OBJECT (selector), "primary-selection"); +} + +static void +source_selector_set_extension_name (ESourceSelector *selector, + const gchar *extension_name) +{ + g_return_if_fail (extension_name != NULL); + g_return_if_fail (selector->priv->extension_name == NULL); + + selector->priv->extension_name = g_strdup (extension_name); +} + +static void +source_selector_set_registry (ESourceSelector *selector, + ESourceRegistry *registry) +{ + g_return_if_fail (E_IS_SOURCE_REGISTRY (registry)); + g_return_if_fail (selector->priv->registry == NULL); + + selector->priv->registry = g_object_ref (registry); +} + +static void +source_selector_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) +{ + switch (property_id) { + case PROP_EXTENSION_NAME: + source_selector_set_extension_name ( + E_SOURCE_SELECTOR (object), + g_value_get_string (value)); + return; + + case PROP_PRIMARY_SELECTION: + e_source_selector_set_primary_selection ( + E_SOURCE_SELECTOR (object), + g_value_get_object (value)); + return; + + case PROP_REGISTRY: + source_selector_set_registry ( + E_SOURCE_SELECTOR (object), + g_value_get_object (value)); + return; + + case PROP_SHOW_COLORS: + e_source_selector_set_show_colors ( + E_SOURCE_SELECTOR (object), + g_value_get_boolean (value)); + return; + + case PROP_SHOW_TOGGLES: + e_source_selector_set_show_toggles ( + E_SOURCE_SELECTOR (object), + g_value_get_boolean (value)); + return; + } + + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); +} + +static void +source_selector_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) +{ + switch (property_id) { + case PROP_EXTENSION_NAME: + g_value_set_string ( + value, + e_source_selector_get_extension_name ( + E_SOURCE_SELECTOR (object))); + return; + + case PROP_PRIMARY_SELECTION: + g_value_take_object ( + value, + e_source_selector_ref_primary_selection ( + E_SOURCE_SELECTOR (object))); + return; + + case PROP_REGISTRY: + g_value_set_object ( + value, + e_source_selector_get_registry ( + E_SOURCE_SELECTOR (object))); + return; + + case PROP_SHOW_COLORS: + g_value_set_boolean ( + value, + e_source_selector_get_show_colors ( + E_SOURCE_SELECTOR (object))); + return; + + case PROP_SHOW_TOGGLES: + g_value_set_boolean ( + value, + e_source_selector_get_show_toggles ( + E_SOURCE_SELECTOR (object))); + return; + } + + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); +} + +static void +source_selector_dispose (GObject *object) +{ + ESourceSelectorPrivate *priv; + + priv = E_SOURCE_SELECTOR_GET_PRIVATE (object); + + if (priv->registry != NULL) { + g_signal_handlers_disconnect_matched ( + priv->registry, + G_SIGNAL_MATCH_DATA, + 0, 0, NULL, NULL, object); + g_object_unref (priv->registry); + priv->registry = NULL; + } + + g_hash_table_remove_all (priv->source_index); + g_hash_table_remove_all (priv->pending_writes); + + clear_saved_primary_selection (E_SOURCE_SELECTOR (object)); + + /* Chain up to parent's dispose() method. */ + G_OBJECT_CLASS (e_source_selector_parent_class)->dispose (object); +} + +static void +source_selector_finalize (GObject *object) +{ + ESourceSelectorPrivate *priv; + + priv = E_SOURCE_SELECTOR_GET_PRIVATE (object); + + g_hash_table_destroy (priv->source_index); + g_hash_table_destroy (priv->pending_writes); + + g_free (priv->extension_name); + + if (priv->main_context != NULL) + g_main_context_unref (priv->main_context); + + /* Chain up to parent's finalize() method. */ + G_OBJECT_CLASS (e_source_selector_parent_class)->finalize (object); +} + +static void +source_selector_constructed (GObject *object) +{ + ESourceRegistry *registry; + ESourceSelector *selector; + + selector = E_SOURCE_SELECTOR (object); + registry = e_source_selector_get_registry (selector); + + g_signal_connect ( + registry, "source-added", + G_CALLBACK (source_selector_source_added_cb), selector); + + g_signal_connect ( + registry, "source-changed", + G_CALLBACK (source_selector_source_changed_cb), selector); + + g_signal_connect ( + registry, "source-removed", + G_CALLBACK (source_selector_source_removed_cb), selector); + + g_signal_connect ( + registry, "source-enabled", + G_CALLBACK (source_selector_source_enabled_cb), selector); + + g_signal_connect ( + registry, "source-disabled", + G_CALLBACK (source_selector_source_disabled_cb), selector); + + source_selector_build_model (selector); + + gtk_tree_view_expand_all (GTK_TREE_VIEW (selector)); +} + +static gboolean +source_selector_button_press_event (GtkWidget *widget, + GdkEventButton *event) +{ + ESourceSelector *selector; + GtkWidgetClass *widget_class; + GtkTreePath *path; + ESource *source = NULL; + ESource *primary; + gboolean right_click = FALSE; + gboolean triple_click = FALSE; + gboolean row_exists; + gboolean res = FALSE; + + selector = E_SOURCE_SELECTOR (widget); + + selector->priv->toggled_last = FALSE; + + /* Triple-clicking a source selects it exclusively. */ + + if (event->button == 3 && event->type == GDK_BUTTON_PRESS) + right_click = TRUE; + else if (event->button == 1 && event->type == GDK_3BUTTON_PRESS) + triple_click = TRUE; + else + goto chainup; + + row_exists = gtk_tree_view_get_path_at_pos ( + GTK_TREE_VIEW (widget), event->x, event->y, + &path, NULL, NULL, NULL); + + /* Get the source/group */ + if (row_exists) { + GtkTreeModel *model; + GtkTreeIter iter; + + model = gtk_tree_view_get_model (GTK_TREE_VIEW (widget)); + + gtk_tree_model_get_iter (model, &iter, path); + gtk_tree_model_get (model, &iter, COLUMN_SOURCE, &source, -1); + } + + if (source == NULL) + goto chainup; + + primary = e_source_selector_ref_primary_selection (selector); + if (source != primary) + e_source_selector_set_primary_selection (selector, source); + if (primary != NULL) + g_object_unref (primary); + + if (right_click) + g_signal_emit ( + widget, signals[POPUP_EVENT], 0, source, event, &res); + + if (triple_click) { + e_source_selector_select_exclusive (selector, source); + res = TRUE; + } + + g_object_unref (source); + + return res; + +chainup: + + /* Chain up to parent's button_press_event() method. */ + widget_class = GTK_WIDGET_CLASS (e_source_selector_parent_class); + return widget_class->button_press_event (widget, event); +} + +static void +source_selector_drag_leave (GtkWidget *widget, + GdkDragContext *context, + guint time_) +{ + GtkTreeView *tree_view; + GtkTreeViewDropPosition pos; + + tree_view = GTK_TREE_VIEW (widget); + pos = GTK_TREE_VIEW_DROP_BEFORE; + + gtk_tree_view_set_drag_dest_row (tree_view, NULL, pos); +} + +static gboolean +source_selector_drag_motion (GtkWidget *widget, + GdkDragContext *context, + gint x, + gint y, + guint time_) +{ + ESource *source = NULL; + GtkTreeView *tree_view; + GtkTreeModel *model; + GtkTreePath *path = NULL; + GtkTreeIter iter; + GtkTreeViewDropPosition pos; + GdkDragAction action = 0; + + tree_view = GTK_TREE_VIEW (widget); + model = gtk_tree_view_get_model (tree_view); + + if (!gtk_tree_view_get_dest_row_at_pos (tree_view, x, y, &path, NULL)) + goto exit; + + if (!gtk_tree_model_get_iter (model, &iter, path)) + goto exit; + + gtk_tree_model_get (model, &iter, COLUMN_SOURCE, &source, -1); + + if (!e_source_get_writable (source)) + goto exit; + + pos = GTK_TREE_VIEW_DROP_INTO_OR_BEFORE; + gtk_tree_view_set_drag_dest_row (tree_view, path, pos); + + if (gdk_drag_context_get_actions (context) & GDK_ACTION_MOVE) + action = GDK_ACTION_MOVE; + else + action = gdk_drag_context_get_suggested_action (context); + +exit: + if (path != NULL) + gtk_tree_path_free (path); + + if (source != NULL) + g_object_unref (source); + + gdk_drag_status (context, action, time_); + + return TRUE; +} + +static gboolean +source_selector_drag_drop (GtkWidget *widget, + GdkDragContext *context, + gint x, + gint y, + guint time_) +{ + ESource *source; + ESourceSelector *selector; + GtkTreeView *tree_view; + GtkTreeModel *model; + GtkTreePath *path; + GtkTreeIter iter; + const gchar *extension_name; + gboolean drop_zone; + gboolean valid; + + tree_view = GTK_TREE_VIEW (widget); + model = gtk_tree_view_get_model (tree_view); + + if (!gtk_tree_view_get_path_at_pos ( + tree_view, x, y, &path, NULL, NULL, NULL)) + return FALSE; + + valid = gtk_tree_model_get_iter (model, &iter, path); + gtk_tree_path_free (path); + g_return_val_if_fail (valid, FALSE); + + gtk_tree_model_get (model, &iter, COLUMN_SOURCE, &source, -1); + + selector = E_SOURCE_SELECTOR (widget); + extension_name = e_source_selector_get_extension_name (selector); + drop_zone = e_source_has_extension (source, extension_name); + + g_object_unref (source); + + return drop_zone; +} + +static void +source_selector_drag_data_received (GtkWidget *widget, + GdkDragContext *context, + gint x, + gint y, + GtkSelectionData *selection_data, + guint info, + guint time_) +{ + ESource *source = NULL; + GtkTreeView *tree_view; + GtkTreeModel *model; + GtkTreePath *path = NULL; + GtkTreeIter iter; + GdkDragAction action; + gboolean delete; + gboolean success = FALSE; + + tree_view = GTK_TREE_VIEW (widget); + model = gtk_tree_view_get_model (tree_view); + + action = gdk_drag_context_get_selected_action (context); + delete = (action == GDK_ACTION_MOVE); + + if (!gtk_tree_view_get_dest_row_at_pos (tree_view, x, y, &path, NULL)) + goto exit; + + if (!gtk_tree_model_get_iter (model, &iter, path)) + goto exit; + + gtk_tree_model_get (model, &iter, COLUMN_SOURCE, &source, -1); + + if (!e_source_get_writable (source)) + goto exit; + + g_signal_emit ( + widget, signals[DATA_DROPPED], 0, selection_data, + source, gdk_drag_context_get_selected_action (context), + info, &success); + +exit: + if (path != NULL) + gtk_tree_path_free (path); + + if (source != NULL) + g_object_unref (source); + + gtk_drag_finish (context, success, delete, time_); +} + +static gboolean +source_selector_popup_menu (GtkWidget *widget) +{ + ESourceSelector *selector; + ESource *source; + gboolean res = FALSE; + + selector = E_SOURCE_SELECTOR (widget); + source = e_source_selector_ref_primary_selection (selector); + g_signal_emit (selector, signals[POPUP_EVENT], 0, source, NULL, &res); + + if (source != NULL) + g_object_unref (source); + + return res; +} + +static gboolean +source_selector_test_collapse_row (GtkTreeView *tree_view, + GtkTreeIter *iter, + GtkTreePath *path) +{ + ESourceSelectorPrivate *priv; + GtkTreeSelection *selection; + GtkTreeModel *model; + GtkTreeIter child_iter; + + priv = E_SOURCE_SELECTOR_GET_PRIVATE (tree_view); + + /* Clear this because something else has been clicked on now */ + priv->toggled_last = FALSE; + + if (priv->saved_primary_selection) + return FALSE; + + selection = gtk_tree_view_get_selection (tree_view); + + if (!gtk_tree_selection_get_selected (selection, &model, &child_iter)) + return FALSE; + + if (gtk_tree_store_is_ancestor (GTK_TREE_STORE (model), iter, &child_iter)) { + GtkTreeRowReference *reference; + GtkTreePath *child_path; + + child_path = gtk_tree_model_get_path (model, &child_iter); + reference = gtk_tree_row_reference_new (model, child_path); + priv->saved_primary_selection = reference; + gtk_tree_path_free (child_path); + } + + return FALSE; +} + +static void +source_selector_row_expanded (GtkTreeView *tree_view, + GtkTreeIter *iter, + GtkTreePath *path) +{ + ESourceSelectorPrivate *priv; + GtkTreeModel *model; + GtkTreePath *child_path; + GtkTreeIter child_iter; + + priv = E_SOURCE_SELECTOR_GET_PRIVATE (tree_view); + + if (!priv->saved_primary_selection) + return; + + model = gtk_tree_view_get_model (tree_view); + + child_path = gtk_tree_row_reference_get_path ( + priv->saved_primary_selection); + gtk_tree_model_get_iter (model, &child_iter, child_path); + + if (gtk_tree_store_is_ancestor (GTK_TREE_STORE (model), iter, &child_iter)) { + GtkTreeSelection *selection; + + selection = gtk_tree_view_get_selection (tree_view); + gtk_tree_selection_select_iter (selection, &child_iter); + + clear_saved_primary_selection (E_SOURCE_SELECTOR (tree_view)); + } + + gtk_tree_path_free (child_path); +} + +static gboolean +source_selector_get_source_selected (ESourceSelector *selector, + ESource *source) +{ + ESourceSelectable *extension; + const gchar *extension_name; + gboolean selected = TRUE; + + extension_name = e_source_selector_get_extension_name (selector); + + if (!e_source_has_extension (source, extension_name)) + return FALSE; + + extension = e_source_get_extension (source, extension_name); + + if (E_IS_SOURCE_SELECTABLE (extension)) + selected = e_source_selectable_get_selected (extension); + + return selected; +} + +static void +source_selector_set_source_selected (ESourceSelector *selector, + ESource *source, + gboolean selected) +{ + ESourceSelectable *extension; + const gchar *extension_name; + + extension_name = e_source_selector_get_extension_name (selector); + + if (!e_source_has_extension (source, extension_name)) + return; + + extension = e_source_get_extension (source, extension_name); + + if (!E_IS_SOURCE_SELECTABLE (extension)) + return; + + if (selected != e_source_selectable_get_selected (extension)) { + e_source_selectable_set_selected (extension, selected); + e_source_selector_queue_write (selector, source); + } +} + +static gboolean +ess_bool_accumulator (GSignalInvocationHint *ihint, + GValue *out, + const GValue *in, + gpointer data) +{ + gboolean v_boolean; + + v_boolean = g_value_get_boolean (in); + g_value_set_boolean (out, v_boolean); + + return !v_boolean; +} + +static void +e_source_selector_class_init (ESourceSelectorClass *class) +{ + GObjectClass *object_class; + GtkWidgetClass *widget_class; + GtkTreeViewClass *tree_view_class; + + g_type_class_add_private (class, sizeof (ESourceSelectorPrivate)); + + object_class = G_OBJECT_CLASS (class); + object_class->set_property = source_selector_set_property; + object_class->get_property = source_selector_get_property; + object_class->dispose = source_selector_dispose; + object_class->finalize = source_selector_finalize; + object_class->constructed = source_selector_constructed; + + widget_class = GTK_WIDGET_CLASS (class); + widget_class->button_press_event = source_selector_button_press_event; + widget_class->drag_leave = source_selector_drag_leave; + widget_class->drag_motion = source_selector_drag_motion; + widget_class->drag_drop = source_selector_drag_drop; + widget_class->drag_data_received = source_selector_drag_data_received; + widget_class->popup_menu = source_selector_popup_menu; + + tree_view_class = GTK_TREE_VIEW_CLASS (class); + tree_view_class->test_collapse_row = source_selector_test_collapse_row; + tree_view_class->row_expanded = source_selector_row_expanded; + + class->get_source_selected = source_selector_get_source_selected; + class->set_source_selected = source_selector_set_source_selected; + + g_object_class_install_property ( + object_class, + PROP_EXTENSION_NAME, + g_param_spec_string ( + "extension-name", + NULL, + NULL, + NULL, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property ( + object_class, + PROP_PRIMARY_SELECTION, + g_param_spec_object ( + "primary-selection", + NULL, + NULL, + E_TYPE_SOURCE, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property ( + object_class, + PROP_REGISTRY, + g_param_spec_object ( + "registry", + NULL, + NULL, + E_TYPE_SOURCE_REGISTRY, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property ( + object_class, + PROP_SHOW_COLORS, + g_param_spec_boolean ( + "show-colors", + NULL, + NULL, + TRUE, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property ( + object_class, + PROP_SHOW_TOGGLES, + g_param_spec_boolean ( + "show-toggles", + NULL, + NULL, + TRUE, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); + + signals[SELECTION_CHANGED] = g_signal_new ( + "selection-changed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ESourceSelectorClass, selection_changed), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + + /* XXX Consider this signal deprecated. Connect + * to "notify::primary-selection" instead. */ + signals[PRIMARY_SELECTION_CHANGED] = g_signal_new ( + "primary-selection-changed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ESourceSelectorClass, primary_selection_changed), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + + signals[POPUP_EVENT] = g_signal_new ( + "popup-event", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ESourceSelectorClass, popup_event), + ess_bool_accumulator, NULL, NULL, + G_TYPE_BOOLEAN, 2, G_TYPE_OBJECT, + GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); + + signals[DATA_DROPPED] = g_signal_new ( + "data-dropped", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ESourceSelectorClass, data_dropped), + NULL, NULL, NULL, + G_TYPE_BOOLEAN, 4, + GTK_TYPE_SELECTION_DATA | G_SIGNAL_TYPE_STATIC_SCOPE, + E_TYPE_SOURCE, + GDK_TYPE_DRAG_ACTION, + G_TYPE_UINT); +} + +static void +e_source_selector_init (ESourceSelector *selector) +{ + GHashTable *pending_writes; + GtkTreeViewColumn *column; + GtkTreeSelection *selection; + GtkCellRenderer *renderer; + GtkTreeStore *tree_store; + GtkTreeView *tree_view; + + pending_writes = g_hash_table_new_full ( + (GHashFunc) g_direct_hash, + (GEqualFunc) g_direct_equal, + (GDestroyNotify) g_object_unref, + (GDestroyNotify) pending_writes_destroy_source); + + selector->priv = E_SOURCE_SELECTOR_GET_PRIVATE (selector); + + selector->priv->pending_writes = pending_writes; + + selector->priv->main_context = g_main_context_get_thread_default (); + if (selector->priv->main_context != NULL) + g_main_context_ref (selector->priv->main_context); + + tree_view = GTK_TREE_VIEW (selector); + + gtk_tree_view_set_search_column (tree_view, COLUMN_SOURCE); + gtk_tree_view_set_enable_search (tree_view, TRUE); + + selector->priv->toggled_last = FALSE; + selector->priv->select_new = FALSE; + selector->priv->show_colors = TRUE; + selector->priv->show_toggles = TRUE; + + selector->priv->source_index = g_hash_table_new_full ( + (GHashFunc) e_source_hash, + (GEqualFunc) e_source_equal, + (GDestroyNotify) g_object_unref, + (GDestroyNotify) gtk_tree_row_reference_free); + + tree_store = gtk_tree_store_new ( + NUM_COLUMNS, + G_TYPE_STRING, /* COLUMN_NAME */ + GDK_TYPE_COLOR, /* COLUMN_COLOR */ + G_TYPE_BOOLEAN, /* COLUMN_ACTIVE */ + G_TYPE_BOOLEAN, /* COLUMN_SHOW_COLOR */ + G_TYPE_BOOLEAN, /* COLUMN_SHOW_TOGGLE */ + G_TYPE_INT, /* COLUMN_WEIGHT */ + E_TYPE_SOURCE); /* COLUMN_SOURCE */ + + gtk_tree_view_set_model (tree_view, GTK_TREE_MODEL (tree_store)); + + column = gtk_tree_view_column_new (); + gtk_tree_view_append_column (tree_view, column); + + renderer = e_cell_renderer_color_new (); + g_object_set ( + G_OBJECT (renderer), "mode", + GTK_CELL_RENDERER_MODE_ACTIVATABLE, NULL); + gtk_tree_view_column_pack_start (column, renderer, FALSE); + gtk_tree_view_column_add_attribute ( + column, renderer, "color", COLUMN_COLOR); + gtk_tree_view_column_add_attribute ( + column, renderer, "visible", COLUMN_SHOW_COLOR); + + renderer = e_cell_renderer_safe_toggle_new (); + gtk_tree_view_column_pack_start (column, renderer, FALSE); + gtk_tree_view_column_add_attribute ( + column, renderer, "active", COLUMN_ACTIVE); + gtk_tree_view_column_add_attribute ( + column, renderer, "visible", COLUMN_SHOW_TOGGLE); + g_signal_connect ( + renderer, "toggled", + G_CALLBACK (cell_toggled_callback), selector); + + renderer = gtk_cell_renderer_text_new (); + g_object_set ( + G_OBJECT (renderer), + "ellipsize", PANGO_ELLIPSIZE_END, NULL); + g_signal_connect_swapped ( + renderer, "edited", + G_CALLBACK (text_cell_edited_cb), selector); + gtk_tree_view_column_pack_start (column, renderer, TRUE); + gtk_tree_view_column_set_attributes ( + column, renderer, + "text", COLUMN_NAME, + "weight", COLUMN_WEIGHT, + NULL); + + selection = gtk_tree_view_get_selection (tree_view); + gtk_tree_selection_set_select_function ( + selection, (GtkTreeSelectionFunc) + selection_func, selector, NULL); + g_signal_connect_object ( + selection, "changed", + G_CALLBACK (selection_changed_callback), + G_OBJECT (selector), 0); + + gtk_tree_view_set_headers_visible (tree_view, FALSE); +} + +/** + * e_source_selector_new: + * @registry: an #ESourceRegistry + * @extension_name: the name of an #ESource extension + * + * Displays a list of sources from @registry having an extension named + * @extension_name. The sources are grouped by backend or groupware + * account, which are described by the parent source. + * + * Returns: a new #ESourceSelector + **/ +GtkWidget * +e_source_selector_new (ESourceRegistry *registry, + const gchar *extension_name) +{ + g_return_val_if_fail (E_IS_SOURCE_REGISTRY (registry), NULL); + g_return_val_if_fail (extension_name != NULL, NULL); + + return g_object_new ( + E_TYPE_SOURCE_SELECTOR, "registry", registry, + "extension-name", extension_name, NULL); +} + +/** + * e_source_selector_get_registry: + * @selector: an #ESourceSelector + * + * Returns the #ESourceRegistry that @selector is getting sources from. + * + * Returns: an #ESourceRegistry + * + * Since: 3.6 + **/ +ESourceRegistry * +e_source_selector_get_registry (ESourceSelector *selector) +{ + g_return_val_if_fail (E_IS_SOURCE_SELECTOR (selector), NULL); + + return selector->priv->registry; +} + +/** + * e_source_selector_get_extension_name: + * @selector: an #ESourceSelector + * + * Returns the extension name used to filter which sources are displayed. + * + * Returns: the #ESource extension name + * + * Since: 3.6 + **/ +const gchar * +e_source_selector_get_extension_name (ESourceSelector *selector) +{ + g_return_val_if_fail (E_IS_SOURCE_SELECTOR (selector), NULL); + + return selector->priv->extension_name; +} + +/** + * e_source_selector_get_show_colors: + * @selector: an #ESourceSelector + * + * Returns whether colors are shown next to data sources. + * + * Returns: %TRUE if colors are being shown + * + * Since: 3.6 + **/ +gboolean +e_source_selector_get_show_colors (ESourceSelector *selector) +{ + g_return_val_if_fail (E_IS_SOURCE_SELECTOR (selector), FALSE); + + return selector->priv->show_colors; +} + +/** + * e_source_selector_set_show_colors: + * @selector: an #ESourceSelector + * @show_colors: whether to show colors + * + * Sets whether to show colors next to data sources. + * + * Since: 3.6 + **/ +void +e_source_selector_set_show_colors (ESourceSelector *selector, + gboolean show_colors) +{ + g_return_if_fail (E_IS_SOURCE_SELECTOR (selector)); + + if ((show_colors ? 1 : 0) == (selector->priv->show_colors ? 1 : 0)) + return; + + selector->priv->show_colors = show_colors; + + g_object_notify (G_OBJECT (selector), "show-colors"); + + source_selector_build_model (selector); +} + +/** + * e_source_selector_get_show_toggles: + * @selector: an #ESourceSelector + * + * Returns whether toggles are shown next to data sources. + * + * Returns: %TRUE if toggles are being shown + * + * Since: 3.6 + **/ +gboolean +e_source_selector_get_show_toggles (ESourceSelector *selector) +{ + g_return_val_if_fail (E_IS_SOURCE_SELECTOR (selector), FALSE); + + return selector->priv->show_toggles; +} + +/** + * e_source_selector_set_show_toggles: + * @selector: an #ESourceSelector + * @show_toggles: whether to show toggles + * + * Sets whether to show toggles next to data sources. + * + * Since: 3.6 + **/ +void +e_source_selector_set_show_toggles (ESourceSelector *selector, + gboolean show_toggles) +{ + g_return_if_fail (E_IS_SOURCE_SELECTOR (selector)); + + if ((show_toggles ? 1 : 0) == (selector->priv->show_toggles ? 1 : 0)) + return; + + selector->priv->show_toggles = show_toggles; + + g_object_notify (G_OBJECT (selector), "show-toggles"); + + source_selector_build_model (selector); +} + +/* Helper for e_source_selector_get_selection() */ +static gboolean +source_selector_check_selected (GtkTreeModel *model, + GtkTreePath *path, + GtkTreeIter *iter, + gpointer user_data) +{ + ESource *source; + + struct { + ESourceSelector *selector; + GSList *list; + } *closure = user_data; + + gtk_tree_model_get (model, iter, COLUMN_SOURCE, &source, -1); + + if (e_source_selector_source_is_selected (closure->selector, source)) + closure->list = g_slist_prepend (closure->list, source); + else + g_object_unref (source); + + return FALSE; +} + +/** + * e_source_selector_get_selection: + * @selector: an #ESourceSelector + * + * Get the list of selected sources, i.e. those that were enabled through the + * corresponding checkboxes in the tree. + * + * Returns: A list of the ESources currently selected. The sources will + * be in the same order as they appear on the screen, and the list should be + * freed using e_source_selector_free_selection(). + **/ +GSList * +e_source_selector_get_selection (ESourceSelector *selector) +{ + struct { + ESourceSelector *selector; + GSList *list; + } closure; + + g_return_val_if_fail (E_IS_SOURCE_SELECTOR (selector), NULL); + + closure.selector = selector; + closure.list = NULL; + + gtk_tree_model_foreach ( + gtk_tree_view_get_model (GTK_TREE_VIEW (selector)), + (GtkTreeModelForeachFunc) source_selector_check_selected, + &closure); + + return g_slist_reverse (closure.list); +} + +/** + * e_source_list_free_selection: + * @list: A selection list returned by e_source_selector_get_selection(). + * + * Free the selection list. + **/ +void +e_source_selector_free_selection (GSList *list) +{ + g_slist_foreach (list, (GFunc) g_object_unref, NULL); + g_slist_free (list); +} + +/** + * e_source_selector_set_select_new: + * @selector: An #ESourceSelector widget + * @state: A gboolean + * + * Set whether or not to select new sources added to @selector. + **/ +void +e_source_selector_set_select_new (ESourceSelector *selector, + gboolean state) +{ + g_return_if_fail (E_IS_SOURCE_SELECTOR (selector)); + + selector->priv->select_new = state; +} + +/** + * e_source_selector_select_source: + * @selector: An #ESourceSelector widget + * @source: An #ESource. + * + * Select @source in @selector. + **/ +void +e_source_selector_select_source (ESourceSelector *selector, + ESource *source) +{ + ESourceSelectorClass *class; + GtkTreeRowReference *reference; + GHashTable *source_index; + + g_return_if_fail (E_IS_SOURCE_SELECTOR (selector)); + g_return_if_fail (E_IS_SOURCE (source)); + + /* Make sure the ESource is in our tree model. */ + source_index = selector->priv->source_index; + reference = g_hash_table_lookup (source_index, source); + g_return_if_fail (gtk_tree_row_reference_valid (reference)); + + class = E_SOURCE_SELECTOR_GET_CLASS (selector); + g_return_if_fail (class->set_source_selected != NULL); + + class->set_source_selected (selector, source, TRUE); + + g_signal_emit (selector, signals[SELECTION_CHANGED], 0); +} + +/** + * e_source_selector_unselect_source: + * @selector: An #ESourceSelector widget + * @source: An #ESource. + * + * Unselect @source in @selector. + **/ +void +e_source_selector_unselect_source (ESourceSelector *selector, + ESource *source) +{ + ESourceSelectorClass *class; + GtkTreeRowReference *reference; + GHashTable *source_index; + + g_return_if_fail (E_IS_SOURCE_SELECTOR (selector)); + g_return_if_fail (E_IS_SOURCE (source)); + + /* Make sure the ESource is in our tree model. */ + source_index = selector->priv->source_index; + reference = g_hash_table_lookup (source_index, source); + g_return_if_fail (gtk_tree_row_reference_valid (reference)); + + class = E_SOURCE_SELECTOR_GET_CLASS (selector); + g_return_if_fail (class->set_source_selected != NULL); + + class->set_source_selected (selector, source, FALSE); + + g_signal_emit (selector, signals[SELECTION_CHANGED], 0); +} + +/** + * e_source_selector_select_exclusive: + * @selector: An #ESourceSelector widget + * @source: An #ESource. + * + * Select @source in @selector and unselect all others. + * + * Since: 2.30 + **/ +void +e_source_selector_select_exclusive (ESourceSelector *selector, + ESource *source) +{ + ESourceSelectorClass *class; + GHashTable *source_index; + GHashTableIter iter; + gpointer key; + + g_return_if_fail (E_IS_SOURCE_SELECTOR (selector)); + g_return_if_fail (E_IS_SOURCE (source)); + + class = E_SOURCE_SELECTOR_GET_CLASS (selector); + g_return_if_fail (class->set_source_selected != NULL); + + source_index = selector->priv->source_index; + g_hash_table_iter_init (&iter, source_index); + + while (g_hash_table_iter_next (&iter, &key, NULL)) { + gboolean selected = e_source_equal (key, source); + class->set_source_selected (selector, key, selected); + } + + g_signal_emit (selector, signals[SELECTION_CHANGED], 0); +} + +/** + * e_source_selector_source_is_selected: + * @selector: An #ESourceSelector widget + * @source: An #ESource. + * + * Check whether @source is selected in @selector. + * + * Returns: %TRUE if @source is currently selected, %FALSE otherwise. + **/ +gboolean +e_source_selector_source_is_selected (ESourceSelector *selector, + ESource *source) +{ + ESourceSelectorClass *class; + GtkTreeRowReference *reference; + GHashTable *source_index; + + g_return_val_if_fail (E_IS_SOURCE_SELECTOR (selector), FALSE); + g_return_val_if_fail (E_IS_SOURCE (source), FALSE); + + /* Make sure the ESource is in our tree model. */ + source_index = selector->priv->source_index; + reference = g_hash_table_lookup (source_index, source); + g_return_val_if_fail (gtk_tree_row_reference_valid (reference), FALSE); + + class = E_SOURCE_SELECTOR_GET_CLASS (selector); + g_return_val_if_fail (class->get_source_selected != NULL, FALSE); + + return class->get_source_selected (selector, source); +} + +/** + * e_source_selector_edit_primary_selection: + * @selector: An #ESourceSelector widget + * + * Allows the user to rename the primary selected source by opening an + * entry box directly in @selector. + * + * Since: 2.26 + **/ +void +e_source_selector_edit_primary_selection (ESourceSelector *selector) +{ + GtkTreeRowReference *reference; + GtkTreeSelection *selection; + GtkTreeViewColumn *column; + GtkCellRenderer *renderer; + GtkTreeView *tree_view; + GtkTreeModel *model; + GtkTreePath *path = NULL; + GtkTreeIter iter; + GList *list; + + g_return_if_fail (E_IS_SOURCE_SELECTOR (selector)); + + tree_view = GTK_TREE_VIEW (selector); + column = gtk_tree_view_get_column (tree_view, 0); + reference = selector->priv->saved_primary_selection; + selection = gtk_tree_view_get_selection (tree_view); + + if (reference != NULL) + path = gtk_tree_row_reference_get_path (reference); + else if (gtk_tree_selection_get_selected (selection, &model, &iter)) + path = gtk_tree_model_get_path (model, &iter); + + if (path == NULL) + return; + + /* XXX Because we stuff three renderers in a single column, + * we have to manually hunt for the text renderer. */ + renderer = NULL; + list = gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (column)); + while (list != NULL) { + renderer = list->data; + if (GTK_IS_CELL_RENDERER_TEXT (renderer)) + break; + list = g_list_delete_link (list, list); + } + g_list_free (list); + + /* Make the text cell renderer editable, but only temporarily. + * We don't want editing to be activated by simply clicking on + * the source name. Too easy for accidental edits to occur. */ + g_object_set (renderer, "editable", TRUE, NULL); + gtk_tree_view_expand_to_path (tree_view, path); + gtk_tree_view_set_cursor_on_cell ( + tree_view, path, column, renderer, TRUE); + g_object_set (renderer, "editable", FALSE, NULL); + + gtk_tree_path_free (path); +} + +/** + * e_source_selector_ref_primary_selection: + * @selector: An #ESourceSelector widget + * + * Get the primary selected source. The primary selection is the one that is + * highlighted through the normal #GtkTreeView selection mechanism (as opposed + * to the "normal" selection, which is the set of source whose checkboxes are + * checked). + * + * The returned #ESource is referenced for thread-safety and must be + * unreferenced with g_object_unref() when finished with it. + * + * Returns: The selected source. + * + * Since: 3.6 + **/ +ESource * +e_source_selector_ref_primary_selection (ESourceSelector *selector) +{ + ESource *source; + GtkTreeRowReference *reference; + GtkTreeSelection *selection; + GtkTreeView *tree_view; + GtkTreeModel *model; + GtkTreeIter iter; + const gchar *extension_name; + gboolean have_iter = FALSE; + + g_return_val_if_fail (E_IS_SOURCE_SELECTOR (selector), NULL); + + tree_view = GTK_TREE_VIEW (selector); + model = gtk_tree_view_get_model (tree_view); + selection = gtk_tree_view_get_selection (tree_view); + + reference = selector->priv->saved_primary_selection; + + if (gtk_tree_row_reference_valid (reference)) { + GtkTreePath *path; + + path = gtk_tree_row_reference_get_path (reference); + have_iter = gtk_tree_model_get_iter (model, &iter, path); + gtk_tree_path_free (path); + } + + if (!have_iter) + have_iter = gtk_tree_selection_get_selected ( + selection, NULL, &iter); + + if (!have_iter) + return NULL; + + gtk_tree_model_get (model, &iter, COLUMN_SOURCE, &source, -1); + + extension_name = e_source_selector_get_extension_name (selector); + + if (!e_source_has_extension (source, extension_name)) { + g_object_unref (source); + return NULL; + } + + return source; +} + +/** + * e_source_selector_set_primary_selection: + * @selector: an #ESourceSelector widget + * @source: an #ESource to select + * + * Highlights @source in @selector. The highlighted #ESource is called + * the primary selection. + * + * Do not confuse this function with e_source_selector_select_source(), + * which activates the check box next to an #ESource's display name in + * @selector. This function does not alter the check box. + **/ +void +e_source_selector_set_primary_selection (ESourceSelector *selector, + ESource *source) +{ + GHashTable *source_index; + GtkTreeRowReference *reference; + GtkTreeSelection *selection; + GtkTreeView *tree_view; + GtkTreePath *child_path; + GtkTreePath *parent_path; + const gchar *extension_name; + + g_return_if_fail (E_IS_SOURCE_SELECTOR (selector)); + g_return_if_fail (E_IS_SOURCE (source)); + + tree_view = GTK_TREE_VIEW (selector); + selection = gtk_tree_view_get_selection (tree_view); + + source_index = selector->priv->source_index; + reference = g_hash_table_lookup (source_index, source); + + /* XXX Maybe we should return a success/fail boolean? */ + if (!gtk_tree_row_reference_valid (reference)) + return; + + extension_name = e_source_selector_get_extension_name (selector); + + /* Return silently if attempting to select a parent node + * lacking the expected extension (e.g. On This Computer). */ + if (!e_source_has_extension (source, extension_name)) + return; + + /* We block the signal because this all needs to be atomic */ + g_signal_handlers_block_matched ( + selection, G_SIGNAL_MATCH_FUNC, + 0, 0, NULL, selection_changed_callback, NULL); + gtk_tree_selection_unselect_all (selection); + g_signal_handlers_unblock_matched ( + selection, G_SIGNAL_MATCH_FUNC, + 0, 0, NULL, selection_changed_callback, NULL); + + clear_saved_primary_selection (selector); + + child_path = gtk_tree_row_reference_get_path (reference); + + parent_path = gtk_tree_path_copy (child_path); + gtk_tree_path_up (parent_path); + + if (gtk_tree_view_row_expanded (tree_view, parent_path)) { + gtk_tree_selection_select_path (selection, child_path); + } else { + selector->priv->saved_primary_selection = + gtk_tree_row_reference_copy (reference); + g_signal_emit (selector, signals[PRIMARY_SELECTION_CHANGED], 0); + g_object_notify (G_OBJECT (selector), "primary-selection"); + } + + gtk_tree_path_free (child_path); + gtk_tree_path_free (parent_path); +} + +/** + * e_source_selector_ref_source_by_path: + * @selector: an #ESourceSelector + * @path: a #GtkTreePath + * + * Returns the #ESource object at @path, or %NULL if @path is invalid. + * + * The returned #ESource is referenced for thread-safety and must be + * unreferenced with g_object_unref() when finished with it. + * + * Returns: the #ESource object at @path, or %NULL + * + * Since: 3.6 + **/ +ESource * +e_source_selector_ref_source_by_path (ESourceSelector *selector, + GtkTreePath *path) +{ + ESource *source = NULL; + GtkTreeModel *model; + GtkTreeIter iter; + + g_return_val_if_fail (E_IS_SOURCE_SELECTOR (selector), NULL); + g_return_val_if_fail (path != NULL, NULL); + + model = gtk_tree_view_get_model (GTK_TREE_VIEW (selector)); + + if (gtk_tree_model_get_iter (model, &iter, path)) + gtk_tree_model_get (model, &iter, COLUMN_SOURCE, &source, -1); + + return source; +} + +/** + * e_source_selector_queue_write: + * @selector: an #ESourceSelecetor + * @source: an #ESource with changes to be written + * + * Queues a main loop idle callback to write changes to @source back to + * the D-Bus registry service. + * + * Since: 3.6 + **/ +void +e_source_selector_queue_write (ESourceSelector *selector, + ESource *source) +{ + GSource *idle_source; + GHashTable *pending_writes; + GMainContext *main_context; + AsyncContext *async_context; + + g_return_if_fail (E_IS_SOURCE_SELECTOR (selector)); + g_return_if_fail (E_IS_SOURCE (source)); + + main_context = selector->priv->main_context; + pending_writes = selector->priv->pending_writes; + + idle_source = g_hash_table_lookup (pending_writes, source); + if (idle_source != NULL && !g_source_is_destroyed (idle_source)) + return; + + async_context = g_slice_new0 (AsyncContext); + async_context->selector = g_object_ref (selector); + async_context->source = g_object_ref (source); + + /* Set a higher priority so this idle source runs before our + * source_selector_cancel_write() signal handler, which will + * cancel this idle source. Cancellation is the right thing + * to do when receiving changes from OTHER registry clients, + * but we don't want to cancel our own changes. + * + * XXX This might be an argument for using etags. + */ + idle_source = g_idle_source_new (); + g_hash_table_insert ( + pending_writes, + g_object_ref (source), + g_source_ref (idle_source)); + g_source_set_callback ( + idle_source, + source_selector_write_idle_cb, + async_context, + (GDestroyNotify) async_context_free); + g_source_set_priority (idle_source, G_PRIORITY_HIGH_IDLE); + g_source_attach (idle_source, main_context); + g_source_unref (idle_source); +} + diff --git a/e-util/e-source-selector.h b/e-util/e-source-selector.h new file mode 100644 index 0000000000..d4d92284fc --- /dev/null +++ b/e-util/e-source-selector.h @@ -0,0 +1,141 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* e-source-selector.h + * + * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) + * + * 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) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + * + * Author: Ettore Perazzoli <ettore@ximian.com> + */ + +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + +#ifndef E_SOURCE_SELECTOR_H +#define E_SOURCE_SELECTOR_H + +#include <gtk/gtk.h> +#include <libedataserver/libedataserver.h> + +/* Standard GObject macros */ +#define E_TYPE_SOURCE_SELECTOR \ + (e_source_selector_get_type ()) +#define E_SOURCE_SELECTOR(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST \ + ((obj), E_TYPE_SOURCE_SELECTOR, ESourceSelector)) +#define E_SOURCE_SELECTOR_CLASS(cls) \ + (G_TYPE_CHECK_CLASS_CAST \ + ((cls), E_TYPE_SOURCE_SELECTOR, ESourceSelectorClass)) +#define E_IS_SOURCE_SELECTOR(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE \ + ((obj), E_TYPE_SOURCE_SELECTOR)) +#define E_IS_SOURCE_SELECTOR_CLASS(cls) \ + (G_TYPE_CHECK_CLASS_TYPE \ + ((cls), E_TYPE_SOURCE_SELECTOR)) +#define E_SOURCE_SELECTOR_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS \ + ((obj), E_TYPE_SOURCE_SELECTOR, ESourceSelectorClass)) + +G_BEGIN_DECLS + +typedef struct _ESourceSelector ESourceSelector; +typedef struct _ESourceSelectorClass ESourceSelectorClass; +typedef struct _ESourceSelectorPrivate ESourceSelectorPrivate; + +struct _ESourceSelector { + GtkTreeView parent; + ESourceSelectorPrivate *priv; +}; + +struct _ESourceSelectorClass { + GtkTreeViewClass parent_class; + + /* Methods */ + gboolean (*get_source_selected) (ESourceSelector *selector, + ESource *source); + void (*set_source_selected) (ESourceSelector *selector, + ESource *source, + gboolean selected); + + /* Signals */ + void (*selection_changed) (ESourceSelector *selector); + void (*primary_selection_changed) + (ESourceSelector *selector); + gboolean (*popup_event) (ESourceSelector *selector, + ESource *primary, + GdkEventButton *event); + gboolean (*data_dropped) (ESourceSelector *selector, + GtkSelectionData *data, + ESource *destination, + GdkDragAction action, + guint target_info); + + gpointer padding1; + gpointer padding2; + gpointer padding3; +}; + +GType e_source_selector_get_type (void); +GtkWidget * e_source_selector_new (ESourceRegistry *registry, + const gchar *extension_name); +ESourceRegistry * + e_source_selector_get_registry (ESourceSelector *selector); +const gchar * e_source_selector_get_extension_name + (ESourceSelector *selector); +gboolean e_source_selector_get_show_colors + (ESourceSelector *selector); +void e_source_selector_set_show_colors + (ESourceSelector *selector, + gboolean show_colors); +gboolean e_source_selector_get_show_toggles + (ESourceSelector *selector); +void e_source_selector_set_show_toggles + (ESourceSelector *selector, + gboolean show_toggles); +void e_source_selector_select_source (ESourceSelector *selector, + ESource *source); +void e_source_selector_unselect_source + (ESourceSelector *selector, + ESource *source); +void e_source_selector_select_exclusive + (ESourceSelector *selector, + ESource *source); +gboolean e_source_selector_source_is_selected + (ESourceSelector *selector, + ESource *source); +GSList * e_source_selector_get_selection (ESourceSelector *selector); +void e_source_selector_free_selection + (GSList *list); +void e_source_selector_set_select_new + (ESourceSelector *selector, + gboolean state); +void e_source_selector_edit_primary_selection + (ESourceSelector *selector); +ESource * e_source_selector_ref_primary_selection + (ESourceSelector *selector); +void e_source_selector_set_primary_selection + (ESourceSelector *selector, + ESource *source); +ESource * e_source_selector_ref_source_by_path + (ESourceSelector *selector, + GtkTreePath *path); +void e_source_selector_queue_write (ESourceSelector *selector, + ESource *source); + +G_END_DECLS + +#endif /* E_SOURCE_SELECTOR_H */ diff --git a/e-util/e-source-util.h b/e-util/e-source-util.h index 452e91113d..e10097f38a 100644 --- a/e-util/e-source-util.h +++ b/e-util/e-source-util.h @@ -16,6 +16,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + /* These functions combine asynchronous ESource and ESourceRegistry methods * with Evolution's EActivity and EAlert facilities to offer an easy-to-use, * "fire-and-forget" API for ESource operations. Use these in situations @@ -28,7 +32,7 @@ #include <libedataserver/libedataserver.h> #include <e-util/e-activity.h> -#include <libevolution-utils/e-alert-sink.h> +#include <e-util/e-alert-sink.h> G_BEGIN_DECLS diff --git a/widgets/misc/e-spell-entry.c b/e-util/e-spell-entry.c index 56f7c14f8c..56f7c14f8c 100644 --- a/widgets/misc/e-spell-entry.c +++ b/e-util/e-spell-entry.c diff --git a/widgets/misc/e-spell-entry.h b/e-util/e-spell-entry.h index 2d6aabad95..07c4c0d24d 100644 --- a/widgets/misc/e-spell-entry.h +++ b/e-util/e-spell-entry.h @@ -16,6 +16,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_SPELL_ENTRY_H #define E_SPELL_ENTRY_H diff --git a/e-util/e-stock-request.c b/e-util/e-stock-request.c index 8736dba7d4..2b00f9faa4 100644 --- a/e-util/e-stock-request.c +++ b/e-util/e-stock-request.c @@ -21,10 +21,9 @@ #include "e-stock-request.h" #include <stdlib.h> +#include <gtk/gtk.h> #include <libsoup/soup.h> -#include <e-util/e-util.h> - #include <string.h> #define d(x) diff --git a/e-util/e-stock-request.h b/e-util/e-stock-request.h index 39a22ba424..b482d7fada 100644 --- a/e-util/e-stock-request.h +++ b/e-util/e-stock-request.h @@ -16,6 +16,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_STOCK_REQUEST_H #define E_STOCK_REQUEST_H diff --git a/widgets/table/e-table-click-to-add.c b/e-util/e-table-click-to-add.c index b08d3fcf39..6de00f913b 100644 --- a/widgets/table/e-table-click-to-add.c +++ b/e-util/e-table-click-to-add.c @@ -24,22 +24,22 @@ #include <config.h> #endif -#include <gdk/gdkkeysyms.h> -#include <gtk/gtk.h> -#include <libgnomecanvas/libgnomecanvas.h> -#include <gdk-pixbuf/gdk-pixbuf.h> +#include "e-table-click-to-add.h" -#include "gal-a11y-e-table-click-to-add.h" -#include "text/e-text.h" +#include <gtk/gtk.h> #include <glib/gi18n.h> -#include "e-util/e-util.h" -#include "misc/e-canvas-utils.h" -#include "misc/e-canvas.h" +#include <gdk/gdkkeysyms.h> +#include <gdk-pixbuf/gdk-pixbuf.h> +#include <libgnomecanvas/libgnomecanvas.h> -#include "e-table-click-to-add.h" +#include "e-canvas-utils.h" +#include "e-canvas.h" +#include "e-marshal.h" #include "e-table-defines.h" #include "e-table-header.h" #include "e-table-one.h" +#include "e-text.h" +#include "gal-a11y-e-table-click-to-add.h" enum { CURSOR_CHANGE, diff --git a/widgets/table/e-table-click-to-add.h b/e-util/e-table-click-to-add.h index b92672d387..cd1519b82e 100644 --- a/widgets/table/e-table-click-to-add.h +++ b/e-util/e-table-click-to-add.h @@ -20,15 +20,20 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef _E_TABLE_CLICK_TO_ADD_H_ #define _E_TABLE_CLICK_TO_ADD_H_ #include <libxml/tree.h> #include <libgnomecanvas/libgnomecanvas.h> -#include <table/e-table-header.h> -#include <table/e-table-sort-info.h> -#include <table/e-table-item.h> -#include <table/e-table-selection-model.h> + +#include <e-util/e-table-header.h> +#include <e-util/e-table-item.h> +#include <e-util/e-table-selection-model.h> +#include <e-util/e-table-sort-info.h> /* Standard GObject macros */ #define E_TYPE_TABLE_CLICK_TO_ADD \ diff --git a/widgets/table/e-table-col-dnd.h b/e-util/e-table-col-dnd.h index 100a4d94d9..608e14e826 100644 --- a/widgets/table/e-table-col-dnd.h +++ b/e-util/e-table-col-dnd.h @@ -21,6 +21,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef _E_TABLE_COL_DND_H_ #define _E_TABLE_COL_DND_H_ diff --git a/widgets/table/e-table-col.c b/e-util/e-table-col.c index 823aba415d..4e5e18a5b6 100644 --- a/widgets/table/e-table-col.c +++ b/e-util/e-table-col.c @@ -25,7 +25,6 @@ #endif #include <glib/gi18n.h> -#include "e-util/e-util.h" #include "e-table-col.h" diff --git a/widgets/table/e-table-col.h b/e-util/e-table-col.h index 042137b40a..243aa04e7a 100644 --- a/widgets/table/e-table-col.h +++ b/e-util/e-table-col.h @@ -21,11 +21,16 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_TABLE_COL_H #define E_TABLE_COL_H #include <gdk-pixbuf/gdk-pixbuf.h> -#include <table/e-cell.h> + +#include <e-util/e-cell.h> /* Standard GObject macros */ #define E_TYPE_TABLE_COL \ diff --git a/widgets/table/e-table-column-specification.c b/e-util/e-table-column-specification.c index 033b693073..d1cf089d2d 100644 --- a/widgets/table/e-table-column-specification.c +++ b/e-util/e-table-column-specification.c @@ -26,15 +26,14 @@ #include <config.h> #endif +#include "e-table-column-specification.h" + #include <stdlib.h> #include <libxml/parser.h> #include <libxml/xmlmemory.h> -#include "e-util/e-util.h" -#include "libevolution-utils/e-xml-utils.h" - -#include "e-table-column-specification.h" +#include "e-xml-utils.h" /* workaround for avoiding API breakage */ #define etcs_get_type e_table_column_specification_get_type diff --git a/widgets/table/e-table-column-specification.h b/e-util/e-table-column-specification.h index e20d7de6b5..ae1a00cc65 100644 --- a/widgets/table/e-table-column-specification.h +++ b/e-util/e-table-column-specification.h @@ -20,6 +20,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef _E_TABLE_COLUMN_SPECIFICATION_H_ #define _E_TABLE_COLUMN_SPECIFICATION_H_ diff --git a/widgets/table/e-table-config.c b/e-util/e-table-config.c index 3be7539ada..98f89ffd10 100644 --- a/widgets/table/e-table-config.c +++ b/e-util/e-table-config.c @@ -31,19 +31,18 @@ #include <config.h> #endif +#include "e-table-config.h" + #include <stdlib.h> #include <string.h> #include <gtk/gtk.h> - #include <glib/gi18n.h> -#include "e-util/e-util-private.h" -#include "e-util/e-util.h" -#include "e-util/e-unicode.h" -#include "e-table-config.h" #include "e-table-memory-store.h" #include "e-table-without.h" +#include "e-unicode.h" +#include "e-util-private.h" G_DEFINE_TYPE (ETableConfig, e_table_config, G_TYPE_OBJECT) diff --git a/widgets/table/e-table-config.h b/e-util/e-table-config.h index 083160772f..7fc74d9f27 100644 --- a/widgets/table/e-table-config.h +++ b/e-util/e-table-config.h @@ -21,16 +21,21 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef _E_TABLE_CONFIG_H_ #define _E_TABLE_CONFIG_H_ -#include <table/e-table-sort-info.h> -#include <table/e-table-specification.h> -#include <table/e-table-without.h> -#include <table/e-table-subset-variable.h> -#include <table/e-table.h> #include <gtk/gtk.h> +#include <e-util/e-table-sort-info.h> +#include <e-util/e-table-specification.h> +#include <e-util/e-table-subset-variable.h> +#include <e-util/e-table-without.h> +#include <e-util/e-table.h> + /* Standard GObject macros */ #define E_TYPE_TABLE_CONFIG \ (e_table_config_get_type ()) diff --git a/widgets/table/e-table-config.ui b/e-util/e-table-config.ui index cfc6cb57fc..cfc6cb57fc 100644 --- a/widgets/table/e-table-config.ui +++ b/e-util/e-table-config.ui diff --git a/widgets/table/e-table-defines.h b/e-util/e-table-defines.h index d7b261160b..0575f1cea7 100644 --- a/widgets/table/e-table-defines.h +++ b/e-util/e-table-defines.h @@ -21,6 +21,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef __E_TABLE_DEFINES__ #define __E_TABLE_DEFINES__ 1 diff --git a/widgets/table/e-table-extras.c b/e-util/e-table-extras.c index d39677bbc8..1820f35451 100644 --- a/widgets/table/e-table-extras.c +++ b/e-util/e-table-extras.c @@ -31,8 +31,6 @@ #include <gtk/gtk.h> -#include "e-util/e-util.h" - #include "e-cell-checkbox.h" #include "e-cell-date.h" #include "e-cell-number.h" diff --git a/widgets/table/e-table-extras.h b/e-util/e-table-extras.h index 6b1ed4200f..93acc4cea0 100644 --- a/widgets/table/e-table-extras.h +++ b/e-util/e-table-extras.h @@ -21,11 +21,15 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_TABLE_EXTRAS_H #define E_TABLE_EXTRAS_H -#include <table/e-cell.h> #include <gdk-pixbuf/gdk-pixbuf.h> +#include <e-util/e-cell.h> /* Standard GObject macros */ #define E_TYPE_TABLE_EXTRAS \ diff --git a/widgets/table/e-table-field-chooser-dialog.c b/e-util/e-table-field-chooser-dialog.c index fb005ed30f..4c643089a1 100644 --- a/widgets/table/e-table-field-chooser-dialog.c +++ b/e-util/e-table-field-chooser-dialog.c @@ -28,7 +28,6 @@ #include <gtk/gtk.h> #include <glib/gi18n.h> -#include "e-util/e-util.h" #include "e-table-field-chooser-dialog.h" diff --git a/widgets/table/e-table-field-chooser-dialog.h b/e-util/e-table-field-chooser-dialog.h index bd378bc89d..15be375c53 100644 --- a/widgets/table/e-table-field-chooser-dialog.h +++ b/e-util/e-table-field-chooser-dialog.h @@ -20,12 +20,17 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef __E_TABLE_FIELD_CHOOSER_DIALOG_H__ #define __E_TABLE_FIELD_CHOOSER_DIALOG_H__ #include <gtk/gtk.h> -#include <table/e-table-field-chooser.h> -#include <table/e-table-header.h> + +#include <e-util/e-table-field-chooser.h> +#include <e-util/e-table-header.h> #define E_TYPE_TABLE_FIELD_CHOOSER_DIALOG \ (e_table_field_chooser_dialog_get_type ()) diff --git a/widgets/table/e-table-field-chooser-item.c b/e-util/e-table-field-chooser-item.c index 3c6c33cdcf..f72e059f20 100644 --- a/widgets/table/e-table-field-chooser-item.c +++ b/e-util/e-table-field-chooser-item.c @@ -27,19 +27,17 @@ #include <string.h> #include <gtk/gtk.h> +#include <glib/gi18n.h> #include <libgnomecanvas/libgnomecanvas.h> #include <gdk-pixbuf/gdk-pixbuf.h> -#include <glib/gi18n.h> -#include "e-util/e-util.h" -#include "libevolution-utils/e-xml-utils.h" -#include "misc/e-canvas.h" - +#include "e-canvas.h" #include "e-table-col-dnd.h" #include "e-table-defines.h" #include "e-table-field-chooser-item.h" #include "e-table-header-utils.h" #include "e-table-header.h" +#include "e-xml-utils.h" #define d(x) diff --git a/widgets/table/e-table-field-chooser-item.h b/e-util/e-table-field-chooser-item.h index f08b94ac6f..08bfeb6729 100644 --- a/widgets/table/e-table-field-chooser-item.h +++ b/e-util/e-table-field-chooser-item.h @@ -21,12 +21,17 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef _E_TABLE_FIELD_CHOOSER_ITEM_H_ #define _E_TABLE_FIELD_CHOOSER_ITEM_H_ #include <libgnomecanvas/libgnomecanvas.h> #include <libxml/tree.h> -#include <table/e-table-header.h> + +#include <e-util/e-table-header.h> /* Standard GObject macros */ #define E_TYPE_TABLE_FIELD_CHOOSER_ITEM \ diff --git a/widgets/table/e-table-field-chooser.c b/e-util/e-table-field-chooser.c index 50f8267109..c402edb7fe 100644 --- a/widgets/table/e-table-field-chooser.c +++ b/e-util/e-table-field-chooser.c @@ -24,17 +24,15 @@ #include <config.h> #endif -#include <gtk/gtk.h> -#include <libgnomecanvas/libgnomecanvas.h> +#include "e-table-field-chooser.h" +#include <gtk/gtk.h> #include <glib/gi18n.h> -#include "e-util/e-util.h" -#include "e-util/e-util-private.h" - -#include "misc/e-canvas.h" +#include <libgnomecanvas/libgnomecanvas.h> -#include "e-table-field-chooser.h" +#include "e-canvas.h" #include "e-table-field-chooser-item.h" +#include "e-util-private.h" static void e_table_field_chooser_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); static void e_table_field_chooser_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); diff --git a/widgets/table/e-table-field-chooser.h b/e-util/e-table-field-chooser.h index a594fa2ae5..567b9afa5c 100644 --- a/widgets/table/e-table-field-chooser.h +++ b/e-util/e-table-field-chooser.h @@ -21,13 +21,18 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef __E_TABLE_FIELD_CHOOSER_H__ #define __E_TABLE_FIELD_CHOOSER_H__ #include <gtk/gtk.h> -#include <table/e-table-header.h> #include <libgnomecanvas/libgnomecanvas.h> +#include <e-util/e-table-header.h> + /* Standard GObject macros */ #define E_TYPE_TABLE_FIELD_CHOOSER \ (e_table_field_chooser_get_type ()) diff --git a/widgets/table/e-table-group-container.c b/e-util/e-table-group-container.c index 27f3116d26..5741cd1093 100644 --- a/widgets/table/e-table-group-container.c +++ b/e-util/e-table-group-container.c @@ -24,22 +24,21 @@ #include <config.h> #endif +#include "e-table-group-container.h" + #include <gtk/gtk.h> +#include <glib/gi18n.h> #include <gdk/gdkkeysyms.h> #include <libgnomecanvas/libgnomecanvas.h> -#include "text/e-text.h" -#include <glib/gi18n.h> -#include "e-util/e-util.h" -#include "misc/e-canvas-utils.h" -#include "misc/e-canvas.h" -#include "e-util/e-unicode.h" - +#include "e-canvas-utils.h" +#include "e-canvas.h" #include "e-table-defines.h" -#include "e-table-group-container.h" #include "e-table-group-leaf.h" #include "e-table-item.h" #include "e-table-sorting-utils.h" +#include "e-text.h" +#include "e-unicode.h" #define TITLE_HEIGHT 16 diff --git a/widgets/table/e-table-group-container.h b/e-util/e-table-group-container.h index ac5f7c9033..3f6fb03b7a 100644 --- a/widgets/table/e-table-group-container.h +++ b/e-util/e-table-group-container.h @@ -21,14 +21,19 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef _E_TABLE_GROUP_CONTAINER_H_ #define _E_TABLE_GROUP_CONTAINER_H_ #include <libgnomecanvas/libgnomecanvas.h> -#include <table/e-table-model.h> -#include <table/e-table-header.h> -#include <table/e-table-group.h> -#include <table/e-table-item.h> + +#include <e-util/e-table-group.h> +#include <e-util/e-table-header.h> +#include <e-util/e-table-item.h> +#include <e-util/e-table-model.h> /* Standard GObject macros */ #define E_TYPE_TABLE_GROUP_CONTAINER \ diff --git a/widgets/table/e-table-group-leaf.c b/e-util/e-table-group-leaf.c index 2da75bf006..8d1a91da69 100644 --- a/widgets/table/e-table-group-leaf.c +++ b/e-util/e-table-group-leaf.c @@ -25,15 +25,15 @@ #include <config.h> #endif -#include <gtk/gtk.h> -#include <libgnomecanvas/libgnomecanvas.h> +#include "e-table-group-leaf.h" +#include <gtk/gtk.h> #include <glib/gi18n.h> -#include "e-util/e-util.h" -#include "misc/e-canvas.h" +#include <libgnomecanvas/libgnomecanvas.h> + +#include "e-canvas.h" #include "e-table-item.h" -#include "e-table-group-leaf.h" #include "e-table-sorted.h" #include "e-table-sorted-variable.h" diff --git a/widgets/table/e-table-group-leaf.h b/e-util/e-table-group-leaf.h index beed62e7d1..93aa2bf2da 100644 --- a/widgets/table/e-table-group-leaf.h +++ b/e-util/e-table-group-leaf.h @@ -21,13 +21,18 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef _E_TABLE_GROUP_LEAF_H_ #define _E_TABLE_GROUP_LEAF_H_ #include <libgnomecanvas/libgnomecanvas.h> -#include <table/e-table-group.h> -#include <table/e-table-subset.h> -#include <table/e-table-item.h> + +#include <e-util/e-table-group.h> +#include <e-util/e-table-item.h> +#include <e-util/e-table-subset.h> /* Standard GObject macros */ #define E_TYPE_TABLE_GROUP_LEAF \ diff --git a/widgets/table/e-table-group.c b/e-util/e-table-group.c index 032ec7dd88..b119b06982 100644 --- a/widgets/table/e-table-group.c +++ b/e-util/e-table-group.c @@ -27,8 +27,6 @@ #include <gtk/gtk.h> #include <libgnomecanvas/libgnomecanvas.h> -#include "e-util/e-util.h" - #include "e-table-group.h" #include "e-table-group-container.h" #include "e-table-group-leaf.h" diff --git a/widgets/table/e-table-group.h b/e-util/e-table-group.h index 5731dfdeaf..7e9e905753 100644 --- a/widgets/table/e-table-group.h +++ b/e-util/e-table-group.h @@ -21,16 +21,21 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef _E_TABLE_GROUP_H_ #define _E_TABLE_GROUP_H_ #include <libgnomecanvas/libgnomecanvas.h> -#include <table/e-table-model.h> -#include <table/e-table-header.h> -#include <table/e-table-sort-info.h> -#include <table/e-table-defines.h> -#include <e-util/e-util.h> -#include <misc/e-printable.h> + +#include <e-util/e-misc-utils.h> +#include <e-util/e-printable.h> +#include <e-util/e-table-defines.h> +#include <e-util/e-table-header.h> +#include <e-util/e-table-model.h> +#include <e-util/e-table-sort-info.h> /* Standard GObject macros */ #define E_TYPE_TABLE_GROUP \ diff --git a/widgets/table/e-table-header-item.c b/e-util/e-table-header-item.c index 44d3979e1c..103ed3a807 100644 --- a/widgets/table/e-table-header-item.c +++ b/e-util/e-table-header-item.c @@ -25,28 +25,27 @@ #include <config.h> #endif +#include "e-table-header-item.h" + #include <string.h> #include <gtk/gtk.h> -#include <libgnomecanvas/libgnomecanvas.h> -#include <gdk-pixbuf/gdk-pixbuf.h> +#include <glib/gi18n.h> #include <gdk/gdkkeysyms.h> +#include <gdk-pixbuf/gdk-pixbuf.h> -#include <glib/gi18n.h> -#include "e-util/e-util.h" -#include "libevolution-utils/e-xml-utils.h" -#include "misc/e-canvas.h" +#include <libgnomecanvas/libgnomecanvas.h> +#include "e-canvas.h" #include "e-popup-menu.h" -#include "e-table.h" #include "e-table-col-dnd.h" #include "e-table-config.h" #include "e-table-defines.h" #include "e-table-field-chooser-dialog.h" -#include "e-table-header.h" #include "e-table-header-utils.h" - -#include "e-table-header-item.h" +#include "e-table-header.h" +#include "e-table.h" +#include "e-xml-utils.h" #include "arrow-up.xpm" #include "arrow-down.xpm" diff --git a/widgets/table/e-table-header-item.h b/e-util/e-table-header-item.h index baaa07cacf..1cd0c717ab 100644 --- a/widgets/table/e-table-header-item.h +++ b/e-util/e-table-header-item.h @@ -21,15 +21,20 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef _E_TABLE_HEADER_ITEM_H_ #define _E_TABLE_HEADER_ITEM_H_ -#include <table/e-table.h> -#include <table/e-tree.h> -#include <libgnomecanvas/libgnomecanvas.h> #include <libxml/tree.h> -#include <table/e-table-header.h> -#include <table/e-table-sort-info.h> +#include <libgnomecanvas/libgnomecanvas.h> + +#include <e-util/e-table-header.h> +#include <e-util/e-table-sort-info.h> +#include <e-util/e-table.h> +#include <e-util/e-tree.h> /* Standard GObject macros */ #define E_TYPE_TABLE_HEADER_ITEM \ diff --git a/widgets/table/e-table-header-utils.c b/e-util/e-table-header-utils.c index e3d4ced22c..d3ee1aca38 100644 --- a/widgets/table/e-table-header-utils.c +++ b/e-util/e-table-header-utils.c @@ -26,14 +26,14 @@ #include <config.h> #endif +#include "e-table-header-utils.h" + #include <string.h> /* strlen() */ #include <gtk/gtk.h> -#include "e-util/e-unicode.h" - #include "e-table-defines.h" -#include "e-table-header-utils.h" +#include "e-unicode.h" static void get_button_padding (GtkWidget *widget, diff --git a/widgets/table/e-table-header-utils.h b/e-util/e-table-header-utils.h index e6d2aaba1d..3022681caa 100644 --- a/widgets/table/e-table-header-utils.h +++ b/e-util/e-table-header-utils.h @@ -23,10 +23,14 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_TABLE_HEADER_UTILS_H #define E_TABLE_HEADER_UTILS_H -#include <table/e-table-col.h> +#include <e-util/e-table-col.h> G_BEGIN_DECLS diff --git a/widgets/table/e-table-header.c b/e-util/e-table-header.c index 325390d559..d06b26e147 100644 --- a/widgets/table/e-table-header.c +++ b/e-util/e-table-header.c @@ -29,8 +29,7 @@ #include <gtk/gtk.h> -#include "e-util/e-util.h" - +#include "e-marshal.h" #include "e-table-defines.h" #include "e-table-header.h" diff --git a/widgets/table/e-table-header.h b/e-util/e-table-header.h index 1ac3016c8f..298131eeed 100644 --- a/widgets/table/e-table-header.h +++ b/e-util/e-table-header.h @@ -22,12 +22,17 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef _E_TABLE_COLUMN_H_ #define _E_TABLE_COLUMN_H_ #include <gdk/gdk.h> -#include <table/e-table-sort-info.h> -#include <table/e-table-col.h> + +#include <e-util/e-table-col.h> +#include <e-util/e-table-sort-info.h> /* Standard GObject macros */ #define E_TYPE_TABLE_HEADER \ diff --git a/widgets/table/e-table-item.c b/e-util/e-table-item.c index ddf7d0ac62..de749ead68 100644 --- a/widgets/table/e-table-item.c +++ b/e-util/e-table-item.c @@ -30,24 +30,24 @@ #include <config.h> #endif +#include "e-table-item.h" + #include <math.h> #include <stdio.h> #include <string.h> #include <stdlib.h> #include <gtk/gtk.h> -#include <gdk/gdkkeysyms.h> - -#include "gal-a11y-e-table-item-factory.h" -#include "gal-a11y-e-table-item.h" #include <glib/gi18n.h> -#include "e-util/e-util.h" -#include "misc/e-canvas.h" -#include "misc/e-canvas-utils.h" +#include <gdk/gdkkeysyms.h> +#include "e-canvas-utils.h" +#include "e-canvas.h" #include "e-cell.h" -#include "e-table-item.h" +#include "e-marshal.h" #include "e-table-subset.h" +#include "gal-a11y-e-table-item-factory.h" +#include "gal-a11y-e-table-item.h" /* workaround for avoiding API breakage */ #define eti_get_type e_table_item_get_type diff --git a/widgets/table/e-table-item.h b/e-util/e-table-item.h index 26a181dd64..09fdab90cc 100644 --- a/widgets/table/e-table-item.h +++ b/e-util/e-table-item.h @@ -22,15 +22,20 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef _E_TABLE_ITEM_H_ #define _E_TABLE_ITEM_H_ #include <libgnomecanvas/libgnomecanvas.h> -#include <table/e-table-model.h> -#include <table/e-table-header.h> -#include <table/e-table-defines.h> -#include <misc/e-selection-model.h> -#include <misc/e-printable.h> + +#include <e-util/e-printable.h> +#include <e-util/e-selection-model.h> +#include <e-util/e-table-defines.h> +#include <e-util/e-table-header.h> +#include <e-util/e-table-model.h> /* Standard GObject macros */ #define E_TYPE_TABLE_ITEM \ diff --git a/widgets/table/e-table-memory-callbacks.c b/e-util/e-table-memory-callbacks.c index 279d0a505e..a3f919b981 100644 --- a/widgets/table/e-table-memory-callbacks.c +++ b/e-util/e-table-memory-callbacks.c @@ -25,8 +25,6 @@ #include <config.h> #endif -#include "e-util/e-util.h" - #include "e-table-memory-callbacks.h" G_DEFINE_TYPE (ETableMemoryCallbacks, e_table_memory_callbacks, E_TYPE_TABLE_MEMORY) diff --git a/widgets/table/e-table-memory-callbacks.h b/e-util/e-table-memory-callbacks.h index 8feb6e9884..a71cac1d91 100644 --- a/widgets/table/e-table-memory-callbacks.h +++ b/e-util/e-table-memory-callbacks.h @@ -20,10 +20,14 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef _E_TABLE_MEMORY_CALLBACKS_H_ #define _E_TABLE_MEMORY_CALLBACKS_H_ -#include <table/e-table-memory.h> +#include <e-util/e-table-memory.h> /* Standard GObject macros */ #define E_TYPE_TABLE_MEMORY_CALLBACKS \ diff --git a/widgets/table/e-table-memory-store.c b/e-util/e-table-memory-store.c index 950b58e31e..066d319122 100644 --- a/widgets/table/e-table-memory-store.c +++ b/e-util/e-table-memory-store.c @@ -26,8 +26,6 @@ #include <string.h> -#include "e-util/e-util.h" - #include "e-table-memory-store.h" #define E_TABLE_MEMORY_STORE_GET_PRIVATE(obj) \ diff --git a/widgets/table/e-table-memory-store.h b/e-util/e-table-memory-store.h index 9d3d638e18..c8167f8608 100644 --- a/widgets/table/e-table-memory-store.h +++ b/e-util/e-table-memory-store.h @@ -21,11 +21,15 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef _E_TABLE_MEMORY_STORE_H_ #define _E_TABLE_MEMORY_STORE_H_ -#include <table/e-table-memory.h> -#include <table/e-table-memory-callbacks.h> +#include <e-util/e-table-memory.h> +#include <e-util/e-table-memory-callbacks.h> /* Standard GObject macros */ #define E_TYPE_TABLE_MEMORY_STORE \ diff --git a/widgets/table/e-table-memory.c b/e-util/e-table-memory.c index 58c1f8415a..b9a7eb94e7 100644 --- a/widgets/table/e-table-memory.c +++ b/e-util/e-table-memory.c @@ -34,10 +34,8 @@ #include <libxml/parser.h> #include <libxml/xmlmemory.h> -#include "e-util/e-util.h" -#include "libevolution-utils/e-xml-utils.h" - #include "e-table-memory.h" +#include "e-xml-utils.h" #define E_TABLE_MEMORY_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ diff --git a/widgets/table/e-table-memory.h b/e-util/e-table-memory.h index 853f378c9e..8762027eaf 100644 --- a/widgets/table/e-table-memory.h +++ b/e-util/e-table-memory.h @@ -20,11 +20,16 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef _E_TABLE_MEMORY_H_ #define _E_TABLE_MEMORY_H_ #include <gdk-pixbuf/gdk-pixbuf.h> -#include <table/e-table-model.h> + +#include <e-util/e-table-model.h> /* Standard GObject macros */ #define E_TYPE_TABLE_MEMORY \ diff --git a/widgets/table/e-table-model.c b/e-util/e-table-model.c index 99479f94ee..1ae4d3e81b 100644 --- a/widgets/table/e-table-model.c +++ b/e-util/e-table-model.c @@ -25,10 +25,10 @@ #include <config.h> #endif -#include "e-util/e-util.h" - #include "e-table-model.h" +#include "e-marshal.h" + #define ETM_FROZEN(e) \ (GPOINTER_TO_INT (g_object_get_data (G_OBJECT (e), "frozen")) != 0) diff --git a/widgets/table/e-table-model.h b/e-util/e-table-model.h index 2ff4eacebd..3ed188e11c 100644 --- a/widgets/table/e-table-model.h +++ b/e-util/e-table-model.h @@ -21,6 +21,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef _E_TABLE_MODEL_H_ #define _E_TABLE_MODEL_H_ diff --git a/widgets/table/e-table-one.c b/e-util/e-table-one.c index 503b6a47a7..db9c27e4d1 100644 --- a/widgets/table/e-table-one.c +++ b/e-util/e-table-one.c @@ -25,8 +25,6 @@ #include <config.h> #endif -#include "e-util/e-util.h" - #include "e-table-one.h" G_DEFINE_TYPE (ETableOne, e_table_one, E_TYPE_TABLE_MODEL) diff --git a/widgets/table/e-table-one.h b/e-util/e-table-one.h index a0d5c7bf88..86f5538ffb 100644 --- a/widgets/table/e-table-one.h +++ b/e-util/e-table-one.h @@ -20,10 +20,14 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef _E_TABLE_ONE_H_ #define _E_TABLE_ONE_H_ -#include <table/e-table-model.h> +#include <e-util/e-table-model.h> /* Standard GObject macros */ #define E_TYPE_TABLE_ONE \ diff --git a/widgets/table/e-table-search.c b/e-util/e-table-search.c index e084bc9602..5b6a7bd8d6 100644 --- a/widgets/table/e-table-search.c +++ b/e-util/e-table-search.c @@ -24,11 +24,11 @@ #include <config.h> #endif -#include <string.h> +#include "e-table-search.h" -#include "e-util/e-util.h" +#include <string.h> -#include "e-table-search.h" +#include "e-marshal.h" #define d(x) diff --git a/widgets/table/e-table-search.h b/e-util/e-table-search.h index ecd56a5d72..1348e6487f 100644 --- a/widgets/table/e-table-search.h +++ b/e-util/e-table-search.h @@ -21,6 +21,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef _E_TABLE_SEARCH_H_ #define _E_TABLE_SEARCH_H_ diff --git a/widgets/table/e-table-selection-model.c b/e-util/e-table-selection-model.c index 2ee44a7ffe..abe4b0c3ff 100644 --- a/widgets/table/e-table-selection-model.c +++ b/e-util/e-table-selection-model.c @@ -29,7 +29,6 @@ #include <gdk/gdkkeysyms.h> #include <glib/gi18n.h> -#include "e-util/e-util.h" #include "e-table-selection-model.h" diff --git a/widgets/table/e-table-selection-model.h b/e-util/e-table-selection-model.h index 02309c047a..0f955ad4bb 100644 --- a/widgets/table/e-table-selection-model.h +++ b/e-util/e-table-selection-model.h @@ -21,12 +21,16 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef _E_TABLE_SELECTION_MODEL_H_ #define _E_TABLE_SELECTION_MODEL_H_ -#include <misc/e-selection-model-array.h> -#include <table/e-table-model.h> -#include <table/e-table-header.h> +#include <e-util/e-selection-model-array.h> +#include <e-util/e-table-header.h> +#include <e-util/e-table-model.h> /* Standard GObject macros */ #define E_TYPE_TABLE_SELECTION_MODEL \ diff --git a/widgets/table/e-table-sort-info.c b/e-util/e-table-sort-info.c index 7ce56d7c75..d2654c55b4 100644 --- a/widgets/table/e-table-sort-info.c +++ b/e-util/e-table-sort-info.c @@ -24,12 +24,11 @@ #include <config.h> #endif -#include <string.h> +#include "e-table-sort-info.h" -#include "e-util/e-util.h" -#include "libevolution-utils/e-xml-utils.h" +#include <string.h> -#include "e-table-sort-info.h" +#include "e-xml-utils.h" #define ETM_CLASS(e) (E_TABLE_SORT_INFO_GET_CLASS (e)) diff --git a/widgets/table/e-table-sort-info.h b/e-util/e-table-sort-info.h index a577481150..c56c5b07f5 100644 --- a/widgets/table/e-table-sort-info.h +++ b/e-util/e-table-sort-info.h @@ -20,6 +20,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef _E_TABLE_SORT_INFO_H_ #define _E_TABLE_SORT_INFO_H_ diff --git a/widgets/table/e-table-sorted-variable.c b/e-util/e-table-sorted-variable.c index 73a92c35ef..17c10d5328 100644 --- a/widgets/table/e-table-sorted-variable.c +++ b/e-util/e-table-sorted-variable.c @@ -27,8 +27,6 @@ #include <stdlib.h> #include <string.h> -#include "e-util/e-util.h" - #include "e-table-sorted-variable.h" #include "e-table-sorting-utils.h" diff --git a/widgets/table/e-table-sorted-variable.h b/e-util/e-table-sorted-variable.h index 917338ae4d..60861e527a 100644 --- a/widgets/table/e-table-sorted-variable.h +++ b/e-util/e-table-sorted-variable.h @@ -21,13 +21,17 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef _E_TABLE_SORTED_VARIABLE_H_ #define _E_TABLE_SORTED_VARIABLE_H_ -#include <table/e-table-model.h> -#include <table/e-table-subset-variable.h> -#include <table/e-table-sort-info.h> -#include <table/e-table-header.h> +#include <e-util/e-table-header.h> +#include <e-util/e-table-model.h> +#include <e-util/e-table-sort-info.h> +#include <e-util/e-table-subset-variable.h> /* Standard GObject macros */ #define E_TYPE_TABLE_SORTED_VARIABLE \ diff --git a/widgets/table/e-table-sorted.c b/e-util/e-table-sorted.c index 31f0fa60b4..3f548d349b 100644 --- a/widgets/table/e-table-sorted.c +++ b/e-util/e-table-sorted.c @@ -27,8 +27,6 @@ #include <stdlib.h> #include <string.h> -#include "e-util/e-util.h" - #include "e-table-sorted.h" #include "e-table-sorting-utils.h" diff --git a/widgets/table/e-table-sorted.h b/e-util/e-table-sorted.h index feff6e2ad5..c9f4b65482 100644 --- a/widgets/table/e-table-sorted.h +++ b/e-util/e-table-sorted.h @@ -21,13 +21,17 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef _E_TABLE_SORTED_H_ #define _E_TABLE_SORTED_H_ -#include <table/e-table-model.h> -#include <table/e-table-subset.h> -#include <table/e-table-sort-info.h> -#include <table/e-table-header.h> +#include <e-util/e-table-header.h> +#include <e-util/e-table-model.h> +#include <e-util/e-table-sort-info.h> +#include <e-util/e-table-subset.h> /* Standard GObject macros */ #define E_TYPE_TABLE_SORTED \ diff --git a/widgets/table/e-table-sorter.c b/e-util/e-table-sorter.c index 2815d13b1b..5fdc077503 100644 --- a/widgets/table/e-table-sorter.c +++ b/e-util/e-table-sorter.c @@ -28,7 +28,6 @@ #include <string.h> #include <glib/gi18n.h> -#include "e-util/e-util.h" #include "e-table-sorter.h" #include "e-table-sorting-utils.h" diff --git a/widgets/table/e-table-sorter.h b/e-util/e-table-sorter.h index 0f36f441f6..9615a9b17f 100644 --- a/widgets/table/e-table-sorter.h +++ b/e-util/e-table-sorter.h @@ -20,14 +20,18 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef _E_TABLE_SORTER_H_ #define _E_TABLE_SORTER_H_ #include <e-util/e-sorter.h> -#include <table/e-table-model.h> -#include <table/e-table-subset-variable.h> -#include <table/e-table-sort-info.h> -#include <table/e-table-header.h> +#include <e-util/e-table-header.h> +#include <e-util/e-table-model.h> +#include <e-util/e-table-sort-info.h> +#include <e-util/e-table-subset-variable.h> /* Standard GObject macros */ #define E_TYPE_TABLE_SORTER \ diff --git a/widgets/table/e-table-sorting-utils.c b/e-util/e-table-sorting-utils.c index a94c45f7b0..23303ea418 100644 --- a/widgets/table/e-table-sorting-utils.c +++ b/e-util/e-table-sorting-utils.c @@ -24,12 +24,12 @@ #include <config.h> #endif +#include "e-table-sorting-utils.h" + #include <string.h> #include <camel/camel.h> -#include "e-util/e-util.h" - -#include "e-table-sorting-utils.h" +#include "e-misc-utils.h" #define d(x) diff --git a/widgets/table/e-table-sorting-utils.h b/e-util/e-table-sorting-utils.h index 5a0a3cd3d7..2d5ccb4363 100644 --- a/widgets/table/e-table-sorting-utils.h +++ b/e-util/e-table-sorting-utils.h @@ -20,15 +20,19 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef _E_TABLE_SORTING_UTILS_H_ #define _E_TABLE_SORTING_UTILS_H_ -G_BEGIN_DECLS +#include <e-util/e-table-header.h> +#include <e-util/e-table-model.h> +#include <e-util/e-table-sort-info.h> +#include <e-util/e-tree-model.h> -#include <table/e-table-model.h> -#include <table/e-tree-model.h> -#include <table/e-table-sort-info.h> -#include <table/e-table-header.h> +G_BEGIN_DECLS gboolean e_table_sorting_utils_affects_sort (ETableSortInfo *sort_info, diff --git a/widgets/table/e-table-specification.c b/e-util/e-table-specification.c index 9f301f6852..03cb429131 100644 --- a/widgets/table/e-table-specification.c +++ b/e-util/e-table-specification.c @@ -24,6 +24,8 @@ #include <config.h> #endif +#include "e-table-specification.h" + #include <stdlib.h> #include <string.h> @@ -33,10 +35,7 @@ #include <libedataserver/libedataserver.h> -#include "e-util/e-util.h" -#include "libevolution-utils/e-xml-utils.h" - -#include "e-table-specification.h" +#include "e-xml-utils.h" /* workaround for avoiding API breakage */ #define etsp_get_type e_table_specification_get_type diff --git a/widgets/table/e-table-specification.h b/e-util/e-table-specification.h index 021c0524c5..8ed43aed73 100644 --- a/widgets/table/e-table-specification.h +++ b/e-util/e-table-specification.h @@ -21,14 +21,19 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef _E_TABLE_SPECIFICATION_H_ #define _E_TABLE_SPECIFICATION_H_ #include <libxml/tree.h> -#include <misc/e-selection-model.h> -#include <table/e-table-state.h> -#include <table/e-table-column-specification.h> -#include <table/e-table-defines.h> + +#include <e-util/e-selection-model.h> +#include <e-util/e-table-column-specification.h> +#include <e-util/e-table-defines.h> +#include <e-util/e-table-state.h> /* Standard GObject macros */ #define E_TYPE_TABLE_SPECIFICATION \ diff --git a/widgets/table/e-table-state.c b/e-util/e-table-state.c index 61c0e5ced5..e5253be7c9 100644 --- a/widgets/table/e-table-state.c +++ b/e-util/e-table-state.c @@ -24,6 +24,8 @@ #include <config.h> #endif +#include "e-table-state.h" + #include <stdlib.h> #include <string.h> @@ -32,10 +34,7 @@ #include <libedataserver/libedataserver.h> -#include "e-util/e-util.h" -#include "libevolution-utils/e-xml-utils.h" - -#include "e-table-state.h" +#include "e-xml-utils.h" #define STATE_VERSION 0.1 diff --git a/widgets/table/e-table-state.h b/e-util/e-table-state.h index 23fc5b2fb2..ac3cfc2879 100644 --- a/widgets/table/e-table-state.h +++ b/e-util/e-table-state.h @@ -20,11 +20,16 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef _E_TABLE_STATE_H_ #define _E_TABLE_STATE_H_ #include <libxml/tree.h> -#include <table/e-table-sort-info.h> + +#include <e-util/e-table-sort-info.h> /* Standard GObject macros */ #define E_TYPE_TABLE_STATE \ diff --git a/widgets/table/e-table-subset-variable.c b/e-util/e-table-subset-variable.c index a40859b492..8d9f3d0c8d 100644 --- a/widgets/table/e-table-subset-variable.c +++ b/e-util/e-table-subset-variable.c @@ -27,8 +27,6 @@ #include <stdlib.h> #include <string.h> -#include "e-util/e-util.h" - #include "e-table-subset-variable.h" #define ETSSV_CLASS(e) (E_TABLE_SUBSET_VARIABLE_GET_CLASS (e)) diff --git a/widgets/table/e-table-subset-variable.h b/e-util/e-table-subset-variable.h index da8186a1df..ca4adddd18 100644 --- a/widgets/table/e-table-subset-variable.h +++ b/e-util/e-table-subset-variable.h @@ -20,10 +20,14 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef _E_TABLE_SUBSET_VARIABLE_H_ #define _E_TABLE_SUBSET_VARIABLE_H_ -#include <table/e-table-subset.h> +#include <e-util/e-table-subset.h> /* Standard GObject macros */ #define E_TYPE_TABLE_SUBSET_VARIABLE \ diff --git a/widgets/table/e-table-subset.c b/e-util/e-table-subset.c index 411102eac1..88532d03bd 100644 --- a/widgets/table/e-table-subset.c +++ b/e-util/e-table-subset.c @@ -28,8 +28,6 @@ #include <stdlib.h> -#include "e-util/e-util.h" - #include "e-table-subset.h" static void etss_proxy_model_pre_change_real diff --git a/widgets/table/e-table-subset.h b/e-util/e-table-subset.h index 9729bdd6b0..9e8d69496d 100644 --- a/widgets/table/e-table-subset.h +++ b/e-util/e-table-subset.h @@ -22,10 +22,14 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef _E_TABLE_SUBSET_H_ #define _E_TABLE_SUBSET_H_ -#include <table/e-table-model.h> +#include <e-util/e-table-model.h> /* Standard GObject macros */ #define E_TYPE_TABLE_SUBSET \ diff --git a/widgets/table/e-table-utils.c b/e-util/e-table-utils.c index 2bdfddc949..b914e595b4 100644 --- a/widgets/table/e-table-utils.c +++ b/e-util/e-table-utils.c @@ -25,14 +25,13 @@ #include <config.h> #endif +#include "e-table-utils.h" + #include <libintl.h> /* This file uses dgettext() but no _() */ #include <string.h> -#include "e-util/e-util.h" -#include "e-util/e-unicode.h" - -#include "e-table-utils.h" #include "e-table-header-utils.h" +#include "e-unicode.h" ETableHeader * e_table_state_to_header (GtkWidget *widget, diff --git a/widgets/table/e-table-utils.h b/e-util/e-table-utils.h index a53e7e4060..1b7b144ce5 100644 --- a/widgets/table/e-table-utils.h +++ b/e-util/e-table-utils.h @@ -21,13 +21,17 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef _E_TABLE_UTILS_H_ #define _E_TABLE_UTILS_H_ -#include <table/e-table-header.h> -#include <table/e-table-state.h> -#include <table/e-table-specification.h> -#include <table/e-table-extras.h> +#include <e-util/e-table-extras.h> +#include <e-util/e-table-header.h> +#include <e-util/e-table-specification.h> +#include <e-util/e-table-state.h> G_BEGIN_DECLS diff --git a/widgets/table/e-table-without.c b/e-util/e-table-without.c index 6fba6cbe12..7139ad15df 100644 --- a/widgets/table/e-table-without.c +++ b/e-util/e-table-without.c @@ -28,8 +28,6 @@ #include <stdlib.h> #include <string.h> -#include "e-util/e-util.h" - #include "e-table-without.h" #define E_TABLE_WITHOUT_GET_PRIVATE(obj) \ diff --git a/widgets/table/e-table-without.h b/e-util/e-table-without.h index 03e1db6702..0853c54cb5 100644 --- a/widgets/table/e-table-without.h +++ b/e-util/e-table-without.h @@ -21,10 +21,14 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef _E_TABLE_WITHOUT_H_ #define _E_TABLE_WITHOUT_H_ -#include <table/e-table-subset.h> +#include <e-util/e-table-subset.h> /* Standard GObject macros */ #define E_TYPE_TABLE_WITHOUT \ diff --git a/widgets/table/e-table.c b/e-util/e-table.c index b73ae55ba6..4dc90bebf1 100644 --- a/widgets/table/e-table.c +++ b/e-util/e-table.c @@ -27,24 +27,22 @@ #include <config.h> #endif +#include "e-table.h" + #include <stdlib.h> #include <string.h> #include <stdio.h> +#include <gtk/gtk.h> +#include <glib/gi18n.h> #include <glib/gstdio.h> #include <gdk/gdkkeysyms.h> -#include <gtk/gtk.h> -#include <libgnomecanvas/libgnomecanvas.h> -#include "gal-a11y-e-table.h" -#include <glib/gi18n.h> -#include "e-util/e-util.h" -#include "misc/e-canvas.h" -#include "misc/e-canvas-background.h" -#include "misc/e-canvas-vbox.h" -#include "e-util/e-unicode.h" +#include <libgnomecanvas/libgnomecanvas.h> -#include "e-table.h" +#include "e-canvas-background.h" +#include "e-canvas-vbox.h" +#include "e-canvas.h" #include "e-table-click-to-add.h" #include "e-table-column-specification.h" #include "e-table-group-leaf.h" @@ -52,6 +50,8 @@ #include "e-table-header-utils.h" #include "e-table-subset.h" #include "e-table-utils.h" +#include "e-unicode.h" +#include "gal-a11y-e-table.h" #define COLUMN_HEADER_HEIGHT 16 diff --git a/widgets/table/e-table.h b/e-util/e-table.h index 6c2908811c..8370e440df 100644 --- a/widgets/table/e-table.h +++ b/e-util/e-table.h @@ -21,24 +21,29 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef _E_TABLE_H_ #define _E_TABLE_H_ #include <libgnomecanvas/libgnomecanvas.h> #include <gtk/gtk.h> #include <libxml/tree.h> -#include <table/e-table-model.h> -#include <table/e-table-header.h> -#include <table/e-table-group.h> -#include <table/e-table-sort-info.h> -#include <table/e-table-item.h> -#include <table/e-table-selection-model.h> -#include <table/e-table-extras.h> -#include <table/e-table-specification.h> -#include <misc/e-printable.h> -#include <table/e-table-state.h> -#include <table/e-table-sorter.h> -#include <table/e-table-search.h> + +#include <e-util/e-printable.h> +#include <e-util/e-table-extras.h> +#include <e-util/e-table-group.h> +#include <e-util/e-table-header.h> +#include <e-util/e-table-item.h> +#include <e-util/e-table-model.h> +#include <e-util/e-table-search.h> +#include <e-util/e-table-selection-model.h> +#include <e-util/e-table-sort-info.h> +#include <e-util/e-table-sorter.h> +#include <e-util/e-table-specification.h> +#include <e-util/e-table-state.h> /* Standard GObject macros */ #define E_TYPE_TABLE \ diff --git a/e-util/e-text-event-processor-emacs-like.c b/e-util/e-text-event-processor-emacs-like.c index 2a42ae939c..c734cf84d4 100644 --- a/e-util/e-text-event-processor-emacs-like.c +++ b/e-util/e-text-event-processor-emacs-like.c @@ -29,7 +29,6 @@ #include <gdk/gdkkeysyms.h> #include "e-text-event-processor-emacs-like.h" -#include "e-util.h" static gint e_text_event_processor_emacs_like_event (ETextEventProcessor *tep, diff --git a/e-util/e-text-event-processor-emacs-like.h b/e-util/e-text-event-processor-emacs-like.h index 0b9c6c143c..5a8890d519 100644 --- a/e-util/e-text-event-processor-emacs-like.h +++ b/e-util/e-text-event-processor-emacs-like.h @@ -21,6 +21,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef __E_TEXT_EVENT_PROCESSOR_EMACS_LIKE_H__ #define __E_TEXT_EVENT_PROCESSOR_EMACS_LIKE_H__ diff --git a/e-util/e-text-event-processor-types.h b/e-util/e-text-event-processor-types.h index d7d0bb3854..cf7da4f5aa 100644 --- a/e-util/e-text-event-processor-types.h +++ b/e-util/e-text-event-processor-types.h @@ -21,6 +21,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef __E_TEXT_EVENT_PROCESSOR_TYPES_H__ #define __E_TEXT_EVENT_PROCESSOR_TYPES_H__ diff --git a/e-util/e-text-event-processor.c b/e-util/e-text-event-processor.c index a5da7810dd..7988bd6973 100644 --- a/e-util/e-text-event-processor.c +++ b/e-util/e-text-event-processor.c @@ -27,7 +27,6 @@ #include <glib/gi18n.h> #include "e-text-event-processor.h" -#include "e-util.h" static void e_text_event_processor_set_property (GObject *object, guint property_id, diff --git a/e-util/e-text-event-processor.h b/e-util/e-text-event-processor.h index cf14ebb286..203e2de236 100644 --- a/e-util/e-text-event-processor.h +++ b/e-util/e-text-event-processor.h @@ -20,6 +20,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef __E_TEXT_EVENT_PROCESSOR_H__ #define __E_TEXT_EVENT_PROCESSOR_H__ diff --git a/widgets/text/e-text-model-repos.c b/e-util/e-text-model-repos.c index b56a213215..b56a213215 100644 --- a/widgets/text/e-text-model-repos.c +++ b/e-util/e-text-model-repos.c diff --git a/widgets/text/e-text-model-repos.h b/e-util/e-text-model-repos.h index f6d50a1111..1450c02715 100644 --- a/widgets/text/e-text-model-repos.h +++ b/e-util/e-text-model-repos.h @@ -22,6 +22,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_TEXT_MODEL_REPOS_H #define E_TEXT_MODEL_REPOS_H diff --git a/widgets/text/e-text-model.c b/e-util/e-text-model.c index 5027b3a3f7..ab6bff8ff3 100644 --- a/widgets/text/e-text-model.c +++ b/e-util/e-text-model.c @@ -26,14 +26,14 @@ #include <config.h> #endif +#include "e-text-model.h" + #include <ctype.h> #include <string.h> #include <gtk/gtk.h> -#include "e-util/e-util.h" - -#include "e-text-model.h" +#include "e-marshal.h" #include "e-text-model-repos.h" #define E_TEXT_MODEL_GET_PRIVATE(obj) \ diff --git a/widgets/text/e-text-model.h b/e-util/e-text-model.h index 4b0a4475cb..3426c183e2 100644 --- a/widgets/text/e-text-model.h +++ b/e-util/e-text-model.h @@ -20,6 +20,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_TEXT_MODEL_H #define E_TEXT_MODEL_H diff --git a/widgets/text/e-text.c b/e-util/e-text.c index f75c4ca8b9..d23decad86 100644 --- a/widgets/text/e-text.c +++ b/e-util/e-text.c @@ -39,22 +39,22 @@ #include <config.h> #endif +#include "e-text.h" + #include <math.h> #include <ctype.h> #include <string.h> -#include <gdk/gdkkeysyms.h> +#include <glib/gi18n.h> #include <gtk/gtk.h> +#include <gdk/gdkkeysyms.h> +#include "e-canvas-utils.h" +#include "e-canvas.h" +#include "e-marshal.h" +#include "e-text-event-processor-emacs-like.h" +#include "e-unicode.h" #include "gal-a11y-e-text.h" -#include "misc/e-canvas.h" -#include "misc/e-canvas-utils.h" -#include "e-util/e-unicode.h" -#include <glib/gi18n.h> -#include "e-util/e-text-event-processor-emacs-like.h" -#include "e-util/e-util.h" - -#include "e-text.h" G_DEFINE_TYPE (EText, e_text, GNOME_TYPE_CANVAS_ITEM) diff --git a/widgets/text/e-text.h b/e-util/e-text.h index b3099f1a64..40e92bf585 100644 --- a/widgets/text/e-text.h +++ b/e-util/e-text.h @@ -35,14 +35,18 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_TEXT_H #define E_TEXT_H #include <gtk/gtk.h> +#include <e-util/e-canvas.h> #include <e-util/e-text-event-processor.h> -#include <text/e-text-model.h> -#include <misc/e-canvas.h> +#include <e-util/e-text-model.h> G_BEGIN_DECLS diff --git a/widgets/e-timezone-dialog/e-timezone-dialog.c b/e-util/e-timezone-dialog.c index 32194b4871..431287c2df 100644 --- a/widgets/e-timezone-dialog/e-timezone-dialog.c +++ b/e-util/e-timezone-dialog.c @@ -24,17 +24,17 @@ #include <config.h> #endif +#include "e-timezone-dialog.h" + #include <time.h> #include <string.h> #include <glib/gi18n.h> -#include <misc/e-map.h> #include <libecal/libecal.h> -#include "e-util/e-util.h" -#include "e-util/e-util-private.h" - -#include "e-timezone-dialog.h" +#include "e-map.h" +#include "e-misc-utils.h" +#include "e-util-private.h" #ifdef G_OS_WIN32 #ifdef gmtime_r diff --git a/widgets/e-timezone-dialog/e-timezone-dialog.h b/e-util/e-timezone-dialog.h index fa10098675..df87e80941 100644 --- a/widgets/e-timezone-dialog/e-timezone-dialog.h +++ b/e-util/e-timezone-dialog.h @@ -22,6 +22,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_TIMEZONE_DIALOG_H #define E_TIMEZONE_DIALOG_H diff --git a/widgets/e-timezone-dialog/e-timezone-dialog.ui b/e-util/e-timezone-dialog.ui index 5a23ec180e..5a23ec180e 100644 --- a/widgets/e-timezone-dialog/e-timezone-dialog.ui +++ b/e-util/e-timezone-dialog.ui diff --git a/widgets/table/e-tree-memory-callbacks.c b/e-util/e-tree-memory-callbacks.c index 9f8d7d468a..9d2fda6e3e 100644 --- a/widgets/table/e-tree-memory-callbacks.c +++ b/e-util/e-tree-memory-callbacks.c @@ -27,8 +27,6 @@ #include <gtk/gtk.h> -#include "e-util/e-util.h" - #include "e-tree-memory-callbacks.h" G_DEFINE_TYPE (ETreeMemoryCallbacks, e_tree_memory_callbacks, E_TYPE_TREE_MEMORY) diff --git a/widgets/table/e-tree-memory-callbacks.h b/e-util/e-tree-memory-callbacks.h index f2e202bec3..df47e9a491 100644 --- a/widgets/table/e-tree-memory-callbacks.h +++ b/e-util/e-tree-memory-callbacks.h @@ -20,10 +20,14 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef _E_TREE_MEMORY_CALLBACKS_H_ #define _E_TREE_MEMORY_CALLBACKS_H_ -#include <table/e-tree-memory.h> +#include <e-util/e-tree-memory.h> /* Standard GObject macros */ #define E_TYPE_TREE_MEMORY_CALLBACKS \ diff --git a/widgets/table/e-tree-memory.c b/e-util/e-tree-memory.c index f779405d0e..0af5d27b31 100644 --- a/widgets/table/e-tree-memory.c +++ b/e-util/e-tree-memory.c @@ -25,6 +25,8 @@ #include <config.h> #endif +#include "e-tree-memory.h" + #include <stdio.h> #include <errno.h> #include <unistd.h> @@ -34,10 +36,7 @@ #include <libxml/parser.h> #include <libxml/xmlmemory.h> -#include "e-util/e-util.h" -#include "libevolution-utils/e-xml-utils.h" - -#include "e-tree-memory.h" +#include "e-xml-utils.h" #define E_TREE_MEMORY_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ diff --git a/widgets/table/e-tree-memory.h b/e-util/e-tree-memory.h index cff4811256..3e58952ad2 100644 --- a/widgets/table/e-tree-memory.h +++ b/e-util/e-tree-memory.h @@ -22,11 +22,16 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef _E_TREE_MEMORY_H_ #define _E_TREE_MEMORY_H_ #include <gdk-pixbuf/gdk-pixbuf.h> -#include <table/e-tree-model.h> + +#include <e-util/e-tree-model.h> /* Standard GObject macros */ #define E_TYPE_TREE_MEMORY \ diff --git a/e-util/e-tree-model-generator.c b/e-util/e-tree-model-generator.c new file mode 100644 index 0000000000..aff912998c --- /dev/null +++ b/e-util/e-tree-model-generator.c @@ -0,0 +1,1345 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ + +/* e-tree-model-generator.c - Model wrapper that permutes underlying rows. + * + * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU Lesser General Public + * License as published by the Free Software Foundation. + * + * 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 this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * Authors: Hans Petter Jansson <hpj@novell.com> + */ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#include <string.h> +#include <glib/gi18n-lib.h> +#include "e-tree-model-generator.h" + +#define ETMG_DEBUG(x) + +#define ITER_IS_VALID(tree_model_generator, iter) \ + ((iter)->stamp == (tree_model_generator)->priv->stamp) +#define ITER_GET(iter, group, index) \ + G_STMT_START { \ + *(group) = (iter)->user_data; \ + *(index) = GPOINTER_TO_INT ((iter)->user_data2); \ + } G_STMT_END + +#define ITER_SET(tree_model_generator, iter, group, index) \ + G_STMT_START { \ + (iter)->stamp = (tree_model_generator)->priv->stamp; \ + (iter)->user_data = group; \ + (iter)->user_data2 = GINT_TO_POINTER (index); \ + } G_STMT_END + +#define E_TREE_MODEL_GENERATOR_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE \ + ((obj), E_TYPE_TREE_MODEL_GENERATOR, ETreeModelGeneratorPrivate)) + +struct _ETreeModelGeneratorPrivate { + GtkTreeModel *child_model; + GArray *root_nodes; + gint stamp; + + ETreeModelGeneratorGenerateFunc generate_func; + gpointer generate_func_data; + + ETreeModelGeneratorModifyFunc modify_func; + gpointer modify_func_data; +}; + +static void e_tree_model_generator_tree_model_init (GtkTreeModelIface *iface); + +G_DEFINE_TYPE_WITH_CODE ( + ETreeModelGenerator, e_tree_model_generator, G_TYPE_OBJECT, + G_IMPLEMENT_INTERFACE (GTK_TYPE_TREE_MODEL, e_tree_model_generator_tree_model_init)) + +static GtkTreeModelFlags e_tree_model_generator_get_flags (GtkTreeModel *tree_model); +static gint e_tree_model_generator_get_n_columns (GtkTreeModel *tree_model); +static GType e_tree_model_generator_get_column_type (GtkTreeModel *tree_model, + gint index); +static gboolean e_tree_model_generator_get_iter (GtkTreeModel *tree_model, + GtkTreeIter *iter, + GtkTreePath *path); +static GtkTreePath *e_tree_model_generator_get_path (GtkTreeModel *tree_model, + GtkTreeIter *iter); +static void e_tree_model_generator_get_value (GtkTreeModel *tree_model, + GtkTreeIter *iter, + gint column, + GValue *value); +static gboolean e_tree_model_generator_iter_next (GtkTreeModel *tree_model, + GtkTreeIter *iter); +static gboolean e_tree_model_generator_iter_children (GtkTreeModel *tree_model, + GtkTreeIter *iter, + GtkTreeIter *parent); +static gboolean e_tree_model_generator_iter_has_child (GtkTreeModel *tree_model, + GtkTreeIter *iter); +static gint e_tree_model_generator_iter_n_children (GtkTreeModel *tree_model, + GtkTreeIter *iter); +static gboolean e_tree_model_generator_iter_nth_child (GtkTreeModel *tree_model, + GtkTreeIter *iter, + GtkTreeIter *parent, + gint n); +static gboolean e_tree_model_generator_iter_parent (GtkTreeModel *tree_model, + GtkTreeIter *iter, + GtkTreeIter *child); + +static GArray *build_node_map (ETreeModelGenerator *tree_model_generator, GtkTreeIter *parent_iter, + GArray *parent_group, gint parent_index); +static void release_node_map (GArray *group); + +static void child_row_changed (ETreeModelGenerator *tree_model_generator, GtkTreePath *path, GtkTreeIter *iter); +static void child_row_inserted (ETreeModelGenerator *tree_model_generator, GtkTreePath *path, GtkTreeIter *iter); +static void child_row_deleted (ETreeModelGenerator *tree_model_generator, GtkTreePath *path); + +typedef struct { + GArray *parent_group; + gint parent_index; + + gint n_generated; + GArray *child_nodes; +} +Node; + +enum { + PROP_0, + PROP_CHILD_MODEL +}; + +/* ------------------ * + * Class/object setup * + * ------------------ */ + +static void +tree_model_generator_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + ETreeModelGenerator *tree_model_generator = E_TREE_MODEL_GENERATOR (object); + + switch (prop_id) + { + case PROP_CHILD_MODEL: + tree_model_generator->priv->child_model = g_value_get_object (value); + g_object_ref (tree_model_generator->priv->child_model); + + if (tree_model_generator->priv->root_nodes) + release_node_map (tree_model_generator->priv->root_nodes); + tree_model_generator->priv->root_nodes = + build_node_map (tree_model_generator, NULL, NULL, -1); + + g_signal_connect_swapped ( + tree_model_generator->priv->child_model, "row-changed", + G_CALLBACK (child_row_changed), tree_model_generator); + g_signal_connect_swapped ( + tree_model_generator->priv->child_model, "row-deleted", + G_CALLBACK (child_row_deleted), tree_model_generator); + g_signal_connect_swapped ( + tree_model_generator->priv->child_model, "row-inserted", + G_CALLBACK (child_row_inserted), tree_model_generator); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +tree_model_generator_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + ETreeModelGenerator *tree_model_generator = E_TREE_MODEL_GENERATOR (object); + + switch (prop_id) + { + case PROP_CHILD_MODEL: + g_value_set_object (value, tree_model_generator->priv->child_model); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +tree_model_generator_finalize (GObject *object) +{ + ETreeModelGenerator *tree_model_generator = E_TREE_MODEL_GENERATOR (object); + + if (tree_model_generator->priv->child_model) { + g_signal_handlers_disconnect_matched ( + tree_model_generator->priv->child_model, + G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, + tree_model_generator); + g_object_unref (tree_model_generator->priv->child_model); + } + + if (tree_model_generator->priv->root_nodes) + release_node_map (tree_model_generator->priv->root_nodes); + + /* Chain up to parent's finalize() method. */ + G_OBJECT_CLASS (e_tree_model_generator_parent_class)->finalize (object); +} + +static void +e_tree_model_generator_class_init (ETreeModelGeneratorClass *class) +{ + GObjectClass *object_class; + + g_type_class_add_private (class, sizeof (ETreeModelGeneratorPrivate)); + + object_class = G_OBJECT_CLASS (class); + object_class->get_property = tree_model_generator_get_property; + object_class->set_property = tree_model_generator_set_property; + object_class->finalize = tree_model_generator_finalize; + + g_object_class_install_property ( + object_class, + PROP_CHILD_MODEL, + g_param_spec_object ( + "child-model", + "Child Model", + "The child model to extend", + G_TYPE_OBJECT, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT_ONLY)); +} + +static void +e_tree_model_generator_tree_model_init (GtkTreeModelIface *iface) +{ + iface->get_flags = e_tree_model_generator_get_flags; + iface->get_n_columns = e_tree_model_generator_get_n_columns; + iface->get_column_type = e_tree_model_generator_get_column_type; + iface->get_iter = e_tree_model_generator_get_iter; + iface->get_path = e_tree_model_generator_get_path; + iface->get_value = e_tree_model_generator_get_value; + iface->iter_next = e_tree_model_generator_iter_next; + iface->iter_children = e_tree_model_generator_iter_children; + iface->iter_has_child = e_tree_model_generator_iter_has_child; + iface->iter_n_children = e_tree_model_generator_iter_n_children; + iface->iter_nth_child = e_tree_model_generator_iter_nth_child; + iface->iter_parent = e_tree_model_generator_iter_parent; +} + +static void +e_tree_model_generator_init (ETreeModelGenerator *tree_model_generator) +{ + tree_model_generator->priv = + E_TREE_MODEL_GENERATOR_GET_PRIVATE (tree_model_generator); + + tree_model_generator->priv->stamp = g_random_int (); + tree_model_generator->priv->root_nodes = g_array_new (FALSE, FALSE, sizeof (Node)); +} + +/* ------------------ * + * Row update helpers * + * ------------------ */ + +static void +row_deleted (ETreeModelGenerator *tree_model_generator, + GtkTreePath *path) +{ + g_assert (path); + + ETMG_DEBUG (g_print ("row_deleted emitting\n")); + gtk_tree_model_row_deleted (GTK_TREE_MODEL (tree_model_generator), path); +} + +static void +row_inserted (ETreeModelGenerator *tree_model_generator, + GtkTreePath *path) +{ + GtkTreeIter iter; + + g_assert (path); + + if (gtk_tree_model_get_iter (GTK_TREE_MODEL (tree_model_generator), &iter, path)) { + ETMG_DEBUG (g_print ("row_inserted emitting\n")); + gtk_tree_model_row_inserted (GTK_TREE_MODEL (tree_model_generator), path, &iter); + } else { + ETMG_DEBUG (g_print ("row_inserted could not get iter!\n")); + } +} + +static void +row_changed (ETreeModelGenerator *tree_model_generator, + GtkTreePath *path) +{ + GtkTreeIter iter; + + g_assert (path); + + if (gtk_tree_model_get_iter (GTK_TREE_MODEL (tree_model_generator), &iter, path)) { + ETMG_DEBUG (g_print ("row_changed emitting\n")); + gtk_tree_model_row_changed (GTK_TREE_MODEL (tree_model_generator), path, &iter); + } else { + ETMG_DEBUG (g_print ("row_changed could not get iter!\n")); + } +} + +/* -------------------- * + * Node map translation * + * -------------------- */ + +static gint +generated_offset_to_child_offset (GArray *group, + gint offset, + gint *internal_offset) +{ + gboolean success = FALSE; + gint accum_offset = 0; + gint i; + + for (i = 0; i < group->len; i++) { + Node *node = &g_array_index (group, Node, i); + + accum_offset += node->n_generated; + if (accum_offset > offset) { + accum_offset -= node->n_generated; + success = TRUE; + break; + } + } + + if (!success) + return -1; + + if (internal_offset) + *internal_offset = offset - accum_offset; + + return i; +} + +static gint +child_offset_to_generated_offset (GArray *group, + gint offset) +{ + gint accum_offset = 0; + gint i; + + g_return_val_if_fail (group != NULL, -1); + + for (i = 0; i < group->len && i < offset; i++) { + Node *node = &g_array_index (group, Node, i); + + accum_offset += node->n_generated; + } + + return accum_offset; +} + +static gint +count_generated_nodes (GArray *group) +{ + gint accum_offset = 0; + gint i; + + for (i = 0; i < group->len; i++) { + Node *node = &g_array_index (group, Node, i); + + accum_offset += node->n_generated; + } + + return accum_offset; +} + +/* ------------------- * + * Node map management * + * ------------------- */ + +static void +release_node_map (GArray *group) +{ + gint i; + + for (i = 0; i < group->len; i++) { + Node *node = &g_array_index (group, Node, i); + + if (node->child_nodes) + release_node_map (node->child_nodes); + } + + g_array_free (group, TRUE); +} + +static gint +append_node (GArray *group) +{ + g_array_set_size (group, group->len + 1); + return group->len - 1; +} + +static GArray * +build_node_map (ETreeModelGenerator *tree_model_generator, + GtkTreeIter *parent_iter, + GArray *parent_group, + gint parent_index) +{ + GArray *group; + GtkTreeIter iter; + gboolean result; + + if (parent_iter) + result = gtk_tree_model_iter_children (tree_model_generator->priv->child_model, &iter, parent_iter); + else + result = gtk_tree_model_get_iter_first (tree_model_generator->priv->child_model, &iter); + + if (!result) + return NULL; + + group = g_array_new (FALSE, FALSE, sizeof (Node)); + + do { + Node *node; + gint i; + + i = append_node (group); + node = &g_array_index (group, Node, i); + + node->parent_group = parent_group; + node->parent_index = parent_index; + + if (tree_model_generator->priv->generate_func) + node->n_generated = + tree_model_generator->priv->generate_func (tree_model_generator->priv->child_model, + &iter, tree_model_generator->priv->generate_func_data); + else + node->n_generated = 1; + + node->child_nodes = build_node_map (tree_model_generator, &iter, group, i); + } while (gtk_tree_model_iter_next (tree_model_generator->priv->child_model, &iter)); + + return group; +} + +static gint +get_first_visible_index_from (GArray *group, + gint index) +{ + gint i; + + for (i = index; i < group->len; i++) { + Node *node = &g_array_index (group, Node, i); + + if (node->n_generated) + break; + } + + if (i >= group->len) + i = -1; + + return i; +} + +static Node * +get_node_by_child_path (ETreeModelGenerator *tree_model_generator, + GtkTreePath *path, + GArray **node_group) +{ + Node *node = NULL; + GArray *group; + gint depth; + + group = tree_model_generator->priv->root_nodes; + + for (depth = 0; depth < gtk_tree_path_get_depth (path); depth++) { + gint index; + + if (!group) { + g_warning ("ETreeModelGenerator got unknown child element!"); + break; + } + + index = gtk_tree_path_get_indices (path)[depth]; + node = &g_array_index (group, Node, index); + + if (depth + 1 < gtk_tree_path_get_depth (path)) + group = node->child_nodes; + } + + if (!node) + group = NULL; + + if (node_group) + *node_group = group; + + return node; +} + +static Node * +create_node_at_child_path (ETreeModelGenerator *tree_model_generator, + GtkTreePath *path) +{ + GtkTreePath *parent_path; + gint parent_index; + GArray *parent_group; + GArray *group; + gint index; + Node *node; + + parent_path = gtk_tree_path_copy (path); + gtk_tree_path_up (parent_path); + node = get_node_by_child_path (tree_model_generator, parent_path, &parent_group); + + if (node) { + if (!node->child_nodes) + node->child_nodes = g_array_new (FALSE, FALSE, sizeof (Node)); + + group = node->child_nodes; + parent_index = gtk_tree_path_get_indices (parent_path)[gtk_tree_path_get_depth (parent_path) - 1]; + } else { + if (!tree_model_generator->priv->root_nodes) + tree_model_generator->priv->root_nodes = g_array_new (FALSE, FALSE, sizeof (Node)); + + group = tree_model_generator->priv->root_nodes; + parent_index = -1; + } + + gtk_tree_path_free (parent_path); + + index = gtk_tree_path_get_indices (path)[gtk_tree_path_get_depth (path) - 1]; + ETMG_DEBUG (g_print ("Inserting index %d into group of length %d\n", index, group->len)); + index = MIN (index, group->len); + + append_node (group); + + if (group->len - 1 - index > 0) { + gint i; + + memmove ( + (Node *) group->data + index + 1, + (Node *) group->data + index, + (group->len - 1 - index) * sizeof (Node)); + + /* Update parent pointers */ + for (i = index + 1; i < group->len; i++) { + Node *pnode = &g_array_index (group, Node, i); + GArray *child_group; + gint j; + + child_group = pnode->child_nodes; + if (!child_group) + continue; + + for (j = 0; j < child_group->len; j++) { + Node *child_node = &g_array_index (child_group, Node, j); + child_node->parent_index = i; + } + } + } + + node = &g_array_index (group, Node, index); + node->parent_group = parent_group; + node->parent_index = parent_index; + node->n_generated = 0; + node->child_nodes = NULL; + + ETMG_DEBUG ( + g_print ("Created node at offset %d, parent_group = %p, parent_index = %d\n", + index, node->parent_group, node->parent_index)); + + return node; +} + +ETMG_DEBUG ( + +static void +dump_group (GArray *group) +{ + gint i; + + g_print ("\nGroup %p:\n", group); + + for (i = 0; i < group->len; i++) { + Node *node = &g_array_index (group, Node, i); + g_print ( + " %04d: pgroup=%p, pindex=%d, n_generated=%d, child_nodes=%p\n", + i, node->parent_group, node->parent_index, node->n_generated, node->child_nodes); + } +} + +) + +static void +delete_node_at_child_path (ETreeModelGenerator *tree_model_generator, + GtkTreePath *path) +{ + GtkTreePath *parent_path; + GArray *parent_group; + GArray *group; + gint index; + Node *node; + gint i; + + parent_path = gtk_tree_path_copy (path); + gtk_tree_path_up (parent_path); + node = get_node_by_child_path (tree_model_generator, parent_path, &parent_group); + + if (node) { + group = node->child_nodes; + } else { + group = tree_model_generator->priv->root_nodes; + } + + gtk_tree_path_free (parent_path); + + if (!group) + return; + + index = gtk_tree_path_get_indices (path)[gtk_tree_path_get_depth (path) - 1]; + if (index >= group->len) + return; + + node = &g_array_index (group, Node, index); + if (node->child_nodes) + release_node_map (node->child_nodes); + g_array_remove_index (group, index); + + /* Update parent pointers */ + for (i = index; i < group->len; i++) { + Node *pnode = &g_array_index (group, Node, i); + GArray *child_group; + gint j; + + child_group = pnode->child_nodes; + if (!child_group) + continue; + + for (j = 0; j < child_group->len; j++) { + Node *child_node = &g_array_index (child_group, Node, j); + child_node->parent_index = i; + } + } +} + +static void +child_row_changed (ETreeModelGenerator *tree_model_generator, + GtkTreePath *path, + GtkTreeIter *iter) +{ + GtkTreePath *generated_path; + Node *node; + gint n_generated; + gint i; + + if (tree_model_generator->priv->generate_func) + n_generated = + tree_model_generator->priv->generate_func (tree_model_generator->priv->child_model, + iter, tree_model_generator->priv->generate_func_data); + else + n_generated = 1; + + node = get_node_by_child_path (tree_model_generator, path, NULL); + if (!node) + return; + + generated_path = e_tree_model_generator_convert_child_path_to_path (tree_model_generator, path); + + /* FIXME: Converting the path to an iter every time is inefficient */ + + for (i = 0; i < n_generated && i < node->n_generated; i++) { + row_changed (tree_model_generator, generated_path); + gtk_tree_path_next (generated_path); + } + + for (; i < node->n_generated; ) { + node->n_generated--; + row_deleted (tree_model_generator, generated_path); + } + + for (; i < n_generated; i++) { + node->n_generated++; + row_inserted (tree_model_generator, generated_path); + gtk_tree_path_next (generated_path); + } + + gtk_tree_path_free (generated_path); +} + +static void +child_row_inserted (ETreeModelGenerator *tree_model_generator, + GtkTreePath *path, + GtkTreeIter *iter) +{ + GtkTreePath *generated_path; + Node *node; + gint n_generated; + + if (tree_model_generator->priv->generate_func) + n_generated = + tree_model_generator->priv->generate_func (tree_model_generator->priv->child_model, + iter, tree_model_generator->priv->generate_func_data); + else + n_generated = 1; + + node = create_node_at_child_path (tree_model_generator, path); + if (!node) + return; + + generated_path = e_tree_model_generator_convert_child_path_to_path (tree_model_generator, path); + + /* FIXME: Converting the path to an iter every time is inefficient */ + + for (node->n_generated = 0; node->n_generated < n_generated; ) { + node->n_generated++; + row_inserted (tree_model_generator, generated_path); + gtk_tree_path_next (generated_path); + } + + gtk_tree_path_free (generated_path); +} + +static void +child_row_deleted (ETreeModelGenerator *tree_model_generator, + GtkTreePath *path) +{ + GtkTreePath *generated_path; + Node *node; + + node = get_node_by_child_path (tree_model_generator, path, NULL); + if (!node) + return; + + generated_path = e_tree_model_generator_convert_child_path_to_path (tree_model_generator, path); + + /* FIXME: Converting the path to an iter every time is inefficient */ + + for (; node->n_generated; ) { + node->n_generated--; + row_deleted (tree_model_generator, generated_path); + } + + delete_node_at_child_path (tree_model_generator, path); + gtk_tree_path_free (generated_path); +} + +/* ----------------------- * + * ETreeModelGenerator API * + * ----------------------- */ + +/** + * e_tree_model_generator_new: + * @child_model: a #GtkTreeModel + * + * Creates a new #ETreeModelGenerator wrapping @child_model. + * + * Returns: A new #ETreeModelGenerator. + **/ +ETreeModelGenerator * +e_tree_model_generator_new (GtkTreeModel *child_model) +{ + g_return_val_if_fail (GTK_IS_TREE_MODEL (child_model), NULL); + + return E_TREE_MODEL_GENERATOR ( + g_object_new (E_TYPE_TREE_MODEL_GENERATOR, + "child-model", child_model, NULL)); +} + +/** + * e_tree_model_generator_get_model: + * @tree_model_generator: an #ETreeModelGenerator + * + * Gets the child model being wrapped by @tree_model_generator. + * + * Returns: A #GtkTreeModel being wrapped. + **/ +GtkTreeModel * +e_tree_model_generator_get_model (ETreeModelGenerator *tree_model_generator) +{ + g_return_val_if_fail (E_IS_TREE_MODEL_GENERATOR (tree_model_generator), NULL); + + return tree_model_generator->priv->child_model; +} + +/** + * e_tree_model_generator_set_generate_func: + * @tree_model_generator: an #ETreeModelGenerator + * @func: an #ETreeModelGeneratorGenerateFunc, or %NULL + * @data: user data to pass to @func + * @destroy: + * + * Sets the callback function used to filter or generate additional rows + * based on the child model's data. This function is called for each child + * row, and returns a value indicating the number of rows that will be + * used to represent the child row - 0 or more. + * + * If @func is %NULL, a filtering/generating function will not be applied. + **/ +void +e_tree_model_generator_set_generate_func (ETreeModelGenerator *tree_model_generator, + ETreeModelGeneratorGenerateFunc func, + gpointer data, + GDestroyNotify destroy) +{ + g_return_if_fail (E_IS_TREE_MODEL_GENERATOR (tree_model_generator)); + + tree_model_generator->priv->generate_func = func; + tree_model_generator->priv->generate_func_data = data; +} + +/** + * e_tree_model_generator_set_modify_func: + * @tree_model_generator: an #ETreeModelGenerator + * @func: an @ETreeModelGeneratorModifyFunc, or %NULL + * @data: user data to pass to @func + * @destroy: + * + * Sets the callback function used to override values for the child row's + * columns and specify values for generated rows' columns. + * + * If @func is %NULL, the child model's values will always be used. + **/ +void +e_tree_model_generator_set_modify_func (ETreeModelGenerator *tree_model_generator, + ETreeModelGeneratorModifyFunc func, + gpointer data, + GDestroyNotify destroy) +{ + g_return_if_fail (E_IS_TREE_MODEL_GENERATOR (tree_model_generator)); + + tree_model_generator->priv->modify_func = func; + tree_model_generator->priv->modify_func_data = data; +} + +/** + * e_tree_model_generator_convert_child_path_to_path: + * @tree_model_generator: an #ETreeModelGenerator + * @child_path: a #GtkTreePath + * + * Convert a path to a child row to a path to a @tree_model_generator row. + * + * Returns: A new GtkTreePath, owned by the caller. + **/ +GtkTreePath * +e_tree_model_generator_convert_child_path_to_path (ETreeModelGenerator *tree_model_generator, + GtkTreePath *child_path) +{ + GtkTreePath *path; + GArray *group; + gint depth; + + g_return_val_if_fail (E_IS_TREE_MODEL_GENERATOR (tree_model_generator), NULL); + g_return_val_if_fail (child_path != NULL, NULL); + + path = gtk_tree_path_new (); + + group = tree_model_generator->priv->root_nodes; + + for (depth = 0; depth < gtk_tree_path_get_depth (child_path); depth++) { + Node *node; + gint index; + gint generated_index; + + if (!group) { + g_warning ("ETreeModelGenerator was asked for path to unknown child element!"); + break; + } + + index = gtk_tree_path_get_indices (child_path)[depth]; + generated_index = child_offset_to_generated_offset (group, index); + node = &g_array_index (group, Node, index); + group = node->child_nodes; + + gtk_tree_path_append_index (path, generated_index); + } + + return path; +} + +/** + * e_tree_model_generator_convert_child_iter_to_iter: + * @tree_model_generator: an #ETreeModelGenerator + * @generator_iter: a #GtkTreeIter to set + * @child_iter: a #GtkTreeIter to convert + * + * Convert @child_iter to a corresponding #GtkTreeIter for @tree_model_generator, + * storing the result in @generator_iter. + **/ +void +e_tree_model_generator_convert_child_iter_to_iter (ETreeModelGenerator *tree_model_generator, + GtkTreeIter *generator_iter, + GtkTreeIter *child_iter) +{ + GtkTreePath *path; + GArray *group; + gint depth; + gint index = 0; + + g_return_if_fail (E_IS_TREE_MODEL_GENERATOR (tree_model_generator)); + + path = gtk_tree_model_get_path (tree_model_generator->priv->child_model, child_iter); + if (!path) + return; + + group = tree_model_generator->priv->root_nodes; + + for (depth = 0; depth < gtk_tree_path_get_depth (path); depth++) { + Node *node; + + index = gtk_tree_path_get_indices (path)[depth]; + node = &g_array_index (group, Node, index); + + if (depth + 1 < gtk_tree_path_get_depth (path)) + group = node->child_nodes; + + if (!group) { + g_warning ("ETreeModelGenerator was asked for iter to unknown child element!"); + break; + } + } + + g_return_if_fail (group != NULL); + + index = child_offset_to_generated_offset (group, index); + ITER_SET (tree_model_generator, generator_iter, group, index); + gtk_tree_path_free (path); +} + +/** + * e_tree_model_generator_convert_path_to_child_path: + * @tree_model_generator: an #ETreeModelGenerator + * @generator_path: a #GtkTreePath to a @tree_model_generator row + * + * Converts @generator_path to a corresponding #GtkTreePath in the child model. + * + * Returns: A new #GtkTreePath, owned by the caller. + **/ +GtkTreePath * +e_tree_model_generator_convert_path_to_child_path (ETreeModelGenerator *tree_model_generator, + GtkTreePath *generator_path) +{ + GtkTreePath *path; + GArray *group; + gint depth; + + g_return_val_if_fail (E_IS_TREE_MODEL_GENERATOR (tree_model_generator), NULL); + g_return_val_if_fail (generator_path != NULL, NULL); + + path = gtk_tree_path_new (); + + group = tree_model_generator->priv->root_nodes; + + for (depth = 0; depth < gtk_tree_path_get_depth (generator_path); depth++) { + Node *node; + gint index; + gint child_index; + + if (!group) { + g_warning ("ETreeModelGenerator was asked for path to unknown child element!"); + break; + } + + index = gtk_tree_path_get_indices (generator_path)[depth]; + child_index = generated_offset_to_child_offset (group, index, NULL); + node = &g_array_index (group, Node, child_index); + group = node->child_nodes; + + gtk_tree_path_append_index (path, child_index); + } + + return path; +} + +/** + * e_tree_model_generator_convert_iter_to_child_iter: + * @tree_model_generator: an #ETreeModelGenerator + * @child_iter: a #GtkTreeIter to set + * @permutation_n: a permutation index to set + * @generator_iter: a #GtkTreeIter indicating the row to convert + * + * Converts a @tree_model_generator row into a child row and permutation index. + * The permutation index is the index of the generated row based on this + * child row, with the first generated row based on this child row being 0. + **/ +void +e_tree_model_generator_convert_iter_to_child_iter (ETreeModelGenerator *tree_model_generator, + GtkTreeIter *child_iter, + gint *permutation_n, + GtkTreeIter *generator_iter) +{ + GtkTreePath *path; + GArray *group; + gint index; + gint internal_offset = 0; + + g_return_if_fail (E_IS_TREE_MODEL_GENERATOR (tree_model_generator)); + g_return_if_fail (ITER_IS_VALID (tree_model_generator, generator_iter)); + + path = gtk_tree_path_new (); + ITER_GET (generator_iter, &group, &index); + + index = generated_offset_to_child_offset (group, index, &internal_offset); + gtk_tree_path_prepend_index (path, index); + + while (group) { + Node *node = &g_array_index (group, Node, index); + + group = node->parent_group; + index = node->parent_index; + + if (group) + gtk_tree_path_prepend_index (path, index); + } + + if (child_iter) + gtk_tree_model_get_iter (tree_model_generator->priv->child_model, child_iter, path); + if (permutation_n) + *permutation_n = internal_offset; + + gtk_tree_path_free (path); +} + +/* ---------------- * + * GtkTreeModel API * + * ---------------- */ + +static GtkTreeModelFlags +e_tree_model_generator_get_flags (GtkTreeModel *tree_model) +{ + ETreeModelGenerator *tree_model_generator = E_TREE_MODEL_GENERATOR (tree_model); + + g_return_val_if_fail (E_IS_TREE_MODEL_GENERATOR (tree_model), 0); + + return gtk_tree_model_get_flags (tree_model_generator->priv->child_model); +} + +static gint +e_tree_model_generator_get_n_columns (GtkTreeModel *tree_model) +{ + ETreeModelGenerator *tree_model_generator = E_TREE_MODEL_GENERATOR (tree_model); + + g_return_val_if_fail (E_IS_TREE_MODEL_GENERATOR (tree_model), 0); + + return gtk_tree_model_get_n_columns (tree_model_generator->priv->child_model); +} + +static GType +e_tree_model_generator_get_column_type (GtkTreeModel *tree_model, + gint index) +{ + ETreeModelGenerator *tree_model_generator = E_TREE_MODEL_GENERATOR (tree_model); + + g_return_val_if_fail (E_IS_TREE_MODEL_GENERATOR (tree_model), G_TYPE_INVALID); + + return gtk_tree_model_get_column_type (tree_model_generator->priv->child_model, index); +} + +static gboolean +e_tree_model_generator_get_iter (GtkTreeModel *tree_model, + GtkTreeIter *iter, + GtkTreePath *path) +{ + ETreeModelGenerator *tree_model_generator = E_TREE_MODEL_GENERATOR (tree_model); + GArray *group; + gint depth; + gint index = 0; + + g_return_val_if_fail (E_IS_TREE_MODEL_GENERATOR (tree_model), FALSE); + g_return_val_if_fail (gtk_tree_path_get_depth (path) > 0, FALSE); + + group = tree_model_generator->priv->root_nodes; + if (!group) + return FALSE; + + for (depth = 0; depth < gtk_tree_path_get_depth (path); depth++) { + Node *node; + gint child_index; + + index = gtk_tree_path_get_indices (path)[depth]; + child_index = generated_offset_to_child_offset (group, index, NULL); + if (child_index < 0) + return FALSE; + + node = &g_array_index (group, Node, child_index); + + if (depth + 1 < gtk_tree_path_get_depth (path)) { + group = node->child_nodes; + if (!group) + return FALSE; + } + } + + ITER_SET (tree_model_generator, iter, group, index); + return TRUE; +} + +static GtkTreePath * +e_tree_model_generator_get_path (GtkTreeModel *tree_model, + GtkTreeIter *iter) +{ + ETreeModelGenerator *tree_model_generator = E_TREE_MODEL_GENERATOR (tree_model); + GtkTreePath *path; + GArray *group; + gint index; + + g_return_val_if_fail (E_IS_TREE_MODEL_GENERATOR (tree_model), NULL); + g_return_val_if_fail (ITER_IS_VALID (tree_model_generator, iter), NULL); + + ITER_GET (iter, &group, &index); + path = gtk_tree_path_new (); + + /* FIXME: Converting a path to an iter is a destructive operation, because + * we don't store a node for each generated entry... Doesn't matter for + * lists, not sure about trees. */ + + gtk_tree_path_prepend_index (path, index); + index = generated_offset_to_child_offset (group, index, NULL); + + while (group) { + Node *node = &g_array_index (group, Node, index); + gint generated_index; + + group = node->parent_group; + index = node->parent_index; + if (group) { + generated_index = child_offset_to_generated_offset (group, index); + gtk_tree_path_prepend_index (path, generated_index); + } + } + + return path; +} + +static gboolean +e_tree_model_generator_iter_next (GtkTreeModel *tree_model, + GtkTreeIter *iter) +{ + ETreeModelGenerator *tree_model_generator = E_TREE_MODEL_GENERATOR (tree_model); + Node *node; + GArray *group; + gint index; + gint child_index; + gint internal_offset = 0; + + g_return_val_if_fail (E_IS_TREE_MODEL_GENERATOR (tree_model), FALSE); + g_return_val_if_fail (ITER_IS_VALID (tree_model_generator, iter), FALSE); + + ITER_GET (iter, &group, &index); + child_index = generated_offset_to_child_offset (group, index, &internal_offset); + node = &g_array_index (group, Node, child_index); + + if (internal_offset + 1 < node->n_generated || + get_first_visible_index_from (group, child_index + 1) >= 0) { + ITER_SET (tree_model_generator, iter, group, index + 1); + return TRUE; + } + + return FALSE; +} + +static gboolean +e_tree_model_generator_iter_children (GtkTreeModel *tree_model, + GtkTreeIter *iter, + GtkTreeIter *parent) +{ + ETreeModelGenerator *tree_model_generator = E_TREE_MODEL_GENERATOR (tree_model); + Node *node; + GArray *group; + gint index; + + g_return_val_if_fail (E_IS_TREE_MODEL_GENERATOR (tree_model), FALSE); + + if (!parent) { + if (!tree_model_generator->priv->root_nodes || + !count_generated_nodes (tree_model_generator->priv->root_nodes)) + return FALSE; + + ITER_SET (tree_model_generator, iter, tree_model_generator->priv->root_nodes, 0); + return TRUE; + } + + ITER_GET (parent, &group, &index); + index = generated_offset_to_child_offset (group, index, NULL); + if (index < 0) + return FALSE; + + node = &g_array_index (group, Node, index); + + if (!node->child_nodes) + return FALSE; + + if (!count_generated_nodes (node->child_nodes)) + return FALSE; + + ITER_SET (tree_model_generator, iter, node->child_nodes, 0); + return TRUE; +} + +static gboolean +e_tree_model_generator_iter_has_child (GtkTreeModel *tree_model, + GtkTreeIter *iter) +{ + ETreeModelGenerator *tree_model_generator = E_TREE_MODEL_GENERATOR (tree_model); + Node *node; + GArray *group; + gint index; + + g_return_val_if_fail (E_IS_TREE_MODEL_GENERATOR (tree_model), FALSE); + + if (iter == NULL) { + if (!tree_model_generator->priv->root_nodes || + !count_generated_nodes (tree_model_generator->priv->root_nodes)) + return FALSE; + + return TRUE; + } + + ITER_GET (iter, &group, &index); + index = generated_offset_to_child_offset (group, index, NULL); + if (index < 0) + return FALSE; + + node = &g_array_index (group, Node, index); + + if (!node->child_nodes) + return FALSE; + + if (!count_generated_nodes (node->child_nodes)) + return FALSE; + + return TRUE; +} + +static gint +e_tree_model_generator_iter_n_children (GtkTreeModel *tree_model, + GtkTreeIter *iter) +{ + ETreeModelGenerator *tree_model_generator = E_TREE_MODEL_GENERATOR (tree_model); + Node *node; + GArray *group; + gint index; + + g_return_val_if_fail (E_IS_TREE_MODEL_GENERATOR (tree_model), 0); + + if (iter == NULL) + return tree_model_generator->priv->root_nodes ? + count_generated_nodes (tree_model_generator->priv->root_nodes) : 0; + + ITER_GET (iter, &group, &index); + index = generated_offset_to_child_offset (group, index, NULL); + if (index < 0) + return 0; + + node = &g_array_index (group, Node, index); + + if (!node->child_nodes) + return 0; + + return count_generated_nodes (node->child_nodes); +} + +static gboolean +e_tree_model_generator_iter_nth_child (GtkTreeModel *tree_model, + GtkTreeIter *iter, + GtkTreeIter *parent, + gint n) +{ + ETreeModelGenerator *tree_model_generator = E_TREE_MODEL_GENERATOR (tree_model); + Node *node; + GArray *group; + gint index; + + g_return_val_if_fail (E_IS_TREE_MODEL_GENERATOR (tree_model), FALSE); + + if (!parent) { + if (!tree_model_generator->priv->root_nodes) + return FALSE; + + if (n >= count_generated_nodes (tree_model_generator->priv->root_nodes)) + return FALSE; + + ITER_SET (tree_model_generator, iter, tree_model_generator->priv->root_nodes, n); + return TRUE; + } + + ITER_GET (parent, &group, &index); + index = generated_offset_to_child_offset (group, index, NULL); + if (index < 0) + return FALSE; + + node = &g_array_index (group, Node, index); + + if (!node->child_nodes) + return FALSE; + + if (n >= count_generated_nodes (node->child_nodes)) + return FALSE; + + ITER_SET (tree_model_generator, iter, node->child_nodes, n); + return TRUE; +} + +static gboolean +e_tree_model_generator_iter_parent (GtkTreeModel *tree_model, + GtkTreeIter *iter, + GtkTreeIter *child) +{ + ETreeModelGenerator *tree_model_generator = E_TREE_MODEL_GENERATOR (tree_model); + Node *node; + GArray *group; + gint index; + + g_return_val_if_fail (E_IS_TREE_MODEL_GENERATOR (tree_model), FALSE); + g_return_val_if_fail (ITER_IS_VALID (tree_model_generator, iter), FALSE); + + ITER_GET (child, &group, &index); + index = generated_offset_to_child_offset (group, index, NULL); + if (index < 0) + return FALSE; + + node = &g_array_index (group, Node, index); + + group = node->parent_group; + if (!group) + return FALSE; + + ITER_SET (tree_model_generator, iter, group, node->parent_index); + return TRUE; +} + +static void +e_tree_model_generator_get_value (GtkTreeModel *tree_model, + GtkTreeIter *iter, + gint column, + GValue *value) +{ + ETreeModelGenerator *tree_model_generator = E_TREE_MODEL_GENERATOR (tree_model); + GtkTreeIter child_iter; + gint permutation_n; + + g_return_if_fail (E_IS_TREE_MODEL_GENERATOR (tree_model)); + g_return_if_fail (ITER_IS_VALID (tree_model_generator, iter)); + + e_tree_model_generator_convert_iter_to_child_iter ( + tree_model_generator, &child_iter, + &permutation_n, iter); + + if (tree_model_generator->priv->modify_func) { + tree_model_generator->priv->modify_func (tree_model_generator->priv->child_model, + &child_iter, permutation_n, + column, value, + tree_model_generator->priv->modify_func_data); + return; + } + + gtk_tree_model_get_value (tree_model_generator->priv->child_model, &child_iter, column, value); +} diff --git a/e-util/e-tree-model-generator.h b/e-util/e-tree-model-generator.h new file mode 100644 index 0000000000..e85a1adc12 --- /dev/null +++ b/e-util/e-tree-model-generator.h @@ -0,0 +1,104 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ + +/* e-tree-model-generator.h - Model wrapper that permutes underlying rows. + * + * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU Lesser General Public + * License as published by the Free Software Foundation. + * + * 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 this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * Authors: Hans Petter Jansson <hpj@novell.com> + */ + +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + +#ifndef E_TREE_MODEL_GENERATOR_H +#define E_TREE_MODEL_GENERATOR_H + +#include <gtk/gtk.h> + +/* Standard GObject macros */ +#define E_TYPE_TREE_MODEL_GENERATOR \ + (e_tree_model_generator_get_type ()) +#define E_TREE_MODEL_GENERATOR(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST \ + ((obj), E_TYPE_TREE_MODEL_GENERATOR, ETreeModelGenerator)) +#define E_TREE_MODEL_GENERATOR_CLASS(cls) \ + (G_TYPE_CHECK_CLASS_CAST \ + ((cls), E_TYPE_TREE_MODEL_GENERATOR, ETreeModelGeneratorClass)) +#define E_IS_TREE_MODEL_GENERATOR(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE \ + ((obj), E_TYPE_TREE_MODEL_GENERATOR)) +#define E_IS_TREE_MODEL_GENERATOR_CLASS(cls) \ + (G_TYPE_CHECK_CLASS_TYPE \ + ((cls), E_TYPE_TREE_MODEL_GENERATOR)) +#define E_TREE_MODEL_GENERATOR_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS \ + ((obj), E_TYPE_TREE_MODEL_GENERATOR, ETreeModelGeneratorClass)) + +G_BEGIN_DECLS + +typedef gint (*ETreeModelGeneratorGenerateFunc) (GtkTreeModel *model, GtkTreeIter *child_iter, + gpointer data); +typedef void (*ETreeModelGeneratorModifyFunc) (GtkTreeModel *model, GtkTreeIter *child_iter, + gint permutation_n, gint column, GValue *value, + gpointer data); + +typedef struct _ETreeModelGenerator ETreeModelGenerator; +typedef struct _ETreeModelGeneratorClass ETreeModelGeneratorClass; +typedef struct _ETreeModelGeneratorPrivate ETreeModelGeneratorPrivate; + +struct _ETreeModelGenerator { + GObject parent; + ETreeModelGeneratorPrivate *priv; +}; + +struct _ETreeModelGeneratorClass { + GObjectClass parent_class; +}; + +GType e_tree_model_generator_get_type (void); +ETreeModelGenerator * + e_tree_model_generator_new (GtkTreeModel *child_model); +GtkTreeModel * e_tree_model_generator_get_model (ETreeModelGenerator *tree_model_generator); +void e_tree_model_generator_set_generate_func + (ETreeModelGenerator *tree_model_generator, + ETreeModelGeneratorGenerateFunc func, + gpointer data, + GDestroyNotify destroy); +void e_tree_model_generator_set_modify_func + (ETreeModelGenerator *tree_model_generator, + ETreeModelGeneratorModifyFunc func, + gpointer data, + GDestroyNotify destroy); +GtkTreePath * e_tree_model_generator_convert_child_path_to_path + (ETreeModelGenerator *tree_model_generator, + GtkTreePath *child_path); +void e_tree_model_generator_convert_child_iter_to_iter + (ETreeModelGenerator *tree_model_generator, + GtkTreeIter *generator_iter, + GtkTreeIter *child_iter); +GtkTreePath * e_tree_model_generator_convert_path_to_child_path + (ETreeModelGenerator *tree_model_generator, + GtkTreePath *generator_path); +void e_tree_model_generator_convert_iter_to_child_iter + (ETreeModelGenerator *tree_model_generator, + GtkTreeIter *child_iter, + gint *permutation_n, + GtkTreeIter *generator_iter); + +G_END_DECLS + +#endif /* E_TREE_MODEL_GENERATOR_H */ diff --git a/widgets/table/e-tree-model.c b/e-util/e-tree-model.c index 944572dfb4..db763cf782 100644 --- a/widgets/table/e-tree-model.c +++ b/e-util/e-tree-model.c @@ -25,6 +25,8 @@ #include <config.h> #endif +#include "e-tree-model.h" + #include <stdio.h> #include <stdlib.h> #include <unistd.h> @@ -34,10 +36,8 @@ #include <libxml/parser.h> #include <libxml/xmlmemory.h> -#include "e-util/e-util.h" -#include "libevolution-utils/e-xml-utils.h" - -#include "e-tree-model.h" +#include "e-marshal.h" +#include "e-xml-utils.h" #define ETM_CLASS(e) (E_TREE_MODEL_GET_CLASS(e)) diff --git a/widgets/table/e-tree-model.h b/e-util/e-tree-model.h index f857e52a49..1d02615a45 100644 --- a/widgets/table/e-tree-model.h +++ b/e-util/e-tree-model.h @@ -22,6 +22,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef _E_TREE_MODEL_H_ #define _E_TREE_MODEL_H_ diff --git a/widgets/table/e-tree-selection-model.c b/e-util/e-tree-selection-model.c index 33e4ab0780..480b5a4e8a 100644 --- a/widgets/table/e-tree-selection-model.c +++ b/e-util/e-tree-selection-model.c @@ -25,11 +25,11 @@ #include <config.h> #endif -#include "table/e-tree-table-adapter.h" +#include "e-tree-selection-model.h" + #include <glib/gi18n.h> -#include "e-util/e-util.h" -#include "e-tree-selection-model.h" +#include "e-tree-table-adapter.h" #define E_TREE_SELECTION_MODEL_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ diff --git a/widgets/table/e-tree-selection-model.h b/e-util/e-tree-selection-model.h index 1541fcb95a..eafa66eba5 100644 --- a/widgets/table/e-tree-selection-model.h +++ b/e-util/e-tree-selection-model.h @@ -20,12 +20,16 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef _E_TREE_SELECTION_MODEL_H_ #define _E_TREE_SELECTION_MODEL_H_ +#include <e-util/e-selection-model.h> #include <e-util/e-sorter.h> -#include <misc/e-selection-model.h> -#include <table/e-tree-model.h> +#include <e-util/e-tree-model.h> /* Standard GObject macros */ #define E_TYPE_TREE_SELECTION_MODEL \ diff --git a/widgets/table/e-tree-sorted.c b/e-util/e-tree-sorted.c index 0b8f1c4447..25cfceb337 100644 --- a/widgets/table/e-tree-sorted.c +++ b/e-util/e-tree-sorted.c @@ -29,6 +29,8 @@ #include <config.h> #endif +#include "e-tree-sorted.h" + #include <stdio.h> #include <errno.h> #include <stdlib.h> @@ -39,11 +41,8 @@ #include <libxml/parser.h> #include <libxml/xmlmemory.h> -#include "e-util/e-util.h" -#include "libevolution-utils/e-xml-utils.h" - #include "e-table-sorting-utils.h" -#include "e-tree-sorted.h" +#include "e-xml-utils.h" /* maximum insertions between an idle event that we will do without scheduling an idle sort */ #define ETS_INSERT_MAX (4) diff --git a/widgets/table/e-tree-sorted.h b/e-util/e-tree-sorted.h index 456ee15d14..b6dacaf9d6 100644 --- a/widgets/table/e-tree-sorted.h +++ b/e-util/e-tree-sorted.h @@ -21,13 +21,18 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef _E_TREE_SORTED_H_ #define _E_TREE_SORTED_H_ #include <gdk-pixbuf/gdk-pixbuf.h> -#include <table/e-tree-model.h> -#include <table/e-table-sort-info.h> -#include <table/e-table-header.h> + +#include <e-util/e-table-header.h> +#include <e-util/e-table-sort-info.h> +#include <e-util/e-tree-model.h> /* Standard GObject macros */ #define E_TYPE_TREE_SORTED \ diff --git a/widgets/table/e-tree-table-adapter.c b/e-util/e-tree-table-adapter.c index c610039c83..f76f11b26a 100644 --- a/widgets/table/e-tree-table-adapter.c +++ b/e-util/e-tree-table-adapter.c @@ -25,20 +25,21 @@ #include <config.h> #endif +#include "e-tree-table-adapter.h" + #include <stdlib.h> #include <string.h> #include <glib/gstdio.h> + #include <libxml/tree.h> #include <libxml/parser.h> #include <libedataserver/libedataserver.h> -#include "e-util/e-util.h" -#include "libevolution-utils/e-xml-utils.h" - +#include "e-marshal.h" #include "e-table-sorting-utils.h" -#include "e-tree-table-adapter.h" +#include "e-xml-utils.h" #define E_TREE_TABLE_ADAPTER_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ diff --git a/widgets/table/e-tree-table-adapter.h b/e-util/e-tree-table-adapter.h index ea7b86b21d..17f3304aa4 100644 --- a/widgets/table/e-tree-table-adapter.h +++ b/e-util/e-tree-table-adapter.h @@ -21,15 +21,20 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef _E_TREE_TABLE_ADAPTER_H_ #define _E_TREE_TABLE_ADAPTER_H_ -#include <table/e-table-model.h> -#include <table/e-tree-model.h> -#include <table/e-table-sort-info.h> -#include <table/e-table-header.h> #include <libxml/tree.h> +#include <e-util/e-table-header.h> +#include <e-util/e-table-model.h> +#include <e-util/e-table-sort-info.h> +#include <e-util/e-tree-model.h> + /* Standard GObject macros */ #define E_TYPE_TREE_TABLE_ADAPTER \ (e_tree_table_adapter_get_type ()) diff --git a/widgets/table/e-tree.c b/e-util/e-tree.c index 78eef72746..ee451cd28a 100644 --- a/widgets/table/e-tree.c +++ b/e-util/e-tree.c @@ -28,31 +28,31 @@ #include <stdio.h> #include <string.h> -#include <gdk/gdkkeysyms.h> #include <gtk/gtk.h> -#include <libgnomecanvas/libgnomecanvas.h> - -#include "gal-a11y-e-tree.h" #include <glib/gi18n.h> -#include "e-util/e-util.h" -#include "misc/e-canvas.h" -#include "misc/e-canvas-utils.h" -#include "misc/e-canvas-background.h" -#include "text/e-text.h" +#include <gdk/gdkkeysyms.h> + +#include <libgnomecanvas/libgnomecanvas.h> +#include "e-canvas-background.h" +#include "e-canvas-utils.h" +#include "e-canvas.h" #include "e-table-column-specification.h" #include "e-table-header-item.h" #include "e-table-header.h" #include "e-table-item.h" #include "e-table-sort-info.h" #include "e-table-utils.h" +#include "e-text.h" +#include "e-tree-table-adapter.h" +#include "e-tree.h" +#include "gal-a11y-e-tree.h" + #ifdef E_TREE_USE_TREE_SELECTION #include "e-tree-selection-model.h" #else #include "e-table-selection-model.h" #endif -#include "e-tree.h" -#include "e-tree-table-adapter.h" #define COLUMN_HEADER_HEIGHT 16 diff --git a/widgets/table/e-tree.h b/e-util/e-tree.h index f3d1f9f6a7..1d6243cc61 100644 --- a/widgets/table/e-tree.h +++ b/e-util/e-tree.h @@ -20,25 +20,29 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef _E_TREE_H_ #define _E_TREE_H_ #include <gtk/gtk.h> #include <libxml/tree.h> #include <libgnomecanvas/libgnomecanvas.h> -#include <misc/e-printable.h> -#include <table/e-table-extras.h> -#include <table/e-table-specification.h> -#include <table/e-table-state.h> -#include <table/e-tree-model.h> -#include <table/e-tree-table-adapter.h> -#include <table/e-table-item.h> +#include <e-util/e-printable.h> +#include <e-util/e-table-extras.h> +#include <e-util/e-table-item.h> +#include <e-util/e-table-specification.h> +#include <e-util/e-table-state.h> +#include <e-util/e-tree-model.h> +#include <e-util/e-tree-table-adapter.h> #define E_TREE_USE_TREE_SELECTION #ifdef E_TREE_USE_TREE_SELECTION -#include <table/e-tree-selection-model.h> +#include <e-util/e-tree-selection-model.h> #endif /* Standard GObject macros */ diff --git a/e-util/e-ui-manager.c b/e-util/e-ui-manager.c index 3308b500d2..e494d351a6 100644 --- a/e-util/e-ui-manager.c +++ b/e-util/e-ui-manager.c @@ -19,7 +19,7 @@ /** * SECTION: e-ui-manager * @short_description: construct menus and toolbars from a UI definition - * @include: e-util/e-ui-manager.h + * @include: e-util/e-util.h * * This is a #GtkUIManager with support for Evolution's "express" mode, * which influences the parsing of UI definitions. diff --git a/e-util/e-ui-manager.h b/e-util/e-ui-manager.h index 9b1f389d76..4c295888d0 100644 --- a/e-util/e-ui-manager.h +++ b/e-util/e-ui-manager.h @@ -16,6 +16,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_UI_MANAGER_H #define E_UI_MANAGER_H diff --git a/e-util/e-unicode.h b/e-util/e-unicode.h index c519c2e6e2..2901744f8b 100644 --- a/e-util/e-unicode.h +++ b/e-util/e-unicode.h @@ -22,6 +22,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef _E_UNICODE_H_ #define _E_UNICODE_H_ diff --git a/widgets/misc/e-url-entry.c b/e-util/e-url-entry.c index 68b8a8fac0..7752732ccc 100644 --- a/widgets/misc/e-url-entry.c +++ b/e-util/e-url-entry.c @@ -24,10 +24,12 @@ #include <config.h> #endif +#include "e-url-entry.h" + #include <gtk/gtk.h> #include <glib/gi18n.h> -#include "e-url-entry.h" -#include "e-util/e-util.h" + +#include "e-misc-utils.h" #define E_URL_ENTRY_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ diff --git a/widgets/misc/e-url-entry.h b/e-util/e-url-entry.h index 2393f823ac..0925287b63 100644 --- a/widgets/misc/e-url-entry.h +++ b/e-util/e-url-entry.h @@ -20,6 +20,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef _E_URL_ENTRY_H_ #define _E_URL_ENTRY_H_ diff --git a/e-util/e-util-enums.h b/e-util/e-util-enums.h index 5f5ef75587..b2da504fb2 100644 --- a/e-util/e-util-enums.h +++ b/e-util/e-util-enums.h @@ -16,6 +16,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_UTIL_ENUMS_H #define E_UTIL_ENUMS_H diff --git a/e-util/e-util.h b/e-util/e-util.h index fa98153223..a5ab42bd3b 100644 --- a/e-util/e-util.h +++ b/e-util/e-util.h @@ -1,4 +1,6 @@ /* + * e-util.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 @@ -12,145 +14,229 @@ * 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: - * Chris Lahey <clahey@ximian.com> - * - * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) - * */ #ifndef E_UTIL_H #define E_UTIL_H -#include <sys/types.h> -#include <gtk/gtk.h> -#include <limits.h> +#define __E_UTIL_H_INSIDE__ #include <libedataserver/libedataserver.h> -#include <libevolution-utils/evolution-util.h> - -#include <e-util/e-marshal.h> +#include <e-util/e-action-combo-box.h> +#include <e-util/e-activity-bar.h> +#include <e-util/e-activity-proxy.h> +#include <e-util/e-activity.h> +#include <e-util/e-alarm-selector.h> +#include <e-util/e-alert-bar.h> +#include <e-util/e-alert-dialog.h> +#include <e-util/e-alert-sink.h> +#include <e-util/e-alert.h> +#include <e-util/e-attachment-bar.h> +#include <e-util/e-attachment-button.h> +#include <e-util/e-attachment-dialog.h> +#include <e-util/e-attachment-handler-image.h> +#include <e-util/e-attachment-handler-sendto.h> +#include <e-util/e-attachment-handler.h> +#include <e-util/e-attachment-icon-view.h> +#include <e-util/e-attachment-paned.h> +#include <e-util/e-attachment-store.h> +#include <e-util/e-attachment-tree-view.h> +#include <e-util/e-attachment-view.h> +#include <e-util/e-attachment.h> +#include <e-util/e-auth-combo-box.h> +#include <e-util/e-autocomplete-selector.h> +#include <e-util/e-bit-array.h> +#include <e-util/e-book-source-config.h> +#include <e-util/e-buffer-tagger.h> +#include <e-util/e-cal-source-config.h> +#include <e-util/e-calendar-item.h> +#include <e-util/e-calendar.h> +#include <e-util/e-canvas-background.h> +#include <e-util/e-canvas-utils.h> +#include <e-util/e-canvas-vbox.h> +#include <e-util/e-canvas.h> +#include <e-util/e-categories-config.h> +#include <e-util/e-categories-dialog.h> +#include <e-util/e-categories-editor.h> +#include <e-util/e-categories-selector.h> +#include <e-util/e-category-completion.h> +#include <e-util/e-category-editor.h> +#include <e-util/e-cell-checkbox.h> +#include <e-util/e-cell-combo.h> +#include <e-util/e-cell-date-edit.h> +#include <e-util/e-cell-date.h> +#include <e-util/e-cell-hbox.h> +#include <e-util/e-cell-number.h> +#include <e-util/e-cell-percent.h> +#include <e-util/e-cell-pixbuf.h> +#include <e-util/e-cell-popup.h> +#include <e-util/e-cell-renderer-color.h> +#include <e-util/e-cell-size.h> +#include <e-util/e-cell-text.h> +#include <e-util/e-cell-toggle.h> +#include <e-util/e-cell-tree.h> +#include <e-util/e-cell-vbox.h> +#include <e-util/e-cell.h> +#include <e-util/e-charset-combo-box.h> +#include <e-util/e-charset.h> +#include <e-util/e-client-utils.h> +#include <e-util/e-config.h> +#include <e-util/e-contact-map-window.h> +#include <e-util/e-contact-map.h> +#include <e-util/e-contact-marker.h> +#include <e-util/e-contact-store.h> +#include <e-util/e-dateedit.h> +#include <e-util/e-datetime-format.h> +#include <e-util/e-destination-store.h> +#include <e-util/e-dialog-utils.h> +#include <e-util/e-dialog-widgets.h> +#include <e-util/e-event.h> +#include <e-util/e-file-request.h> +#include <e-util/e-file-utils.h> +#include <e-util/e-filter-code.h> +#include <e-util/e-filter-color.h> +#include <e-util/e-filter-datespec.h> +#include <e-util/e-filter-element.h> +#include <e-util/e-filter-file.h> +#include <e-util/e-filter-input.h> +#include <e-util/e-filter-int.h> +#include <e-util/e-filter-option.h> +#include <e-util/e-filter-part.h> +#include <e-util/e-filter-rule.h> +#include <e-util/e-focus-tracker.h> +#include <e-util/e-html-utils.h> +#include <e-util/e-icon-factory.h> +#include <e-util/e-image-chooser.h> +#include <e-util/e-import-assistant.h> +#include <e-util/e-import.h> +#include <e-util/e-interval-chooser.h> +#include <e-util/e-mail-identity-combo-box.h> +#include <e-util/e-mail-signature-combo-box.h> +#include <e-util/e-mail-signature-editor.h> +#include <e-util/e-mail-signature-manager.h> +#include <e-util/e-mail-signature-preview.h> +#include <e-util/e-mail-signature-script-dialog.h> +#include <e-util/e-mail-signature-tree-view.h> +#include <e-util/e-map.h> +#include <e-util/e-menu-tool-action.h> +#include <e-util/e-menu-tool-button.h> +#include <e-util/e-misc-utils.h> +#include <e-util/e-mktemp.h> +#include <e-util/e-name-selector-dialog.h> +#include <e-util/e-name-selector-entry.h> +#include <e-util/e-name-selector-list.h> +#include <e-util/e-name-selector-model.h> +#include <e-util/e-name-selector.h> +#include <e-util/e-online-button.h> +#include <e-util/e-paned.h> +#include <e-util/e-passwords.h> +#include <e-util/e-picture-gallery.h> +#include <e-util/e-plugin-ui.h> +#include <e-util/e-plugin.h> +#include <e-util/e-poolv.h> +#include <e-util/e-popup-action.h> +#include <e-util/e-popup-menu.h> +#include <e-util/e-port-entry.h> +#include <e-util/e-preferences-window.h> +#include <e-util/e-preview-pane.h> +#include <e-util/e-print.h> +#include <e-util/e-printable.h> +#include <e-util/e-reflow-model.h> +#include <e-util/e-reflow.h> +#include <e-util/e-rule-context.h> +#include <e-util/e-rule-editor.h> +#include <e-util/e-search-bar.h> +#include <e-util/e-selectable.h> +#include <e-util/e-selection-model-array.h> +#include <e-util/e-selection-model-simple.h> +#include <e-util/e-selection-model.h> +#include <e-util/e-selection.h> +#include <e-util/e-send-options.h> +#include <e-util/e-sorter-array.h> +#include <e-util/e-sorter.h> +#include <e-util/e-source-combo-box.h> +#include <e-util/e-source-config-backend.h> +#include <e-util/e-source-config-dialog.h> +#include <e-util/e-source-config.h> +#include <e-util/e-source-selector-dialog.h> +#include <e-util/e-source-selector.h> +#include <e-util/e-source-util.h> +#include <e-util/e-spell-entry.h> +#include <e-util/e-stock-request.h> +#include <e-util/e-table-click-to-add.h> +#include <e-util/e-table-col-dnd.h> +#include <e-util/e-table-col.h> +#include <e-util/e-table-column-specification.h> +#include <e-util/e-table-config.h> +#include <e-util/e-table-defines.h> +#include <e-util/e-table-extras.h> +#include <e-util/e-table-field-chooser-dialog.h> +#include <e-util/e-table-field-chooser-item.h> +#include <e-util/e-table-field-chooser.h> +#include <e-util/e-table-group-container.h> +#include <e-util/e-table-group-leaf.h> +#include <e-util/e-table-group.h> +#include <e-util/e-table-header-item.h> +#include <e-util/e-table-header-utils.h> +#include <e-util/e-table-header.h> +#include <e-util/e-table-item.h> +#include <e-util/e-table-memory-callbacks.h> +#include <e-util/e-table-memory-store.h> +#include <e-util/e-table-memory.h> +#include <e-util/e-table-model.h> +#include <e-util/e-table-one.h> +#include <e-util/e-table-search.h> +#include <e-util/e-table-selection-model.h> +#include <e-util/e-table-sort-info.h> +#include <e-util/e-table-sorted-variable.h> +#include <e-util/e-table-sorted.h> +#include <e-util/e-table-sorter.h> +#include <e-util/e-table-sorting-utils.h> +#include <e-util/e-table-specification.h> +#include <e-util/e-table-state.h> +#include <e-util/e-table-subset-variable.h> +#include <e-util/e-table-subset.h> +#include <e-util/e-table-utils.h> +#include <e-util/e-table-without.h> +#include <e-util/e-table.h> +#include <e-util/e-text-event-processor-emacs-like.h> +#include <e-util/e-text-event-processor-types.h> +#include <e-util/e-text-event-processor.h> +#include <e-util/e-text-model-repos.h> +#include <e-util/e-text-model.h> +#include <e-util/e-text.h> +#include <e-util/e-timezone-dialog.h> +#include <e-util/e-tree-memory-callbacks.h> +#include <e-util/e-tree-memory.h> +#include <e-util/e-tree-model-generator.h> +#include <e-util/e-tree-model.h> +#include <e-util/e-tree-selection-model.h> +#include <e-util/e-tree-sorted.h> +#include <e-util/e-tree-table-adapter.h> +#include <e-util/e-tree.h> +#include <e-util/e-ui-manager.h> +#include <e-util/e-unicode.h> +#include <e-util/e-url-entry.h> #include <e-util/e-util-enums.h> - -G_BEGIN_DECLS - -typedef enum { - E_FOCUS_NONE, - E_FOCUS_CURRENT, - E_FOCUS_START, - E_FOCUS_END -} EFocus; - -typedef enum { - E_RESTORE_WINDOW_SIZE = 1 << 0, - E_RESTORE_WINDOW_POSITION = 1 << 1 -} ERestoreWindowFlags; - -const gchar * e_get_accels_filename (void); -void e_show_uri (GtkWindow *parent, - const gchar *uri); -void e_display_help (GtkWindow *parent, - const gchar *link_id); -void e_restore_window (GtkWindow *window, - const gchar *settings_path, - ERestoreWindowFlags flags); -GtkAction * e_lookup_action (GtkUIManager *ui_manager, - const gchar *action_name); -GtkActionGroup *e_lookup_action_group (GtkUIManager *ui_manager, - const gchar *group_name); -gint e_action_compare_by_label (GtkAction *action1, - GtkAction *action2); -void e_action_group_remove_all_actions - (GtkActionGroup *action_group); -GtkRadioAction *e_radio_action_get_current_action - (GtkRadioAction *radio_action); -void e_action_group_add_actions_localized - (GtkActionGroup *action_group, - const gchar *translation_domain, - const GtkActionEntry *entries, - guint n_entries, - gpointer user_data); -void e_categories_add_change_hook (GHookFunc func, - gpointer object); - -gchar * e_str_without_underscores (const gchar *string); -gint e_str_compare (gconstpointer x, - gconstpointer y); -gint e_str_case_compare (gconstpointer x, - gconstpointer y); -gint e_collate_compare (gconstpointer x, - gconstpointer y); -gint e_int_compare (gconstpointer x, - gconstpointer y); -guint32 e_color_to_value (GdkColor *color); - -guint32 e_rgba_to_value (GdkRGBA *rgba); - -/* This only makes a filename safe for usage as a filename. - * It still may have shell meta-characters in it. */ -gchar * e_format_number (gint number); - -typedef gint (*ESortCompareFunc) (gconstpointer first, - gconstpointer second, - gpointer closure); - -void e_bsearch (gconstpointer key, - gconstpointer base, - gsize nmemb, - gsize size, - ESortCompareFunc compare, - gpointer closure, - gsize *start, - gsize *end); - -gsize e_strftime_fix_am_pm (gchar *str, - gsize max, - const gchar *fmt, - const struct tm *tm); -gsize e_utf8_strftime_fix_am_pm (gchar *str, - gsize max, - const gchar *fmt, - const struct tm *tm); -const gchar * e_get_month_name (GDateMonth month, - gboolean abbreviated); -const gchar * e_get_weekday_name (GDateWeekday weekday, - gboolean abbreviated); - -gboolean e_file_lock_create (void); -void e_file_lock_destroy (void); -gboolean e_file_lock_exists (void); - -gchar * e_util_guess_mime_type (const gchar *filename, - gboolean localfile); - -GSList * e_util_get_category_filter_options - (void); -GList * e_util_get_searchable_categories (void); - -/* Useful GBinding transform functions */ -gboolean e_binding_transform_color_to_string - (GBinding *binding, - const GValue *source_value, - GValue *target_value, - gpointer not_used); -gboolean e_binding_transform_string_to_color - (GBinding *binding, - const GValue *source_value, - GValue *target_value, - gpointer not_used); -gboolean e_binding_transform_source_to_uid - (GBinding *binding, - const GValue *source_value, - GValue *target_value, - ESourceRegistry *registry); -gboolean e_binding_transform_uid_to_source - (GBinding *binding, - const GValue *source_value, - GValue *target_value, - ESourceRegistry *registry); - -G_END_DECLS +#include <e-util/e-web-view-gtkhtml.h> +#include <e-util/e-web-view-preview.h> +#include <e-util/e-web-view.h> +#include <e-util/e-xml-utils.h> +#include <e-util/ea-cell-table.h> +#include <e-util/ea-factory.h> +#include <e-util/gal-define-views-dialog.h> +#include <e-util/gal-define-views-model.h> +#include <e-util/gal-view-collection.h> +#include <e-util/gal-view-etable.h> +#include <e-util/gal-view-factory-etable.h> +#include <e-util/gal-view-factory.h> +#include <e-util/gal-view-instance-save-as-dialog.h> +#include <e-util/gal-view-instance.h> +#include <e-util/gal-view-new-dialog.h> +#include <e-util/gal-view.h> + +#undef __E_UTIL_H_INSIDE__ #endif /* E_UTIL_H */ + diff --git a/widgets/misc/e-web-view-gtkhtml.c b/e-util/e-web-view-gtkhtml.c index fddbd9ee90..7303277f6a 100644 --- a/widgets/misc/e-web-view-gtkhtml.c +++ b/e-util/e-web-view-gtkhtml.c @@ -28,11 +28,10 @@ #include <camel/camel.h> #include <libebackend/libebackend.h> -#include <e-util/e-util.h> -#include <e-util/e-plugin-ui.h> -#include <libevolution-utils/e-alert-dialog.h> -#include <libevolution-utils/e-alert-sink.h> - +#include "e-alert-dialog.h" +#include "e-alert-sink.h" +#include "e-misc-utils.h" +#include "e-plugin-ui.h" #include "e-popup-action.h" #include "e-selectable.h" diff --git a/widgets/misc/e-web-view-gtkhtml.h b/e-util/e-web-view-gtkhtml.h index aab06e8b54..ebe965c61b 100644 --- a/widgets/misc/e-web-view-gtkhtml.h +++ b/e-util/e-web-view-gtkhtml.h @@ -24,6 +24,10 @@ * This class handles basic tasks like mouse hovers over links, clicked * links, and servicing URI requests asynchronously via GIO. */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_WEB_VIEW_GTKHTML_H #define E_WEB_VIEW_GTKHTML_H diff --git a/widgets/misc/e-web-view-preview.c b/e-util/e-web-view-preview.c index b75814fa83..b75814fa83 100644 --- a/widgets/misc/e-web-view-preview.c +++ b/e-util/e-web-view-preview.c diff --git a/widgets/misc/e-web-view-preview.h b/e-util/e-web-view-preview.h index 07c78ff182..54963b6fe6 100644 --- a/widgets/misc/e-web-view-preview.h +++ b/e-util/e-web-view-preview.h @@ -34,10 +34,14 @@ * and the content of the EWebView is updated. */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_WEB_VIEW_PREVIEW_H #define E_WEB_VIEW_PREVIEW_H -#include <misc/e-web-view.h> +#include <e-util/e-web-view.h> /* Standard GObject macros */ #define E_TYPE_WEB_VIEW_PREVIEW \ diff --git a/widgets/misc/e-web-view.c b/e-util/e-web-view.c index 0d0903c7bd..2fefe4fa95 100644 --- a/widgets/misc/e-web-view.c +++ b/e-util/e-web-view.c @@ -24,6 +24,7 @@ #include <math.h> +#include <stdlib.h> #include <string.h> #include <glib/gi18n-lib.h> #include <pango/pango.h> @@ -31,20 +32,18 @@ #include <camel/camel.h> #include <libebackend/libebackend.h> -#include <e-util/e-util.h> -#include <libevolution-utils/e-alert-dialog.h> -#include <libevolution-utils/e-alert-sink.h> -#include <e-util/e-plugin-ui.h> -#include <e-util/e-file-request.h> -#include <e-util/e-stock-request.h> - #define LIBSOUP_USE_UNSTABLE_REQUEST_API #include <libsoup/soup.h> #include <libsoup/soup-requester.h> +#include "e-alert-dialog.h" +#include "e-alert-sink.h" +#include "e-file-request.h" +#include "e-misc-utils.h" +#include "e-plugin-ui.h" #include "e-popup-action.h" #include "e-selectable.h" -#include <stdlib.h> +#include "e-stock-request.h" #define E_WEB_VIEW_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ diff --git a/widgets/misc/e-web-view.h b/e-util/e-web-view.h index fe17d621c0..6690725b86 100644 --- a/widgets/misc/e-web-view.h +++ b/e-util/e-web-view.h @@ -24,6 +24,10 @@ * This class handles basic tasks like mouse hovers over links, clicked * links, and servicing URI requests asynchronously via GIO. */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef E_WEB_VIEW_H #define E_WEB_VIEW_H diff --git a/libevolution-utils/e-xml-utils.c b/e-util/e-xml-utils.c index 23113235e8..aaa66b6010 100644 --- a/libevolution-utils/e-xml-utils.c +++ b/e-util/e-xml-utils.c @@ -24,6 +24,8 @@ #include <config.h> #endif +#include "e-xml-utils.h" + #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -41,8 +43,7 @@ #include <libxml/parser.h> #include <libxml/xmlmemory.h> -#include "evolution-util.h" -#include "e-xml-utils.h" +#include "e-misc-utils.h" /* Returns the first child with the name child_name and the "lang" * attribute that matches the current LC_MESSAGES, or else, the first diff --git a/libevolution-utils/e-xml-utils.h b/e-util/e-xml-utils.h index 9796569774..9796569774 100644 --- a/libevolution-utils/e-xml-utils.h +++ b/e-util/e-xml-utils.h diff --git a/widgets/misc/ea-calendar-cell.c b/e-util/ea-calendar-cell.c index 90a889ef18..a9784df31a 100644 --- a/widgets/misc/ea-calendar-cell.c +++ b/e-util/ea-calendar-cell.c @@ -26,10 +26,9 @@ #endif #include <gtk/gtk.h> -#include <e-util/e-util.h> #include "ea-calendar-cell.h" #include "ea-calendar-item.h" -#include "a11y/ea-factory.h" +#include "ea-factory.h" /* ECalendarCell */ diff --git a/widgets/misc/ea-calendar-cell.h b/e-util/ea-calendar-cell.h index 2fd2051538..2d228c2a74 100644 --- a/widgets/misc/ea-calendar-cell.h +++ b/e-util/ea-calendar-cell.h @@ -20,11 +20,15 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef __EA_CALENDAR_CELL_H__ #define __EA_CALENDAR_CELL_H__ #include <atk/atkgobjectaccessible.h> -#include "misc/e-calendar-item.h" +#include <e-util/e-calendar-item.h> G_BEGIN_DECLS diff --git a/widgets/misc/ea-calendar-item.c b/e-util/ea-calendar-item.c index dc878c4e1d..2f5ac91d5b 100644 --- a/widgets/misc/ea-calendar-item.c +++ b/e-util/ea-calendar-item.c @@ -28,7 +28,6 @@ #include <time.h> #include <string.h> #include <libgnomecanvas/gnome-canvas.h> -#include <e-util/e-util.h> #include <glib/gi18n.h> #include <libedataserver/libedataserver.h> @@ -37,6 +36,8 @@ #include "ea-calendar-cell.h" #include "ea-cell-table.h" +#include "e-misc-utils.h" + #define EA_CALENDAR_COLUMN_NUM E_CALENDAR_COLS_PER_MONTH /* EaCalendarItem */ diff --git a/widgets/misc/ea-calendar-item.h b/e-util/ea-calendar-item.h index b5271a9f8b..db2e342020 100644 --- a/widgets/misc/ea-calendar-item.h +++ b/e-util/ea-calendar-item.h @@ -20,11 +20,15 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef __EA_CALENDAR_ITEM_H__ #define __EA_CALENDAR_ITEM_H__ #include <atk/atkgobjectaccessible.h> -#include <misc/e-calendar-item.h> +#include <e-util/e-calendar-item.h> G_BEGIN_DECLS diff --git a/widgets/misc/ea-cell-table.c b/e-util/ea-cell-table.c index bbdef0aea1..bbdef0aea1 100644 --- a/widgets/misc/ea-cell-table.c +++ b/e-util/ea-cell-table.c diff --git a/widgets/misc/ea-cell-table.h b/e-util/ea-cell-table.h index a13d7a52c7..3ddd74914c 100644 --- a/widgets/misc/ea-cell-table.h +++ b/e-util/ea-cell-table.h @@ -20,6 +20,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + /* EaCellTable */ #include <glib-object.h> diff --git a/a11y/ea-factory.h b/e-util/ea-factory.h index f68b3a065b..c24469721d 100644 --- a/a11y/ea-factory.h +++ b/e-util/ea-factory.h @@ -21,6 +21,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + /* Evolution Accessibility */ diff --git a/widgets/misc/ea-widgets.c b/e-util/ea-widgets.c index 1b74d44fd2..0a65730359 100644 --- a/widgets/misc/ea-widgets.c +++ b/e-util/ea-widgets.c @@ -24,7 +24,7 @@ #include <config.h> #endif -#include "a11y/ea-factory.h" +#include "ea-factory.h" #include "ea-calendar-item.h" #include "ea-widgets.h" diff --git a/widgets/misc/ea-widgets.h b/e-util/ea-widgets.h index 495222ae05..3fd212ff94 100644 --- a/widgets/misc/ea-widgets.h +++ b/e-util/ea-widgets.h @@ -21,6 +21,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + /* Evolution Accessibility */ diff --git a/e-util/evolution-source-viewer.c b/e-util/evolution-source-viewer.c new file mode 100644 index 0000000000..9f5fb117a5 --- /dev/null +++ b/e-util/evolution-source-viewer.c @@ -0,0 +1,1176 @@ +/* + * evolution-source-viewer.c + * + * 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/> + * + */ + +#include <config.h> +#include <gtk/gtk.h> +#include <glib/gi18n.h> + +#include <libedataserver/libedataserver.h> + +/* XXX Even though this is all one file, I'm still being pedantic about data + * encapsulation (except for a private struct, even I'm not that anal!). + * I expect this program will eventually be too complex for one file + * and we'll want to split off an e-source-viewer.[ch]. */ + +/* Standard GObject macros */ +#define E_TYPE_SOURCE_VIEWER \ + (e_source_viewer_get_type ()) +#define E_SOURCE_VIEWER(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST \ + ((obj), E_TYPE_SOURCE_VIEWER, ESourceViewer)) +#define E_SOURCE_VIEWER_CLASS(cls) \ + (G_TYPE_CHECK_CLASS_CAST \ + ((cls), E_TYPE_SOURCE_VIEWER, ESourceViewerClass)) +#define E_IS_SOURCE_VIEWER(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE \ + ((obj), E_TYPE_SOURCE_VIEWER)) +#define E_IS_SOURCE_VIEWER_CLASS(cls) \ + (G_TYPE_CHECK_CLASS_TYPE \ + ((cls), E_TYPE_SOURCE_VIEWER)) +#define E_SOURCE_VIEWER_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS \ + ((obj), E_TYPE_SOURCE_VIEWER, ESourceViewerClass)) + +typedef struct _ESourceViewer ESourceViewer; +typedef struct _ESourceViewerClass ESourceViewerClass; + +struct _ESourceViewer { + GtkWindow parent; + ESourceRegistry *registry; + + GtkTreeStore *tree_store; + GHashTable *source_index; + + GCancellable *delete_operation; + + GtkWidget *tree_view; /* not referenced */ + GtkWidget *text_view; /* not referenced */ + GtkWidget *top_panel; /* not referenced */ + + /* Viewing Page */ + GtkWidget *viewing_label; /* not referenced */ + GtkWidget *delete_button; /* not referenced */ + + /* Deleting Page */ + GtkWidget *deleting_label; /* not referenced */ + GtkWidget *deleting_cancel; /* not referenced */ +}; + +struct _ESourceViewerClass { + GtkWindowClass parent_class; +}; + +enum { + PAGE_VIEWING, + PAGE_DELETING +}; + +enum { + PROP_0, + PROP_REGISTRY +}; + +enum { + COLUMN_DISPLAY_NAME, + COLUMN_SOURCE_UID, + COLUMN_REMOVABLE, + COLUMN_WRITABLE, + COLUMN_REMOTE_CREATABLE, + COLUMN_REMOTE_DELETABLE, + COLUMN_SOURCE, + NUM_COLUMNS +}; + +/* Forward Declarations */ +GType e_source_viewer_get_type (void) G_GNUC_CONST; +GtkWidget * e_source_viewer_new (GCancellable *cancellable, + GError **error); +ESourceRegistry * + e_source_viewer_get_registry (ESourceViewer *viewer); +GtkTreePath * e_source_viewer_dup_selected_path + (ESourceViewer *viewer); +gboolean e_source_viewer_set_selected_path + (ESourceViewer *viewer, + GtkTreePath *path); +ESource * e_source_viewer_ref_selected_source + (ESourceViewer *viewer); +gboolean e_source_viewer_set_selected_source + (ESourceViewer *viewer, + ESource *source); +GNode * e_source_viewer_build_display_tree + (ESourceViewer *viewer); + +static void e_source_viewer_initable_init (GInitableIface *interface); + +G_DEFINE_TYPE_WITH_CODE ( + ESourceViewer, + e_source_viewer, + GTK_TYPE_WINDOW, + G_IMPLEMENT_INTERFACE ( + G_TYPE_INITABLE, + e_source_viewer_initable_init)); + +static GIcon * +source_view_new_remote_creatable_icon (void) +{ + GEmblem *emblem; + GIcon *emblem_icon; + GIcon *folder_icon; + GIcon *icon; + + emblem_icon = g_themed_icon_new ("emblem-new"); + folder_icon = g_themed_icon_new ("folder-remote"); + + emblem = g_emblem_new (emblem_icon); + icon = g_emblemed_icon_new (folder_icon, emblem); + g_object_unref (emblem); + + g_object_unref (folder_icon); + g_object_unref (emblem_icon); + + return icon; +} + +static GIcon * +source_view_new_remote_deletable_icon (void) +{ + GEmblem *emblem; + GIcon *emblem_icon; + GIcon *folder_icon; + GIcon *icon; + + emblem_icon = g_themed_icon_new ("edit-delete"); + folder_icon = g_themed_icon_new ("folder-remote"); + + emblem = g_emblem_new (emblem_icon); + icon = g_emblemed_icon_new (folder_icon, emblem); + g_object_unref (emblem); + + g_object_unref (folder_icon); + g_object_unref (emblem_icon); + + return icon; +} + +static gchar * +source_viewer_get_monospace_font_name (void) +{ + GSettings *settings; + gchar *font_name; + + settings = g_settings_new ("org.gnome.desktop.interface"); + font_name = g_settings_get_string (settings, "monospace-font-name"); + g_object_unref (settings); + + /* Fallback to a reasonable default. */ + if (font_name == NULL) + font_name = g_strdup ("Monospace 10"); + + return font_name; +} + +static void +source_viewer_set_text (ESourceViewer *viewer, + ESource *source) +{ + GtkTextView *text_view; + GtkTextBuffer *buffer; + GtkTextIter start; + GtkTextIter end; + + text_view = GTK_TEXT_VIEW (viewer->text_view); + buffer = gtk_text_view_get_buffer (text_view); + + gtk_text_buffer_get_start_iter (buffer, &start); + gtk_text_buffer_get_end_iter (buffer, &end); + gtk_text_buffer_delete (buffer, &start, &end); + + if (source != NULL) { + gchar *string; + gsize length; + + gtk_text_buffer_get_start_iter (buffer, &start); + + string = e_source_to_string (source, &length); + gtk_text_buffer_insert (buffer, &start, string, length); + g_free (string); + } +} + +static void +source_viewer_update_row (ESourceViewer *viewer, + ESource *source) +{ + GHashTable *source_index; + GtkTreeRowReference *reference; + GtkTreeModel *model; + GtkTreePath *path; + GtkTreeIter iter; + const gchar *display_name; + const gchar *source_uid; + gboolean removable; + gboolean writable; + gboolean remote_creatable; + gboolean remote_deletable; + + source_index = viewer->source_index; + reference = g_hash_table_lookup (source_index, source); + + /* We show all sources, so the reference should be valid. */ + g_return_if_fail (gtk_tree_row_reference_valid (reference)); + + model = gtk_tree_row_reference_get_model (reference); + path = gtk_tree_row_reference_get_path (reference); + gtk_tree_model_get_iter (model, &iter, path); + gtk_tree_path_free (path); + + source_uid = e_source_get_uid (source); + display_name = e_source_get_display_name (source); + removable = e_source_get_removable (source); + writable = e_source_get_writable (source); + remote_creatable = e_source_get_remote_creatable (source); + remote_deletable = e_source_get_remote_deletable (source); + + gtk_tree_store_set ( + GTK_TREE_STORE (model), &iter, + COLUMN_DISPLAY_NAME, display_name, + COLUMN_SOURCE_UID, source_uid, + COLUMN_REMOVABLE, removable, + COLUMN_WRITABLE, writable, + COLUMN_REMOTE_CREATABLE, remote_creatable, + COLUMN_REMOTE_DELETABLE, remote_deletable, + COLUMN_SOURCE, source, + -1); +} + +static gboolean +source_viewer_traverse (GNode *node, + gpointer user_data) +{ + ESourceViewer *viewer; + ESource *source; + GHashTable *source_index; + GtkTreeRowReference *reference = NULL; + GtkTreeView *tree_view; + GtkTreeModel *model; + GtkTreePath *path; + GtkTreeIter iter; + + /* Skip the root node. */ + if (G_NODE_IS_ROOT (node)) + return FALSE; + + viewer = E_SOURCE_VIEWER (user_data); + + source_index = viewer->source_index; + + tree_view = GTK_TREE_VIEW (viewer->tree_view); + model = gtk_tree_view_get_model (tree_view); + + if (node->parent != NULL && node->parent->data != NULL) + reference = g_hash_table_lookup ( + source_index, node->parent->data); + + if (gtk_tree_row_reference_valid (reference)) { + GtkTreeIter parent; + + path = gtk_tree_row_reference_get_path (reference); + gtk_tree_model_get_iter (model, &parent, path); + gtk_tree_path_free (path); + + gtk_tree_store_append (GTK_TREE_STORE (model), &iter, &parent); + } else + gtk_tree_store_append (GTK_TREE_STORE (model), &iter, NULL); + + /* Source index takes ownership. */ + source = g_object_ref (node->data); + + path = gtk_tree_model_get_path (model, &iter); + reference = gtk_tree_row_reference_new (model, path); + g_hash_table_insert (source_index, source, reference); + gtk_tree_path_free (path); + + source_viewer_update_row (viewer, source); + + return FALSE; +} + +static void +source_viewer_save_expanded (GtkTreeView *tree_view, + GtkTreePath *path, + GQueue *queue) +{ + GtkTreeModel *model; + GtkTreeIter iter; + ESource *source; + + model = gtk_tree_view_get_model (tree_view); + gtk_tree_model_get_iter (model, &iter, path); + gtk_tree_model_get (model, &iter, COLUMN_SOURCE, &source, -1); + g_queue_push_tail (queue, source); +} + +static void +source_viewer_build_model (ESourceViewer *viewer) +{ + GQueue queue = G_QUEUE_INIT; + GHashTable *source_index; + GtkTreeView *tree_view; + GtkTreeModel *model; + GtkTreePath *sel_path; + ESource *sel_source; + GNode *root; + + tree_view = GTK_TREE_VIEW (viewer->tree_view); + + source_index = viewer->source_index; + sel_path = e_source_viewer_dup_selected_path (viewer); + sel_source = e_source_viewer_ref_selected_source (viewer); + + /* Save expanded sources to restore later. */ + gtk_tree_view_map_expanded_rows ( + tree_view, (GtkTreeViewMappingFunc) + source_viewer_save_expanded, &queue); + + model = gtk_tree_view_get_model (tree_view); + gtk_tree_store_clear (GTK_TREE_STORE (model)); + + g_hash_table_remove_all (source_index); + + root = e_source_viewer_build_display_tree (viewer); + + g_node_traverse ( + root, G_PRE_ORDER, G_TRAVERSE_ALL, -1, + (GNodeTraverseFunc) source_viewer_traverse, viewer); + + e_source_registry_free_display_tree (root); + + /* Restore previously expanded sources. */ + while (!g_queue_is_empty (&queue)) { + GtkTreeRowReference *reference; + ESource *source; + + source = g_queue_pop_head (&queue); + reference = g_hash_table_lookup (source_index, source); + + if (gtk_tree_row_reference_valid (reference)) { + GtkTreePath *path; + + path = gtk_tree_row_reference_get_path (reference); + gtk_tree_view_expand_to_path (tree_view, path); + gtk_tree_path_free (path); + } + + g_object_unref (source); + } + + /* Restore the selection. */ + if (sel_source != NULL && sel_path != NULL) { + if (!e_source_viewer_set_selected_source (viewer, sel_source)) + e_source_viewer_set_selected_path (viewer, sel_path); + } + + if (sel_path != NULL) + gtk_tree_path_free (sel_path); + + if (sel_source != NULL) + g_object_unref (sel_source); +} + +static void +source_viewer_expand_to_source (ESourceViewer *viewer, + ESource *source) +{ + GHashTable *source_index; + GtkTreeRowReference *reference; + GtkTreeView *tree_view; + GtkTreePath *path; + + source_index = viewer->source_index; + reference = g_hash_table_lookup (source_index, source); + + /* We show all sources, so the reference should be valid. */ + g_return_if_fail (gtk_tree_row_reference_valid (reference)); + + /* Expand the tree view to the path containing the ESource. */ + tree_view = GTK_TREE_VIEW (viewer->tree_view); + path = gtk_tree_row_reference_get_path (reference); + gtk_tree_view_expand_to_path (tree_view, path); + gtk_tree_path_free (path); +} + +static void +source_viewer_source_added_cb (ESourceRegistry *registry, + ESource *source, + ESourceViewer *viewer) +{ + source_viewer_build_model (viewer); + + source_viewer_expand_to_source (viewer, source); +} + +static void +source_viewer_source_changed_cb (ESourceRegistry *registry, + ESource *source, + ESourceViewer *viewer) +{ + ESource *selected; + + source_viewer_update_row (viewer, source); + + selected = e_source_viewer_ref_selected_source (viewer); + if (selected != NULL) { + if (e_source_equal (source, selected)) + source_viewer_set_text (viewer, source); + g_object_unref (selected); + } +} + +static void +source_viewer_source_removed_cb (ESourceRegistry *registry, + ESource *source, + ESourceViewer *viewer) +{ + source_viewer_build_model (viewer); +} + +static void +source_viewer_selection_changed_cb (GtkTreeSelection *selection, + ESourceViewer *viewer) +{ + ESource *source; + const gchar *uid = NULL; + gboolean removable = FALSE; + + source = e_source_viewer_ref_selected_source (viewer); + + source_viewer_set_text (viewer, source); + + if (source != NULL) { + uid = e_source_get_uid (source); + removable = e_source_get_removable (source); + } + + gtk_label_set_text (GTK_LABEL (viewer->viewing_label), uid); + gtk_widget_set_visible (viewer->delete_button, removable); + + if (source != NULL) + g_object_unref (source); +} + +static void +source_viewer_delete_done_cb (GObject *source_object, + GAsyncResult *result, + gpointer user_data) +{ + ESource *source; + ESourceViewer *viewer; + GError *error = NULL; + + source = E_SOURCE (source_object); + viewer = E_SOURCE_VIEWER (user_data); + + e_source_remove_finish (source, result, &error); + + /* Ignore cancellations. */ + if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) { + g_clear_error (&error); + + /* FIXME Show an info bar with the error message. */ + } else if (error != NULL) { + g_warning ("%s: %s", G_STRFUNC, error->message); + g_clear_error (&error); + } + + gtk_notebook_set_current_page ( + GTK_NOTEBOOK (viewer->top_panel), PAGE_VIEWING); + gtk_widget_set_sensitive (viewer->tree_view, TRUE); + + g_object_unref (viewer->delete_operation); + viewer->delete_operation = NULL; + + g_object_unref (viewer); +} + +static void +source_viewer_delete_button_clicked_cb (GtkButton *delete_button, + ESourceViewer *viewer) +{ + ESource *source; + const gchar *uid; + + g_return_if_fail (viewer->delete_operation == NULL); + + source = e_source_viewer_ref_selected_source (viewer); + g_return_if_fail (source != NULL); + + uid = e_source_get_uid (source); + gtk_label_set_text (GTK_LABEL (viewer->deleting_label), uid); + + gtk_notebook_set_current_page ( + GTK_NOTEBOOK (viewer->top_panel), PAGE_DELETING); + gtk_widget_set_sensitive (viewer->tree_view, FALSE); + + viewer->delete_operation = g_cancellable_new (); + + e_source_remove ( + source, + viewer->delete_operation, + source_viewer_delete_done_cb, + g_object_ref (viewer)); + + g_object_unref (source); +} + +static void +source_viewer_deleting_cancel_clicked_cb (GtkButton *deleting_cancel, + ESourceViewer *viewer) +{ + g_return_if_fail (viewer->delete_operation != NULL); + + g_cancellable_cancel (viewer->delete_operation); +} + +static void +source_viewer_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) +{ + switch (property_id) { + case PROP_REGISTRY: + g_value_set_object ( + value, + e_source_viewer_get_registry ( + E_SOURCE_VIEWER (object))); + return; + } + + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); +} + +static void +source_viewer_dispose (GObject *object) +{ + ESourceViewer *viewer = E_SOURCE_VIEWER (object); + + if (viewer->registry != NULL) { + g_signal_handlers_disconnect_matched ( + viewer->registry, + G_SIGNAL_MATCH_DATA, + 0, 0, NULL, NULL, object); + g_object_unref (viewer->registry); + viewer->registry = NULL; + } + + if (viewer->tree_store != NULL) { + g_object_unref (viewer->tree_store); + viewer->tree_store = NULL; + } + + g_hash_table_remove_all (viewer->source_index); + + if (viewer->delete_operation != NULL) { + g_object_unref (viewer->delete_operation); + viewer->delete_operation = NULL; + } + + /* Chain up to parent's dispose() method. */ + G_OBJECT_CLASS (e_source_viewer_parent_class)->dispose (object); +} + +static void +source_viewer_finalize (GObject *object) +{ + ESourceViewer *viewer = E_SOURCE_VIEWER (object); + + g_hash_table_destroy (viewer->source_index); + + /* Chain up to parent's finalize() method. */ + G_OBJECT_CLASS (e_source_viewer_parent_class)->finalize (object); +} + +static void +source_viewer_constructed (GObject *object) +{ + ESourceViewer *viewer; + GtkTreeViewColumn *column; + GtkTreeSelection *selection; + GtkCellRenderer *renderer; + GtkWidget *container; + GtkWidget *paned; + GtkWidget *widget; + PangoAttribute *attr; + PangoAttrList *bold; + PangoFontDescription *desc; + GIcon *icon; + const gchar *title; + gchar *font_name; + gint page_num; + + viewer = E_SOURCE_VIEWER (object); + + /* Chain up to parent's constructed() method. */ + G_OBJECT_CLASS (e_source_viewer_parent_class)->constructed (object); + + bold = pango_attr_list_new (); + attr = pango_attr_weight_new (PANGO_WEIGHT_BOLD); + pango_attr_list_insert (bold, attr); + + title = _("Evolution Source Viewer"); + gtk_window_set_title (GTK_WINDOW (viewer), title); + gtk_window_set_default_size (GTK_WINDOW (viewer), 800, 600); + + paned = gtk_paned_new (GTK_ORIENTATION_HORIZONTAL); + gtk_paned_set_position (GTK_PANED (paned), 400); + gtk_container_add (GTK_CONTAINER (viewer), paned); + gtk_widget_show (paned); + + /* Left panel */ + + widget = gtk_scrolled_window_new (NULL, NULL); + gtk_scrolled_window_set_policy ( + GTK_SCROLLED_WINDOW (widget), + GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); + gtk_scrolled_window_set_shadow_type ( + GTK_SCROLLED_WINDOW (widget), GTK_SHADOW_IN); + gtk_paned_add1 (GTK_PANED (paned), widget); + gtk_widget_show (widget); + + container = widget; + + widget = gtk_tree_view_new_with_model ( + GTK_TREE_MODEL (viewer->tree_store)); + gtk_container_add (GTK_CONTAINER (container), widget); + viewer->tree_view = widget; /* do not reference */ + gtk_widget_show (widget); + + column = gtk_tree_view_column_new (); + /* Translators: The name that is displayed in the user interface */ + gtk_tree_view_column_set_title (column, _("Display Name")); + gtk_tree_view_append_column (GTK_TREE_VIEW (widget), column); + + renderer = gtk_cell_renderer_text_new (); + gtk_tree_view_column_pack_start (column, renderer, TRUE); + gtk_tree_view_column_add_attribute ( + column, renderer, "text", COLUMN_DISPLAY_NAME); + + column = gtk_tree_view_column_new (); + gtk_tree_view_column_set_title (column, _("Flags")); + gtk_tree_view_append_column (GTK_TREE_VIEW (widget), column); + + renderer = gtk_cell_renderer_pixbuf_new (); + g_object_set ( + renderer, + "stock-id", GTK_STOCK_EDIT, + "stock-size", GTK_ICON_SIZE_MENU, + NULL); + gtk_tree_view_column_pack_start (column, renderer, FALSE); + gtk_tree_view_column_add_attribute ( + column, renderer, "visible", COLUMN_WRITABLE); + + renderer = gtk_cell_renderer_pixbuf_new (); + g_object_set ( + renderer, + "stock-id", GTK_STOCK_DELETE, + "stock-size", GTK_ICON_SIZE_MENU, + NULL); + gtk_tree_view_column_pack_start (column, renderer, FALSE); + gtk_tree_view_column_add_attribute ( + column, renderer, "visible", COLUMN_REMOVABLE); + + icon = source_view_new_remote_creatable_icon (); + renderer = gtk_cell_renderer_pixbuf_new (); + g_object_set ( + renderer, + "gicon", icon, + "stock-size", GTK_ICON_SIZE_MENU, + NULL); + gtk_tree_view_column_pack_start (column, renderer, FALSE); + gtk_tree_view_column_add_attribute ( + column, renderer, "visible", COLUMN_REMOTE_CREATABLE); + g_object_unref (icon); + + icon = source_view_new_remote_deletable_icon (); + renderer = gtk_cell_renderer_pixbuf_new (); + g_object_set ( + renderer, + "gicon", icon, + "stock-size", GTK_ICON_SIZE_MENU, + NULL); + gtk_tree_view_column_pack_start (column, renderer, FALSE); + gtk_tree_view_column_add_attribute ( + column, renderer, "visible", COLUMN_REMOTE_DELETABLE); + g_object_unref (icon); + + /* Append an empty pixbuf renderer to fill leftover space. */ + renderer = gtk_cell_renderer_pixbuf_new (); + gtk_tree_view_column_pack_start (column, renderer, TRUE); + + column = gtk_tree_view_column_new (); + gtk_tree_view_column_set_title (column, _("Identity")); + gtk_tree_view_append_column (GTK_TREE_VIEW (widget), column); + + renderer = gtk_cell_renderer_text_new (); + gtk_tree_view_column_pack_start (column, renderer, FALSE); + gtk_tree_view_column_add_attribute ( + column, renderer, "text", COLUMN_SOURCE_UID); + + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (widget)); + + /* Right panel */ + + widget = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); + gtk_paned_add2 (GTK_PANED (paned), widget); + gtk_widget_show (widget); + + container = widget; + + widget = gtk_notebook_new (); + gtk_widget_set_margin_top (widget, 3); + gtk_widget_set_margin_right (widget, 3); + gtk_widget_set_margin_bottom (widget, 3); + /* leave left margin at zero */ + gtk_notebook_set_show_tabs (GTK_NOTEBOOK (widget), FALSE); + gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0); + viewer->top_panel = widget; /* do not reference */ + gtk_widget_show (widget); + + widget = gtk_scrolled_window_new (NULL, NULL); + gtk_scrolled_window_set_policy ( + GTK_SCROLLED_WINDOW (widget), + GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); + gtk_scrolled_window_set_shadow_type ( + GTK_SCROLLED_WINDOW (widget), GTK_SHADOW_IN); + gtk_box_pack_start (GTK_BOX (container), widget, TRUE, TRUE, 0); + gtk_widget_show (widget); + + container = widget; + + widget = gtk_text_view_new (); + gtk_text_view_set_editable (GTK_TEXT_VIEW (widget), FALSE); + gtk_container_add (GTK_CONTAINER (container), widget); + viewer->text_view = widget; /* do not reference */ + gtk_widget_show (widget); + + font_name = source_viewer_get_monospace_font_name (); + desc = pango_font_description_from_string (font_name); + gtk_widget_override_font (widget, desc); + pango_font_description_free (desc); + g_free (font_name); + + /* Top panel: Viewing */ + + container = viewer->top_panel; + + widget = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6); + page_num = gtk_notebook_append_page ( + GTK_NOTEBOOK (container), widget, NULL); + g_warn_if_fail (page_num == PAGE_VIEWING); + gtk_widget_show (widget); + + container = widget; + + widget = gtk_label_new ("Identity:"); + gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0); + gtk_widget_show (widget); + + widget = gtk_label_new (NULL); + gtk_label_set_attributes (GTK_LABEL (widget), bold); + gtk_label_set_ellipsize (GTK_LABEL (widget), PANGO_ELLIPSIZE_END); + gtk_misc_set_alignment (GTK_MISC (widget), 0.0, 0.5); + gtk_box_pack_start (GTK_BOX (container), widget, TRUE, TRUE, 0); + viewer->viewing_label = widget; /* do not reference */ + gtk_widget_show (widget); + + widget = gtk_button_new_from_stock (GTK_STOCK_DELETE); + gtk_box_pack_end (GTK_BOX (container), widget, FALSE, FALSE, 0); + viewer->delete_button = widget; /* do not reference */ + gtk_widget_hide (widget); + + /* Top panel: Deleting */ + + container = viewer->top_panel; + + widget = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6); + page_num = gtk_notebook_append_page ( + GTK_NOTEBOOK (container), widget, NULL); + g_warn_if_fail (page_num == PAGE_DELETING); + gtk_widget_show (widget); + + container = widget; + + widget = gtk_label_new ("Deleting"); + gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0); + gtk_widget_show (widget); + + widget = gtk_label_new (NULL); + gtk_label_set_attributes (GTK_LABEL (widget), bold); + gtk_label_set_ellipsize (GTK_LABEL (widget), PANGO_ELLIPSIZE_END); + gtk_misc_set_alignment (GTK_MISC (widget), 0.0, 0.5); + gtk_box_pack_start (GTK_BOX (container), widget, TRUE, TRUE, 0); + viewer->deleting_label = widget; /* do not reference */ + gtk_widget_show (widget); + + widget = gtk_button_new_from_stock (GTK_STOCK_CANCEL); + gtk_box_pack_end (GTK_BOX (container), widget, FALSE, FALSE, 0); + viewer->deleting_cancel = widget; /* do not reference */ + gtk_widget_show (widget); + + pango_attr_list_unref (bold); + + g_signal_connect ( + selection, "changed", + G_CALLBACK (source_viewer_selection_changed_cb), viewer); + + g_signal_connect ( + viewer->delete_button, "clicked", + G_CALLBACK (source_viewer_delete_button_clicked_cb), viewer); + + g_signal_connect ( + viewer->deleting_cancel, "clicked", + G_CALLBACK (source_viewer_deleting_cancel_clicked_cb), viewer); +} + +static gboolean +source_viewer_initable_init (GInitable *initable, + GCancellable *cancellable, + GError **error) +{ + ESourceViewer *viewer; + ESourceRegistry *registry; + + viewer = E_SOURCE_VIEWER (initable); + + registry = e_source_registry_new_sync (cancellable, error); + + if (registry == NULL) + return FALSE; + + viewer->registry = registry; /* takes ownership */ + + g_signal_connect ( + registry, "source-added", + G_CALLBACK (source_viewer_source_added_cb), viewer); + + g_signal_connect ( + registry, "source-changed", + G_CALLBACK (source_viewer_source_changed_cb), viewer); + + g_signal_connect ( + registry, "source-removed", + G_CALLBACK (source_viewer_source_removed_cb), viewer); + + source_viewer_build_model (viewer); + + gtk_tree_view_expand_all (GTK_TREE_VIEW (viewer->tree_view)); + + return TRUE; +} + +static void +e_source_viewer_class_init (ESourceViewerClass *class) +{ + GObjectClass *object_class; + + object_class = G_OBJECT_CLASS (class); + object_class->get_property = source_viewer_get_property; + object_class->dispose = source_viewer_dispose; + object_class->finalize = source_viewer_finalize; + object_class->constructed = source_viewer_constructed; + + g_object_class_install_property ( + object_class, + PROP_REGISTRY, + g_param_spec_object ( + "registry", + "Registry", + "Data source registry", + E_TYPE_SOURCE_REGISTRY, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); +} + +static void +e_source_viewer_initable_init (GInitableIface *interface) +{ + interface->init = source_viewer_initable_init; +} + +static void +e_source_viewer_init (ESourceViewer *viewer) +{ + viewer->tree_store = gtk_tree_store_new ( + NUM_COLUMNS, + G_TYPE_STRING, /* COLUMN_DISPLAY_NAME */ + G_TYPE_STRING, /* COLUMN_SOURCE_UID */ + G_TYPE_BOOLEAN, /* COLUMN_REMOVABLE */ + G_TYPE_BOOLEAN, /* COLUMN_WRITABLE */ + G_TYPE_BOOLEAN, /* COLUMN_REMOTE_CREATABLE */ + G_TYPE_BOOLEAN, /* COLUMN_REMOTE_DELETABLE */ + E_TYPE_SOURCE); /* COLUMN_SOURCE */ + + viewer->source_index = g_hash_table_new_full ( + (GHashFunc) e_source_hash, + (GEqualFunc) e_source_equal, + (GDestroyNotify) g_object_unref, + (GDestroyNotify) gtk_tree_row_reference_free); +} + +GtkWidget * +e_source_viewer_new (GCancellable *cancellable, + GError **error) +{ + return g_initable_new ( + E_TYPE_SOURCE_VIEWER, + cancellable, error, NULL); +} + +ESourceRegistry * +e_source_viewer_get_registry (ESourceViewer *viewer) +{ + g_return_val_if_fail (E_IS_SOURCE_VIEWER (viewer), NULL); + + return viewer->registry; +} + +GtkTreePath * +e_source_viewer_dup_selected_path (ESourceViewer *viewer) +{ + GtkTreeSelection *selection; + GtkTreeView *tree_view; + GtkTreeModel *model; + GtkTreeIter iter; + + g_return_val_if_fail (E_IS_SOURCE_VIEWER (viewer), NULL); + + tree_view = GTK_TREE_VIEW (viewer->tree_view); + selection = gtk_tree_view_get_selection (tree_view); + + if (!gtk_tree_selection_get_selected (selection, &model, &iter)) + return NULL; + + return gtk_tree_model_get_path (model, &iter); +} + +gboolean +e_source_viewer_set_selected_path (ESourceViewer *viewer, + GtkTreePath *path) +{ + GtkTreeSelection *selection; + GtkTreeView *tree_view; + GtkTreeModel *model; + GtkTreeIter iter; + + g_return_val_if_fail (E_IS_SOURCE_VIEWER (viewer), FALSE); + g_return_val_if_fail (path != NULL, FALSE); + + tree_view = GTK_TREE_VIEW (viewer->tree_view); + selection = gtk_tree_view_get_selection (tree_view); + + /* Check that the path is valid. */ + model = gtk_tree_view_get_model (tree_view); + if (!gtk_tree_model_get_iter (model, &iter, path)) + return FALSE; + + gtk_tree_selection_unselect_all (selection); + + gtk_tree_view_expand_to_path (tree_view, path); + gtk_tree_selection_select_path (selection, path); + + return TRUE; +} + +ESource * +e_source_viewer_ref_selected_source (ESourceViewer *viewer) +{ + ESource *source; + GtkTreeSelection *selection; + GtkTreeView *tree_view; + GtkTreeModel *model; + GtkTreeIter iter; + + g_return_val_if_fail (E_IS_SOURCE_VIEWER (viewer), NULL); + + tree_view = GTK_TREE_VIEW (viewer->tree_view); + selection = gtk_tree_view_get_selection (tree_view); + + if (!gtk_tree_selection_get_selected (selection, &model, &iter)) + return NULL; + + gtk_tree_model_get (model, &iter, COLUMN_SOURCE, &source, -1); + + return source; +} + +gboolean +e_source_viewer_set_selected_source (ESourceViewer *viewer, + ESource *source) +{ + GHashTable *source_index; + GtkTreeRowReference *reference; + GtkTreePath *path; + gboolean success; + + g_return_val_if_fail (E_IS_SOURCE_VIEWER (viewer), FALSE); + g_return_val_if_fail (E_IS_SOURCE (source), FALSE); + + source_index = viewer->source_index; + reference = g_hash_table_lookup (source_index, source); + + if (!gtk_tree_row_reference_valid (reference)) + return FALSE; + + path = gtk_tree_row_reference_get_path (reference); + success = e_source_viewer_set_selected_path (viewer, path); + gtk_tree_path_free (path); + + return success; +} + +/* Helper for e_source_viewer_build_display_tree() */ +static gint +source_viewer_compare_nodes (GNode *node_a, + GNode *node_b) +{ + ESource *source_a = E_SOURCE (node_a->data); + ESource *source_b = E_SOURCE (node_b->data); + + return e_source_compare_by_display_name (source_a, source_b); +} + +/* Helper for e_source_viewer_build_display_tree() */ +static gboolean +source_viewer_sort_nodes (GNode *node, + gpointer unused) +{ + GQueue queue = G_QUEUE_INIT; + GNode *child_node; + + /* Unlink all the child nodes and place them in a queue. */ + while ((child_node = g_node_first_child (node)) != NULL) { + g_node_unlink (child_node); + g_queue_push_tail (&queue, child_node); + } + + /* Sort the queue by source name. */ + g_queue_sort ( + &queue, (GCompareDataFunc) + source_viewer_compare_nodes, NULL); + + /* Pop nodes off the head of the queue and put them back + * under the parent node (preserving the sorted order). */ + while ((child_node = g_queue_pop_head (&queue)) != NULL) + g_node_append (node, child_node); + + return FALSE; +} + +GNode * +e_source_viewer_build_display_tree (ESourceViewer *viewer) +{ + GNode *root; + GHashTable *index; + GList *list, *link; + GHashTableIter iter; + gpointer value; + + /* This is just like e_source_registry_build_display_tree() + * except it includes all data sources, even disabled ones. + * Free the tree with e_source_registry_free_display_tree(). */ + + g_return_val_if_fail (E_IS_SOURCE_VIEWER (viewer), NULL); + + root = g_node_new (NULL); + index = g_hash_table_new (g_str_hash, g_str_equal); + + /* Add a GNode for each ESource to the index. + * The GNodes take ownership of the ESource references. */ + list = e_source_registry_list_sources (viewer->registry, NULL); + for (link = list; link != NULL; link = g_list_next (link)) { + ESource *source = E_SOURCE (link->data); + gpointer key = (gpointer) e_source_get_uid (source); + g_hash_table_insert (index, key, g_node_new (source)); + } + g_list_free (list); + + /* Traverse the index and link the nodes together. */ + g_hash_table_iter_init (&iter, index); + while (g_hash_table_iter_next (&iter, NULL, &value)) { + ESource *source; + GNode *source_node; + GNode *parent_node; + const gchar *parent_uid; + + source_node = (GNode *) value; + source = E_SOURCE (source_node->data); + parent_uid = e_source_get_parent (source); + + if (parent_uid == NULL || *parent_uid == '\0') { + parent_node = root; + } else { + parent_node = g_hash_table_lookup (index, parent_uid); + } + + /* This could be NULL if the registry service was + * shutdown or reloaded. All sources will vanish. */ + if (parent_node != NULL) + g_node_append (parent_node, source_node); + } + + /* Sort nodes by display name in post order. */ + g_node_traverse ( + root, G_POST_ORDER, G_TRAVERSE_ALL, + -1, source_viewer_sort_nodes, NULL); + + g_hash_table_destroy (index); + + return root; +} + +gint +main (gint argc, + gchar **argv) +{ + GtkWidget *viewer; + GError *error = NULL; + + bindtextdomain (GETTEXT_PACKAGE, EVOLUTION_LOCALEDIR); + bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); + textdomain (GETTEXT_PACKAGE); + + gtk_init (&argc, &argv); + + viewer = e_source_viewer_new (NULL, &error); + + if (error != NULL) { + g_warn_if_fail (viewer == NULL); + g_error ("%s", error->message); + g_assert_not_reached (); + } + + g_signal_connect ( + viewer, "delete-event", + G_CALLBACK (gtk_main_quit), NULL); + + gtk_widget_show (viewer); + + gtk_main (); + + return 0; +} diff --git a/filter/filter.error.xml b/e-util/filter.error.xml index 62b75193d2..62b75193d2 100644 --- a/filter/filter.error.xml +++ b/e-util/filter.error.xml diff --git a/filter/filter.ui b/e-util/filter.ui index d91292736d..d91292736d 100644 --- a/filter/filter.ui +++ b/e-util/filter.ui diff --git a/widgets/table/gal-a11y-e-cell-popup.c b/e-util/gal-a11y-e-cell-popup.c index 1c97ee3198..523869bcb7 100644 --- a/widgets/table/gal-a11y-e-cell-popup.c +++ b/e-util/gal-a11y-e-cell-popup.c @@ -24,15 +24,15 @@ #include <config.h> #endif -#include <gdk/gdkkeysyms.h> -#include <gtk/gtk.h> +#include "gal-a11y-e-cell-popup.h" -#include "a11y/gal-a11y-util.h" -#include "table/e-cell-popup.h" +#include <gtk/gtk.h> #include <glib/gi18n.h> +#include <gdk/gdkkeysyms.h> -#include "gal-a11y-e-cell-popup.h" +#include "e-cell-popup.h" #include "gal-a11y-e-cell-registry.h" +#include "gal-a11y-util.h" static AtkObjectClass *parent_class = NULL; #define PARENT_TYPE (gal_a11y_e_cell_get_type ()) diff --git a/widgets/table/gal-a11y-e-cell-popup.h b/e-util/gal-a11y-e-cell-popup.h index fdf20802a1..30ce4a7677 100644 --- a/widgets/table/gal-a11y-e-cell-popup.h +++ b/e-util/gal-a11y-e-cell-popup.h @@ -21,13 +21,18 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef __GAL_A11Y_E_CELL_POPUP_H__ #define __GAL_A11Y_E_CELL_POPUP_H__ -#include <table/e-table-item.h> -#include <table/gal-a11y-e-cell.h> #include <atk/atkgobjectaccessible.h> +#include <e-util/e-table-item.h> +#include <e-util/gal-a11y-e-cell.h> + #define GAL_A11Y_TYPE_E_CELL_POPUP (gal_a11y_e_cell_popup_get_type ()) #define GAL_A11Y_E_CELL_POPUP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAL_A11Y_TYPE_E_CELL_POPUP, GalA11yECellPopup)) #define GAL_A11Y_E_CELL_POPUP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAL_A11Y_TYPE_E_CELL_POPUP, GalA11yECellPopupClass)) diff --git a/widgets/table/gal-a11y-e-cell-registry.c b/e-util/gal-a11y-e-cell-registry.c index db05ac05c1..db05ac05c1 100644 --- a/widgets/table/gal-a11y-e-cell-registry.c +++ b/e-util/gal-a11y-e-cell-registry.c diff --git a/widgets/table/gal-a11y-e-cell-registry.h b/e-util/gal-a11y-e-cell-registry.h index de8b21b701..fdfd9dcffd 100644 --- a/widgets/table/gal-a11y-e-cell-registry.h +++ b/e-util/gal-a11y-e-cell-registry.h @@ -20,12 +20,17 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef __GAL_A11Y_E_CELL_REGISTRY_H__ #define __GAL_A11Y_E_CELL_REGISTRY_H__ #include <atk/atkobject.h> -#include <table/e-table-item.h> -#include <table/e-cell.h> + +#include <e-util/e-table-item.h> +#include <e-util/e-cell.h> #define GAL_A11Y_TYPE_E_CELL_REGISTRY (gal_a11y_e_cell_registry_get_type ()) #define GAL_A11Y_E_CELL_REGISTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAL_A11Y_TYPE_E_CELL_REGISTRY, GalA11yECellRegistry)) diff --git a/widgets/table/gal-a11y-e-cell-toggle.c b/e-util/gal-a11y-e-cell-toggle.c index 33d9e4fd32..8be7f44122 100644 --- a/widgets/table/gal-a11y-e-cell-toggle.c +++ b/e-util/gal-a11y-e-cell-toggle.c @@ -23,13 +23,13 @@ #include <config.h> #endif -#include <gtk/gtk.h> +#include "gal-a11y-e-cell-toggle.h" -#include "table/e-cell-toggle.h" -#include "table/e-table-model.h" +#include <gtk/gtk.h> #include <glib/gi18n.h> -#include "gal-a11y-e-cell-toggle.h" +#include "e-cell-toggle.h" +#include "e-table-model.h" #define PARENT_TYPE (gal_a11y_e_cell_get_type ()) static GObjectClass *parent_class; diff --git a/widgets/table/gal-a11y-e-cell-toggle.h b/e-util/gal-a11y-e-cell-toggle.h index 3c29d777e3..bd3670edda 100644 --- a/widgets/table/gal-a11y-e-cell-toggle.h +++ b/e-util/gal-a11y-e-cell-toggle.h @@ -19,6 +19,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef __GAL_A11Y_E_CELL_TOGGLE_H__ #define __GAL_A11Y_E_CELL_TOGGLE_H__ diff --git a/widgets/table/gal-a11y-e-cell-tree.c b/e-util/gal-a11y-e-cell-tree.c index 599b660ca5..e0757f5300 100644 --- a/widgets/table/gal-a11y-e-cell-tree.c +++ b/e-util/gal-a11y-e-cell-tree.c @@ -24,16 +24,16 @@ #include <config.h> #endif -#include <atk/atk.h> +#include "gal-a11y-e-cell-tree.h" -#include "a11y/gal-a11y-util.h" -#include "table/e-cell-tree.h" -#include "table/e-table.h" -#include "table/e-tree-table-adapter.h" +#include <atk/atk.h> #include <glib/gi18n.h> -#include "gal-a11y-e-cell-tree.h" +#include "e-cell-tree.h" +#include "e-table.h" +#include "e-tree-table-adapter.h" #include "gal-a11y-e-cell-registry.h" +#include "gal-a11y-util.h" #define CS_CLASS(a11y) (G_TYPE_INSTANCE_GET_CLASS ((a11y), C_TYPE_STREAM, GalA11yECellTreeClass)) static AtkObjectClass *a11y_parent_class; diff --git a/widgets/table/gal-a11y-e-cell-tree.h b/e-util/gal-a11y-e-cell-tree.h index 18ccf9c7bc..caa5f4034a 100644 --- a/widgets/table/gal-a11y-e-cell-tree.h +++ b/e-util/gal-a11y-e-cell-tree.h @@ -20,12 +20,16 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef __GAL_A11Y_E_CELL_TREE_H__ #define __GAL_A11Y_E_CELL_TREE_H__ -#include <table/e-table-item.h> -#include <table/e-cell-tree.h> -#include "gal-a11y-e-cell.h" +#include <e-util/e-table-item.h> +#include <e-util/e-cell-tree.h> +#include <e-util/gal-a11y-e-cell.h> #define GAL_A11Y_TYPE_E_CELL_TREE (gal_a11y_e_cell_tree_get_type ()) #define GAL_A11Y_E_CELL_TREE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAL_A11Y_TYPE_E_CELL_TREE, GalA11yECellTree)) diff --git a/widgets/table/gal-a11y-e-cell-vbox.c b/e-util/gal-a11y-e-cell-vbox.c index d00547c877..7864dc04ea 100644 --- a/widgets/table/gal-a11y-e-cell-vbox.c +++ b/e-util/gal-a11y-e-cell-vbox.c @@ -26,12 +26,12 @@ #include <config.h> #endif -#include <atk/atk.h> +#include "gal-a11y-e-cell-vbox.h" -#include "table/e-cell-vbox.h" +#include <atk/atk.h> +#include "e-cell-vbox.h" #include "gal-a11y-e-cell-registry.h" -#include "gal-a11y-e-cell-vbox.h" static GObjectClass *parent_class; static AtkComponentIface *component_parent_iface; diff --git a/widgets/table/gal-a11y-e-cell-vbox.h b/e-util/gal-a11y-e-cell-vbox.h index 657cb5d9a5..cb6807e0a4 100644 --- a/widgets/table/gal-a11y-e-cell-vbox.h +++ b/e-util/gal-a11y-e-cell-vbox.h @@ -22,6 +22,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef __GAL_A11Y_E_CELL_VBOX_H__ #define __GAL_A11Y_E_CELL_VBOX_H__ diff --git a/widgets/table/gal-a11y-e-cell.c b/e-util/gal-a11y-e-cell.c index 3972c2de16..9f16b34fd9 100644 --- a/widgets/table/gal-a11y-e-cell.c +++ b/e-util/gal-a11y-e-cell.c @@ -24,18 +24,18 @@ #include <config.h> #endif +#include "gal-a11y-e-cell.h" + #include <string.h> #include <gtk/gtk.h> - -#include "a11y/gal-a11y-util.h" -#include "table/e-table.h" -#include "table/e-tree.h" #include <glib/gi18n.h> -#include "gal-a11y-e-cell.h" +#include "e-table.h" +#include "e-tree.h" #include "gal-a11y-e-cell-vbox.h" #include "gal-a11y-e-table-item.h" +#include "gal-a11y-util.h" static GObjectClass *parent_class; #define PARENT_TYPE (atk_object_get_type ()) diff --git a/widgets/table/gal-a11y-e-cell.h b/e-util/gal-a11y-e-cell.h index 48c7d2bec8..63e8ecfe6b 100644 --- a/widgets/table/gal-a11y-e-cell.h +++ b/e-util/gal-a11y-e-cell.h @@ -20,11 +20,15 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef __GAL_A11Y_E_CELL_H__ #define __GAL_A11Y_E_CELL_H__ -#include <table/e-table-item.h> -#include <table/e-cell.h> +#include <e-util/e-table-item.h> +#include <e-util/e-cell.h> #define GAL_A11Y_TYPE_E_CELL (gal_a11y_e_cell_get_type ()) #define GAL_A11Y_E_CELL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAL_A11Y_TYPE_E_CELL, GalA11yECell)) diff --git a/widgets/table/gal-a11y-e-table-click-to-add-factory.c b/e-util/gal-a11y-e-table-click-to-add-factory.c index 1a4b418adf..ff923d8e40 100644 --- a/widgets/table/gal-a11y-e-table-click-to-add-factory.c +++ b/e-util/gal-a11y-e-table-click-to-add-factory.c @@ -24,14 +24,14 @@ #include <config.h> #endif -#include <atk/atk.h> +#include "gal-a11y-e-table-click-to-add-factory.h" -#include "table/e-table.h" -#include "table/e-table-click-to-add.h" +#include <atk/atk.h> -#include "gal-a11y-e-table.h" +#include "e-table-click-to-add.h" +#include "e-table.h" #include "gal-a11y-e-table-click-to-add.h" -#include "gal-a11y-e-table-click-to-add-factory.h" +#include "gal-a11y-e-table.h" #define CS_CLASS(factory) (G_TYPE_INSTANCE_GET_CLASS ((factory), C_TYPE_STREAM, GalA11yETableClickToAddFactoryClass)) static AtkObjectFactoryClass *parent_class; diff --git a/widgets/table/gal-a11y-e-table-click-to-add-factory.h b/e-util/gal-a11y-e-table-click-to-add-factory.h index c7b2cf8e6a..cc6d47f6b1 100644 --- a/widgets/table/gal-a11y-e-table-click-to-add-factory.h +++ b/e-util/gal-a11y-e-table-click-to-add-factory.h @@ -20,6 +20,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef __GAL_A11Y_E_TABLE_CLICK_TO_ADD_FACTORY_H__ #define __GAL_A11Y_E_TABLE_CLICK_TO_ADD_FACTORY_H__ diff --git a/widgets/table/gal-a11y-e-table-click-to-add.c b/e-util/gal-a11y-e-table-click-to-add.c index 52466cd7cb..bebe8c44a9 100644 --- a/widgets/table/gal-a11y-e-table-click-to-add.c +++ b/e-util/gal-a11y-e-table-click-to-add.c @@ -24,16 +24,16 @@ #include <config.h> #endif -#include <atk/atk.h> +#include "gal-a11y-e-table-click-to-add.h" -#include "a11y/gal-a11y-util.h" -#include "table/e-table-click-to-add.h" -#include "table/e-table-group.h" -#include "table/e-table-group-leaf.h" +#include <atk/atk.h> #include <glib/gi18n.h> -#include "gal-a11y-e-table-click-to-add.h" +#include "e-table-click-to-add.h" +#include "e-table-group-leaf.h" +#include "e-table-group.h" #include "gal-a11y-e-table-click-to-add-factory.h" +#include "gal-a11y-util.h" static AtkObjectClass *parent_class; static GType parent_type; diff --git a/widgets/table/gal-a11y-e-table-click-to-add.h b/e-util/gal-a11y-e-table-click-to-add.h index 8d95a00baa..46f3939bbe 100644 --- a/widgets/table/gal-a11y-e-table-click-to-add.h +++ b/e-util/gal-a11y-e-table-click-to-add.h @@ -19,11 +19,15 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef __GAL_A11Y_E_TABLE_CLICK_TO_ADD_H__ #define __GAL_A11Y_E_TABLE_CLICK_TO_ADD_H__ -#include <table/e-table-item.h> #include <atk/atkgobjectaccessible.h> +#include <e-util/e-table-item.h> #define GAL_A11Y_TYPE_E_TABLE_CLICK_TO_ADD (gal_a11y_e_table_click_to_add_get_type ()) #define GAL_A11Y_E_TABLE_CLICK_TO_ADD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAL_A11Y_TYPE_E_TABLE_CLICK_TO_ADD, GalA11yETableClickToAdd)) diff --git a/widgets/table/gal-a11y-e-table-column-header.c b/e-util/gal-a11y-e-table-column-header.c index 05a99e381b..46fb374e9a 100644 --- a/widgets/table/gal-a11y-e-table-column-header.c +++ b/e-util/gal-a11y-e-table-column-header.c @@ -25,12 +25,14 @@ #include <config.h> #endif +#include "gal-a11y-e-table-column-header.h" + #include <glib/gi18n.h> #include <atk/atkobject.h> #include <atk/atkregistry.h> -#include "table/e-table-header-item.h" -#include "a11y/gal-a11y-util.h" -#include "gal-a11y-e-table-column-header.h" + +#include "e-table-header-item.h" +#include "gal-a11y-util.h" static GObjectClass *parent_class; static gint priv_offset; diff --git a/widgets/table/gal-a11y-e-table-column-header.h b/e-util/gal-a11y-e-table-column-header.h index 20d41004f2..9d77467bda 100644 --- a/widgets/table/gal-a11y-e-table-column-header.h +++ b/e-util/gal-a11y-e-table-column-header.h @@ -21,11 +21,18 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef __GAL_A11Y_E_TABLE_COLUMN_HEADER_H__ #define __GAL_A11Y_E_TABLE_COLUMN_HEADER_H__ #include <atk/atkgobjectaccessible.h> +#include <e-util/e-table-col.h> +#include <e-util/e-table-item.h> + #define GAL_A11Y_TYPE_E_TABLE_COLUMN_HEADER (gal_a11y_e_table_column_header_get_type ()) #define GAL_A11Y_E_TABLE_COLUMN_HEADER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAL_A11Y_TYPE_E_TABLE_COLUMN_HEADER, GalA11yETableColumnHeader)) #define GAL_A11Y_E_TABLE_COLUMN_HEADER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAL_A11Y_TYPE_E_TABLE_COLUMN_HEADER, GalA11yETableColumnHeaderClass)) diff --git a/widgets/table/gal-a11y-e-table-factory.c b/e-util/gal-a11y-e-table-factory.c index a3905ab393..a3905ab393 100644 --- a/widgets/table/gal-a11y-e-table-factory.c +++ b/e-util/gal-a11y-e-table-factory.c diff --git a/widgets/table/gal-a11y-e-table-factory.h b/e-util/gal-a11y-e-table-factory.h index 6f66e6b82a..3a8b18f32f 100644 --- a/widgets/table/gal-a11y-e-table-factory.h +++ b/e-util/gal-a11y-e-table-factory.h @@ -21,6 +21,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef __GAL_A11Y_E_TABLE_FACTORY_H__ #define __GAL_A11Y_E_TABLE_FACTORY_H__ diff --git a/widgets/table/gal-a11y-e-table-item-factory.c b/e-util/gal-a11y-e-table-item-factory.c index a38269bd81..3ef551d66a 100644 --- a/widgets/table/gal-a11y-e-table-item-factory.c +++ b/e-util/gal-a11y-e-table-item-factory.c @@ -24,14 +24,14 @@ #include <config.h> #endif -#include <atk/atk.h> +#include "gal-a11y-e-table-item-factory.h" -#include "table/e-table.h" -#include "table/e-tree.h" +#include <atk/atk.h> -#include "gal-a11y-e-table.h" +#include "e-table.h" +#include "e-tree.h" #include "gal-a11y-e-table-item.h" -#include "gal-a11y-e-table-item-factory.h" +#include "gal-a11y-e-table.h" #define CS_CLASS(factory) (G_TYPE_INSTANCE_GET_CLASS ((factory), C_TYPE_STREAM, GalA11yETableItemFactoryClass)) static AtkObjectFactoryClass *parent_class; diff --git a/widgets/table/gal-a11y-e-table-item-factory.h b/e-util/gal-a11y-e-table-item-factory.h index c2995eaaf0..4aef02d113 100644 --- a/widgets/table/gal-a11y-e-table-item-factory.h +++ b/e-util/gal-a11y-e-table-item-factory.h @@ -20,6 +20,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef __GAL_A11Y_E_TABLE_ITEM_FACTORY_H__ #define __GAL_A11Y_E_TABLE_ITEM_FACTORY_H__ diff --git a/widgets/table/gal-a11y-e-table-item.c b/e-util/gal-a11y-e-table-item.c index d5a0edefdc..9f5c407507 100644 --- a/widgets/table/gal-a11y-e-table-item.c +++ b/e-util/gal-a11y-e-table-item.c @@ -25,24 +25,24 @@ #include <config.h> #endif +#include "gal-a11y-e-table-item.h" + #include <string.h> #include <atk/atk.h> -#include "a11y/gal-a11y-util.h" -#include "table/e-table-click-to-add.h" -#include "table/e-table-subset.h" -#include "table/e-table.h" -#include "table/e-tree.h" -#include "misc/e-canvas.h" -#include "misc/e-selection-model.h" - -#include "gal-a11y-e-table-item.h" -#include "gal-a11y-e-table-item-factory.h" -#include "gal-a11y-e-table-click-to-add.h" +#include "e-canvas.h" +#include "e-selection-model.h" +#include "e-table-click-to-add.h" +#include "e-table-subset.h" +#include "e-table.h" +#include "e-tree.h" #include "gal-a11y-e-cell-registry.h" #include "gal-a11y-e-cell.h" +#include "gal-a11y-e-table-click-to-add.h" #include "gal-a11y-e-table-column-header.h" +#include "gal-a11y-e-table-item-factory.h" +#include "gal-a11y-util.h" static GObjectClass *parent_class; static AtkComponentIface *component_parent_iface; diff --git a/widgets/table/gal-a11y-e-table-item.h b/e-util/gal-a11y-e-table-item.h index b77c5c3e93..4791a70354 100644 --- a/widgets/table/gal-a11y-e-table-item.h +++ b/e-util/gal-a11y-e-table-item.h @@ -21,12 +21,17 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef __GAL_A11Y_E_TABLE_ITEM_H__ #define __GAL_A11Y_E_TABLE_ITEM_H__ -#include <table/e-table-item.h> #include <atk/atkgobjectaccessible.h> +#include <e-util/e-table-item.h> + #define GAL_A11Y_TYPE_E_TABLE_ITEM (gal_a11y_e_table_item_get_type ()) #define GAL_A11Y_E_TABLE_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAL_A11Y_TYPE_E_TABLE_ITEM, GalA11yETableItem)) #define GAL_A11Y_E_TABLE_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAL_A11Y_TYPE_E_TABLE_ITEM, GalA11yETableItemClass)) diff --git a/widgets/table/gal-a11y-e-table.c b/e-util/gal-a11y-e-table.c index ec0025c6b8..f9178bd144 100644 --- a/widgets/table/gal-a11y-e-table.c +++ b/e-util/gal-a11y-e-table.c @@ -24,16 +24,16 @@ #include <config.h> #endif -#include "a11y/gal-a11y-util.h" -#include "table/e-table.h" -#include "table/e-table-click-to-add.h" -#include "table/e-table-group.h" -#include "table/e-table-group-container.h" -#include "table/e-table-group-leaf.h" - #include "gal-a11y-e-table.h" + +#include "e-table-click-to-add.h" +#include "e-table-group-container.h" +#include "e-table-group-leaf.h" +#include "e-table-group.h" +#include "e-table.h" #include "gal-a11y-e-table-factory.h" #include "gal-a11y-e-table-item.h" +#include "gal-a11y-util.h" #define CS_CLASS(a11y) (G_TYPE_INSTANCE_GET_CLASS ((a11y), C_TYPE_STREAM, GalA11yETableClass)) static AtkObjectClass *parent_class; diff --git a/widgets/table/gal-a11y-e-table.h b/e-util/gal-a11y-e-table.h index f5dba40c7e..1e47965af4 100644 --- a/widgets/table/gal-a11y-e-table.h +++ b/e-util/gal-a11y-e-table.h @@ -21,6 +21,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef __GAL_A11Y_E_TABLE_H__ #define __GAL_A11Y_E_TABLE_H__ diff --git a/widgets/text/gal-a11y-e-text-factory.c b/e-util/gal-a11y-e-text-factory.c index 8e33b38562..191b30d362 100644 --- a/widgets/text/gal-a11y-e-text-factory.c +++ b/e-util/gal-a11y-e-text-factory.c @@ -24,7 +24,7 @@ #include <config.h> #endif -#include "text/e-text.h" +#include "e-text.h" #include "gal-a11y-e-text-factory.h" #include "gal-a11y-e-text.h" diff --git a/widgets/text/gal-a11y-e-text-factory.h b/e-util/gal-a11y-e-text-factory.h index 1e66d34ff8..4647fe3fcd 100644 --- a/widgets/text/gal-a11y-e-text-factory.h +++ b/e-util/gal-a11y-e-text-factory.h @@ -20,6 +20,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef __GAL_A11Y_E_TEXT_FACTORY_H__ #define __GAL_A11Y_E_TEXT_FACTORY_H__ diff --git a/widgets/text/gal-a11y-e-text.c b/e-util/gal-a11y-e-text.c index 44b069d3a7..9b03a78483 100644 --- a/widgets/text/gal-a11y-e-text.c +++ b/e-util/gal-a11y-e-text.c @@ -24,16 +24,16 @@ #include <config.h> #endif +#include "gal-a11y-e-text.h" + #include <string.h> #include <gtk/gtk.h> -#include "a11y/gal-a11y-util.h" -#include "text/e-text.h" -#include "text/e-text-model-repos.h" - -#include "gal-a11y-e-text.h" +#include "e-text.h" +#include "e-text-model-repos.h" #include "gal-a11y-e-text-factory.h" +#include "gal-a11y-util.h" static GObjectClass *parent_class; static AtkComponentIface *component_parent_iface; diff --git a/widgets/text/gal-a11y-e-text.h b/e-util/gal-a11y-e-text.h index adf2833a19..22ebe09dd1 100644 --- a/widgets/text/gal-a11y-e-text.h +++ b/e-util/gal-a11y-e-text.h @@ -21,10 +21,14 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef __GAL_A11Y_E_TEXT_H__ #define __GAL_A11Y_E_TEXT_H__ -#include <table/e-table-item.h> +#include <atk/atk.h> #define GAL_A11Y_TYPE_E_TEXT (gal_a11y_e_text_get_type ()) #define GAL_A11Y_E_TEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAL_A11Y_TYPE_E_TEXT, GalA11yEText)) diff --git a/widgets/table/gal-a11y-e-tree-factory.c b/e-util/gal-a11y-e-tree-factory.c index 00ce55c8c0..00ce55c8c0 100644 --- a/widgets/table/gal-a11y-e-tree-factory.c +++ b/e-util/gal-a11y-e-tree-factory.c diff --git a/widgets/table/gal-a11y-e-tree-factory.h b/e-util/gal-a11y-e-tree-factory.h index a2e44445a0..5919ab2091 100644 --- a/widgets/table/gal-a11y-e-tree-factory.h +++ b/e-util/gal-a11y-e-tree-factory.h @@ -20,6 +20,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef __GAL_A11Y_E_TREE_FACTORY_H__ #define __GAL_A11Y_E_TREE_FACTORY_H__ diff --git a/widgets/table/gal-a11y-e-tree.c b/e-util/gal-a11y-e-tree.c index 26d2f24e7b..52c34f312b 100644 --- a/widgets/table/gal-a11y-e-tree.c +++ b/e-util/gal-a11y-e-tree.c @@ -24,13 +24,13 @@ #include <config.h> #endif -#include "a11y/gal-a11y-util.h" -#include "table/e-table-item.h" -#include "table/e-tree.h" +#include "gal-a11y-e-tree.h" +#include "e-table-item.h" +#include "e-tree.h" #include "gal-a11y-e-table-item.h" -#include "gal-a11y-e-tree.h" #include "gal-a11y-e-tree-factory.h" +#include "gal-a11y-util.h" #define CS_CLASS(a11y) (G_TYPE_INSTANCE_GET_CLASS ((a11y), C_TYPE_STREAM, GalA11yETreeClass)) static AtkObjectClass *parent_class; diff --git a/widgets/table/gal-a11y-e-tree.h b/e-util/gal-a11y-e-tree.h index 61799e1b93..709fce0380 100644 --- a/widgets/table/gal-a11y-e-tree.h +++ b/e-util/gal-a11y-e-tree.h @@ -20,6 +20,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef __GAL_A11Y_E_TREE_H__ #define __GAL_A11Y_E_TREE_H__ diff --git a/a11y/gal-a11y-factory.h b/e-util/gal-a11y-factory.h index 9cd2b7b151..79ffcf286f 100644 --- a/a11y/gal-a11y-factory.h +++ b/e-util/gal-a11y-factory.h @@ -22,6 +22,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef _GAL_A11Y_FACTORY_H__ #define _GAL_A11Y_FACTORY_H__ diff --git a/a11y/gal-a11y-util.c b/e-util/gal-a11y-util.c index 9d44758187..9d44758187 100644 --- a/a11y/gal-a11y-util.c +++ b/e-util/gal-a11y-util.c diff --git a/a11y/gal-a11y-util.h b/e-util/gal-a11y-util.h index d6cf7f4000..75642621d9 100644 --- a/a11y/gal-a11y-util.h +++ b/e-util/gal-a11y-util.h @@ -21,6 +21,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef __GAL_A11Y_UTIL_H__ #define __GAL_A11Y_UTIL_H__ diff --git a/widgets/menus/gal-define-views-dialog.c b/e-util/gal-define-views-dialog.c index 974cdad323..4bed5944e1 100644 --- a/widgets/menus/gal-define-views-dialog.c +++ b/e-util/gal-define-views-dialog.c @@ -27,8 +27,8 @@ #include <glib/gi18n.h> -#include "e-util/e-util.h" -#include "e-util/e-util-private.h" +#include "e-misc-utils.h" +#include "e-util-private.h" #include "gal-define-views-dialog.h" #include "gal-define-views-model.h" diff --git a/widgets/menus/gal-define-views-dialog.h b/e-util/gal-define-views-dialog.h index feb349e2d3..a3b6973cf5 100644 --- a/widgets/menus/gal-define-views-dialog.h +++ b/e-util/gal-define-views-dialog.h @@ -20,11 +20,15 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef GAL_DEFINE_VIEWS_DIALOG_H #define GAL_DEFINE_VIEWS_DIALOG_H #include <gtk/gtk.h> -#include <menus/gal-view-collection.h> +#include <e-util/gal-view-collection.h> /* Standard GObject macros */ #define GAL_TYPE_DEFINE_VIEWS_DIALOG \ diff --git a/widgets/menus/gal-define-views-model.c b/e-util/gal-define-views-model.c index d9432d24cc..f9963acbfe 100644 --- a/widgets/menus/gal-define-views-model.c +++ b/e-util/gal-define-views-model.c @@ -29,7 +29,6 @@ #include <libxml/xmlmemory.h> #include <glib/gi18n.h> -#include "e-util/e-util.h" #include "gal-define-views-model.h" diff --git a/widgets/menus/gal-define-views-model.h b/e-util/gal-define-views-model.h index cc7b7a5aa4..7219384a59 100644 --- a/widgets/menus/gal-define-views-model.h +++ b/e-util/gal-define-views-model.h @@ -21,12 +21,16 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef _GAL_DEFINE_VIEWS_MODEL_H_ #define _GAL_DEFINE_VIEWS_MODEL_H_ -#include <table/e-table-model.h> -#include <widgets/menus/gal-view.h> -#include <widgets/menus/gal-view-collection.h> +#include <e-util/e-table-model.h> +#include <e-util/gal-view.h> +#include <e-util/gal-view-collection.h> G_BEGIN_DECLS diff --git a/widgets/menus/gal-define-views.ui b/e-util/gal-define-views.ui index b3314aa4ee..b3314aa4ee 100644 --- a/widgets/menus/gal-define-views.ui +++ b/e-util/gal-define-views.ui diff --git a/widgets/menus/gal-view-collection.c b/e-util/gal-view-collection.c index 85dcc32f13..bcbad52fea 100644 --- a/widgets/menus/gal-view-collection.c +++ b/e-util/gal-view-collection.c @@ -24,6 +24,8 @@ #include <config.h> #endif +#include "gal-view-collection.h" + #include <ctype.h> #include <string.h> #include <errno.h> @@ -32,11 +34,9 @@ #include <libedataserver/libedataserver.h> #include <glib/gi18n.h> -#include "e-util/e-util.h" -#include "libevolution-utils/e-xml-utils.h" -#include "e-util/e-unicode.h" -#include "gal-view-collection.h" +#include "e-unicode.h" +#include "e-xml-utils.h" G_DEFINE_TYPE (GalViewCollection, gal_view_collection, G_TYPE_OBJECT) diff --git a/widgets/menus/gal-view-collection.h b/e-util/gal-view-collection.h index 143bee53d1..980f7c0365 100644 --- a/widgets/menus/gal-view-collection.h +++ b/e-util/gal-view-collection.h @@ -20,10 +20,14 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef _GAL_VIEW_SET_H_ #define _GAL_VIEW_SET_H_ -#include <menus/gal-view-factory.h> +#include <e-util/gal-view-factory.h> G_BEGIN_DECLS diff --git a/widgets/menus/gal-view-etable.c b/e-util/gal-view-etable.c index c259cc9004..3f50e2881a 100644 --- a/widgets/menus/gal-view-etable.c +++ b/e-util/gal-view-etable.c @@ -24,10 +24,10 @@ #include <config.h> #endif -#include "table/e-table-config.h" - #include "gal-view-etable.h" +#include "e-table-config.h" + G_DEFINE_TYPE (GalViewEtable, gal_view_etable, GAL_TYPE_VIEW) static void diff --git a/widgets/menus/gal-view-etable.h b/e-util/gal-view-etable.h index cfccf1e15b..92f7e64efb 100644 --- a/widgets/menus/gal-view-etable.h +++ b/e-util/gal-view-etable.h @@ -21,15 +21,19 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef GAL_VIEW_ETABLE_H #define GAL_VIEW_ETABLE_H #include <gtk/gtk.h> -#include <menus/gal-view.h> -#include <table/e-table-state.h> -#include <table/e-table-specification.h> -#include <table/e-table.h> -#include <table/e-tree.h> +#include <e-util/gal-view.h> +#include <e-util/e-table-state.h> +#include <e-util/e-table-specification.h> +#include <e-util/e-table.h> +#include <e-util/e-tree.h> /* Standard GObject macros */ #define GAL_TYPE_VIEW_ETABLE \ diff --git a/widgets/menus/gal-view-factory-etable.c b/e-util/gal-view-factory-etable.c index 8570d3c98c..632c959a85 100644 --- a/widgets/menus/gal-view-factory-etable.c +++ b/e-util/gal-view-factory-etable.c @@ -26,7 +26,6 @@ #endif #include <glib/gi18n.h> -#include "e-util/e-util.h" #include "gal-view-etable.h" #include "gal-view-factory-etable.h" diff --git a/widgets/menus/gal-view-factory-etable.h b/e-util/gal-view-factory-etable.h index a107b87083..cc4b617448 100644 --- a/widgets/menus/gal-view-factory-etable.h +++ b/e-util/gal-view-factory-etable.h @@ -21,12 +21,16 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef GAL_VIEW_FACTORY_ETABLE_H #define GAL_VIEW_FACTORY_ETABLE_H #include <gtk/gtk.h> -#include <menus/gal-view-factory.h> -#include <table/e-table-specification.h> +#include <e-util/gal-view-factory.h> +#include <e-util/e-table-specification.h> /* Standard GObject macros */ #define GAL_TYPE_VIEW_FACTORY_ETABLE \ diff --git a/widgets/menus/gal-view-factory.c b/e-util/gal-view-factory.c index 0f311cf976..0e0dde05cb 100644 --- a/widgets/menus/gal-view-factory.c +++ b/e-util/gal-view-factory.c @@ -26,8 +26,6 @@ #include "gal-view-factory.h" -#include <e-util/e-util.h> - G_DEFINE_TYPE (GalViewFactory, gal_view_factory, G_TYPE_OBJECT) /* XXX Should GalViewFactory be a GInterface? */ diff --git a/widgets/menus/gal-view-factory.h b/e-util/gal-view-factory.h index 92c3df45ac..abdcacd6ac 100644 --- a/widgets/menus/gal-view-factory.h +++ b/e-util/gal-view-factory.h @@ -21,10 +21,14 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef GAL_VIEW_FACTORY_H #define GAL_VIEW_FACTORY_H -#include <menus/gal-view.h> +#include <e-util/gal-view.h> /* Standard GObject macros */ #define GAL_TYPE_VIEW_FACTORY \ diff --git a/widgets/menus/gal-view-instance-save-as-dialog.c b/e-util/gal-view-instance-save-as-dialog.c index df1d1ca743..c71892e4ff 100644 --- a/widgets/menus/gal-view-instance-save-as-dialog.c +++ b/e-util/gal-view-instance-save-as-dialog.c @@ -24,12 +24,13 @@ #include <config.h> #endif +#include "gal-view-instance-save-as-dialog.h" + #include <glib/gi18n.h> -#include "e-util/e-util.h" -#include "e-util/e-util-private.h" +#include "e-misc-utils.h" +#include "e-util-private.h" #include "gal-define-views-model.h" -#include "gal-view-instance-save-as-dialog.h" #include "gal-view-new-dialog.h" G_DEFINE_TYPE (GalViewInstanceSaveAsDialog, gal_view_instance_save_as_dialog, GTK_TYPE_DIALOG) diff --git a/widgets/menus/gal-view-instance-save-as-dialog.h b/e-util/gal-view-instance-save-as-dialog.h index b5f9ac56e8..47b76b1155 100644 --- a/widgets/menus/gal-view-instance-save-as-dialog.h +++ b/e-util/gal-view-instance-save-as-dialog.h @@ -20,12 +20,16 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef GAL_VIEW_INSTANCE_SAVE_AS_DIALOG_H #define GAL_VIEW_INSTANCE_SAVE_AS_DIALOG_H #include <gtk/gtk.h> -#include <widgets/menus/gal-view-collection.h> -#include <widgets/menus/gal-view-instance.h> +#include <e-util/gal-view-collection.h> +#include <e-util/gal-view-instance.h> /* Standard GObject macros */ #define GAL_TYPE_VIEW_INSTANCE_SAVE_AS_DIALOG \ diff --git a/widgets/menus/gal-view-instance-save-as-dialog.ui b/e-util/gal-view-instance-save-as-dialog.ui index d7215f1f61..d7215f1f61 100644 --- a/widgets/menus/gal-view-instance-save-as-dialog.ui +++ b/e-util/gal-view-instance-save-as-dialog.ui diff --git a/widgets/menus/gal-view-instance.c b/e-util/gal-view-instance.c index 97ba252a0b..e0a107f146 100644 --- a/widgets/menus/gal-view-instance.c +++ b/e-util/gal-view-instance.c @@ -25,6 +25,8 @@ #include <config.h> #endif +#include "gal-view-instance.h" + #include <ctype.h> #include <string.h> #include <errno.h> @@ -38,12 +40,9 @@ #include <libedataserver/libedataserver.h> -#include "e-util/e-util.h" -#include "libevolution-utils/e-xml-utils.h" -#include "e-util/e-unicode.h" - +#include "e-unicode.h" +#include "e-xml-utils.h" #include "gal-define-views-dialog.h" -#include "gal-view-instance.h" #include "gal-view-instance-save-as-dialog.h" G_DEFINE_TYPE (GalViewInstance, gal_view_instance, G_TYPE_OBJECT) diff --git a/widgets/menus/gal-view-instance.h b/e-util/gal-view-instance.h index 7495f0fa8f..c5debd1c3a 100644 --- a/widgets/menus/gal-view-instance.h +++ b/e-util/gal-view-instance.h @@ -21,10 +21,14 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef _GAL_VIEW_INSTANCE_H_ #define _GAL_VIEW_INSTANCE_H_ -#include <menus/gal-view-collection.h> +#include <e-util/gal-view-collection.h> G_BEGIN_DECLS diff --git a/widgets/menus/gal-view-new-dialog.c b/e-util/gal-view-new-dialog.c index b0de7156dc..1df95a1985 100644 --- a/widgets/menus/gal-view-new-dialog.c +++ b/e-util/gal-view-new-dialog.c @@ -25,13 +25,14 @@ #include <config.h> #endif +#include "gal-view-new-dialog.h" + #include <glib/gi18n.h> -#include "e-util/e-util.h" -#include "e-util/e-util-private.h" -#include "e-util/e-unicode.h" +#include "e-misc-utils.h" +#include "e-util-private.h" +#include "e-unicode.h" #include "gal-define-views-model.h" -#include "gal-view-new-dialog.h" enum { PROP_0, diff --git a/widgets/menus/gal-view-new-dialog.h b/e-util/gal-view-new-dialog.h index 6b7d2b0335..503a594abb 100644 --- a/widgets/menus/gal-view-new-dialog.h +++ b/e-util/gal-view-new-dialog.h @@ -20,11 +20,15 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef __GAL_VIEW_NEW_DIALOG_H__ #define __GAL_VIEW_NEW_DIALOG_H__ #include <gtk/gtk.h> -#include <gal-view-collection.h> +#include <e-util/gal-view-collection.h> G_BEGIN_DECLS diff --git a/widgets/menus/gal-view-new-dialog.ui b/e-util/gal-view-new-dialog.ui index 227e3954d8..227e3954d8 100644 --- a/widgets/menus/gal-view-new-dialog.ui +++ b/e-util/gal-view-new-dialog.ui diff --git a/widgets/menus/gal-view.c b/e-util/gal-view.c index b24be56e83..4302988a6e 100644 --- a/widgets/menus/gal-view.c +++ b/e-util/gal-view.c @@ -27,8 +27,6 @@ #include "gal-view.h" -#include <e-util/e-util.h> - #define d(x) enum { diff --git a/widgets/menus/gal-view.h b/e-util/gal-view.h index 84c26ba77f..d769895d03 100644 --- a/widgets/menus/gal-view.h +++ b/e-util/gal-view.h @@ -21,6 +21,10 @@ * */ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + #ifndef GAL_VIEW_H #define GAL_VIEW_H diff --git a/widgets/misc/test-calendar.c b/e-util/test-calendar.c index 7d3584a424..718c80e639 100644 --- a/widgets/misc/test-calendar.c +++ b/e-util/test-calendar.c @@ -29,8 +29,7 @@ #endif #include <gtk/gtk.h> - -#include "e-calendar.h" +#include <e-util/e-util.h> /* Drag and Drop stuff. */ enum { diff --git a/e-util/test-category-completion.c b/e-util/test-category-completion.c new file mode 100644 index 0000000000..d9e14731e1 --- /dev/null +++ b/e-util/test-category-completion.c @@ -0,0 +1,67 @@ +/* + * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU Lesser General Public + * License as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include <e-util/e-util.h> + +static gboolean +on_idle_create_widget (void) +{ + GtkWidget *window; + GtkWidget *vgrid; + GtkWidget *entry; + GtkEntryCompletion *completion; + + window = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_window_set_default_size (GTK_WINDOW (window), 400, 200); + + g_signal_connect ( + window, "delete-event", + G_CALLBACK (gtk_main_quit), NULL); + + vgrid = g_object_new (GTK_TYPE_GRID, + "orientation", GTK_ORIENTATION_VERTICAL, + "column-homogeneous", FALSE, + "row-spacing", 3, + NULL); + gtk_container_add (GTK_CONTAINER (window), vgrid); + + entry = gtk_entry_new (); + completion = e_category_completion_new (); + gtk_entry_set_completion (GTK_ENTRY (entry), completion); + gtk_widget_set_vexpand (entry, TRUE); + gtk_widget_set_hexpand (entry, TRUE); + gtk_widget_set_halign (entry, GTK_ALIGN_FILL); + gtk_container_add (GTK_CONTAINER (vgrid), entry); + + gtk_widget_show_all (window); + + return FALSE; +} + +gint +main (gint argc, + gchar **argv) +{ + gtk_init (&argc, &argv); + + g_idle_add ((GSourceFunc) on_idle_create_widget, NULL); + + gtk_main (); + + return 0; +} diff --git a/e-util/test-contact-store.c b/e-util/test-contact-store.c new file mode 100644 index 0000000000..59ba42502b --- /dev/null +++ b/e-util/test-contact-store.c @@ -0,0 +1,145 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ + +/* test-contact-store.c - Test program for EContactStore. + * + * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU Lesser General Public + * License as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + * + * Author: Hans Petter Jansson <hpj@novell.com> + */ + +#include <e-util/e-util.h> + +static void +entry_changed (GtkWidget *entry, + EContactStore *contact_store) +{ + const gchar *text; + EBookQuery *query; + + text = gtk_entry_get_text (GTK_ENTRY (entry)); + + query = e_book_query_any_field_contains (text); + e_contact_store_set_query (contact_store, query); + e_book_query_unref (query); +} + +static GtkTreeViewColumn * +create_text_column_for_field (EContactField field_id) +{ + GtkTreeViewColumn *column; + GtkCellRenderer *cell_renderer; + + column = gtk_tree_view_column_new (); + cell_renderer = GTK_CELL_RENDERER (gtk_cell_renderer_text_new ()); + gtk_tree_view_column_pack_start (column, cell_renderer, TRUE); + gtk_tree_view_column_set_resizable (column, TRUE); + gtk_tree_view_column_set_title (column, e_contact_pretty_name (field_id)); + gtk_tree_view_column_add_attribute (column, cell_renderer, "text", field_id); + gtk_tree_view_column_set_sort_column_id (column, field_id); + + return column; +} + +static gint +start_test (const gchar *param) +{ + EContactStore *contact_store; + GtkTreeModel *model_sort; + GtkWidget *scrolled_window; + GtkWidget *window; + GtkWidget *tree_view; + GtkWidget *vgrid; + GtkWidget *entry; + GtkTreeViewColumn *column; +#if 0 /* ACCOUNT_MGMT */ + EBookClient *book_client; +#endif /* ACCOUNT_MGMT */ + EBookQuery *book_query; + + window = gtk_window_new (GTK_WINDOW_TOPLEVEL); + + vgrid = g_object_new (GTK_TYPE_GRID, + "orientation", GTK_ORIENTATION_VERTICAL, + "column-homogeneous", FALSE, + "row-spacing", 2, + NULL); + gtk_container_add (GTK_CONTAINER (window), vgrid); + + entry = gtk_entry_new (); + gtk_widget_set_halign (entry, GTK_ALIGN_FILL); + gtk_container_add (GTK_CONTAINER (vgrid), entry); + + scrolled_window = gtk_scrolled_window_new (NULL, NULL); + gtk_widget_set_hexpand (scrolled_window, TRUE); + gtk_widget_set_halign (scrolled_window, GTK_ALIGN_FILL); + gtk_widget_set_vexpand (scrolled_window, TRUE); + gtk_widget_set_valign (scrolled_window, GTK_ALIGN_FILL); + gtk_container_add (GTK_CONTAINER (vgrid), scrolled_window); + + contact_store = e_contact_store_new (); + model_sort = gtk_tree_model_sort_new_with_model (GTK_TREE_MODEL (contact_store)); + tree_view = GTK_WIDGET (gtk_tree_view_new ()); + gtk_tree_view_set_model (GTK_TREE_VIEW (tree_view), model_sort); + + column = create_text_column_for_field (E_CONTACT_FILE_AS); + gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), column); + + column = create_text_column_for_field (E_CONTACT_FULL_NAME); + gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), column); + + column = create_text_column_for_field (E_CONTACT_EMAIL_1); + gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), column); + + gtk_container_add (GTK_CONTAINER (scrolled_window), tree_view); + +#if 0 /* ACCOUNT_MGMT */ + book_client = e_book_client_new_default (NULL); + g_warn_if_fail (e_client_open_sync (E_CLIENT (book_client), TRUE, NULL, NULL)); + e_contact_store_add_client (contact_store, book_client); + g_object_unref (book_client); +#endif /* ACCOUNT_MGMT */ + + book_query = e_book_query_any_field_contains (""); + e_contact_store_set_query (contact_store, book_query); + e_book_query_unref (book_query); + + g_signal_connect (entry, "changed", G_CALLBACK (entry_changed), contact_store); + + gtk_widget_show_all (window); + + return FALSE; +} + +gint +main (gint argc, + gchar **argv) +{ + const gchar *param; + + gtk_init (&argc, &argv); + + if (argc < 2) + param = "???"; + else + param = argv[1]; + + g_idle_add ((GSourceFunc) start_test, (gpointer) param); + + gtk_main (); + + return 0; +} diff --git a/widgets/misc/test-dateedit.c b/e-util/test-dateedit.c index 5592afbc70..5592afbc70 100644 --- a/widgets/misc/test-dateedit.c +++ b/e-util/test-dateedit.c diff --git a/widgets/misc/test-mail-signatures.c b/e-util/test-mail-signatures.c index 597e77effb..3dc5f0a720 100644 --- a/widgets/misc/test-mail-signatures.c +++ b/e-util/test-mail-signatures.c @@ -20,11 +20,7 @@ #include <libedataserver/libedataserver.h> -#include <libevolution-utils/e-alert-sink.h> -#include <misc/e-mail-identity-combo-box.h> -#include <misc/e-mail-signature-combo-box.h> -#include <misc/e-mail-signature-manager.h> -#include <misc/e-mail-signature-preview.h> +#include <e-util/e-util.h> static GCancellable *cancellable = NULL; diff --git a/e-util/test-name-selector.c b/e-util/test-name-selector.c new file mode 100644 index 0000000000..3744ad9f1a --- /dev/null +++ b/e-util/test-name-selector.c @@ -0,0 +1,102 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ + +/* test-name-selector.c - Test for name selector components. + * + * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU Lesser General Public + * License as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + * + * Author: Hans Petter Jansson <hpj@novell.com> + */ + +#include <camel/camel.h> +#include <e-util/e-util.h> + +static ENameSelectorDialog *name_selector_dialog; +static GtkWidget *name_selector_entry_window; + +static void +close_dialog (GtkWidget *widget, + gint response, + gpointer data) +{ + gtk_widget_destroy (GTK_WIDGET (name_selector_dialog)); + gtk_widget_destroy (name_selector_entry_window); + + g_timeout_add (4000, (GSourceFunc) gtk_main_quit, NULL); +} + +static gboolean +start_test (ESourceRegistry *registry) +{ + ENameSelectorModel *name_selector_model; + ENameSelectorEntry *name_selector_entry; + EDestinationStore *destination_store; + GtkWidget *container; + + destination_store = e_destination_store_new (); + name_selector_model = e_name_selector_model_new (); + + e_name_selector_model_add_section (name_selector_model, "to", "To", destination_store); + e_name_selector_model_add_section (name_selector_model, "cc", "Cc", NULL); + e_name_selector_model_add_section (name_selector_model, "bcc", "Bcc", NULL); + + name_selector_dialog = e_name_selector_dialog_new (registry); + e_name_selector_dialog_set_model (name_selector_dialog, name_selector_model); + gtk_window_set_modal (GTK_WINDOW (name_selector_dialog), FALSE); + + name_selector_entry = e_name_selector_entry_new (registry); + e_name_selector_entry_set_destination_store (name_selector_entry, destination_store); + + g_signal_connect (name_selector_dialog, "response", G_CALLBACK (close_dialog), name_selector_dialog); + gtk_widget_show (GTK_WIDGET (name_selector_dialog)); + + container = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_container_add (GTK_CONTAINER (container), GTK_WIDGET (name_selector_entry)); + gtk_widget_show_all (container); + + name_selector_entry_window = container; + + g_object_unref (name_selector_model); + g_object_unref (destination_store); + return FALSE; +} + +gint +main (gint argc, + gchar **argv) +{ + ESourceRegistry *registry; + GError *error = NULL; + + gtk_init (&argc, &argv); + + camel_init (NULL, 0); + + registry = e_source_registry_new_sync (NULL, &error); + + if (error != NULL) { + g_error ( + "Failed to load ESource registry: %s", + error->message); + g_assert_not_reached (); + } + + g_idle_add ((GSourceFunc) start_test, registry); + + gtk_main (); + + return 0; +} diff --git a/widgets/misc/test-preferences-window.c b/e-util/test-preferences-window.c index 4ad30e2245..4ad30e2245 100644 --- a/widgets/misc/test-preferences-window.c +++ b/e-util/test-preferences-window.c diff --git a/e-util/test-source-combo-box.c b/e-util/test-source-combo-box.c new file mode 100644 index 0000000000..cb40f6eb18 --- /dev/null +++ b/e-util/test-source-combo-box.c @@ -0,0 +1,107 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* test-source-combo-box.c - Test for ESourceComboBox. + * + * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU Lesser General Public + * License as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + * + * Author: Ettore Perazzoli <ettore@ximian.com> + */ + +#include <config.h> +#include <gtk/gtk.h> + +#include <e-util/e-util.h> + +static const gchar *extension_name; + +static void +source_changed_cb (ESourceComboBox *combo_box) +{ + ESource *source; + + source = e_source_combo_box_ref_active (combo_box); + if (source != NULL) { + const gchar *display_name; + display_name = e_source_get_display_name (source); + g_print ("source selected: \"%s\"\n", display_name); + g_object_unref (source); + } else { + g_print ("source selected: (none)\n"); + } +} + +static gint +on_idle_create_widget (ESourceRegistry *registry) +{ + GtkWidget *window; + GtkWidget *box; + GtkWidget *combo_box; + GtkWidget *button; + + window = gtk_window_new (GTK_WINDOW_TOPLEVEL); + + box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6); + gtk_container_add (GTK_CONTAINER (window), box); + + combo_box = e_source_combo_box_new (registry, extension_name); + g_signal_connect ( + combo_box, "changed", + G_CALLBACK (source_changed_cb), NULL); + gtk_box_pack_start (GTK_BOX (box), combo_box, FALSE, FALSE, 0); + + button = gtk_toggle_button_new_with_label ("Show Colors"); + gtk_box_pack_start (GTK_BOX (box), button, FALSE, FALSE, 0); + + g_object_bind_property ( + combo_box, "show-colors", + button, "active", + G_BINDING_SYNC_CREATE | + G_BINDING_BIDIRECTIONAL); + + gtk_widget_show_all (window); + + return FALSE; +} + +gint +main (gint argc, + gchar **argv) +{ + ESourceRegistry *registry; + GError *error = NULL; + + gtk_init (&argc, &argv); + + if (argc < 2) + extension_name = E_SOURCE_EXTENSION_ADDRESS_BOOK; + else + extension_name = argv[1]; + + registry = e_source_registry_new_sync (NULL, &error); + + if (error != NULL) { + g_error ( + "Failed to load ESource registry: %s", + error->message); + g_assert_not_reached (); + } + + g_idle_add ((GSourceFunc) on_idle_create_widget, registry); + + gtk_main (); + + return 0; +} diff --git a/widgets/misc/test-source-config.c b/e-util/test-source-config.c index 4a5ce30d91..4a5ce30d91 100644 --- a/widgets/misc/test-source-config.c +++ b/e-util/test-source-config.c diff --git a/e-util/test-source-selector.c b/e-util/test-source-selector.c new file mode 100644 index 0000000000..0c1a77289e --- /dev/null +++ b/e-util/test-source-selector.c @@ -0,0 +1,157 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* test-source-list-selector.c - Test program for the ESourceListSelector + * widget. + * + * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU Lesser General Public + * License as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + * + * Author: Ettore Perazzoli <ettore@ximian.com> + */ + +#include <e-util/e-util.h> + +static const gchar *extension_name; + +static void +dump_selection (ESourceSelector *selector) +{ + GSList *selection = e_source_selector_get_selection (selector); + + g_print ("Current selection:\n"); + if (selection == NULL) { + g_print ("\t(None)\n"); + } else { + GSList *p; + + for (p = selection; p != NULL; p = p->next) { + ESource *source = E_SOURCE (p->data); + ESourceBackend *extension; + + extension = e_source_get_extension ( + source, extension_name); + + g_print ( + "\tSource %s (backend %s)\n", + e_source_get_display_name (source), + e_source_backend_get_backend_name (extension)); + } + } + + e_source_selector_free_selection (selection); +} + +static void +selection_changed_callback (ESourceSelector *selector) +{ + g_print ("Selection changed!\n"); + dump_selection (selector); +} + +static gint +on_idle_create_widget (ESourceRegistry *registry) +{ + GtkWidget *window; + GtkWidget *vgrid; + GtkWidget *selector; + GtkWidget *scrolled_window; + GtkWidget *check; + + window = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_window_set_default_size (GTK_WINDOW (window), 200, 300); + + g_signal_connect ( + window, "delete-event", + G_CALLBACK (gtk_main_quit), NULL); + + vgrid = g_object_new (GTK_TYPE_GRID, + "orientation", GTK_ORIENTATION_VERTICAL, + "column-homogeneous", FALSE, + "row-spacing", 6, + NULL); + gtk_container_add (GTK_CONTAINER (window), vgrid); + + selector = e_source_selector_new (registry, extension_name); + g_signal_connect ( + selector, "selection_changed", + G_CALLBACK (selection_changed_callback), NULL); + + scrolled_window = gtk_scrolled_window_new (NULL, NULL); + gtk_scrolled_window_set_policy ( + GTK_SCROLLED_WINDOW (scrolled_window), + GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); + gtk_scrolled_window_set_shadow_type ( + GTK_SCROLLED_WINDOW (scrolled_window), GTK_SHADOW_IN); + gtk_container_add (GTK_CONTAINER (scrolled_window), selector); + gtk_widget_set_hexpand (scrolled_window, TRUE); + gtk_widget_set_halign (scrolled_window, GTK_ALIGN_FILL); + gtk_widget_set_vexpand (scrolled_window, TRUE); + gtk_widget_set_valign (scrolled_window, GTK_ALIGN_FILL); + gtk_container_add (GTK_CONTAINER (vgrid), scrolled_window); + + check = gtk_check_button_new_with_label ("Show colors"); + gtk_widget_set_halign (check, GTK_ALIGN_FILL); + gtk_container_add (GTK_CONTAINER (vgrid), check); + + g_object_bind_property ( + selector, "show-colors", + check, "active", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); + + check = gtk_check_button_new_with_label ("Show toggles"); + gtk_widget_set_halign (check, GTK_ALIGN_FILL); + gtk_container_add (GTK_CONTAINER (vgrid), check); + + g_object_bind_property ( + selector, "show-toggles", + check, "active", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); + + gtk_widget_show_all (window); + + return FALSE; +} + +gint +main (gint argc, + gchar **argv) +{ + ESourceRegistry *registry; + GError *error = NULL; + + gtk_init (&argc, &argv); + + if (argc < 2) + extension_name = E_SOURCE_EXTENSION_ADDRESS_BOOK; + else + extension_name = argv[1]; + + registry = e_source_registry_new_sync (NULL, &error); + + if (error != NULL) { + g_error ( + "Failed to load ESource registry: %s", + error->message); + g_assert_not_reached (); + } + + g_idle_add ((GSourceFunc) on_idle_create_widget, registry); + + gtk_main (); + + return 0; +} diff --git a/widgets/table/tree-expanded.xpm b/e-util/tree-expanded.xpm index 94d162d40b..94d162d40b 100644 --- a/widgets/table/tree-expanded.xpm +++ b/e-util/tree-expanded.xpm diff --git a/widgets/table/tree-unexpanded.xpm b/e-util/tree-unexpanded.xpm index d20ec5aa33..d20ec5aa33 100644 --- a/widgets/table/tree-unexpanded.xpm +++ b/e-util/tree-unexpanded.xpm diff --git a/widgets/misc/widgets.error.xml b/e-util/widgets.error.xml index efaa41c42e..efaa41c42e 100644 --- a/widgets/misc/widgets.error.xml +++ b/e-util/widgets.error.xml diff --git a/em-format/Makefile.am b/em-format/Makefile.am index 164f3004b5..5b2f4aa0e2 100644 --- a/em-format/Makefile.am +++ b/em-format/Makefile.am @@ -25,12 +25,13 @@ libemformat_la_CPPFLAGS = \ -I$(top_srcdir)/em-format \ -I$(top_srcdir)/smime/lib \ -I$(top_srcdir)/smime/gui \ - -I$(top_srcdir)/widgets \ + -DEVOLUTION_IMAGESDIR=\""$(imagesdir)"\" \ + -DEVOLUTION_PRIVDATADIR=\""$(privdatadir)"\" \ $(EVOLUTION_DATA_SERVER_CFLAGS) \ $(GNOME_PLATFORM_CFLAGS) \ - $(LIBSOUP_CFLAGS) \ - -DEVOLUTION_IMAGESDIR=\""$(imagesdir)"\" \ - -DEVOLUTION_PRIVDATADIR=\""$(privdatadir)"\" + $(CHAMPLAIN_CFLAGS) \ + $(GTKHTML_CFLAGS) \ + $(LIBSOUP_CFLAGS) if ENABLE_SMIME SMIME_EXTENSIONS = e-mail-parser-application-smime.c @@ -104,14 +105,13 @@ SMIME_LIBS = \ endif libemformat_la_LIBADD = \ - $(top_builddir)/libevolution-utils/libevolution-utils.la \ $(top_builddir)/e-util/libeutil.la \ $(top_builddir)/shell/libeshell.la \ - $(top_builddir)/libemail-utils/libemail-utils.la \ $(top_builddir)/libemail-engine/libemail-engine.la \ - $(top_builddir)/widgets/misc/libemiscwidgets.la \ $(EVOLUTION_DATA_SERVER_LIBS) \ $(GNOME_PLATFORM_LIBS) \ + $(CHAMPLAIN_LIBS) \ + $(GTKHTML_LIBS) \ $(LIBSOUP_LIBS) \ $(SMIME_LIBS) diff --git a/em-format/e-mail-extension-registry.c b/em-format/e-mail-extension-registry.c index e6a78e4e88..7e5f3a9b0b 100644 --- a/em-format/e-mail-extension-registry.c +++ b/em-format/e-mail-extension-registry.c @@ -16,18 +16,15 @@ * */ -#include <glib-object.h> - #include "e-mail-extension-registry.h" -#include "e-mail-formatter-extension.h" -#include "e-mail-parser-extension.h" -#include <libebackend/libebackend.h> -#include <camel/camel.h> - -#include <glib-object.h> #include <string.h> +#include <libebackend/libebackend.h> + +#include "e-mail-formatter-extension.h" +#include "e-mail-parser-extension.h" + #define E_MAIL_EXTENSION_REGISTRY_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ ((obj), E_TYPE_MAIL_EXTENSION_REGISTRY, EMailExtensionRegistryPrivate)) diff --git a/em-format/e-mail-formatter-attachment-bar.c b/em-format/e-mail-formatter-attachment-bar.c index d0e52cb37e..4591501331 100644 --- a/em-format/e-mail-formatter-attachment-bar.c +++ b/em-format/e-mail-formatter-attachment-bar.c @@ -19,13 +19,12 @@ #ifdef HAVE_CONFIG_H #include <config.h> #endif + #include "e-mail-part-attachment-bar.h" -#include <misc/e-attachment-bar.h> #include <glib/gi18n-lib.h> -#include <em-format/e-mail-formatter-extension.h> -#include <em-format/e-mail-formatter.h> +#include "e-mail-formatter-extension.h" typedef EMailFormatterExtension EMailFormatterAttachmentBar; typedef EMailFormatterExtensionClass EMailFormatterAttachmentBarClass; diff --git a/em-format/e-mail-formatter-attachment.c b/em-format/e-mail-formatter-attachment.c index 663bf841b4..f800ca2994 100644 --- a/em-format/e-mail-formatter-attachment.c +++ b/em-format/e-mail-formatter-attachment.c @@ -20,22 +20,16 @@ #include <config.h> #endif -#include "e-mail-part-attachment.h" -#include "e-mail-part-attachment-bar.h" - -#include <em-format/e-mail-formatter-extension.h> -#include <em-format/e-mail-formatter.h> -#include <em-format/e-mail-part-utils.h> -#include <em-format/e-mail-inline-filter.h> -#include <e-util/e-util.h> +#include <glib/gi18n-lib.h> #include <shell/e-shell.h> #include <shell/e-shell-window.h> -#include <widgets/misc/e-attachment-button.h> - -#include <glib/gi18n-lib.h> -#include <camel/camel.h> +#include "e-mail-formatter-extension.h" +#include "e-mail-inline-filter.h" +#include "e-mail-part-attachment-bar.h" +#include "e-mail-part-attachment.h" +#include "e-mail-part-utils.h" #define d(x) diff --git a/em-format/e-mail-formatter-error.c b/em-format/e-mail-formatter-error.c index 16cfccb049..3adaab90be 100644 --- a/em-format/e-mail-formatter-error.c +++ b/em-format/e-mail-formatter-error.c @@ -22,11 +22,9 @@ #include <glib/gi18n-lib.h> -#include <em-format/e-mail-formatter-extension.h> -#include <em-format/e-mail-formatter.h> #include <e-util/e-util.h> -#include <camel/camel.h> +#include "e-mail-formatter-extension.h" typedef EMailFormatterExtension EMailFormatterError; typedef EMailFormatterExtensionClass EMailFormatterErrorClass; diff --git a/em-format/e-mail-formatter-extension.h b/em-format/e-mail-formatter-extension.h index a921696ed5..9c7e4b95b7 100644 --- a/em-format/e-mail-formatter-extension.h +++ b/em-format/e-mail-formatter-extension.h @@ -19,10 +19,10 @@ #ifndef E_MAIL_FORMATTER_EXTENSION_H #define E_MAIL_FORMATTER_EXTENSION_H +#include <gtk/gtk.h> +#include <camel/camel.h> #include <em-format/e-mail-part.h> #include <em-format/e-mail-formatter.h> -#include <camel/camel.h> -#include <gtk/gtk.h> /* Standard GObject macros */ #define E_TYPE_MAIL_FORMATTER_EXTENSION \ diff --git a/em-format/e-mail-formatter-headers.c b/em-format/e-mail-formatter-headers.c index 56026b2025..3161d88db9 100644 --- a/em-format/e-mail-formatter-headers.c +++ b/em-format/e-mail-formatter-headers.c @@ -20,20 +20,17 @@ #include <config.h> #endif +#include <string.h> #include <glib/gi18n-lib.h> -#include <em-format/e-mail-formatter-extension.h> -#include <em-format/e-mail-formatter.h> -#include <em-format/e-mail-formatter-utils.h> -#include <em-format/e-mail-inline-filter.h> #include <libemail-engine/e-mail-utils.h> #include <libedataserver/libedataserver.h> #include <e-util/e-util.h> #include <shell/e-shell.h> -#include <camel/camel.h> - -#include <string.h> +#include "e-mail-formatter-extension.h" +#include "e-mail-formatter-utils.h" +#include "e-mail-inline-filter.h" typedef EMailFormatterExtension EMailFormatterHeaders; typedef EMailFormatterExtensionClass EMailFormatterHeadersClass; diff --git a/em-format/e-mail-formatter-image.c b/em-format/e-mail-formatter-image.c index 68bef6a64c..4cdd8443e6 100644 --- a/em-format/e-mail-formatter-image.c +++ b/em-format/e-mail-formatter-image.c @@ -20,16 +20,14 @@ #include <config.h> #endif -#include <em-format/e-mail-parser-extension.h> -#include <em-format/e-mail-formatter-extension.h> -#include <em-format/e-mail-part-utils.h> -#include <em-format/e-mail-parser.h> -#include <em-format/e-mail-formatter.h> -#include <em-format/e-mail-inline-filter.h> +#include <glib/gi18n-lib.h> + #include <e-util/e-util.h> -#include <glib/gi18n-lib.h> -#include <camel/camel.h> +#include "e-mail-formatter-extension.h" +#include "e-mail-inline-filter.h" +#include "e-mail-parser-extension.h" +#include "e-mail-part-utils.h" typedef EMailFormatterExtension EMailFormatterImage; typedef EMailFormatterExtensionClass EMailFormatterImageClass; diff --git a/em-format/e-mail-formatter-message-rfc822.c b/em-format/e-mail-formatter-message-rfc822.c index 261dfe8d1b..c0179ab848 100644 --- a/em-format/e-mail-formatter-message-rfc822.c +++ b/em-format/e-mail-formatter-message-rfc822.c @@ -20,18 +20,14 @@ #include <config.h> #endif +#include <string.h> #include <glib/gi18n-lib.h> -#include <glib-object.h> -#include <em-format/e-mail-formatter-extension.h> -#include <em-format/e-mail-formatter.h> -#include <em-format/e-mail-part-list.h> -#include <em-format/e-mail-part-utils.h> #include <e-util/e-util.h> -#include <camel/camel.h> - -#include <string.h> +#include "e-mail-formatter-extension.h" +#include "e-mail-part-list.h" +#include "e-mail-part-utils.h" typedef EMailFormatterExtension EMailFormatterMessageRFC822; typedef EMailFormatterExtensionClass EMailFormatterMessageRFC822Class; diff --git a/em-format/e-mail-formatter-print-headers.c b/em-format/e-mail-formatter-print-headers.c index 8d183a0e9f..c3f683f6b3 100644 --- a/em-format/e-mail-formatter-print-headers.c +++ b/em-format/e-mail-formatter-print-headers.c @@ -20,17 +20,17 @@ #include <config.h> #endif +#include <string.h> #include <glib/gi18n-lib.h> -#include <em-format/e-mail-formatter-print.h> -#include <em-format/e-mail-formatter-utils.h> -#include <em-format/e-mail-inline-filter.h> -#include <libemail-engine/e-mail-utils.h> -#include <e-util/e-util.h> - #include <camel/camel.h> -#include <string.h> +#include <e-util/e-util.h> +#include <libemail-engine/e-mail-utils.h> + +#include "e-mail-formatter-print.h" +#include "e-mail-formatter-utils.h" +#include "e-mail-inline-filter.h" typedef EMailFormatterExtension EMailFormatterPrintHeaders; typedef EMailFormatterExtensionClass EMailFormatterPrintHeadersClass; diff --git a/em-format/e-mail-formatter-print.c b/em-format/e-mail-formatter-print.c index 4466bed31a..89f06085a8 100644 --- a/em-format/e-mail-formatter-print.c +++ b/em-format/e-mail-formatter-print.c @@ -18,8 +18,6 @@ #include "e-mail-formatter-print.h" -#include <camel/camel.h> - #include "e-mail-part-attachment.h" #include "e-mail-formatter-extension.h" #include "e-mail-formatter-utils.h" diff --git a/em-format/e-mail-formatter-quote-attachment.c b/em-format/e-mail-formatter-quote-attachment.c index 5086a3fd0f..628ef97ab0 100644 --- a/em-format/e-mail-formatter-quote-attachment.c +++ b/em-format/e-mail-formatter-quote-attachment.c @@ -20,14 +20,15 @@ #include <config.h> #endif -#include "e-mail-part-attachment.h" +#include <glib/gi18n-lib.h> + +#include <camel/camel.h> -#include <em-format/e-mail-formatter-quote.h> -#include <em-format/e-mail-part-utils.h> #include <e-util/e-util.h> -#include <glib/gi18n-lib.h> -#include <camel/camel.h> +#include "e-mail-formatter-quote.h" +#include "e-mail-part-attachment.h" +#include "e-mail-part-utils.h" #define d(x) diff --git a/em-format/e-mail-formatter-quote-headers.c b/em-format/e-mail-formatter-quote-headers.c index 4af48418dd..8fed82d480 100644 --- a/em-format/e-mail-formatter-quote-headers.c +++ b/em-format/e-mail-formatter-quote-headers.c @@ -20,17 +20,17 @@ #include <config.h> #endif +#include <string.h> #include <glib/gi18n-lib.h> -#include <em-format/e-mail-formatter-quote.h> -#include <em-format/e-mail-formatter-utils.h> -#include <em-format/e-mail-inline-filter.h> -#include <libemail-engine/e-mail-utils.h> -#include <e-util/e-util.h> - #include <camel/camel.h> -#include <string.h> +#include <e-util/e-util.h> +#include <libemail-engine/e-mail-utils.h> + +#include "e-mail-formatter-quote.h" +#include "e-mail-formatter-utils.h" +#include "e-mail-inline-filter.h" typedef EMailFormatterExtension EMailFormatterQuoteHeaders; typedef EMailFormatterExtensionClass EMailFormatterQuoteHeadersClass; diff --git a/em-format/e-mail-formatter-quote-message-rfc822.c b/em-format/e-mail-formatter-quote-message-rfc822.c index e891bce69f..42b3ba5af8 100644 --- a/em-format/e-mail-formatter-quote-message-rfc822.c +++ b/em-format/e-mail-formatter-quote-message-rfc822.c @@ -20,17 +20,16 @@ #include <config.h> #endif +#include <string.h> #include <glib/gi18n-lib.h> -#include <glib-object.h> - -#include <em-format/e-mail-formatter-quote.h> -#include <em-format/e-mail-part-list.h> -#include <em-format/e-mail-part-utils.h> -#include <e-util/e-util.h> #include <camel/camel.h> -#include <string.h> +#include <e-util/e-util.h> + +#include "e-mail-formatter-quote.h" +#include "e-mail-part-list.h" +#include "e-mail-part-utils.h" typedef EMailFormatterExtension EMailFormatterQuoteMessageRFC822; typedef EMailFormatterExtensionClass EMailFormatterQuoteMessageRFC822Class; diff --git a/em-format/e-mail-formatter-quote-text-enriched.c b/em-format/e-mail-formatter-quote-text-enriched.c index 9bbbc534c4..031cc664db 100644 --- a/em-format/e-mail-formatter-quote-text-enriched.c +++ b/em-format/e-mail-formatter-quote-text-enriched.c @@ -20,13 +20,15 @@ #include <config.h> #endif -#include <em-format/e-mail-formatter-quote.h> -#include <em-format/e-mail-inline-filter.h> -#include <e-util/e-util.h> - #include <glib/gi18n-lib.h> + #include <camel/camel.h> +#include <e-util/e-util.h> + +#include "e-mail-formatter-quote.h" +#include "e-mail-inline-filter.h" + typedef EMailFormatterExtension EMailFormatterQuoteTextEnriched; typedef EMailFormatterExtensionClass EMailFormatterQuoteTextEnrichedClass; diff --git a/em-format/e-mail-formatter-quote-text-html.c b/em-format/e-mail-formatter-quote-text-html.c index 4d3a71f4af..71c7d63554 100644 --- a/em-format/e-mail-formatter-quote-text-html.c +++ b/em-format/e-mail-formatter-quote-text-html.c @@ -20,15 +20,16 @@ #include <config.h> #endif -#include <em-format/e-mail-formatter-quote.h> -#include <em-format/e-mail-stripsig-filter.h> -#include <em-format/e-mail-part-utils.h> -#include <e-util/e-util.h> - +#include <string.h> #include <glib/gi18n-lib.h> + #include <camel/camel.h> -#include <string.h> +#include <e-util/e-util.h> + +#include "e-mail-formatter-quote.h" +#include "e-mail-part-utils.h" +#include "e-mail-stripsig-filter.h" typedef EMailFormatterExtension EMailFormatterQuoteTextHTML; typedef EMailFormatterExtensionClass EMailFormatterQuoteTextHTMLClass; diff --git a/em-format/e-mail-formatter-quote-text-plain.c b/em-format/e-mail-formatter-quote-text-plain.c index 5f14c8ea1e..71f1762991 100644 --- a/em-format/e-mail-formatter-quote-text-plain.c +++ b/em-format/e-mail-formatter-quote-text-plain.c @@ -20,14 +20,16 @@ #include <config.h> #endif -#include <em-format/e-mail-formatter-quote.h> -#include <em-format/e-mail-part-utils.h> -#include <em-format/e-mail-stripsig-filter.h> -#include <e-util/e-util.h> - #include <glib/gi18n-lib.h> + #include <camel/camel.h> +#include <e-util/e-util.h> + +#include "e-mail-formatter-quote.h" +#include "e-mail-part-utils.h" +#include "e-mail-stripsig-filter.h" + typedef EMailFormatterExtension EMailFormatterQuoteTextPlain; typedef EMailFormatterExtensionClass EMailFormatterQuoteTextPlainClass; diff --git a/em-format/e-mail-formatter-secure-button.c b/em-format/e-mail-formatter-secure-button.c index 2b61a74d93..c07e042533 100644 --- a/em-format/e-mail-formatter-secure-button.c +++ b/em-format/e-mail-formatter-secure-button.c @@ -22,8 +22,6 @@ #include <glib/gi18n-lib.h> -#include <em-format/e-mail-formatter-extension.h> -#include <em-format/e-mail-formatter.h> #include <e-util/e-util.h> #if defined (HAVE_NSS) && defined (ENABLE_SMIME) @@ -31,7 +29,7 @@ #include "e-cert-db.h" #endif -#include <camel/camel.h> +#include "e-mail-formatter-extension.h" typedef EMailFormatterExtension EMailFormatterSecureButton; typedef EMailFormatterExtensionClass EMailFormatterSecureButtonClass; diff --git a/em-format/e-mail-formatter-source.c b/em-format/e-mail-formatter-source.c index b37af49026..e4ee288261 100644 --- a/em-format/e-mail-formatter-source.c +++ b/em-format/e-mail-formatter-source.c @@ -20,13 +20,12 @@ #include <config.h> #endif -#include <em-format/e-mail-formatter-extension.h> -#include <em-format/e-mail-formatter.h> -#include <em-format/e-mail-inline-filter.h> +#include <glib/gi18n-lib.h> + #include <e-util/e-util.h> -#include <glib/gi18n-lib.h> -#include <camel/camel.h> +#include "e-mail-formatter-extension.h" +#include "e-mail-inline-filter.h" typedef EMailFormatterExtension EMailFormatterSource; typedef EMailFormatterExtensionClass EMailFormatterSourceClass; diff --git a/em-format/e-mail-formatter-text-enriched.c b/em-format/e-mail-formatter-text-enriched.c index be3b1b029b..1ea46e8138 100644 --- a/em-format/e-mail-formatter-text-enriched.c +++ b/em-format/e-mail-formatter-text-enriched.c @@ -20,13 +20,12 @@ #include <config.h> #endif -#include <em-format/e-mail-formatter-extension.h> -#include <em-format/e-mail-formatter.h> -#include <em-format/e-mail-inline-filter.h> +#include <glib/gi18n-lib.h> + #include <e-util/e-util.h> -#include <glib/gi18n-lib.h> -#include <camel/camel.h> +#include "e-mail-formatter-extension.h" +#include "e-mail-inline-filter.h" typedef EMailFormatterExtension EMailFormatterTextEnriched; typedef EMailFormatterExtensionClass EMailFormatterTextEnrichedClass; diff --git a/em-format/e-mail-formatter-text-html.c b/em-format/e-mail-formatter-text-html.c index aabfa72a98..4809c35e4d 100644 --- a/em-format/e-mail-formatter-text-html.c +++ b/em-format/e-mail-formatter-text-html.c @@ -20,17 +20,15 @@ #include <config.h> #endif -#include <em-format/e-mail-formatter-extension.h> -#include <em-format/e-mail-formatter.h> -#include <em-format/e-mail-inline-filter.h> -#include <em-format/e-mail-part-utils.h> -#include <e-util/e-util.h> - -#include <glib/gi18n-lib.h> -#include <camel/camel.h> - #include <ctype.h> #include <string.h> +#include <glib/gi18n-lib.h> + +#include <e-util/e-util.h> + +#include "e-mail-formatter-extension.h" +#include "e-mail-inline-filter.h" +#include "e-mail-part-utils.h" typedef EMailFormatterExtension EMailFormatterTextHTML; typedef EMailFormatterExtensionClass EMailFormatterTextHTMLClass; diff --git a/em-format/e-mail-formatter-text-plain.c b/em-format/e-mail-formatter-text-plain.c index afe5ed200d..3d0de8215c 100644 --- a/em-format/e-mail-formatter-text-plain.c +++ b/em-format/e-mail-formatter-text-plain.c @@ -20,14 +20,13 @@ #include <config.h> #endif -#include <em-format/e-mail-formatter-extension.h> -#include <em-format/e-mail-formatter.h> -#include <em-format/e-mail-inline-filter.h> -#include <em-format/e-mail-part-utils.h> +#include <glib/gi18n-lib.h> + #include <e-util/e-util.h> -#include <glib/gi18n-lib.h> -#include <camel/camel.h> +#include "e-mail-formatter-extension.h" +#include "e-mail-inline-filter.h" +#include "e-mail-part-utils.h" typedef EMailFormatterExtension EMailFormatterTextPlain; typedef EMailFormatterExtensionClass EMailFormatterTextPlainClass; diff --git a/em-format/e-mail-formatter-utils.c b/em-format/e-mail-formatter-utils.c index 11dcc0e10b..5ceeb921e7 100644 --- a/em-format/e-mail-formatter-utils.c +++ b/em-format/e-mail-formatter-utils.c @@ -22,17 +22,15 @@ #include "e-mail-formatter-utils.h" +#include <string.h> +#include <glib/gi18n.h> + #include <camel/camel.h> +#include <libedataserver/libedataserver.h> +#include <e-util/e-util.h> #include <libemail-engine/e-mail-utils.h> #include <libemail-engine/mail-config.h> -#include <e-util/e-util.h> -#include <e-util/e-datetime-format.h> -#include <libedataserver/libedataserver.h> - -#include <glib/gi18n.h> - -#include <string.h> static const gchar *addrspec_hdrs[] = { "Sender", "From", "Reply-To", "To", "Cc", "Bcc", diff --git a/em-format/e-mail-formatter.c b/em-format/e-mail-formatter.c index bc671b8072..dcea08133e 100644 --- a/em-format/e-mail-formatter.c +++ b/em-format/e-mail-formatter.c @@ -18,8 +18,6 @@ #include "e-mail-formatter.h" -#include <camel/camel.h> - #include "e-mail-formatter-extension.h" #include "e-mail-formatter-utils.h" #include "e-mail-part.h" diff --git a/em-format/e-mail-formatter.h b/em-format/e-mail-formatter.h index de625a2555..d17a3ac6da 100644 --- a/em-format/e-mail-formatter.h +++ b/em-format/e-mail-formatter.h @@ -19,11 +19,12 @@ #ifndef E_MAIL_FORMATTER_H_ #define E_MAIL_FORMATTER_H_ -#include <em-format/e-mail-part-list.h> -#include <em-format/e-mail-extension-registry.h> #include <gdk/gdk.h> #include <libemail-engine/e-mail-enums.h> +#include <em-format/e-mail-extension-registry.h> +#include <em-format/e-mail-part-list.h> + /* Standard GObject macros */ #define E_TYPE_MAIL_FORMATTER \ (e_mail_formatter_get_type ()) diff --git a/em-format/e-mail-parser-application-mbox.c b/em-format/e-mail-parser-application-mbox.c index 7007b89624..b0fde83b2e 100644 --- a/em-format/e-mail-parser-application-mbox.c +++ b/em-format/e-mail-parser-application-mbox.c @@ -20,17 +20,13 @@ #include <config.h> #endif -#include <glib-object.h> +#include <string.h> #include <glib/gi18n-lib.h> -#include <em-format/e-mail-parser-extension.h> -#include <em-format/e-mail-parser.h> -#include <em-format/e-mail-part-utils.h> #include <e-util/e-util.h> -#include <camel/camel.h> - -#include <string.h> +#include "e-mail-parser-extension.h" +#include "e-mail-part-utils.h" typedef EMailParserExtension EMailParserApplicationMBox; typedef EMailParserExtensionClass EMailParserApplicationMBoxClass; diff --git a/em-format/e-mail-parser-application-smime.c b/em-format/e-mail-parser-application-smime.c index 4f42b26825..13c3d739c1 100644 --- a/em-format/e-mail-parser-application-smime.c +++ b/em-format/e-mail-parser-application-smime.c @@ -20,17 +20,13 @@ #include <config.h> #endif -#include <glib-object.h> +#include <string.h> #include <glib/gi18n-lib.h> -#include <em-format/e-mail-parser-extension.h> -#include <em-format/e-mail-parser.h> -#include <em-format/e-mail-part-utils.h> #include <e-util/e-util.h> -#include <camel/camel.h> - -#include <string.h> +#include "e-mail-parser-extension.h" +#include "e-mail-part-utils.h" typedef EMailParserExtension EMailParserApplicationSMIME; typedef EMailParserExtensionClass EMailParserApplicationSMIMEClass; diff --git a/em-format/e-mail-parser-attachment-bar.c b/em-format/e-mail-parser-attachment-bar.c index a8939371c5..44fbb9cc82 100644 --- a/em-format/e-mail-parser-attachment-bar.c +++ b/em-format/e-mail-parser-attachment-bar.c @@ -20,16 +20,13 @@ #include <config.h> #endif -#include <glib/gi18n-lib.h> #include "e-mail-part-attachment-bar.h" -#include <em-format/e-mail-parser-extension.h> -#include <em-format/e-mail-parser.h> -#include <e-util/e-util.h> +#include <glib/gi18n-lib.h> -#include <widgets/misc/e-attachment-bar.h> +#include <e-util/e-util.h> -#include <camel/camel.h> +#include "e-mail-parser-extension.h" static void mail_part_attachment_bar_free (EMailPart *part) diff --git a/em-format/e-mail-parser-extension.c b/em-format/e-mail-parser-extension.c index 05fd952fe6..28b3be3133 100644 --- a/em-format/e-mail-parser-extension.c +++ b/em-format/e-mail-parser-extension.c @@ -16,8 +16,6 @@ * */ -#include <camel/camel.h> - #include "e-mail-parser-extension.h" G_DEFINE_ABSTRACT_TYPE ( diff --git a/em-format/e-mail-parser-extension.h b/em-format/e-mail-parser-extension.h index 4c0b88f902..2b486a6dda 100644 --- a/em-format/e-mail-parser-extension.h +++ b/em-format/e-mail-parser-extension.h @@ -19,8 +19,8 @@ #ifndef E_MAIL_PARSER_EXTENSION_H #define E_MAIL_PARSER_EXTENSION_H -#include <em-format/e-mail-parser.h> #include <camel/camel.h> +#include <em-format/e-mail-parser.h> /* Standard GObject macros */ #define E_TYPE_MAIL_PARSER_EXTENSION \ diff --git a/em-format/e-mail-parser-headers.c b/em-format/e-mail-parser-headers.c index d81089d384..f2900945d1 100644 --- a/em-format/e-mail-parser-headers.c +++ b/em-format/e-mail-parser-headers.c @@ -20,16 +20,13 @@ #include <config.h> #endif +#include <string.h> #include <glib/gi18n-lib.h> -#include <em-format/e-mail-parser-extension.h> -#include <em-format/e-mail-parser.h> -#include <libemail-engine/e-mail-utils.h> #include <e-util/e-util.h> +#include <libemail-engine/e-mail-utils.h> -#include <camel/camel.h> - -#include <string.h> +#include "e-mail-parser-extension.h" typedef EMailParserExtension EMailParserHeaders; typedef EMailParserExtensionClass EMailParserHeadersClass; diff --git a/em-format/e-mail-parser-image.c b/em-format/e-mail-parser-image.c index 4ad4b617bf..a602a9b26d 100644 --- a/em-format/e-mail-parser-image.c +++ b/em-format/e-mail-parser-image.c @@ -20,13 +20,12 @@ #include <config.h> #endif -#include <em-format/e-mail-parser-extension.h> -#include <em-format/e-mail-part-utils.h> -#include <em-format/e-mail-parser.h> +#include <glib/gi18n-lib.h> + #include <e-util/e-util.h> -#include <glib/gi18n-lib.h> -#include <camel/camel.h> +#include "e-mail-parser-extension.h" +#include "e-mail-part-utils.h" typedef EMailParserExtension EMailParserImage; typedef EMailParserExtensionClass EMailParserImageClass; diff --git a/em-format/e-mail-parser-inlinepgp-encrypted.c b/em-format/e-mail-parser-inlinepgp-encrypted.c index 5db01aeff6..b7d5738275 100644 --- a/em-format/e-mail-parser-inlinepgp-encrypted.c +++ b/em-format/e-mail-parser-inlinepgp-encrypted.c @@ -20,15 +20,13 @@ #include <config.h> #endif -#include <em-format/e-mail-parser-extension.h> -#include <em-format/e-mail-parser.h> -#include <em-format/e-mail-part-utils.h> -#include <e-util/e-util.h> - +#include <string.h> #include <glib/gi18n-lib.h> -#include <camel/camel.h> -#include <string.h> +#include <e-util/e-util.h> + +#include "e-mail-parser-extension.h" +#include "e-mail-part-utils.h" typedef EMailParserExtension EMailParserInlinePGPEncrypted; typedef EMailParserExtensionClass EMailParserInlinePGPEncryptedClass; diff --git a/em-format/e-mail-parser-inlinepgp-signed.c b/em-format/e-mail-parser-inlinepgp-signed.c index cec1db0594..2b11d6e412 100644 --- a/em-format/e-mail-parser-inlinepgp-signed.c +++ b/em-format/e-mail-parser-inlinepgp-signed.c @@ -20,15 +20,13 @@ #include <config.h> #endif -#include <em-format/e-mail-parser-extension.h> -#include <em-format/e-mail-parser.h> -#include <em-format/e-mail-part-utils.h> -#include <e-util/e-util.h> - +#include <string.h> #include <glib/gi18n-lib.h> -#include <camel/camel.h> -#include <string.h> +#include <e-util/e-util.h> + +#include "e-mail-parser-extension.h" +#include "e-mail-part-utils.h" typedef EMailParserExtension EMailParserInlinePGPSigned; typedef EMailParserExtensionClass EMailParserInlinePGPSignedClass; diff --git a/em-format/e-mail-parser-message-deliverystatus.c b/em-format/e-mail-parser-message-deliverystatus.c index e99adbc6a1..d02bbf9149 100644 --- a/em-format/e-mail-parser-message-deliverystatus.c +++ b/em-format/e-mail-parser-message-deliverystatus.c @@ -20,15 +20,11 @@ #include <config.h> #endif -#include <glib-object.h> +#include <string.h> -#include <em-format/e-mail-parser-extension.h> -#include <em-format/e-mail-parser.h> #include <e-util/e-util.h> -#include <camel/camel.h> - -#include <string.h> +#include "e-mail-parser-extension.h" typedef EMailParserExtension EMailParserMessageDeliveryStatus; typedef EMailParserExtensionClass EMailParserMessageDeliveryStatusClass; diff --git a/em-format/e-mail-parser-message-external.c b/em-format/e-mail-parser-message-external.c index 0c49497869..d24bb657e1 100644 --- a/em-format/e-mail-parser-message-external.c +++ b/em-format/e-mail-parser-message-external.c @@ -20,15 +20,13 @@ #include <config.h> #endif -#include <em-format/e-mail-parser-extension.h> -#include <em-format/e-mail-parser.h> -#include <e-util/e-util.h> - -#include <glib/gi18n-lib.h> -#include <camel/camel.h> - #include <string.h> #include <ctype.h> +#include <glib/gi18n-lib.h> + +#include <e-util/e-util.h> + +#include "e-mail-parser-extension.h" typedef EMailParserExtension EMailParserMessageExternal; typedef EMailParserExtensionClass EMailParserMessageExternalClass; diff --git a/em-format/e-mail-parser-message-rfc822.c b/em-format/e-mail-parser-message-rfc822.c index 2fbfb2d287..ca9dd67df9 100644 --- a/em-format/e-mail-parser-message-rfc822.c +++ b/em-format/e-mail-parser-message-rfc822.c @@ -20,18 +20,14 @@ #include <config.h> #endif +#include <string.h> #include <glib/gi18n-lib.h> -#include <glib-object.h> -#include <em-format/e-mail-parser-extension.h> -#include <em-format/e-mail-parser.h> -#include <em-format/e-mail-part-list.h> -#include <em-format/e-mail-part-utils.h> #include <e-util/e-util.h> -#include <camel/camel.h> - -#include <string.h> +#include "e-mail-parser-extension.h" +#include "e-mail-part-list.h" +#include "e-mail-part-utils.h" typedef EMailParserExtension EMailParserMessageRFC822; typedef EMailParserExtensionClass EMailParserMessageRFC822Class; diff --git a/em-format/e-mail-parser-message.c b/em-format/e-mail-parser-message.c index 3adbc55305..9cd0a2d76c 100644 --- a/em-format/e-mail-parser-message.c +++ b/em-format/e-mail-parser-message.c @@ -20,17 +20,14 @@ #include <config.h> #endif +#include <string.h> #include <glib/gi18n-lib.h> -#include <em-format/e-mail-parser-extension.h> -#include <em-format/e-mail-parser.h> -#include "e-mail-part-utils.h" -#include <libemail-engine/e-mail-utils.h> #include <e-util/e-util.h> +#include <libemail-engine/e-mail-utils.h> -#include <camel/camel.h> - -#include <string.h> +#include "e-mail-parser-extension.h" +#include "e-mail-part-utils.h" typedef EMailParserExtension EMailParserMessage; typedef EMailParserExtensionClass EMailParserMessageClass; diff --git a/em-format/e-mail-parser-multipart-alternative.c b/em-format/e-mail-parser-multipart-alternative.c index 902812b02f..cc1c8724db 100644 --- a/em-format/e-mail-parser-multipart-alternative.c +++ b/em-format/e-mail-parser-multipart-alternative.c @@ -20,14 +20,12 @@ #include <config.h> #endif -#include <em-format/e-mail-parser-extension.h> -#include <em-format/e-mail-parser.h> -#include <em-format/e-mail-part-utils.h> -#include <e-util/e-util.h> +#include <string.h> -#include <camel/camel.h> +#include <e-util/e-util.h> -#include <string.h> +#include "e-mail-parser-extension.h" +#include "e-mail-part-utils.h" typedef EMailParserExtension EMailParserMultipartAlternative; typedef EMailParserExtensionClass EMailParserMultipartAlternativeClass; diff --git a/em-format/e-mail-parser-multipart-appledouble.c b/em-format/e-mail-parser-multipart-appledouble.c index add3fad384..a866363717 100644 --- a/em-format/e-mail-parser-multipart-appledouble.c +++ b/em-format/e-mail-parser-multipart-appledouble.c @@ -20,10 +20,7 @@ #include <config.h> #endif -#include <em-format/e-mail-parser-extension.h> -#include <em-format/e-mail-parser.h> - -#include <camel/camel.h> +#include "e-mail-parser-extension.h" typedef EMailParserExtension EMailParserMultipartAppleDouble; typedef EMailParserExtensionClass EMailParserMultipartAppleDoubleClass; diff --git a/em-format/e-mail-parser-multipart-digest.c b/em-format/e-mail-parser-multipart-digest.c index b62d066411..64d4882a8c 100644 --- a/em-format/e-mail-parser-multipart-digest.c +++ b/em-format/e-mail-parser-multipart-digest.c @@ -20,13 +20,11 @@ #include <config.h> #endif -#include <em-format/e-mail-parser-extension.h> -#include <em-format/e-mail-parser.h> -#include <e-util/e-util.h> +#include <string.h> -#include <camel/camel.h> +#include <e-util/e-util.h> -#include <string.h> +#include "e-mail-parser-extension.h" typedef EMailParserExtension EMailParserMultipartDigest; typedef EMailParserExtensionClass EMailParserMultipartDigestClass; diff --git a/em-format/e-mail-parser-multipart-encrypted.c b/em-format/e-mail-parser-multipart-encrypted.c index fa358013fb..c815ab543c 100644 --- a/em-format/e-mail-parser-multipart-encrypted.c +++ b/em-format/e-mail-parser-multipart-encrypted.c @@ -20,14 +20,13 @@ #include <config.h> #endif -#include <em-format/e-mail-parser-extension.h> -#include <em-format/e-mail-parser.h> -#include <em-format/e-mail-part-utils.h> - #include <glib/gi18n-lib.h> -#include <camel/camel.h> + #include <libedataserver/libedataserver.h> +#include "e-mail-parser-extension.h" +#include "e-mail-part-utils.h" + typedef EMailParserExtension EMailParserMultipartEncrypted; typedef EMailParserExtensionClass EMailParserMultipartEncryptedClass; diff --git a/em-format/e-mail-parser-multipart-mixed.c b/em-format/e-mail-parser-multipart-mixed.c index 8a2bfd930a..9e876eef4e 100644 --- a/em-format/e-mail-parser-multipart-mixed.c +++ b/em-format/e-mail-parser-multipart-mixed.c @@ -20,14 +20,12 @@ #include <config.h> #endif -#include <em-format/e-mail-parser-extension.h> -#include <em-format/e-mail-parser.h> -#include <e-util/e-util.h> -#include <em-format/e-mail-part-utils.h> +#include <string.h> -#include <camel/camel.h> +#include <e-util/e-util.h> -#include <string.h> +#include "e-mail-parser-extension.h" +#include "e-mail-part-utils.h" typedef EMailParserExtension EMailParserMultipartMixed; typedef EMailParserExtensionClass EMailParserMultipartMixedClass; diff --git a/em-format/e-mail-parser-multipart-related.c b/em-format/e-mail-parser-multipart-related.c index a9beac570f..f58a5a0f97 100644 --- a/em-format/e-mail-parser-multipart-related.c +++ b/em-format/e-mail-parser-multipart-related.c @@ -20,14 +20,12 @@ #include <config.h> #endif -#include <em-format/e-mail-parser-extension.h> -#include <em-format/e-mail-parser.h> -#include <em-format/e-mail-part-utils.h> -#include <e-util/e-util.h> +#include <string.h> -#include <camel/camel.h> +#include <e-util/e-util.h> -#include <string.h> +#include "e-mail-parser-extension.h" +#include "e-mail-part-utils.h" typedef EMailParserExtension EMailParserMultipartRelated; typedef EMailParserExtensionClass EMailParserMultipartRelatedClass; diff --git a/em-format/e-mail-parser-multipart-signed.c b/em-format/e-mail-parser-multipart-signed.c index 05e64a8df8..514d40fafb 100644 --- a/em-format/e-mail-parser-multipart-signed.c +++ b/em-format/e-mail-parser-multipart-signed.c @@ -20,14 +20,13 @@ #include <config.h> #endif -#include <em-format/e-mail-parser-extension.h> -#include <em-format/e-mail-parser.h> -#include <em-format/e-mail-part-utils.h> - #include <glib/gi18n-lib.h> -#include <camel/camel.h> + #include <libedataserver/libedataserver.h> +#include "e-mail-parser-extension.h" +#include "e-mail-part-utils.h" + typedef EMailParserExtension EMailParserMultipartSigned; typedef EMailParserExtensionClass EMailParserMultipartSignedClass; diff --git a/em-format/e-mail-parser-secure-button.c b/em-format/e-mail-parser-secure-button.c index cb1f98ee7f..38368592c7 100644 --- a/em-format/e-mail-parser-secure-button.c +++ b/em-format/e-mail-parser-secure-button.c @@ -22,11 +22,9 @@ #include <glib/gi18n-lib.h> -#include <em-format/e-mail-parser-extension.h> -#include <em-format/e-mail-parser.h> #include <e-util/e-util.h> -#include <camel/camel.h> +#include "e-mail-parser-extension.h" typedef EMailParserExtension EMailParserSecureButton; typedef EMailParserExtensionClass EMailParserSecureButtonClass; diff --git a/em-format/e-mail-parser-source.c b/em-format/e-mail-parser-source.c index 0521650966..ff8355db15 100644 --- a/em-format/e-mail-parser-source.c +++ b/em-format/e-mail-parser-source.c @@ -20,12 +20,11 @@ #include <config.h> #endif -#include <em-format/e-mail-parser-extension.h> -#include <em-format/e-mail-parser.h> +#include <glib/gi18n-lib.h> + #include <e-util/e-util.h> -#include <glib/gi18n-lib.h> -#include <camel/camel.h> +#include "e-mail-parser-extension.h" typedef EMailParserExtension EMailParserSource; typedef EMailParserExtensionClass EMailParserSourceClass; diff --git a/em-format/e-mail-parser-text-enriched.c b/em-format/e-mail-parser-text-enriched.c index 18b72512c1..024d160196 100644 --- a/em-format/e-mail-parser-text-enriched.c +++ b/em-format/e-mail-parser-text-enriched.c @@ -20,13 +20,12 @@ #include <config.h> #endif -#include <em-format/e-mail-parser-extension.h> -#include <em-format/e-mail-parser.h> -#include <em-format/e-mail-part-utils.h> +#include <glib/gi18n-lib.h> + #include <e-util/e-util.h> -#include <glib/gi18n-lib.h> -#include <camel/camel.h> +#include "e-mail-parser-extension.h" +#include "e-mail-part-utils.h" typedef EMailParserExtension EMailParserTextEnriched; typedef EMailParserExtensionClass EMailParserTextEnrichedClass; diff --git a/em-format/e-mail-parser-text-html.c b/em-format/e-mail-parser-text-html.c index 0014e2c4bc..ccfc5d6eb3 100644 --- a/em-format/e-mail-parser-text-html.c +++ b/em-format/e-mail-parser-text-html.c @@ -20,15 +20,13 @@ #include <config.h> #endif -#include <em-format/e-mail-parser-extension.h> -#include <em-format/e-mail-parser.h> -#include <em-format/e-mail-part-utils.h> -#include <e-util/e-util.h> - +#include <string.h> #include <glib/gi18n-lib.h> -#include <camel/camel.h> -#include <string.h> +#include <e-util/e-util.h> + +#include "e-mail-parser-extension.h" +#include "e-mail-part-utils.h" typedef EMailParserExtension EMailParserTextHTML; typedef EMailParserExtensionClass EMailParserTextHTMLClass; diff --git a/em-format/e-mail-parser-text-plain.c b/em-format/e-mail-parser-text-plain.c index f5e3064a91..f0b34e4b2c 100644 --- a/em-format/e-mail-parser-text-plain.c +++ b/em-format/e-mail-parser-text-plain.c @@ -20,15 +20,14 @@ #include <config.h> #endif -#include <em-format/e-mail-parser-extension.h> -#include <em-format/e-mail-parser.h> -#include <em-format/e-mail-inline-filter.h> -#include <em-format/e-mail-part-utils.h> +#include <ctype.h> +#include <glib/gi18n-lib.h> + #include <e-util/e-util.h> -#include <glib/gi18n-lib.h> -#include <camel/camel.h> -#include <ctype.h> +#include "e-mail-inline-filter.h" +#include "e-mail-parser-extension.h" +#include "e-mail-part-utils.h" typedef EMailParserExtension EMailParserTextPlain; typedef EMailParserExtensionClass EMailParserTextPlainClass; diff --git a/em-format/e-mail-parser.c b/em-format/e-mail-parser.c index 4ba17bb681..359efe7d9b 100644 --- a/em-format/e-mail-parser.c +++ b/em-format/e-mail-parser.c @@ -17,21 +17,17 @@ */ #include "e-mail-parser.h" -#include "e-mail-parser-extension.h" -#include "e-mail-part-attachment.h" -#include "e-mail-part-utils.h" -#include <camel/camel.h> -#include <libebackend/libebackend.h> +#include <string.h> -#include <e-util/e-util.h> +#include <libebackend/libebackend.h> #include <shell/e-shell.h> #include <shell/e-shell-window.h> -#include <widgets/misc/e-attachment.h> - -#include <string.h> +#include "e-mail-parser-extension.h" +#include "e-mail-part-attachment.h" +#include "e-mail-part-utils.h" #define E_MAIL_PARSER_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ diff --git a/em-format/e-mail-part-attachment-bar.h b/em-format/e-mail-part-attachment-bar.h index e6d65428cb..87b6311b5d 100644 --- a/em-format/e-mail-part-attachment-bar.h +++ b/em-format/e-mail-part-attachment-bar.h @@ -23,8 +23,6 @@ #include <em-format/e-mail-part.h> -#include <widgets/misc/e-attachment-store.h> - typedef struct _EMailPartAttachmentBar { EMailPart parent; diff --git a/em-format/e-mail-part-utils.c b/em-format/e-mail-part-utils.c index 665a7b5996..2e2b5f66f2 100644 --- a/em-format/e-mail-part-utils.c +++ b/em-format/e-mail-part-utils.c @@ -25,7 +25,6 @@ #include "e-mail-part-utils.h" #include "e-mail-parser-extension.h" -#include <camel/camel.h> #include <e-util/e-util.h> #include <gdk/gdk.h> diff --git a/em-format/e-mail-part.h b/em-format/e-mail-part.h index 82e417cb80..774828eb23 100644 --- a/em-format/e-mail-part.h +++ b/em-format/e-mail-part.h @@ -20,9 +20,10 @@ #define E_MAIL_PART_H_ #include <camel/camel.h> -#include <misc/e-attachment.h> #include <webkit/webkitdom.h> +#include <e-util/e-util.h> + #define E_MAIL_PART_IS(p,s_t) \ ((p != NULL) && (e_mail_part_get_instance_size (p) == sizeof (s_t))) #define E_MAIL_PART(o) ((EMailPart *) o) diff --git a/evolution-shell.pc.in b/evolution-shell.pc.in index e92df94515..fd85124de3 100644 --- a/evolution-shell.pc.in +++ b/evolution-shell.pc.in @@ -17,7 +17,7 @@ execversion=@BASE_VERSION@ Name: evolution-shell Description: libraries needed for Evolution shell components Version: @VERSION@ -Requires: gtk+-3.0 libebackend-1.2 libedataserverui-3.0 webkitgtk-3.0 +Requires: gtk+-3.0 libebackend-1.2 libedataserverui-3.0 webkitgtk-3.0 libgtkhtml-4.0 gtkhtml-editor-4.0 Requires.private: gnome-desktop-3.0 -Libs: -L${privlibdir} -leshell -lemiscwidgets -leutil -Wl,-R${privlibdir} +Libs: -L${privlibdir} -leshell -leutil -Wl,-R${privlibdir} Cflags: -I${privincludedir} diff --git a/evolution-zip.in b/evolution-zip.in index 9183c3c52b..eb8acd579d 100755 --- a/evolution-zip.in +++ b/evolution-zip.in @@ -15,14 +15,9 @@ bin/libeabutil-0.dll bin/libecontacteditor-0.dll bin/libecontactlisteditor-0.dll bin/libefilterbar-0.dll -bin/libemiscwidgets-0.dll bin/libeshell-0.dll bin/libessmime-0.dll -bin/libetable-0.dll -bin/libetext-0.dll -bin/libetimezonedialog-0.dll bin/libeutil-0.dll -bin/libevolution-a11y-0.dll bin/libevolution-addressbook-a11y-0.dll bin/libevolution-addressbook-importers-0.dll bin/libevolution-calendar-a11y-0.dll @@ -30,8 +25,6 @@ bin/libevolution-calendar-importers-0.dll bin/libevolution-mail-importers-0.dll bin/libevolution-smime-0.dll bin/libevolution-widgets-a11y-0.dll -bin/libfilter-0.dll -bin/libmenus-0.dll bin/evolution.exe lib/bonobo/servers/GNOME_Evolution_Addressbook.server lib/bonobo/servers/GNOME_Evolution_Calendar.server diff --git a/filter/Makefile.am b/filter/Makefile.am deleted file mode 100644 index 0c2db0a8f0..0000000000 --- a/filter/Makefile.am +++ /dev/null @@ -1,76 +0,0 @@ -ui_DATA = filter.ui - -privsolib_LTLIBRARIES = libfilter.la - -libfilter_la_CPPFLAGS = \ - $(AM_CPPFLAGS) \ - -I $(top_srcdir) \ - -I $(top_srcdir)/e-util \ - -DEVOLUTION_UIDIR=\"$(uidir)\" \ - -DG_LOG_DOMAIN=\"filter\" \ - $(EVOLUTION_DATA_SERVER_CFLAGS) \ - $(GNOME_PLATFORM_CFLAGS) - -filterincludedir = $(privincludedir)/filter - -filterinclude_HEADERS = \ - e-filter-code.h \ - e-filter-color.h \ - e-filter-datespec.h \ - e-filter-element.h \ - e-filter-file.h \ - e-filter-input.h \ - e-filter-int.h \ - e-filter-option.h \ - e-filter-part.h \ - e-filter-rule.h \ - e-rule-context.h \ - e-rule-editor.h - -libfilter_la_SOURCES = \ - e-filter-code.c \ - e-filter-code.h \ - e-filter-color.c \ - e-filter-color.h \ - e-filter-datespec.c \ - e-filter-datespec.h \ - e-filter-element.c \ - e-filter-element.h \ - e-filter-file.c \ - e-filter-file.h \ - e-filter-input.c \ - e-filter-input.h \ - e-filter-int.c \ - e-filter-int.h \ - e-filter-option.c \ - e-filter-option.h \ - e-filter-part.c \ - e-filter-part.h \ - e-filter-rule.c \ - e-filter-rule.h \ - e-rule-context.c \ - e-rule-context.h \ - e-rule-editor.c \ - e-rule-editor.h - -libfilter_la_LDFLAGS = -avoid-version $(NO_UNDEFINED) - -libfilter_la_LIBADD = \ - $(top_builddir)/libevolution-utils/libevolution-utils.la \ - $(EVOLUTION_DATA_SERVER_LIBS) \ - $(GNOME_PLATFORM_LIBS) \ - $(REGEX_LIBS) - -EXTRA_DIST = \ - $(ui_DATA) \ - filter.error.xml - -# basic rules. -error_DATA = filter.error -errordir = $(privdatadir)/errors -@EVO_PLUGIN_RULE@ - -BUILT_SOURCES = $(error_DATA) -CLEANFILES = $(BUILT_SOURCES) - --include $(top_srcdir)/git.mk diff --git a/libemail-engine/Makefile.am b/libemail-engine/Makefile.am index 5589fe4e73..55fbef2334 100644 --- a/libemail-engine/Makefile.am +++ b/libemail-engine/Makefile.am @@ -18,7 +18,9 @@ libemail_engine_la_CPPFLAGS = \ -I$(top_builddir) \ $(EVOLUTION_DATA_SERVER_CFLAGS) \ $(GNOME_PLATFORM_CFLAGS) \ - -DEVOLUTION_PRIVDATADIR=\""$(privdatadir)"\" \ + $(CHAMPLAIN_CFLAGS) \ + $(GTKHTML_CFLAGS) \ + -DEVOLUTION_PRIVDATADIR=\""$(privdatadir)"\" \ $(NULL) libmailengineincludedir = $(privincludedir)/libemail-engine @@ -33,11 +35,15 @@ libmailengineinclude_HEADERS = \ e-mail-session.h \ e-mail-store-utils.h \ e-mail-utils.h \ + em-filter-folder-element.h \ + em-vfolder-context.h \ + em-vfolder-rule.h \ mail-config.h \ mail-folder-cache.h \ + mail-mt.h \ mail-ops.h \ mail-tools.h \ - mail-vfolder.h \ + mail-vfolder.h \ $(NULL) libemail_engine_la_SOURCES = \ @@ -51,19 +57,23 @@ libemail_engine_la_SOURCES = \ e-mail-session.c \ e-mail-store-utils.c \ e-mail-utils.c \ + em-filter-folder-element.c \ + em-vfolder-context.c \ + em-vfolder-rule.c \ mail-config.c \ mail-folder-cache.c \ + mail-mt.c \ mail-ops.c \ mail-tools.c \ - mail-vfolder.c \ + mail-vfolder.c \ $(NULL) libemail_engine_la_LIBADD = \ - $(top_builddir)/libemail-utils/libemail-utils.la \ - $(top_builddir)/filter/libfilter.la \ - $(top_builddir)/libevolution-utils/libevolution-utils.la \ + $(top_builddir)/e-util/libeutil.la \ $(EVOLUTION_DATA_SERVER_LIBS) \ $(GNOME_PLATFORM_LIBS) \ + $(CHAMPLAIN_LIBS) \ + $(GTKHTML_LIBS) \ $(NULL) libemail_engine_la_LDFLAGS = -avoid-version $(NO_UNDEFINED) diff --git a/libemail-engine/e-mail-session.c b/libemail-engine/e-mail-session.c index aa3adefd12..18e336a5f4 100644 --- a/libemail-engine/e-mail-session.c +++ b/libemail-engine/e-mail-session.c @@ -43,9 +43,10 @@ #endif #include <libebackend/libebackend.h> -#include <libedataserverui/libedataserverui.h> -#include "libemail-utils/mail-mt.h" +#include "libemail-engine/mail-mt.h" + +#include "e-util/e-util.h" /* This is our hack, not part of libcamel. */ #include "camel-null-store.h" diff --git a/libemail-engine/e-mail-session.h b/libemail-engine/e-mail-session.h index bd4b2f6727..9445e0b833 100644 --- a/libemail-engine/e-mail-session.h +++ b/libemail-engine/e-mail-session.h @@ -28,8 +28,8 @@ #include <camel/camel.h> #include <libedataserver/libedataserver.h> #include <libemail-engine/e-mail-enums.h> +#include <libemail-engine/em-vfolder-context.h> #include <libemail-engine/mail-folder-cache.h> -#include <libemail-utils/em-vfolder-context.h> /* Standard GObject macros */ #define E_TYPE_MAIL_SESSION \ diff --git a/libemail-engine/e-mail-utils.c b/libemail-engine/e-mail-utils.c index d1429661b7..33ff0d1aaa 100644 --- a/libemail-engine/e-mail-utils.c +++ b/libemail-engine/e-mail-utils.c @@ -39,7 +39,7 @@ #include <glib/gi18n.h> #include <libebook/libebook.h> -#include <libemail-utils/mail-mt.h> +#include <libemail-engine/mail-mt.h> #include "e-mail-folder-utils.h" #include "e-mail-session.h" diff --git a/libemail-utils/em-filter-folder-element.c b/libemail-engine/em-filter-folder-element.c index 6c3033fe83..77569b0309 100644 --- a/libemail-utils/em-filter-folder-element.c +++ b/libemail-engine/em-filter-folder-element.c @@ -26,15 +26,13 @@ #include <config.h> #endif +#include "em-filter-folder-element.h" + #include <string.h> #include <gtk/gtk.h> #include <glib/gi18n.h> -#include "em-filter-folder-element.h" -#include "filter/e-filter-part.h" -#include "libevolution-utils/e-alert.h" - #define EM_FILTER_FOLDER_ELEMENT_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ ((obj), EM_TYPE_FILTER_FOLDER_ELEMENT, EMFilterFolderElementPrivate)) diff --git a/libemail-utils/em-filter-folder-element.h b/libemail-engine/em-filter-folder-element.h index 24ed6aa01f..8c619017a6 100644 --- a/libemail-utils/em-filter-folder-element.h +++ b/libemail-engine/em-filter-folder-element.h @@ -25,7 +25,7 @@ #ifndef EM_FILTER_FOLDER_ELEMENT_H #define EM_FILTER_FOLDER_ELEMENT_H -#include <filter/e-filter-element.h> +#include <e-util/e-util.h> /* Standard GObject macros */ #define EM_TYPE_FILTER_FOLDER_ELEMENT \ diff --git a/libemail-utils/em-vfolder-context.c b/libemail-engine/em-vfolder-context.c index b908f82928..69b82eb18d 100644 --- a/libemail-utils/em-vfolder-context.c +++ b/libemail-engine/em-vfolder-context.c @@ -26,14 +26,12 @@ #include <config.h> #endif -#include <string.h> - #include "em-vfolder-context.h" -#include "em-vfolder-rule.h" -#include "filter/e-filter-option.h" -#include "filter/e-filter-int.h" + +#include <string.h> #include "em-filter-folder-element.h" +#include "em-vfolder-rule.h" #define EM_VFOLDER_CONTEXT_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ diff --git a/libemail-utils/em-vfolder-context.h b/libemail-engine/em-vfolder-context.h index 9d46f92ed1..9e2faf357a 100644 --- a/libemail-utils/em-vfolder-context.h +++ b/libemail-engine/em-vfolder-context.h @@ -25,7 +25,7 @@ #ifndef EM_VFOLDER_CONTEXT_H #define EM_VFOLDER_CONTEXT_H -#include <filter/e-rule-context.h> +#include <e-util/e-util.h> /* Standard GObject macros */ #define EM_TYPE_VFOLDER_CONTEXT \ diff --git a/libemail-utils/em-vfolder-rule.c b/libemail-engine/em-vfolder-rule.c index 30a94af014..0d6b07a8ff 100644 --- a/libemail-utils/em-vfolder-rule.c +++ b/libemail-engine/em-vfolder-rule.c @@ -30,8 +30,6 @@ #include <gtk/gtk.h> #include <glib/gi18n.h> -#include <libevolution-utils/e-alert.h> - #include <libemail-engine/e-mail-folder-utils.h> #include "em-vfolder-context.h" diff --git a/libemail-utils/em-vfolder-rule.h b/libemail-engine/em-vfolder-rule.h index 60f30044b4..312ae175e5 100644 --- a/libemail-utils/em-vfolder-rule.h +++ b/libemail-engine/em-vfolder-rule.h @@ -24,7 +24,7 @@ #ifndef EM_VFOLDER_RULE_H #define EM_VFOLDER_RULE_H -#include <filter/e-filter-rule.h> +#include <e-util/e-util.h> /* Standard GObject macros */ #define EM_TYPE_VFOLDER_RULE \ diff --git a/libemail-engine/libemail-engine.pc.in b/libemail-engine/libemail-engine.pc.in index 2457e0182f..ea5ffab771 100644 --- a/libemail-engine/libemail-engine.pc.in +++ b/libemail-engine/libemail-engine.pc.in @@ -11,6 +11,6 @@ privincludedir=@privincludedir@ Name: libemail-engine Description: Client library for evolution mail Version: @VERSION@ -Requires: libemail-utils +Requires: camel-1.2 libedataserver-1.2 libebackend-1.2 gio-2.0 Libs: -L${privlibdir} -lemail-engine Cflags: -I${privincludedir} diff --git a/libemail-engine/mail-folder-cache.c b/libemail-engine/mail-folder-cache.c index 4d82557467..35e620862e 100644 --- a/libemail-engine/mail-folder-cache.c +++ b/libemail-engine/mail-folder-cache.c @@ -40,7 +40,7 @@ #include <libedataserver/libedataserver.h> -#include <libemail-utils/mail-mt.h> +#include <libemail-engine/mail-mt.h> #include "mail-folder-cache.h" #include "e-mail-utils.h" diff --git a/libemail-utils/mail-mt.c b/libemail-engine/mail-mt.c index baf1476f82..baf1476f82 100644 --- a/libemail-utils/mail-mt.c +++ b/libemail-engine/mail-mt.c diff --git a/libemail-utils/mail-mt.h b/libemail-engine/mail-mt.h index d2a20d273f..03cea96398 100644 --- a/libemail-utils/mail-mt.h +++ b/libemail-engine/mail-mt.h @@ -24,7 +24,8 @@ #define _MAIL_MT #include <camel/camel.h> -#include <libevolution-utils/e-alert-sink.h> + +#include <e-util/e-util.h> typedef struct _MailMsg MailMsg; typedef struct _MailMsgInfo MailMsgInfo; diff --git a/libemail-engine/mail-ops.c b/libemail-engine/mail-ops.c index e2bcaa6894..24fc77253f 100644 --- a/libemail-engine/mail-ops.c +++ b/libemail-engine/mail-ops.c @@ -36,7 +36,7 @@ #include <libedataserver/libedataserver.h> -#include <libemail-utils/mail-mt.h> +#include <libemail-engine/mail-mt.h> #include "e-mail-utils.h" #include "mail-ops.h" diff --git a/libemail-engine/mail-ops.h b/libemail-engine/mail-ops.h index 42f3118987..dd115ff601 100644 --- a/libemail-engine/mail-ops.h +++ b/libemail-engine/mail-ops.h @@ -27,8 +27,8 @@ G_BEGIN_DECLS #include <camel/camel.h> -#include <libemail-utils/mail-mt.h> #include <libemail-engine/e-mail-session.h> +#include <libemail-engine/mail-mt.h> void mail_transfer_messages (EMailSession *session, CamelFolder *source, diff --git a/libemail-engine/mail-vfolder.c b/libemail-engine/mail-vfolder.c index eef4d3899b..b23ce0cf2e 100644 --- a/libemail-engine/mail-vfolder.c +++ b/libemail-engine/mail-vfolder.c @@ -24,24 +24,21 @@ #include <config.h> #endif -#include <string.h> +#include "mail-vfolder.h" +#include <string.h> #include <glib/gi18n.h> -#include "libevolution-utils/e-alert-dialog.h" - -#include "libemail-utils/mail-mt.h" -#include "libemail-engine/mail-folder-cache.h" #include "libemail-engine/e-mail-folder-utils.h" #include "libemail-engine/e-mail-session.h" #include "libemail-engine/e-mail-utils.h" +#include "libemail-engine/em-vfolder-context.h" +#include "libemail-engine/em-vfolder-rule.h" +#include "libemail-engine/mail-folder-cache.h" +#include "libemail-engine/mail-mt.h" #include "libemail-engine/mail-ops.h" #include "libemail-engine/mail-tools.h" -#include <libemail-utils/em-vfolder-context.h> -#include <libemail-utils/em-vfolder-rule.h> -#include "mail-vfolder.h" - #define d(x) /* (printf("%s:%s: ", G_STRLOC, G_STRFUNC), (x))*/ /* Note: Once we completely move mail to EDS, this context wont be available for UI. diff --git a/libemail-engine/mail-vfolder.h b/libemail-engine/mail-vfolder.h index eafd6ba1e1..8732526fef 100644 --- a/libemail-engine/mail-vfolder.h +++ b/libemail-engine/mail-vfolder.h @@ -24,10 +24,9 @@ #include <camel/camel.h> -#include <filter/e-filter-part.h> -#include <filter/e-filter-rule.h> +#include <e-util/e-util.h> #include <libemail-engine/e-mail-session.h> -#include <libemail-utils/em-vfolder-rule.h> +#include <libemail-engine/em-vfolder-rule.h> void vfolder_load_storage (EMailSession *session); diff --git a/libemail-utils/Makefile.am b/libemail-utils/Makefile.am deleted file mode 100644 index 18e99262d3..0000000000 --- a/libemail-utils/Makefile.am +++ /dev/null @@ -1,44 +0,0 @@ -NULL = - -privsolib_LTLIBRARIES = libemail-utils.la - -libemail_utils_la_CPPFLAGS = \ - $(AM_CPPFLAGS) \ - -I$(top_srcdir) \ - -I$(top_builddir) \ - -DEVOLUTION_PRIVDATADIR=\""$(privdatadir)"\" \ - $(EVOLUTION_DATA_SERVER_CFLAGS) \ - $(GNOME_PLATFORM_CFLAGS) \ - $(NULL) - -libmailutilsincludedir = $(privincludedir)/libemail-utils -libmailutilsinclude_HEADERS = \ - em-filter-folder-element.h \ - em-vfolder-context.h \ - em-vfolder-rule.h \ - mail-mt.h \ - $(NULL) - -libemail_utils_la_SOURCES = \ - $(libmailutilsinclude_HEADERS) \ - em-filter-folder-element.c \ - em-vfolder-context.c \ - em-vfolder-rule.c \ - mail-mt.c \ - $(NULL) - -libemail_utils_la_LDFLAGS = -avoid-version $(NO_UNDEFINED) - -libemail_utils_la_LIBADD = \ - $(top_builddir)/filter/libfilter.la \ - $(top_builddir)/libevolution-utils/libevolution-utils.la \ - $(EVOLUTION_DATA_SERVER_LIBS) \ - $(GNOME_PLATFORM_LIBS) \ - $(NULL) - -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = libemail-utils.pc - -DISTCLEANFILES = $(pkgconfig_DATA) - --include $(top_srcdir)/git.mk diff --git a/libemail-utils/libemail-utils.pc.in b/libemail-utils/libemail-utils.pc.in deleted file mode 100644 index c584fd4fcb..0000000000 --- a/libemail-utils/libemail-utils.pc.in +++ /dev/null @@ -1,16 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ -datarootdir=@datarootdir@ -datadir=@datadir@ - -privlibdir=@privsolibdir@ -privincludedir=@privincludedir@ - -Name: libemail-utils -Description: Client library for evolution mail -Version: @VERSION@ -Requires: libevolution-utils camel-1.2 libedataserver-1.2 libebackend-1.2 gio-2.0 -Libs: -L${privlibdir} -lemail-utils -Cflags: -I${privincludedir} diff --git a/libevolution-utils/Makefile.am b/libevolution-utils/Makefile.am deleted file mode 100644 index e785b8fc02..0000000000 --- a/libevolution-utils/Makefile.am +++ /dev/null @@ -1,45 +0,0 @@ -NULL = - -privsolib_LTLIBRARIES = libevolution-utils.la - -libevolution_utils_la_CPPFLAGS = \ - $(AM_CPPFLAGS) \ - -I$(top_srcdir) \ - -I$(top_builddir) \ - -DEVOLUTION_PRIVDATADIR=\""$(privdatadir)"\" \ - -DEVOLUTION_UIDIR=\""$(uidir)"\" \ - $(EVOLUTION_DATA_SERVER_CFLAGS) \ - $(GNOME_PLATFORM_CFLAGS) \ - $(NULL) - -libevolutionutilsincludedir = $(privincludedir)/libevolution-utils -libevolutionutilsinclude_HEADERS = \ - e-alert.h \ - e-alert-dialog.h \ - e-alert-sink.h \ - e-xml-utils.h \ - evolution-util.h \ - $(NULL) - -libevolution_utils_la_SOURCES = \ - $(libevolutionutilsinclude_HEADERS) \ - e-alert.c \ - e-alert-dialog.c \ - e-alert-sink.c \ - e-xml-utils.c \ - evolution-util.c \ - $(NULL) - -libevolution_utils_la_LDFLAGS = -avoid-version $(NO_UNDEFINED) - -libevolution_utils_la_LIBADD = \ - $(EVOLUTION_DATA_SERVER_LIBS) \ - $(GNOME_PLATFORM_LIBS) \ - $(NULL) - -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = libevolution-utils.pc - -DISTCLEANFILES = $(pkgconfig_DATA) - --include $(top_srcdir)/git.mk diff --git a/libevolution-utils/evolution-util.c b/libevolution-utils/evolution-util.c deleted file mode 100644 index 3bba779a09..0000000000 --- a/libevolution-utils/evolution-util.c +++ /dev/null @@ -1,327 +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) 2012 Intel Corporation (www.intel.com) - * - */ - -#include <stdlib.h> -#include <stdio.h> -#include <errno.h> -#include <unistd.h> -#include <ctype.h> -#include <math.h> -#include <string.h> -#include <locale.h> - -#include "evolution-util.h" - -/** - * e_flexible_strtod: - * @nptr: the string to convert to a numeric value. - * @endptr: if non-NULL, it returns the character after - * the last character used in the conversion. - * - * Converts a string to a gdouble value. This function detects - * strings either in the standard C locale or in the current locale. - * - * This function is typically used when reading configuration files or - * other non-user input that should not be locale dependent, but may - * have been in the past. To handle input from the user you should - * normally use the locale-sensitive system strtod function. - * - * To convert from a double to a string in a locale-insensitive way, use - * @g_ascii_dtostr. - * - * Returns: the gdouble value - **/ - -gdouble -e_flexible_strtod (const gchar *nptr, - gchar **endptr) -{ - gchar *fail_pos; - gdouble val; - struct lconv *locale_data; - const gchar *decimal_point; - gint decimal_point_len; - const gchar *p, *decimal_point_pos; - const gchar *end = NULL; /* Silence gcc */ - gchar *copy, *c; - - g_return_val_if_fail (nptr != NULL, 0); - - fail_pos = NULL; - - locale_data = localeconv (); - decimal_point = locale_data->decimal_point; - decimal_point_len = strlen (decimal_point); - - g_return_val_if_fail (decimal_point_len != 0, 0); - - decimal_point_pos = NULL; - if (!strcmp (decimal_point, ".")) - return strtod (nptr, endptr); - - p = nptr; - - /* Skip leading space */ - while (isspace ((guchar) * p)) - p++; - - /* Skip leading optional sign */ - if (*p == '+' || *p == '-') - p++; - - if (p[0] == '0' && - (p[1] == 'x' || p[1] == 'X')) { - p += 2; - /* HEX - find the (optional) decimal point */ - - while (isxdigit ((guchar) * p)) - p++; - - if (*p == '.') { - decimal_point_pos = p++; - - while (isxdigit ((guchar) * p)) - p++; - - if (*p == 'p' || *p == 'P') - p++; - if (*p == '+' || *p == '-') - p++; - while (isdigit ((guchar) * p)) - p++; - end = p; - } else if (strncmp (p, decimal_point, decimal_point_len) == 0) { - return strtod (nptr, endptr); - } - } else { - while (isdigit ((guchar) * p)) - p++; - - if (*p == '.') { - decimal_point_pos = p++; - - while (isdigit ((guchar) * p)) - p++; - - if (*p == 'e' || *p == 'E') - p++; - if (*p == '+' || *p == '-') - p++; - while (isdigit ((guchar) * p)) - p++; - end = p; - } else if (strncmp (p, decimal_point, decimal_point_len) == 0) { - return strtod (nptr, endptr); - } - } - /* For the other cases, we need not convert the decimal point */ - - if (!decimal_point_pos) - return strtod (nptr, endptr); - - /* We need to convert the '.' to the locale specific decimal point */ - copy = g_malloc (end - nptr + 1 + decimal_point_len); - - c = copy; - memcpy (c, nptr, decimal_point_pos - nptr); - c += decimal_point_pos - nptr; - memcpy (c, decimal_point, decimal_point_len); - c += decimal_point_len; - memcpy (c, decimal_point_pos + 1, end - (decimal_point_pos + 1)); - c += end - (decimal_point_pos + 1); - *c = 0; - - val = strtod (copy, &fail_pos); - - if (fail_pos) { - if (fail_pos > decimal_point_pos) - fail_pos = - (gchar *) nptr + (fail_pos - copy) - - (decimal_point_len - 1); - else - fail_pos = (gchar *) nptr + (fail_pos - copy); - } - - g_free (copy); - - if (endptr) - *endptr = fail_pos; - - return val; -} - -/** - * e_ascii_dtostr: - * @buffer: A buffer to place the resulting string in - * @buf_len: The length of the buffer. - * @format: The printf-style format to use for the - * code to use for converting. - * @d: The double to convert - * - * Converts a double to a string, using the '.' as - * decimal_point. To format the number you pass in - * a printf-style formating string. Allowed conversion - * specifiers are eEfFgG. - * - * If you want to generates enough precision that converting - * the string back using @g_strtod gives the same machine-number - * (on machines with IEEE compatible 64bit doubles) use the format - * string "%.17g". If you do this it is guaranteed that the size - * of the resulting string will never be larger than - * @G_ASCII_DTOSTR_BUF_SIZE bytes. - * - * Returns: the pointer to the buffer with the converted string - **/ -gchar * -e_ascii_dtostr (gchar *buffer, - gint buf_len, - const gchar *format, - gdouble d) -{ - struct lconv *locale_data; - const gchar *decimal_point; - gint decimal_point_len; - gchar *p; - gint rest_len; - gchar format_char; - - g_return_val_if_fail (buffer != NULL, NULL); - g_return_val_if_fail (format[0] == '%', NULL); - g_return_val_if_fail (strpbrk (format + 1, "'l%") == NULL, NULL); - - format_char = format[strlen (format) - 1]; - - g_return_val_if_fail (format_char == 'e' || format_char == 'E' || - format_char == 'f' || format_char == 'F' || - format_char == 'g' || format_char == 'G', - NULL); - - if (format[0] != '%') - return NULL; - - if (strpbrk (format + 1, "'l%")) - return NULL; - - if (!(format_char == 'e' || format_char == 'E' || - format_char == 'f' || format_char == 'F' || - format_char == 'g' || format_char == 'G')) - return NULL; - - g_snprintf (buffer, buf_len, format, d); - - locale_data = localeconv (); - decimal_point = locale_data->decimal_point; - decimal_point_len = strlen (decimal_point); - - g_return_val_if_fail (decimal_point_len != 0, NULL); - - if (strcmp (decimal_point, ".")) { - p = buffer; - - if (*p == '+' || *p == '-') - p++; - - while (isdigit ((guchar) * p)) - p++; - - if (strncmp (p, decimal_point, decimal_point_len) == 0) { - *p = '.'; - p++; - if (decimal_point_len > 1) { - rest_len = strlen (p + (decimal_point_len - 1)); - memmove ( - p, p + (decimal_point_len - 1), - rest_len); - p[rest_len] = 0; - } - } - } - - return buffer; -} - -/** - * e_builder_get_widget: - * @builder: a #GtkBuilder - * @widget_name: name of a widget in @builder - * - * Gets the widget named @widget_name. Note that this function does not - * increment the reference count of the returned widget. If @widget_name - * could not be found in the @builder<!-- -->'s object tree, a run-time - * warning is emitted since this usually indicates a programming error. - * - * This is a convenience function to work around the awkwardness of - * #GtkBuilder returning #GObject pointers, when the vast majority of - * the time you want a #GtkWidget pointer. - * - * If you need something from @builder other than a #GtkWidget, or you - * want to test for the existence of some widget name without incurring - * a run-time warning, use gtk_builder_get_object(). - * - * Returns: the widget named @widget_name, or %NULL - **/ -GtkWidget * -e_builder_get_widget (GtkBuilder *builder, - const gchar *widget_name) -{ - GObject *object; - - g_return_val_if_fail (GTK_IS_BUILDER (builder), NULL); - g_return_val_if_fail (widget_name != NULL, NULL); - - object = gtk_builder_get_object (builder, widget_name); - if (object == NULL) { - g_warning ("Could not find widget '%s'", widget_name); - return NULL; - } - - return GTK_WIDGET (object); -} - -/** - * e_load_ui_builder_definition: - * @builder: a #GtkBuilder - * @basename: basename of the UI definition file - * - * Loads a UI definition into @builder from Evolution's UI directory. - * Failure here is fatal, since the application can't function without - * its UI definitions. - **/ -void -e_load_ui_builder_definition (GtkBuilder *builder, - const gchar *basename) -{ - gchar *filename; - GError *error = NULL; - - g_return_if_fail (GTK_IS_BUILDER (builder)); - g_return_if_fail (basename != NULL); - - filename = g_build_filename (EVOLUTION_UIDIR, basename, NULL); - gtk_builder_add_from_file (builder, filename, &error); - g_free (filename); - - if (error != NULL) { - g_error ("%s: %s", basename, error->message); - g_assert_not_reached (); - } -} diff --git a/libevolution-utils/evolution-util.h b/libevolution-utils/evolution-util.h deleted file mode 100644 index c927cbff1a..0000000000 --- a/libevolution-utils/evolution-util.h +++ /dev/null @@ -1,47 +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) 2012 Intel Corporation (www.intel.com) - * - */ - -#ifndef EVOLUTION_UTIL_H -#define EVOLUTION_UTIL_H - -#include <sys/types.h> -#include <glib.h> -#include <gtk/gtk.h> -/* String to/from double conversion functions */ -gdouble e_flexible_strtod (const gchar *nptr, - gchar **endptr); - -/* 29 bytes should enough for all possible values that - * g_ascii_dtostr can produce with the %.17g format. - * Then add 10 for good measure */ -#define E_ASCII_DTOSTR_BUF_SIZE (DBL_DIG + 12 + 10) -gchar * e_ascii_dtostr (gchar *buffer, - gint buf_len, - const gchar *format, - gdouble d); - -GtkWidget * e_builder_get_widget (GtkBuilder *builder, - const gchar *widget_name); -void e_load_ui_builder_definition (GtkBuilder *builder, - const gchar *basename); - -#endif /* EVOLUTION_UTIL_H */ diff --git a/libevolution-utils/libevolution-utils.pc.in b/libevolution-utils/libevolution-utils.pc.in deleted file mode 100644 index e185445b9e..0000000000 --- a/libevolution-utils/libevolution-utils.pc.in +++ /dev/null @@ -1,16 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ -datarootdir=@datarootdir@ -datadir=@datadir@ - -privlibdir=@privsolibdir@ -privincludedir=@privincludedir@ - -Name: libevolution-utils -Description: Client library for evolution -Version: @VERSION@ -Requires: libxml-2.0 gtk+-3.0 -Libs: -L${privlibdir} -levolution-utils -Cflags: -I${privincludedir} diff --git a/mail/Makefile.am b/mail/Makefile.am index 1995e642d7..52b26cc692 100644 --- a/mail/Makefile.am +++ b/mail/Makefile.am @@ -6,8 +6,6 @@ mailincludedir = $(privincludedir)/mail libevolution_mail_la_CPPFLAGS = \ $(AM_CPPFLAGS) \ - -I$(top_srcdir)/widgets \ - -I$(top_srcdir)/widgets/misc \ -I$(top_srcdir) \ -I$(top_srcdir)/em-format \ -I$(top_srcdir)/mail \ @@ -17,13 +15,6 @@ libevolution_mail_la_CPPFLAGS = \ -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) \ - $(CLUTTER_CFLAGS) \ - $(GTKHTML_CFLAGS) \ - $(LIBSOUP_CFLAGS) \ -DEVOLUTION_DATADIR=\""$(datadir)"\" \ -DEVOLUTION_PRIVDATADIR=\""$(privdatadir)"\" \ -DEVOLUTION_ETSPECDIR=\""$(etspecdir)"\" \ @@ -35,7 +26,14 @@ libevolution_mail_la_CPPFLAGS = \ -DEVOLUTION_UIDIR=\""$(uidir)"\" \ -DCAMEL_PROVIDERDIR=\""$(camel_providerdir)"\" \ -DPREFIX=\""$(prefix)"\" \ - -DG_LOG_DOMAIN=\"evolution-mail\" + -DG_LOG_DOMAIN=\"evolution-mail\" \ + $(EVOLUTION_DATA_SERVER_CFLAGS) \ + $(GNOME_PLATFORM_CFLAGS) \ + $(CERT_UI_CFLAGS) \ + $(CANBERRA_CFLAGS) \ + $(CHAMPLAIN_CFLAGS) \ + $(GTKHTML_CFLAGS) \ + $(LIBSOUP_CFLAGS) mailinclude_HEADERS = \ e-http-request.h \ @@ -193,28 +191,19 @@ SMIME_LIBS = \ endif libevolution_mail_la_LIBADD = \ - $(top_builddir)/libemail-utils/libemail-utils.la \ $(top_builddir)/libemail-engine/libemail-engine.la \ $(top_builddir)/e-util/libeutil.la \ $(top_builddir)/shell/libeshell.la \ $(top_builddir)/composer/libcomposer.la \ - $(top_builddir)/widgets/table/libetable.la \ - $(top_builddir)/widgets/text/libetext.la \ - $(top_builddir)/widgets/menus/libmenus.la \ - $(top_builddir)/widgets/misc/libemiscwidgets.la \ - $(top_builddir)/widgets/menus/libmenus.la \ $(top_builddir)/addressbook/gui/contact-editor/libecontacteditor.la \ $(top_builddir)/addressbook/gui/contact-list-editor/libecontactlisteditor.la \ $(top_builddir)/em-format/libemformat.la \ - $(top_builddir)/filter/libfilter.la \ - $(top_builddir)/libevolution-utils/libevolution-utils.la \ $(EVOLUTION_DATA_SERVER_LIBS) \ $(GNOME_PLATFORM_LIBS) \ $(CERT_UI_LIBS) \ $(CANBERRA_LIBS) \ - $(CLUTTER_LIBS) \ + $(CHAMPLAIN_LIBS) \ $(GTKHTML_LIBS) \ - $(E_WIDGETS_LIBS) \ $(SMIME_LIBS) \ $(LIBSOUP_LIBS) \ -lresolv diff --git a/mail/e-mail-account-store.c b/mail/e-mail-account-store.c index 8d8f867312..a2a639d9b4 100644 --- a/mail/e-mail-account-store.c +++ b/mail/e-mail-account-store.c @@ -24,9 +24,6 @@ #include <libebackend/libebackend.h> -#include <e-util/e-marshal.h> -#include <libevolution-utils/e-alert-dialog.h> - #include <libemail-engine/mail-ops.h> #include <mail/mail-vfolder-ui.h> diff --git a/mail/e-mail-backend.c b/mail/e-mail-backend.c index 4fb3291729..0940a78f01 100644 --- a/mail/e-mail-backend.c +++ b/mail/e-mail-backend.c @@ -34,9 +34,6 @@ #include <shell/e-shell.h> -#include <libevolution-utils/e-alert-dialog.h> -#include <libevolution-utils/e-alert-sink.h> - #include <libemail-engine/e-mail-folder-utils.h> #include <libemail-engine/e-mail-session.h> #include <libemail-engine/e-mail-store-utils.h> diff --git a/mail/e-mail-browser.c b/mail/e-mail-browser.c index d0aa556cd1..495bf64895 100644 --- a/mail/e-mail-browser.c +++ b/mail/e-mail-browser.c @@ -28,13 +28,9 @@ #include <string.h> #include <glib/gi18n.h> -#include "e-util/e-util.h" -#include "e-util/e-plugin-ui.h" #include "shell/e-shell.h" #include "shell/e-shell-utils.h" #include "shell/e-shell-settings.h" -#include "widgets/misc/e-popup-action.h" -#include "widgets/misc/e-preview-pane.h" #include "mail/e-mail-reader.h" #include "mail/e-mail-reader-utils.h" diff --git a/mail/e-mail-browser.h b/mail/e-mail-browser.h index 849daebce4..bd636cdaf2 100644 --- a/mail/e-mail-browser.h +++ b/mail/e-mail-browser.h @@ -22,8 +22,8 @@ #ifndef E_MAIL_BROWSER_H #define E_MAIL_BROWSER_H +#include <e-util/e-util.h> #include <mail/e-mail-backend.h> -#include <misc/e-focus-tracker.h> #include <mail/e-mail-display.h> /* Standard GObject macros */ diff --git a/mail/e-mail-config-activity-page.c b/mail/e-mail-config-activity-page.c index 4328555f75..790d1f95bd 100644 --- a/mail/e-mail-config-activity-page.c +++ b/mail/e-mail-config-activity-page.c @@ -20,11 +20,6 @@ #include <camel/camel.h> -#include <libevolution-utils/e-alert-sink.h> -#include <libevolution-utils/e-alert-dialog.h> -#include <misc/e-activity-bar.h> -#include <misc/e-alert-bar.h> - #define E_MAIL_CONFIG_ACTIVITY_PAGE_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ ((obj), E_TYPE_MAIL_CONFIG_ACTIVITY_PAGE, EMailConfigActivityPagePrivate)) diff --git a/mail/e-mail-config-activity-page.h b/mail/e-mail-config-activity-page.h index 62defe20fa..43cc094ef8 100644 --- a/mail/e-mail-config-activity-page.h +++ b/mail/e-mail-config-activity-page.h @@ -25,7 +25,7 @@ #define E_MAIL_CONFIG_ACTIVITY_PAGE_H #include <gtk/gtk.h> -#include <e-util/e-activity.h> +#include <e-util/e-util.h> /* Standard GObject macros */ #define E_TYPE_MAIL_CONFIG_ACTIVITY_PAGE \ diff --git a/mail/e-mail-config-assistant.c b/mail/e-mail-config-assistant.c index 7caa43fea2..92bd971148 100644 --- a/mail/e-mail-config-assistant.c +++ b/mail/e-mail-config-assistant.c @@ -23,8 +23,6 @@ #include <libebackend/libebackend.h> -#include <libevolution-utils/e-alert-sink.h> - #include <mail/e-mail-config-confirm-page.h> #include <mail/e-mail-config-identity-page.h> #include <mail/e-mail-config-lookup-page.h> diff --git a/mail/e-mail-config-auth-check.c b/mail/e-mail-config-auth-check.c index 8abfa6fa09..d60e95f239 100644 --- a/mail/e-mail-config-auth-check.c +++ b/mail/e-mail-config-auth-check.c @@ -19,10 +19,9 @@ #include <config.h> #include <glib/gi18n-lib.h> -#include <libevolution-utils/e-alert.h> -#include <e-util/e-mktemp.h> -#include <misc/e-auth-combo-box.h> -#include <mail/e-mail-config-service-page.h> +#include "e-util/e-util.h" +#include "mail/e-mail-config-service-page.h" + #include "e-mail-ui-session.h" #include "e-mail-config-auth-check.h" diff --git a/mail/e-mail-config-identity-page.c b/mail/e-mail-config-identity-page.c index 40b18f4c36..5db923dc2f 100644 --- a/mail/e-mail-config-identity-page.c +++ b/mail/e-mail-config-identity-page.c @@ -23,9 +23,7 @@ #include <libebackend/libebackend.h> -#include <e-util/e-marshal.h> -#include <misc/e-mail-signature-combo-box.h> -#include <misc/e-mail-signature-editor.h> +#include "e-util/e-util.h" #define E_MAIL_CONFIG_IDENTITY_PAGE_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ diff --git a/mail/e-mail-config-provider-page.h b/mail/e-mail-config-provider-page.h index 1faf187c55..8cf21f3c7e 100644 --- a/mail/e-mail-config-provider-page.h +++ b/mail/e-mail-config-provider-page.h @@ -25,7 +25,7 @@ #include <gtk/gtk.h> #include <camel/camel.h> -#include <e-util/e-activity.h> +#include <e-util/e-util.h> #include <mail/e-mail-config-page.h> #include <mail/e-mail-config-activity-page.h> #include <mail/e-mail-config-service-backend.h> diff --git a/mail/e-mail-config-window.c b/mail/e-mail-config-window.c index 5062abca35..218f751579 100644 --- a/mail/e-mail-config-window.c +++ b/mail/e-mail-config-window.c @@ -21,12 +21,10 @@ #include <config.h> #include <glib/gi18n-lib.h> -#include <libevolution-utils/e-alert-dialog.h> -#include <libevolution-utils/e-alert-sink.h> -#include <misc/e-alert-bar.h> +#include "e-util/e-util.h" -#include <mail/e-mail-config-notebook.h> -#include <mail/e-mail-config-sidebar.h> +#include "mail/e-mail-config-notebook.h" +#include "mail/e-mail-config-sidebar.h" #define E_MAIL_CONFIG_WINDOW_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ diff --git a/mail/e-mail-display.c b/mail/e-mail-display.c index 4f706eef10..3181a90c27 100644 --- a/mail/e-mail-display.c +++ b/mail/e-mail-display.c @@ -24,31 +24,24 @@ #endif #include "e-mail-display.h" -#include "e-mail-display-popup-extension.h" #include <glib/gi18n.h> #include <gdk/gdk.h> -#include <em-format/e-mail-part-utils.h> -#include <em-format/e-mail-formatter-extension.h> -#include <em-format/e-mail-extension-registry.h> -#include <em-format/e-mail-part-attachment.h> -#include <em-format/e-mail-formatter-print.h> - -#include "e-util/e-marshal.h" -#include "e-util/e-util.h" -#include "e-util/e-plugin-ui.h" -#include "e-util/e-file-request.h" -#include "e-util/e-stock-request.h" -#include "mail/em-composer-utils.h" -#include "mail/em-utils.h" -#include "mail/e-mail-request.h" -#include "mail/e-http-request.h" -#include "widgets/misc/e-attachment-bar.h" -#include "widgets/misc/e-attachment-button.h" - #include <camel/camel.h> +#include "em-format/e-mail-part-utils.h" +#include "em-format/e-mail-formatter-extension.h" +#include "em-format/e-mail-extension-registry.h" +#include "em-format/e-mail-part-attachment.h" +#include "em-format/e-mail-formatter-print.h" + +#include "e-http-request.h" +#include "e-mail-display-popup-extension.h" +#include "e-mail-request.h" +#include "em-composer-utils.h" +#include "em-utils.h" + #define d(x) G_DEFINE_TYPE ( diff --git a/mail/e-mail-display.h b/mail/e-mail-display.h index 99ad73a376..7bf4aeed74 100644 --- a/mail/e-mail-display.h +++ b/mail/e-mail-display.h @@ -22,8 +22,7 @@ #ifndef E_MAIL_DISPLAY_H #define E_MAIL_DISPLAY_H -#include <misc/e-web-view.h> -#include <misc/e-search-bar.h> +#include <e-util/e-util.h> #include <em-format/e-mail-formatter.h> diff --git a/mail/e-mail-folder-pane.c b/mail/e-mail-folder-pane.c index e6c0e9213b..985f47b99c 100644 --- a/mail/e-mail-folder-pane.c +++ b/mail/e-mail-folder-pane.c @@ -28,24 +28,18 @@ #include <string.h> #include <glib/gi18n.h> -#include "e-util/e-util.h" -#include "e-util/e-plugin-ui.h" - #include "shell/e-shell.h" #include "shell/e-shell-utils.h" -#include "widgets/misc/e-popup-action.h" -#include "widgets/misc/e-preview-pane.h" - #include "libemail-engine/e-mail-utils.h" #include "libemail-engine/mail-tools.h" -#include "mail/e-mail-reader.h" -#include "mail/e-mail-reader-utils.h" -#include "mail/em-folder-tree-model.h" -#include "mail/em-composer-utils.h" -#include "mail/em-utils.h" -#include "mail/message-list.h" +#include "e-mail-reader.h" +#include "e-mail-reader-utils.h" +#include "em-folder-tree-model.h" +#include "em-composer-utils.h" +#include "em-utils.h" +#include "message-list.h" #define E_MAIL_FOLDER_PANE_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ diff --git a/mail/e-mail-migrate.c b/mail/e-mail-migrate.c index 603bf531f5..24335c9594 100644 --- a/mail/e-mail-migrate.c +++ b/mail/e-mail-migrate.c @@ -46,17 +46,10 @@ #include <libxml/parser.h> #include <libxml/xmlmemory.h> -#include <shell/e-shell.h> -#include <shell/e-shell-migrate.h> +#include "shell/e-shell.h" +#include "shell/e-shell-migrate.h" -#include <e-util/e-util.h> -#include <libevolution-utils/e-xml-utils.h> - -#include <libevolution-utils/e-alert-dialog.h> -#include <e-util/e-util-private.h> -#include <e-util/e-plugin.h> - -#include <libemail-engine/e-mail-folder-utils.h> +#include "libemail-engine/e-mail-folder-utils.h" #include "e-mail-backend.h" #include "em-utils.h" diff --git a/mail/e-mail-notebook-view.h b/mail/e-mail-notebook-view.h index 04b0bd4152..4e1fff64ae 100644 --- a/mail/e-mail-notebook-view.h +++ b/mail/e-mail-notebook-view.h @@ -25,7 +25,6 @@ #include <mail/e-mail-view.h> #include <shell/e-shell-searchbar.h> -#include <menus/gal-view-instance.h> /* Standard GObject macros */ #define E_TYPE_MAIL_NOTEBOOK_VIEW \ diff --git a/mail/e-mail-paned-view.c b/mail/e-mail-paned-view.c index 08bedb717b..2fbf48a5f2 100644 --- a/mail/e-mail-paned-view.c +++ b/mail/e-mail-paned-view.c @@ -24,22 +24,16 @@ #include <config.h> #endif -#include <glib/gi18n.h> #include "e-mail-paned-view.h" -#include "e-util/e-util-private.h" -#include "widgets/menus/gal-view-etable.h" -#include "widgets/menus/gal-view-instance.h" -#include "widgets/misc/e-paned.h" -#include "widgets/misc/e-preview-pane.h" -#include "widgets/misc/e-search-bar.h" +#include <glib/gi18n.h> -#include <shell/e-shell-window-actions.h> +#include "shell/e-shell-window-actions.h" -#include <libemail-engine/e-mail-folder-utils.h> -#include <libemail-engine/e-mail-utils.h> -#include <libemail-engine/mail-config.h> -#include <libemail-engine/mail-ops.h> +#include "libemail-engine/e-mail-folder-utils.h" +#include "libemail-engine/e-mail-utils.h" +#include "libemail-engine/mail-config.h" +#include "libemail-engine/mail-ops.h" #include "em-utils.h" #include "message-list.h" diff --git a/mail/e-mail-printer.c b/mail/e-mail-printer.c index 30c8517a50..2f7e1366b4 100644 --- a/mail/e-mail-printer.c +++ b/mail/e-mail-printer.c @@ -24,13 +24,12 @@ #include <glib/gi18n.h> #include <gtk/gtk.h> -#include <em-format/e-mail-formatter-print.h> -#include <em-format/e-mail-part-utils.h> +#include <webkit/webkitdom.h> -#include <e-util/e-print.h> -#include <e-util/e-marshal.h> +#include "e-util/e-util.h" -#include <webkit/webkitdom.h> +#include "em-format/e-mail-formatter-print.h" +#include "em-format/e-mail-part-utils.h" #include "e-mail-printer.h" #include "e-mail-display.h" diff --git a/mail/e-mail-reader-utils.c b/mail/e-mail-reader-utils.c index 9f027a65fd..cce0046658 100644 --- a/mail/e-mail-reader-utils.c +++ b/mail/e-mail-reader-utils.c @@ -32,30 +32,27 @@ #include <gtkhtml/gtkhtml.h> #include <camel/camel.h> -#include "libevolution-utils/e-alert-dialog.h" -#include "filter/e-filter-rule.h" -#include "misc/e-web-view.h" #include "shell/e-shell-utils.h" -#include <libemail-engine/e-mail-folder-utils.h> -#include <libemail-engine/e-mail-utils.h> -#include <libemail-engine/mail-ops.h> -#include <libemail-engine/mail-tools.h> +#include "libemail-engine/e-mail-folder-utils.h" +#include "libemail-engine/e-mail-utils.h" +#include "libemail-engine/mail-ops.h" +#include "libemail-engine/mail-tools.h" + +#include "em-format/e-mail-parser.h" +#include "em-format/e-mail-part-utils.h" #include "composer/e-composer-actions.h" -#include "mail/e-mail-backend.h" -#include "mail/e-mail-browser.h" -#include "mail/e-mail-printer.h" -#include "mail/e-mail-display.h" -#include "mail/em-composer-utils.h" -#include "mail/em-utils.h" -#include "mail/mail-autofilter.h" -#include "mail/mail-vfolder-ui.h" -#include "mail/message-list.h" - -#include <em-format/e-mail-parser.h> -#include <em-format/e-mail-part-utils.h> +#include "e-mail-backend.h" +#include "e-mail-browser.h" +#include "e-mail-printer.h" +#include "e-mail-display.h" +#include "em-composer-utils.h" +#include "em-utils.h" +#include "mail-autofilter.h" +#include "mail-vfolder-ui.h" +#include "message-list.h" #define d(x) diff --git a/mail/e-mail-reader.c b/mail/e-mail-reader.c index a659404092..c2500a5d59 100644 --- a/mail/e-mail-reader.c +++ b/mail/e-mail-reader.c @@ -32,36 +32,30 @@ #include <X11/XF86keysym.h> #endif -#include "e-util/e-charset.h" -#include "e-util/e-util.h" -#include "libevolution-utils/e-alert-dialog.h" #include "shell/e-shell-utils.h" -#include "widgets/misc/e-popup-action.h" -#include "widgets/misc/e-menu-tool-action.h" -#include "libemail-utils/mail-mt.h" - -#include "libemail-engine/mail-ops.h" -#include "libemail-engine/e-mail-utils.h" #include "libemail-engine/e-mail-enumtypes.h" +#include "libemail-engine/e-mail-utils.h" +#include "libemail-engine/mail-mt.h" +#include "libemail-engine/mail-ops.h" -#include "mail/e-mail-backend.h" -#include "mail/e-mail-browser.h" -#include "mail/e-mail-reader-utils.h" -#include "mail/e-mail-ui-session.h" -#include "mail/e-mail-view.h" -#include "mail/em-composer-utils.h" -#include "mail/em-event.h" -#include "mail/em-folder-selector.h" -#include "mail/em-folder-tree.h" -#include "mail/em-utils.h" -#include "mail/mail-autofilter.h" -#include "mail/mail-vfolder-ui.h" -#include "mail/message-list.h" - -#include <em-format/e-mail-formatter.h> -#include <em-format/e-mail-parser.h> -#include <em-format/e-mail-part-utils.h> +#include "em-format/e-mail-formatter.h" +#include "em-format/e-mail-parser.h" +#include "em-format/e-mail-part-utils.h" + +#include "e-mail-backend.h" +#include "e-mail-browser.h" +#include "e-mail-reader-utils.h" +#include "e-mail-ui-session.h" +#include "e-mail-view.h" +#include "em-composer-utils.h" +#include "em-event.h" +#include "em-folder-selector.h" +#include "em-folder-tree.h" +#include "em-utils.h" +#include "mail-autofilter.h" +#include "mail-vfolder-ui.h" +#include "message-list.h" #define E_MAIL_READER_GET_PRIVATE(obj) \ ((EMailReaderPrivate *) g_object_get_qdata \ diff --git a/mail/e-mail-reader.h b/mail/e-mail-reader.h index b33aee7554..1d513f0a8a 100644 --- a/mail/e-mail-reader.h +++ b/mail/e-mail-reader.h @@ -29,10 +29,10 @@ #include <gtk/gtk.h> #include <camel/camel.h> -#include <libevolution-utils/e-alert-sink.h> +#include <e-util/e-util.h> + #include <mail/e-mail-backend.h> #include <mail/e-mail-display.h> -#include <misc/e-preview-pane.h> /* Standard GObject macros */ #define E_TYPE_MAIL_READER \ diff --git a/mail/e-mail-request.c b/mail/e-mail-request.c index 665711f927..000a0b0516 100644 --- a/mail/e-mail-request.c +++ b/mail/e-mail-request.c @@ -30,14 +30,11 @@ #include <glib/gi18n.h> #include <camel/camel.h> -#include <em-format/e-mail-formatter.h> -#include <em-format/e-mail-formatter-utils.h> -#include <em-format/e-mail-formatter-print.h> +#include "shell/e-shell.h" -#include <e-util/e-icon-factory.h> -#include <e-util/e-util.h> - -#include <shell/e-shell.h> +#include "em-format/e-mail-formatter.h" +#include "em-format/e-mail-formatter-utils.h" +#include "em-format/e-mail-formatter-print.h" #define d(x) #define dd(x) diff --git a/mail/e-mail-tag-editor.c b/mail/e-mail-tag-editor.c index 9039366563..babc4d9c65 100644 --- a/mail/e-mail-tag-editor.c +++ b/mail/e-mail-tag-editor.c @@ -31,7 +31,6 @@ #include <glib/gi18n-lib.h> #include "e-util/e-util.h" -#include "widgets/misc/e-dateedit.h" #define E_MAIL_TAG_EDITOR_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ diff --git a/mail/e-mail-ui-session.c b/mail/e-mail-ui-session.c index 47eeea2eea..7f80d8b6be 100644 --- a/mail/e-mail-ui-session.c +++ b/mail/e-mail-ui-session.c @@ -43,12 +43,10 @@ #endif #include <libebackend/libebackend.h> -#include <libedataserverui/libedataserverui.h> #include "e-mail-account-store.h" #include "e-util/e-util.h" -#include "libevolution-utils/e-alert-dialog.h" #include "e-util/e-util-private.h" #include "shell/e-shell.h" @@ -66,7 +64,7 @@ #include "em-filter-rule.h" #include "em-utils.h" #include "libemail-engine/mail-config.h" -#include "libemail-utils/mail-mt.h" +#include "libemail-engine/mail-mt.h" #include "libemail-engine/mail-ops.h" #include "mail-send-recv.h" #include "libemail-engine/mail-tools.h" diff --git a/mail/e-mail-ui-session.h b/mail/e-mail-ui-session.h index 86ba4dd3f3..e6a65014b3 100644 --- a/mail/e-mail-ui-session.h +++ b/mail/e-mail-ui-session.h @@ -28,11 +28,10 @@ #define E_MAIL_UI_SESSION_H #include <camel/camel.h> +#include <e-util/e-util.h> #include <libemail-engine/e-mail-enums.h> #include <libemail-engine/e-mail-session.h> #include <libemail-engine/mail-folder-cache.h> -#include <mail/e-mail-account-store.h> -#include <e-util/e-activity.h> #include <mail/e-mail-account-store.h> #include <mail/e-mail-label-list-store.h> diff --git a/mail/e-mail-view.h b/mail/e-mail-view.h index 98072aecb0..1ff9878df2 100644 --- a/mail/e-mail-view.h +++ b/mail/e-mail-view.h @@ -25,7 +25,6 @@ #include <shell/e-shell-view.h> #include <shell/e-shell-searchbar.h> -#include <menus/gal-view-instance.h> /* Standard GObject macros */ #define E_TYPE_MAIL_VIEW \ diff --git a/mail/em-composer-utils.c b/mail/em-composer-utils.c index 2d8dcc9530..8f0da6141a 100644 --- a/mail/em-composer-utils.c +++ b/mail/em-composer-utils.c @@ -30,16 +30,13 @@ #include <gtk/gtk.h> #include <glib/gi18n.h> -#include <libevolution-utils/e-alert-dialog.h> -#include <libevolution-utils/e-alert-sink.h> #include <e-util/e-util.h> -#include <libemail-utils/mail-mt.h> - #include <libemail-engine/e-mail-folder-utils.h> -#include <libemail-engine/e-mail-session.h> #include <libemail-engine/e-mail-session-utils.h> +#include <libemail-engine/e-mail-session.h> #include <libemail-engine/e-mail-utils.h> +#include <libemail-engine/mail-mt.h> #include <libemail-engine/mail-ops.h> #include <libemail-engine/mail-tools.h> diff --git a/mail/em-config.h b/mail/em-config.h index ede4a0a20b..5de022b6ad 100644 --- a/mail/em-config.h +++ b/mail/em-config.h @@ -24,8 +24,7 @@ #define EM_CONFIG_H #include <camel/camel.h> - -#include "e-util/e-config.h" +#include <e-util/e-util.h> /* Standard GObject macros */ #define EM_TYPE_CONFIG \ diff --git a/mail/em-event.h b/mail/em-event.h index ef915429fc..8b4c510e16 100644 --- a/mail/em-event.h +++ b/mail/em-event.h @@ -24,8 +24,7 @@ #ifndef EM_EVENT_H #define EM_EVENT_H -#include "e-util/e-event.h" -#include "composer/e-msg-composer.h" +#include <composer/e-msg-composer.h> /* Standard GObject macros */ #define EM_TYPE_EVENT \ diff --git a/mail/em-filter-context.c b/mail/em-filter-context.c index 41c27ff375..c0fd8be52c 100644 --- a/mail/em-filter-context.c +++ b/mail/em-filter-context.c @@ -29,8 +29,6 @@ #include "em-filter-context.h" #include "em-filter-rule.h" -#include "filter/e-filter-option.h" -#include "filter/e-filter-int.h" #include "em-filter-source-element.h" /* For poking into filter-folder guts */ diff --git a/mail/em-filter-context.h b/mail/em-filter-context.h index 1f8889d94c..c3f39d642a 100644 --- a/mail/em-filter-context.h +++ b/mail/em-filter-context.h @@ -25,7 +25,7 @@ #ifndef EM_FILTER_CONTEXT_H #define EM_FILTER_CONTEXT_H -#include <filter/e-rule-context.h> +#include <e-util/e-util.h> #include <libemail-engine/e-mail-session.h> /* Standard GObject macros */ diff --git a/mail/em-filter-editor-folder-element.c b/mail/em-filter-editor-folder-element.c index 6179384e33..0d2f5d6b8e 100644 --- a/mail/em-filter-editor-folder-element.c +++ b/mail/em-filter-editor-folder-element.c @@ -26,17 +26,16 @@ #include <config.h> #endif +#include "em-filter-editor-folder-element.h" + #include <string.h> #include <gtk/gtk.h> #include <glib/gi18n.h> -#include "em-filter-editor-folder-element.h" #include "mail/em-folder-selection-button.h" #include "mail/em-utils.h" #include "shell/e-shell.h" -#include "filter/e-filter-part.h" -#include "libevolution-utils/e-alert.h" #define EM_FILTER_EDITOR_FOLDER_ELEMENT_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ diff --git a/mail/em-filter-editor-folder-element.h b/mail/em-filter-editor-folder-element.h index acb84bb10e..a1d7381c45 100644 --- a/mail/em-filter-editor-folder-element.h +++ b/mail/em-filter-editor-folder-element.h @@ -25,9 +25,9 @@ #ifndef EM_FILTER_EDITOR_FOLDER_ELEMENT_H #define EM_FILTER_EDITOR_FOLDER_ELEMENT_H -#include <filter/e-filter-element.h> -#include <libemail-utils/em-filter-folder-element.h> +#include <e-util/e-util.h> #include <libemail-engine/e-mail-session.h> +#include <libemail-engine/em-filter-folder-element.h> /* Standard GObject macros */ #define EM_TYPE_FILTER_EDITOR_FOLDER_ELEMENT \ diff --git a/mail/em-filter-editor.h b/mail/em-filter-editor.h index 3df5b75dc8..7c5da50cf5 100644 --- a/mail/em-filter-editor.h +++ b/mail/em-filter-editor.h @@ -25,7 +25,8 @@ #ifndef EM_FILTER_EDITOR_H #define EM_FILTER_EDITOR_H -#include "filter/e-rule-editor.h" +#include <e-util/e-util.h> + #include "em-filter-context.h" /* Standard GObject macros */ diff --git a/mail/em-filter-rule.h b/mail/em-filter-rule.h index 3b5fbd7008..805adadd7d 100644 --- a/mail/em-filter-rule.h +++ b/mail/em-filter-rule.h @@ -25,7 +25,7 @@ #ifndef EM_FILTER_RULE_H #define EM_FILTER_RULE_H -#include "filter/e-filter-rule.h" +#include <e-util/e-util.h> #define EM_TYPE_FILTER_RULE \ (em_filter_rule_get_type ()) diff --git a/mail/em-filter-source-element.c b/mail/em-filter-source-element.c index cdb590564f..b08c117d34 100644 --- a/mail/em-filter-source-element.c +++ b/mail/em-filter-source-element.c @@ -25,17 +25,17 @@ #include <config.h> #endif -#include <string.h> - #include "em-filter-source-element.h" -#include "e-mail-account-store.h" -#include "e-mail-ui-session.h" + +#include <string.h> #include <gtk/gtk.h> #include <camel/camel.h> -#include <shell/e-shell.h> -#include <filter/e-filter-part.h> +#include "shell/e-shell.h" + +#include "e-mail-account-store.h" +#include "e-mail-ui-session.h" #define EM_FILTER_SOURCE_ELEMENT_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ diff --git a/mail/em-filter-source-element.h b/mail/em-filter-source-element.h index 061a487fc8..f66a3892be 100644 --- a/mail/em-filter-source-element.h +++ b/mail/em-filter-source-element.h @@ -24,7 +24,7 @@ #ifndef EM_FILTER_SOURCE_ELEMENT_H #define EM_FILTER_SOURCE_ELEMENT_H -#include <filter/e-filter-element.h> +#include <e-util/e-util.h> #include <libemail-engine/e-mail-session.h> /* Standard GObject macros */ diff --git a/mail/em-folder-properties.c b/mail/em-folder-properties.c index d6ab5acfcb..d17fd69b5d 100644 --- a/mail/em-folder-properties.c +++ b/mail/em-folder-properties.c @@ -31,8 +31,8 @@ #include <gtk/gtk.h> #include <glib/gi18n.h> -#include <libemail-utils/mail-mt.h> #include <libemail-engine/e-mail-folder-utils.h> +#include <libemail-engine/mail-mt.h> #include <libemail-engine/mail-ops.h> #include "e-mail-backend.h" diff --git a/mail/em-folder-properties.h b/mail/em-folder-properties.h index a94354dba8..08eb2f08d6 100644 --- a/mail/em-folder-properties.h +++ b/mail/em-folder-properties.h @@ -25,7 +25,6 @@ #define __EM_FOLDER_PROPERTIES_H__ #include <camel/camel.h> -#include <libevolution-utils/e-alert-sink.h> #include <libemail-engine/e-mail-session.h> G_BEGIN_DECLS diff --git a/mail/em-folder-tree-model.c b/mail/em-folder-tree-model.c index 7eca514f54..750c0af208 100644 --- a/mail/em-folder-tree-model.c +++ b/mail/em-folder-tree-model.c @@ -39,12 +39,11 @@ #include <e-util/e-util.h> #include <shell/e-shell.h> -#include <libemail-utils/mail-mt.h> - #include <libemail-engine/e-mail-folder-utils.h> #include <libemail-engine/mail-folder-cache.h> -#include <libemail-engine/mail-tools.h> +#include <libemail-engine/mail-mt.h> #include <libemail-engine/mail-ops.h> +#include <libemail-engine/mail-tools.h> #include <e-mail-account-store.h> #include <e-mail-ui-session.h> diff --git a/mail/em-folder-tree.c b/mail/em-folder-tree.c index 7793f877d0..33a89b1da1 100644 --- a/mail/em-folder-tree.c +++ b/mail/em-folder-tree.c @@ -39,18 +39,11 @@ #include <gdk/gdkkeysyms.h> #include <glib/gi18n.h> -#include "e-util/e-mktemp.h" -#include "e-util/e-icon-factory.h" -#include "libevolution-utils/e-alert-dialog.h" -#include "e-util/e-util.h" - -#include "misc/e-selectable.h" - #include "em-vfolder-editor-rule.h" -#include "libemail-utils/mail-mt.h" #include "libemail-engine/e-mail-folder-utils.h" #include "libemail-engine/e-mail-session.h" +#include "libemail-engine/mail-mt.h" #include "libemail-engine/mail-ops.h" #include "libemail-engine/mail-tools.h" diff --git a/mail/em-folder-tree.h b/mail/em-folder-tree.h index 74eb111554..97c985c9ab 100644 --- a/mail/em-folder-tree.h +++ b/mail/em-folder-tree.h @@ -25,8 +25,7 @@ #define EM_FOLDER_TREE_H #include <gtk/gtk.h> -#include <e-util/e-activity.h> -#include <libevolution-utils/e-alert-sink.h> +#include <e-util/e-util.h> #include <mail/em-folder-tree-model.h> #include <libemail-engine/e-mail-session.h> diff --git a/mail/em-folder-utils.c b/mail/em-folder-utils.c index c211c03c44..686750a8c7 100644 --- a/mail/em-folder-utils.c +++ b/mail/em-folder-utils.c @@ -39,21 +39,18 @@ #include <gdk-pixbuf/gdk-pixbuf.h> #include <glib/gi18n.h> -#include "e-util/e-mktemp.h" - -#include "libevolution-utils/e-alert-dialog.h" -#include "e-util/e-dialog-utils.h" +#include "e-util/e-util.h" #include "em-vfolder-editor-rule.h" -#include "libemail-utils/mail-mt.h" #include "libemail-engine/e-mail-folder-utils.h" #include "libemail-engine/e-mail-session.h" #include "libemail-engine/e-mail-store-utils.h" #include "libemail-engine/e-mail-utils.h" +#include "libemail-engine/mail-folder-cache.h" +#include "libemail-engine/mail-mt.h" #include "libemail-engine/mail-ops.h" #include "libemail-engine/mail-tools.h" -#include "libemail-engine/mail-folder-cache.h" #include "e-mail-ui-session.h" #include "em-utils.h" diff --git a/mail/em-search-context.c b/mail/em-search-context.c index 2a900752aa..95fb097e17 100644 --- a/mail/em-search-context.c +++ b/mail/em-search-context.c @@ -26,12 +26,9 @@ #include <config.h> #endif -#include <string.h> - #include "em-search-context.h" -#include "filter/e-filter-rule.h" -#include "filter/e-filter-option.h" -#include "filter/e-filter-int.h" + +#include <string.h> G_DEFINE_TYPE (EMSearchContext, em_search_context, E_TYPE_RULE_CONTEXT) diff --git a/mail/em-search-context.h b/mail/em-search-context.h index 316a53a909..8a104db005 100644 --- a/mail/em-search-context.h +++ b/mail/em-search-context.h @@ -25,7 +25,7 @@ #ifndef EM_SEARCH_CONTEXT_H #define EM_SEARCH_CONTEXT_H -#include <filter/e-rule-context.h> +#include <e-util/e-util.h> /* Standard GObject macros */ #define EM_SEARCH_TYPE_CONTEXT \ diff --git a/mail/em-subscription-editor.c b/mail/em-subscription-editor.c index 1ee5269278..5a372b9117 100644 --- a/mail/em-subscription-editor.c +++ b/mail/em-subscription-editor.c @@ -25,13 +25,11 @@ #include <string.h> #include <glib/gi18n-lib.h> -#include <libemail-utils/mail-mt.h> -#include <libemail-engine/mail-tools.h> -#include <libemail-engine/mail-ops.h> +#include "libemail-engine/mail-mt.h" +#include "libemail-engine/mail-tools.h" +#include "libemail-engine/mail-ops.h" -#include <e-util/e-dialog-utils.h> -#include <e-util/e-util.h> -#include <e-util/e-util-private.h> +#include "e-util/e-util.h" #include "em-folder-utils.h" diff --git a/mail/em-utils.c b/mail/em-utils.c index d533be741d..3bb4b9f647 100644 --- a/mail/em-utils.c +++ b/mail/em-utils.c @@ -31,6 +31,7 @@ #include <errno.h> #include <time.h> +#include <glib/gi18n.h> #include <glib/gstdio.h> #ifdef G_OS_WIN32 @@ -43,28 +44,18 @@ #include "em-filter-editor.h" -#include <glib/gi18n.h> - #include <libebook/libebook.h> -#include <e-util/e-util.h> -#include <e-util/e-util-private.h> -#include <e-util/e-mktemp.h> -#include <e-util/e-dialog-utils.h> -#include <libevolution-utils/e-alert-dialog.h> - -#include <shell/e-shell.h> -#include <widgets/misc/e-attachment.h> - -#include <em-format/e-mail-parser.h> -#include <em-format/e-mail-formatter-quote.h> +#include "shell/e-shell.h" -#include <libemail-utils/mail-mt.h> +#include "em-format/e-mail-parser.h" +#include "em-format/e-mail-formatter-quote.h" -#include <libemail-engine/e-mail-folder-utils.h> -#include <libemail-engine/e-mail-session.h> -#include <libemail-engine/mail-ops.h> -#include <libemail-engine/mail-tools.h> +#include "libemail-engine/e-mail-folder-utils.h" +#include "libemail-engine/e-mail-session.h" +#include "libemail-engine/mail-mt.h" +#include "libemail-engine/mail-ops.h" +#include "libemail-engine/mail-tools.h" #include "e-mail-tag-editor.h" #include "em-composer-utils.h" diff --git a/mail/em-vfolder-editor-context.c b/mail/em-vfolder-editor-context.c index 31a2c20793..622bb5c882 100644 --- a/mail/em-vfolder-editor-context.c +++ b/mail/em-vfolder-editor-context.c @@ -26,15 +26,15 @@ #include <config.h> #endif -#include <string.h> -#include <shell/e-shell.h> -#include "mail/em-utils.h" #include "em-vfolder-editor-context.h" -#include "em-vfolder-editor-rule.h" -#include "filter/e-filter-option.h" -#include "filter/e-filter-int.h" + +#include <string.h> + +#include "shell/e-shell.h" #include "em-filter-editor-folder-element.h" +#include "em-utils.h" +#include "em-vfolder-editor-rule.h" #define EM_VFOLDER_EDITOR_CONTEXT_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ diff --git a/mail/em-vfolder-editor-context.h b/mail/em-vfolder-editor-context.h index 062d8bf08a..e131d92c11 100644 --- a/mail/em-vfolder-editor-context.h +++ b/mail/em-vfolder-editor-context.h @@ -25,9 +25,9 @@ #ifndef EM_VFOLDER_EDITOR_CONTEXT_H #define EM_VFOLDER_EDITOR_CONTEXT_H -#include <filter/e-rule-context.h> -#include <libemail-utils/em-vfolder-context.h> +#include <e-util/e-util.h> #include <libemail-engine/e-mail-session.h> +#include <libemail-engine/em-vfolder-context.h> /* Standard GObject macros */ #define EM_TYPE_VFOLDER_EDITOR_CONTEXT \ diff --git a/mail/em-vfolder-editor-rule.c b/mail/em-vfolder-editor-rule.c index 6a4cd6c37c..59c3713ed4 100644 --- a/mail/em-vfolder-editor-rule.c +++ b/mail/em-vfolder-editor-rule.c @@ -33,7 +33,6 @@ #include <shell/e-shell.h> #include <e-util/e-util.h> -#include <libevolution-utils/e-alert.h> #include <e-util/e-util-private.h> #include <libemail-engine/e-mail-folder-utils.h> diff --git a/mail/em-vfolder-editor-rule.h b/mail/em-vfolder-editor-rule.h index 39ad09797d..080ce49e3e 100644 --- a/mail/em-vfolder-editor-rule.h +++ b/mail/em-vfolder-editor-rule.h @@ -24,9 +24,9 @@ #ifndef EM_VFOLDER_EDITOR_RULE_H #define EM_VFOLDER_EDITOR_RULE_H -#include <filter/e-filter-rule.h> -#include <libemail-utils/em-vfolder-rule.h> +#include <e-util/e-util.h> #include <libemail-engine/e-mail-session.h> +#include <libemail-engine/em-vfolder-rule.h> /* Standard GObject macros */ #define EM_TYPE_VFOLDER_EDITOR_RULE \ diff --git a/mail/em-vfolder-editor.h b/mail/em-vfolder-editor.h index 311a63777f..252dffe035 100644 --- a/mail/em-vfolder-editor.h +++ b/mail/em-vfolder-editor.h @@ -24,7 +24,8 @@ #ifndef EM_VFOLDER_EDITOR_H #define EM_VFOLDER_EDITOR_H -#include "filter/e-rule-editor.h" +#include <e-util/e-util.h> + #include "em-vfolder-editor-context.h" /* Standard GObject macros */ diff --git a/mail/importers/Makefile.am b/mail/importers/Makefile.am index 6d40087a3f..089dae4892 100644 --- a/mail/importers/Makefile.am +++ b/mail/importers/Makefile.am @@ -5,11 +5,11 @@ libevolution_mail_importers_la_CPPFLAGS = \ -I.. \ -I$(srcdir)/.. \ -I$(top_srcdir) \ - -I$(top_srcdir)/widgets \ -DG_LOG_DOMAIN=\"evolution-mail-importer\" \ -DEVOLUTION_PRIVDATADIR=\""$(privdatadir)"\" \ $(EVOLUTION_DATA_SERVER_CFLAGS) \ $(GNOME_PLATFORM_CFLAGS) \ + $(CHAMPLAIN_CFLAGS) \ $(GTKHTML_CFLAGS) libevolution_mail_importers_la_SOURCES = \ @@ -24,14 +24,12 @@ libevolution_mail_importers_la_LDFLAGS = -avoid-version $(NO_UNDEFINED) libevolution_mail_importers_la_LIBADD = \ $(top_builddir)/e-util/libeutil.la \ $(top_builddir)/shell/libeshell.la \ - $(top_builddir)/filter/libfilter.la \ $(top_builddir)/mail/libevolution-mail.la \ $(top_builddir)/shell/libeshell.la \ - $(top_builddir)/widgets/misc/libemiscwidgets.la \ $(top_builddir)/libemail-engine/libemail-engine.la \ - $(top_builddir)/libemail-utils/libemail-utils.la \ $(EVOLUTION_DATA_SERVER_LIBS) \ $(GNOME_PLATFORM_LIBS) \ + $(CHAMPLAIN_LIBS) \ $(GTKHTML_LIBS) -include $(top_srcdir)/git.mk diff --git a/mail/importers/elm-importer.c b/mail/importers/elm-importer.c index 02d29f5394..8722a8d561 100644 --- a/mail/importers/elm-importer.c +++ b/mail/importers/elm-importer.c @@ -38,9 +38,8 @@ #include "mail-importer.h" -#include "libemail-utils/mail-mt.h" +#include "libemail-engine/mail-mt.h" #include "mail/e-mail-backend.h" -#include "e-util/e-import.h" #include "shell/e-shell.h" #define d(x) diff --git a/mail/importers/evolution-mbox-importer.c b/mail/importers/evolution-mbox-importer.c index 0f1e507f2c..ddbc798374 100644 --- a/mail/importers/evolution-mbox-importer.c +++ b/mail/importers/evolution-mbox-importer.c @@ -44,17 +44,15 @@ #include "shell/e-shell-view.h" #include "shell/e-shell-sidebar.h" +#include "libemail-engine/mail-mt.h" + #include "mail/e-mail-backend.h" #include "mail/em-folder-selection-button.h" #include "mail/em-folder-tree-model.h" #include "mail/em-folder-tree.h" -#include "libemail-utils/mail-mt.h" #include "mail-importer.h" -#include "e-util/e-import.h" -#include "misc/e-web-view-preview.h" - typedef struct { EImport *import; EImportTarget *target; diff --git a/mail/importers/mail-importer.c b/mail/importers/mail-importer.c index be821063a6..19df23d03c 100644 --- a/mail/importers/mail-importer.c +++ b/mail/importers/mail-importer.c @@ -39,9 +39,9 @@ #include "e-util/e-util-private.h" #include "shell/e-shell-backend.h" -#include "libemail-utils/mail-mt.h" -#include "libemail-engine/mail-tools.h" #include "libemail-engine/e-mail-session.h" +#include "libemail-engine/mail-mt.h" +#include "libemail-engine/mail-tools.h" #include "mail-importer.h" diff --git a/mail/importers/mail-importer.h b/mail/importers/mail-importer.h index bd0335c299..11e97955d6 100644 --- a/mail/importers/mail-importer.h +++ b/mail/importers/mail-importer.h @@ -24,8 +24,8 @@ #ifndef __MAIL_IMPORTER_H__ #define __MAIL_IMPORTER_H__ -#include <e-util/e-import.h> #include <camel/camel.h> +#include <e-util/e-util.h> #include <libemail-engine/e-mail-session.h> EImportImporter *mbox_importer_peek (void); diff --git a/mail/importers/pine-importer.c b/mail/importers/pine-importer.c index c8904c4e0b..eb7e5ade07 100644 --- a/mail/importers/pine-importer.c +++ b/mail/importers/pine-importer.c @@ -40,9 +40,8 @@ #include "mail-importer.h" -#include "libemail-utils/mail-mt.h" +#include "libemail-engine/mail-mt.h" #include "mail/e-mail-backend.h" -#include "e-util/e-import.h" #include "shell/e-shell.h" #define d(x) diff --git a/mail/mail-autofilter.c b/mail/mail-autofilter.c index 5ce81dd001..c7cefb3735 100644 --- a/mail/mail-autofilter.c +++ b/mail/mail-autofilter.c @@ -35,7 +35,6 @@ #include "mail-vfolder-ui.h" #include "mail-autofilter.h" #include "em-utils.h" -#include "libevolution-utils/e-alert-dialog.h" #include "e-util/e-util-private.h" #include "em-vfolder-editor-context.h" @@ -45,8 +44,6 @@ #include "em-filter-context.h" #include "em-filter-rule.h" #include "em-filter-editor.h" -#include "filter/e-filter-option.h" -#include "filter/e-filter-input.h" #define d(x) diff --git a/mail/mail-autofilter.h b/mail/mail-autofilter.h index a9e4254f9b..79c879317f 100644 --- a/mail/mail-autofilter.h +++ b/mail/mail-autofilter.h @@ -26,10 +26,9 @@ #include <camel/camel.h> -#include <filter/e-filter-rule.h> #include <mail/em-filter-context.h> -#include <libemail-utils/em-vfolder-context.h> #include <libemail-engine/e-mail-session.h> +#include <libemail-engine/em-vfolder-context.h> enum { AUTO_SUBJECT = 1, diff --git a/mail/mail-send-recv.c b/mail/mail-send-recv.c index e5001157a8..7d7f0f94f6 100644 --- a/mail/mail-send-recv.c +++ b/mail/mail-send-recv.c @@ -32,14 +32,13 @@ #include <shell/e-shell.h> #include <e-util/e-util.h> -#include <libemail-utils/mail-mt.h> - /* This is our hack, not part of libcamel. */ #include <libemail-engine/camel-null-store.h> #include <libemail-engine/e-mail-folder-utils.h> #include <libemail-engine/e-mail-session.h> #include <libemail-engine/mail-folder-cache.h> +#include <libemail-engine/mail-mt.h> #include <libemail-engine/mail-ops.h> #include <libemail-engine/mail-tools.h> diff --git a/mail/mail-vfolder-ui.c b/mail/mail-vfolder-ui.c index efe086c262..48b7fcef66 100644 --- a/mail/mail-vfolder-ui.c +++ b/mail/mail-vfolder-ui.c @@ -28,14 +28,13 @@ #include <glib/gi18n.h> -#include "libevolution-utils/e-alert-dialog.h" #include "e-util/e-util-private.h" -#include "libemail-utils/mail-mt.h" -#include "libemail-engine/mail-folder-cache.h" #include "libemail-engine/e-mail-folder-utils.h" #include "libemail-engine/e-mail-session.h" #include "libemail-engine/e-mail-utils.h" +#include "libemail-engine/mail-folder-cache.h" +#include "libemail-engine/mail-mt.h" #include "libemail-engine/mail-ops.h" #include "libemail-engine/mail-tools.h" diff --git a/mail/mail-vfolder-ui.h b/mail/mail-vfolder-ui.h index 55b838c63b..07bcaa3fe5 100644 --- a/mail/mail-vfolder-ui.h +++ b/mail/mail-vfolder-ui.h @@ -24,12 +24,11 @@ #include <camel/camel.h> -#include <filter/e-filter-part.h> -#include <filter/e-filter-rule.h> +#include <libemail-engine/em-vfolder-rule.h> +#include <libemail-engine/mail-vfolder.h> + #include <mail/e-mail-backend.h> -#include <libemail-utils/em-vfolder-rule.h> #include <shell/e-shell-view.h> -#include <libemail-engine/mail-vfolder.h> void vfolder_edit (EMailBackend *backend, GtkWindow *parent_window); diff --git a/mail/message-list.c b/mail/message-list.c index 473cc4faec..71bc8bbe0c 100644 --- a/mail/message-list.c +++ b/mail/message-list.c @@ -26,6 +26,8 @@ #include <config.h> #endif +#include "message-list.h" + #include <sys/types.h> #include <sys/stat.h> #include <unistd.h> @@ -36,38 +38,18 @@ #include <glib/gi18n.h> #include <glib/gstdio.h> -#include "e-util/e-icon-factory.h" -#include "e-util/e-poolv.h" -#include "e-util/e-util-private.h" -#include "e-util/e-util.h" - -#include "misc/e-selectable.h" - #include "shell/e-shell.h" #include "shell/e-shell-settings.h" -#include "table/e-cell-checkbox.h" -#include "table/e-cell-hbox.h" -#include "table/e-cell-date.h" -#include "table/e-cell-size.h" -#include "table/e-cell-text.h" -#include "table/e-cell-toggle.h" -#include "table/e-cell-tree.h" -#include "table/e-cell-vbox.h" -#include "table/e-table-sorting-utils.h" -#include "table/e-tree-memory-callbacks.h" -#include "table/e-tree-memory.h" - -#include "libemail-utils/mail-mt.h" #include "libemail-engine/e-mail-utils.h" #include "libemail-engine/mail-config.h" +#include "libemail-engine/mail-mt.h" #include "libemail-engine/mail-ops.h" #include "libemail-engine/mail-tools.h" -#include "mail/e-mail-label-list-store.h" -#include "mail/e-mail-ui-session.h" -#include "mail/em-utils.h" -#include "mail/message-list.h" +#include "e-mail-label-list-store.h" +#include "e-mail-ui-session.h" +#include "em-utils.h" /*#define TIMEIT */ diff --git a/mail/message-list.h b/mail/message-list.h index 9c93c46b05..daa27f2c1a 100644 --- a/mail/message-list.h +++ b/mail/message-list.h @@ -26,7 +26,7 @@ #include <gtk/gtk.h> #include <camel/camel.h> -#include <table/e-tree.h> +#include <e-util/e-util.h> #include <libemail-engine/e-mail-session.h> /* Standard GObject macros */ diff --git a/maint/Makefile.am b/maint/Makefile.am index 175832e0f7..e53a1d7104 100644 --- a/maint/Makefile.am +++ b/maint/Makefile.am @@ -12,9 +12,9 @@ libgladeevolution_la_LDFLAGS = \ -module -avoid-version libgladeevolution_la_LIBADD = \ + $(top_srcdir)/e-util/libeutil.la \ $(top_srcdir)/mail/libevolution-mail.la \ $(top_srcdir)/calendar/gui/libevolution-calendar.la \ - $(top_builddir)/widgets/misc/libemiscwidgets.la \ $(EVOLUTION_DATA_SERVER_LIBS) \ $(GNOME_PLATFORM_LIBS) diff --git a/modules/addressbook/Makefile.am b/modules/addressbook/Makefile.am index 49b24e2693..63b1f4b965 100644 --- a/modules/addressbook/Makefile.am +++ b/modules/addressbook/Makefile.am @@ -4,11 +4,8 @@ module_addressbook_la_CPPFLAGS = \ $(AM_CPPFLAGS) \ -DG_LOG_DOMAIN=\"evolution-addressbook\" \ -I$(top_srcdir) \ - -I$(top_srcdir)/widgets \ -I$(top_srcdir)/shell \ -I$(top_builddir)/shell \ - -I$(top_srcdir)/widgets/menus \ - -I$(top_srcdir)/widgets/misc \ -I$(top_srcdir)/addressbook/util \ -I$(top_srcdir)/addressbook/gui/contact-editor \ -I$(top_srcdir)/addressbook/gui/contact-list-editor \ @@ -64,14 +61,9 @@ module_addressbook_la_LIBADD = \ $(top_builddir)/shell/libeshell.la \ $(top_builddir)/addressbook/gui/merging/libeabbookmerging.la \ $(top_builddir)/addressbook/gui/widgets/libeabwidgets.la \ - $(top_builddir)/filter/libfilter.la \ $(top_builddir)/addressbook/util/libeabutil.la \ $(top_builddir)/addressbook/gui/contact-editor/libecontacteditor.la \ $(top_builddir)/addressbook/gui/contact-list-editor/libecontactlisteditor.la \ - $(top_builddir)/widgets/table/libetable.la \ - $(top_builddir)/widgets/text/libetext.la \ - $(top_builddir)/widgets/misc/libemiscwidgets.la \ - $(top_builddir)/widgets/menus/libmenus.la \ $(top_builddir)/addressbook/importers/libevolution-addressbook-importers.la \ $(EVOLUTION_DATA_SERVER_LIBS) \ $(GNOME_PLATFORM_LIBS) \ diff --git a/modules/addressbook/autocompletion-config.c b/modules/addressbook/autocompletion-config.c index 615328992a..d39ea53382 100644 --- a/modules/addressbook/autocompletion-config.c +++ b/modules/addressbook/autocompletion-config.c @@ -25,10 +25,6 @@ #include "autocompletion-config.h" #include <glib/gi18n.h> -#include <libedataserverui/libedataserverui.h> - -#include "e-util/e-datetime-format.h" -#include "misc/e-autocomplete-selector.h" static GtkWidget * add_section (GtkWidget *container, diff --git a/modules/addressbook/autocompletion-config.h b/modules/addressbook/autocompletion-config.h index 2cebea1b4a..2c60301922 100644 --- a/modules/addressbook/autocompletion-config.h +++ b/modules/addressbook/autocompletion-config.h @@ -26,7 +26,6 @@ #define _AUTOCOMPLETION_CONFIG_H #include <shell/e-shell.h> -#include <widgets/misc/e-preferences-window.h> G_BEGIN_DECLS diff --git a/modules/addressbook/e-book-config-hook.c b/modules/addressbook/e-book-config-hook.c index dd4b38b5e5..8ee342473e 100644 --- a/modules/addressbook/e-book-config-hook.c +++ b/modules/addressbook/e-book-config-hook.c @@ -25,7 +25,6 @@ #include "e-book-config-hook.h" -#include "e-util/e-config.h" #include "addressbook/gui/widgets/eab-config.h" static const EConfigHookTargetMask no_masks[] = { diff --git a/modules/addressbook/e-book-config-name-selector-entry.c b/modules/addressbook/e-book-config-name-selector-entry.c index ac7ccf4fce..acc38a773a 100644 --- a/modules/addressbook/e-book-config-name-selector-entry.c +++ b/modules/addressbook/e-book-config-name-selector-entry.c @@ -22,7 +22,7 @@ #include "e-book-config-name-selector-entry.h" -#include <libedataserverui/libedataserverui.h> +#include <e-util/e-util.h> #define E_BOOK_CONFIG_NAME_SELECTOR_ENTRY_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ diff --git a/modules/addressbook/e-book-shell-backend.c b/modules/addressbook/e-book-shell-backend.c index 2475312832..5dded832df 100644 --- a/modules/addressbook/e-book-shell-backend.c +++ b/modules/addressbook/e-book-shell-backend.c @@ -28,14 +28,9 @@ #include <string.h> #include <glib/gi18n.h> #include <libebook/libebook.h> -#include <libedataserverui/libedataserverui.h> -#include "e-util/e-import.h" #include "shell/e-shell.h" #include "shell/e-shell-window.h" -#include "widgets/misc/e-book-source-config.h" -#include "widgets/misc/e-preferences-window.h" -#include "widgets/misc/e-source-config-dialog.h" #include "addressbook/gui/widgets/eab-gui-util.h" #include "addressbook/gui/contact-editor/e-contact-editor.h" diff --git a/modules/addressbook/e-book-shell-content.c b/modules/addressbook/e-book-shell-content.c index 84c8b31699..26b370f6d6 100644 --- a/modules/addressbook/e-book-shell-content.c +++ b/modules/addressbook/e-book-shell-content.c @@ -27,10 +27,7 @@ #include <glib/gi18n.h> -#include "e-util/e-selection.h" #include "shell/e-shell-utils.h" -#include "widgets/misc/e-paned.h" -#include "widgets/misc/e-preview-pane.h" #include "e-book-shell-view.h" #define E_BOOK_SHELL_CONTENT_GET_PRIVATE(obj) \ diff --git a/modules/addressbook/e-book-shell-content.h b/modules/addressbook/e-book-shell-content.h index 63c395cab7..b0258d82ae 100644 --- a/modules/addressbook/e-book-shell-content.h +++ b/modules/addressbook/e-book-shell-content.h @@ -28,8 +28,6 @@ #include <shell/e-shell-searchbar.h> #include <shell/e-shell-view.h> -#include <misc/e-preview-pane.h> - #include "addressbook/gui/widgets/e-addressbook-view.h" #include "eab-composer-util.h" diff --git a/modules/addressbook/e-book-shell-sidebar.h b/modules/addressbook/e-book-shell-sidebar.h index d2bac8ca97..703d67cb0c 100644 --- a/modules/addressbook/e-book-shell-sidebar.h +++ b/modules/addressbook/e-book-shell-sidebar.h @@ -22,8 +22,6 @@ #ifndef E_BOOK_SHELL_SIDEBAR_H #define E_BOOK_SHELL_SIDEBAR_H -#include <libedataserverui/libedataserverui.h> - #include <shell/e-shell-sidebar.h> #include <shell/e-shell-view.h> diff --git a/modules/addressbook/e-book-shell-view-actions.c b/modules/addressbook/e-book-shell-view-actions.c index 54865b7e39..01064f2da6 100644 --- a/modules/addressbook/e-book-shell-view-actions.c +++ b/modules/addressbook/e-book-shell-view-actions.c @@ -25,13 +25,7 @@ #include "e-book-shell-view-private.h" -#include <libevolution-utils/e-alert-dialog.h> #include <e-util/e-util.h> -#include <filter/e-filter-rule.h> - -#ifdef WITH_CONTACT_MAPS -#include <widgets/misc/e-contact-map-window.h> -#endif static void action_address_book_copy_cb (GtkAction *action, diff --git a/modules/addressbook/e-book-shell-view-private.c b/modules/addressbook/e-book-shell-view-private.c index 947f680f6e..884477f451 100644 --- a/modules/addressbook/e-book-shell-view-private.c +++ b/modules/addressbook/e-book-shell-view-private.c @@ -27,7 +27,6 @@ #include "e-book-shell-view-private.h" -#include "widgets/menus/gal-view-factory-etable.h" #include "addressbook/gui/widgets/gal-view-factory-minicard.h" static void diff --git a/modules/addressbook/e-book-shell-view-private.h b/modules/addressbook/e-book-shell-view-private.h index 8338476f5e..8aa12d157d 100644 --- a/modules/addressbook/e-book-shell-view-private.h +++ b/modules/addressbook/e-book-shell-view-private.h @@ -28,18 +28,11 @@ #include <glib/gi18n.h> #include <gdk/gdkkeysyms.h> #include <libebook/libebook.h> -#include <libedataserverui/libedataserverui.h> -#include "e-util/e-util.h" -#include "e-util/e-file-utils.h" #include "shell/e-shell-content.h" #include "shell/e-shell-searchbar.h" #include "shell/e-shell-sidebar.h" #include "shell/e-shell-utils.h" -#include "misc/e-book-source-config.h" -#include "misc/e-popup-action.h" -#include "misc/e-selectable.h" -#include "misc/e-source-config-dialog.h" #include "addressbook/util/eab-book-util.h" #include "addressbook/gui/contact-editor/e-contact-editor.h" diff --git a/modules/audio-inline/Makefile.am b/modules/audio-inline/Makefile.am index 64af11c1af..147379f7b2 100644 --- a/modules/audio-inline/Makefile.am +++ b/modules/audio-inline/Makefile.am @@ -3,11 +3,12 @@ module_LTLIBRARIES = module-audio-inline.la module_audio_inline_la_CPPFLAGS = \ $(AM_CPPFLAGS) \ -I$(top_srcdir) \ - -I$(top_srcdir)/widgets \ -DEVOLUTION_PRIVDATADIR=\""$(privdatadir)"\" \ -DG_LOG_DOMAIN=\"evolution-module-audio-inline\" \ $(EVOLUTION_DATA_SERVER_CFLAGS) \ $(GNOME_PLATFORM_CFLAGS) \ + $(CHAMPLAIN_CFLAGS) \ + $(GTKHTML_CFLAGS) \ $(GSTREAMER_CFLAGS) module_audio_inline_la_SOURCES = \ @@ -24,6 +25,8 @@ module_audio_inline_la_LIBADD = \ $(top_builddir)/em-format/libemformat.la \ $(EVOLUTION_DATA_SERVER_LIBS) \ $(GNOME_PLATFORM_LIBS) \ + $(CHAMPLAIN_LIBS) \ + $(GTKHTML_LIBS) \ $(GSTREAMER_LIBS) module_audio_inline_la_LDFLAGS = \ diff --git a/modules/audio-inline/e-mail-formatter-audio-inline.c b/modules/audio-inline/e-mail-formatter-audio-inline.c index cf31f1596d..86cd6f132f 100644 --- a/modules/audio-inline/e-mail-formatter-audio-inline.c +++ b/modules/audio-inline/e-mail-formatter-audio-inline.c @@ -24,16 +24,14 @@ #include <glib/gi18n-lib.h> +#include <camel/camel.h> +#include <gst/gst.h> + #include <libebackend/libebackend.h> #include <em-format/e-mail-formatter-extension.h> #include <em-format/e-mail-formatter.h> -#include "e-util/e-mktemp.h" - -#include <camel/camel.h> -#include <gst/gst.h> - #include "e-mail-part-audio-inline.h" #define d(x) diff --git a/modules/backup-restore/Makefile.am b/modules/backup-restore/Makefile.am index 7d952e795e..4b5970764c 100644 --- a/modules/backup-restore/Makefile.am +++ b/modules/backup-restore/Makefile.am @@ -5,7 +5,6 @@ module_LTLIBRARIES = module-backup-restore.la module_backup_restore_la_CPPFLAGS = \ $(AM_CPPFLAGS) \ -I$(top_srcdir) \ - -I$(top_srcdir)/widgets \ -DG_LOG_DOMAIN=\"evolution-backup-restore\" \ -DEVOLUTION_LOCALEDIR=\""$(localedir)"\" \ -DEVOLUTION_TOOLSDIR=\""$(privlibexecdir)"\" \ @@ -15,6 +14,7 @@ module_backup_restore_la_CPPFLAGS = \ -DLIBDIR=\""$(libdir)"\" \ $(EVOLUTION_DATA_SERVER_CFLAGS) \ $(GNOME_PLATFORM_CFLAGS) \ + $(CHAMPLAIN_CFLAGS) \ $(GTKHTML_CFLAGS) \ $(NULL) @@ -30,11 +30,10 @@ module_backup_restore_la_LIBADD = \ $(top_builddir)/e-util/libeutil.la \ $(top_builddir)/shell/libeshell.la \ $(top_builddir)/mail/libevolution-mail.la \ - $(top_builddir)/widgets/misc/libemiscwidgets.la \ $(top_builddir)/libemail-engine/libemail-engine.la \ - $(top_builddir)/libevolution-utils/libevolution-utils.la \ $(EVOLUTION_DATA_SERVER_LIBS) \ $(GNOME_PLATFORM_LIBS) \ + $(CHAMPLAIN_LIBS) \ $(GTKHTML_LIBS) \ $(NULL) @@ -46,7 +45,6 @@ privlibexec_PROGRAMS = evolution-backup evolution_backup_CPPFLAGS = \ $(AM_CPPFLAGS) \ -I$(top_srcdir) \ - -I$(top_srcdir)/widgets \ -DEVOLUTION_LOCALEDIR=\""$(localedir)"\" \ -DEVOLUTION_TOOLSDIR=\""$(privlibexecdir)"\" \ -DPREFIX=\""$(prefix)"\" \ @@ -56,6 +54,8 @@ evolution_backup_CPPFLAGS = \ -DDBUS_SERVICES_DIR=\"'${datadir}'/dbus-1/services\" \ $(EVOLUTION_DATA_SERVER_CFLAGS) \ $(GNOME_PLATFORM_CFLAGS) \ + $(CHAMPLAIN_CFLAGS) \ + $(GTKHTML_CFLAGS) \ $(NULL) evolution_backup_SOURCES = \ @@ -66,6 +66,8 @@ evolution_backup_LDADD = \ $(top_builddir)/e-util/libeutil.la \ $(EVOLUTION_DATA_SERVER_LIBS) \ $(GNOME_PLATFORM_LIBS) \ + $(CHAMPLAIN_LIBS) \ + $(GTKHTML_LIBS) \ $(NULL) if OS_WIN32 diff --git a/modules/backup-restore/e-mail-config-restore-page.c b/modules/backup-restore/e-mail-config-restore-page.c index 7a997661e3..33b192c87a 100644 --- a/modules/backup-restore/e-mail-config-restore-page.c +++ b/modules/backup-restore/e-mail-config-restore-page.c @@ -27,9 +27,7 @@ #endif #include <glib/gi18n-lib.h> -#include <libevolution-utils/e-alert-sink.h> -#include <libevolution-utils/e-alert-dialog.h> -#include <misc/e-alert-bar.h> +#include <e-util/e-util.h> #define E_MAIL_CONFIG_RESTORE_PAGE_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ diff --git a/modules/backup-restore/evolution-backup-restore.c b/modules/backup-restore/evolution-backup-restore.c index 925315b8af..01028e53f7 100644 --- a/modules/backup-restore/evolution-backup-restore.c +++ b/modules/backup-restore/evolution-backup-restore.c @@ -30,13 +30,13 @@ #include <libebackend/libebackend.h> -#include <mail/e-mail-config-assistant.h> -#include <libevolution-utils/e-alert-dialog.h> #include <e-util/e-util.h> -#include <e-util/e-dialog-utils.h> + #include <shell/e-shell-utils.h> #include <shell/e-shell-window.h> +#include <mail/e-mail-config-assistant.h> + #include "e-mail-config-restore-page.h" #include "e-mail-config-restore-ready-page.h" diff --git a/modules/bogofilter/Makefile.am b/modules/bogofilter/Makefile.am index aaa72f977d..a3e3019bce 100644 --- a/modules/bogofilter/Makefile.am +++ b/modules/bogofilter/Makefile.am @@ -15,7 +15,6 @@ module_bogofilter_la_LIBADD = \ $(top_builddir)/e-util/libeutil.la \ $(top_builddir)/mail/libevolution-mail.la \ $(top_builddir)/libemail-engine/libemail-engine.la \ - $(top_builddir)/libemail-utils/libemail-utils.la \ $(EVOLUTION_DATA_SERVER_LIBS) \ $(GNOME_PLATFORM_LIBS) diff --git a/modules/book-config-google/Makefile.am b/modules/book-config-google/Makefile.am index edf8789aac..b1f8d7135e 100644 --- a/modules/book-config-google/Makefile.am +++ b/modules/book-config-google/Makefile.am @@ -3,19 +3,21 @@ module_LTLIBRARIES = module-book-config-google.la module_book_config_google_la_CPPFLAGS = \ $(AM_CPPFLAGS) \ -I$(top_srcdir) \ - -I$(top_srcdir)/widgets \ -DG_LOG_DOMAIN=\"evolution-book-config-google\" \ $(EVOLUTION_DATA_SERVER_CFLAGS) \ - $(GNOME_PLATFORM_CFLAGS) + $(GNOME_PLATFORM_CFLAGS) \ + $(CHAMPLAIN_CFLAGS) \ + $(GTKHTML_CFLAGS) module_book_config_google_la_SOURCES = \ evolution-book-config-google.c module_book_config_google_la_LIBADD = \ $(top_builddir)/e-util/libeutil.la \ - $(top_builddir)/widgets/misc/libemiscwidgets.la \ $(EVOLUTION_DATA_SERVER_LIBS) \ - $(GNOME_PLATFORM_LIBS) + $(GNOME_PLATFORM_LIBS) \ + $(CHAMPLAIN_LIBS) \ + $(GTKHTML_LIBS) module_book_config_google_la_LDFLAGS = \ -module -avoid-version $(NO_UNDEFINED) diff --git a/modules/book-config-google/evolution-book-config-google.c b/modules/book-config-google/evolution-book-config-google.c index e097c0a2cd..709a6f3112 100644 --- a/modules/book-config-google/evolution-book-config-google.c +++ b/modules/book-config-google/evolution-book-config-google.c @@ -21,9 +21,7 @@ #include <libebackend/libebackend.h> -#include <misc/e-book-source-config.h> -#include <misc/e-interval-chooser.h> -#include <misc/e-source-config-backend.h> +#include <e-util/e-util.h> typedef ESourceConfigBackend EBookConfigGoogle; typedef ESourceConfigBackendClass EBookConfigGoogleClass; diff --git a/modules/book-config-ldap/Makefile.am b/modules/book-config-ldap/Makefile.am index 6e957dc8c5..df17cb358c 100644 --- a/modules/book-config-ldap/Makefile.am +++ b/modules/book-config-ldap/Makefile.am @@ -3,10 +3,11 @@ module_LTLIBRARIES = module-book-config-ldap.la module_book_config_ldap_la_CPPFLAGS = \ $(AM_CPPFLAGS) \ -I$(top_srcdir) \ - -I$(top_srcdir)/widgets \ -DG_LOG_DOMAIN=\"evolution-book-config-ldap\" \ $(EVOLUTION_DATA_SERVER_CFLAGS) \ $(GNOME_PLATFORM_CFLAGS) \ + $(CHAMPLAIN_CFLAGS) \ + $(GTKHTML_CFLAGS) \ $(LDAP_CFLAGS) module_book_config_ldap_la_SOURCES = \ @@ -15,11 +16,11 @@ module_book_config_ldap_la_SOURCES = \ e-source-ldap.h module_book_config_ldap_la_LIBADD = \ - $(top_builddir)/libevolution-utils/libevolution-utils.la \ $(top_builddir)/e-util/libeutil.la \ - $(top_builddir)/widgets/misc/libemiscwidgets.la \ $(EVOLUTION_DATA_SERVER_LIBS) \ $(GNOME_PLATFORM_LIBS) \ + $(CHAMPLAIN_LIBS) \ + $(GTKHTML_LIBS) \ $(LDAP_LIBS) module_book_config_ldap_la_LDFLAGS = \ diff --git a/modules/book-config-ldap/evolution-book-config-ldap.c b/modules/book-config-ldap/evolution-book-config-ldap.c index 42cea3b5d5..56fc0f24f6 100644 --- a/modules/book-config-ldap/evolution-book-config-ldap.c +++ b/modules/book-config-ldap/evolution-book-config-ldap.c @@ -22,9 +22,7 @@ #include <libebackend/libebackend.h> -#include <libevolution-utils/e-alert-dialog.h> -#include <misc/e-book-source-config.h> -#include <misc/e-source-config-backend.h> +#include <e-util/e-util.h> #include "e-source-ldap.h" diff --git a/modules/book-config-local/Makefile.am b/modules/book-config-local/Makefile.am index 518ea3b52e..eca745d804 100644 --- a/modules/book-config-local/Makefile.am +++ b/modules/book-config-local/Makefile.am @@ -3,19 +3,21 @@ module_LTLIBRARIES = module-book-config-local.la module_book_config_local_la_CPPFLAGS = \ $(AM_CPPFLAGS) \ -I$(top_srcdir) \ - -I$(top_srcdir)/widgets \ -DG_LOG_DOMAIN=\"evolution-book-config-local\" \ $(EVOLUTION_DATA_SERVER_CFLAGS) \ - $(GNOME_PLATFORM_CFLAGS) + $(GNOME_PLATFORM_CFLAGS) \ + $(CHAMPLAIN_CFLAGS) \ + $(GTKHTML_CFLAGS) module_book_config_local_la_SOURCES = \ evolution-book-config-local.c module_book_config_local_la_LIBADD = \ $(top_builddir)/e-util/libeutil.la \ - $(top_builddir)/widgets/misc/libemiscwidgets.la \ $(EVOLUTION_DATA_SERVER_LIBS) \ - $(GNOME_PLATFORM_LIBS) + $(GNOME_PLATFORM_LIBS) \ + $(CHAMPLAIN_LIBS) \ + $(GTKHTML_LIBS) module_book_config_local_la_LDFLAGS = \ -module -avoid-version $(NO_UNDEFINED) diff --git a/modules/book-config-local/evolution-book-config-local.c b/modules/book-config-local/evolution-book-config-local.c index b6c31a7ed8..2726b84b33 100644 --- a/modules/book-config-local/evolution-book-config-local.c +++ b/modules/book-config-local/evolution-book-config-local.c @@ -21,8 +21,7 @@ #include <libebackend/libebackend.h> -#include <misc/e-book-source-config.h> -#include <misc/e-source-config-backend.h> +#include <e-util/e-util.h> typedef ESourceConfigBackend EBookConfigLocal; typedef ESourceConfigBackendClass EBookConfigLocalClass; diff --git a/modules/book-config-webdav/Makefile.am b/modules/book-config-webdav/Makefile.am index 5f3f09cbd6..5c919cc049 100644 --- a/modules/book-config-webdav/Makefile.am +++ b/modules/book-config-webdav/Makefile.am @@ -3,19 +3,21 @@ module_LTLIBRARIES = module-book-config-webdav.la module_book_config_webdav_la_CPPFLAGS = \ $(AM_CPPFLAGS) \ -I$(top_srcdir) \ - -I$(top_srcdir)/widgets \ -DG_LOG_DOMAIN=\"evolution-book-config-webdav\" \ $(EVOLUTION_DATA_SERVER_CFLAGS) \ - $(GNOME_PLATFORM_CFLAGS) + $(GNOME_PLATFORM_CFLAGS) \ + $(CHAMPLAIN_CFLAGS) \ + $(GTKHTML_CFLAGS) module_book_config_webdav_la_SOURCES = \ evolution-book-config-webdav.c module_book_config_webdav_la_LIBADD = \ $(top_builddir)/e-util/libeutil.la \ - $(top_builddir)/widgets/misc/libemiscwidgets.la \ $(EVOLUTION_DATA_SERVER_LIBS) \ - $(GNOME_PLATFORM_LIBS) + $(GNOME_PLATFORM_LIBS) \ + $(CHAMPLAIN_LIBS) \ + $(GTKHTML_LIBS) module_book_config_webdav_la_LDFLAGS = \ -module -avoid-version $(NO_UNDEFINED) diff --git a/modules/book-config-webdav/evolution-book-config-webdav.c b/modules/book-config-webdav/evolution-book-config-webdav.c index 6b6b1b47f2..418de91796 100644 --- a/modules/book-config-webdav/evolution-book-config-webdav.c +++ b/modules/book-config-webdav/evolution-book-config-webdav.c @@ -21,8 +21,7 @@ #include <libebackend/libebackend.h> -#include <misc/e-book-source-config.h> -#include <misc/e-source-config-backend.h> +#include <e-util/e-util.h> typedef ESourceConfigBackend EBookConfigWebdav; typedef ESourceConfigBackendClass EBookConfigWebdavClass; diff --git a/modules/cal-config-caldav/Makefile.am b/modules/cal-config-caldav/Makefile.am index 6905aff473..51a2b58307 100644 --- a/modules/cal-config-caldav/Makefile.am +++ b/modules/cal-config-caldav/Makefile.am @@ -3,10 +3,11 @@ module_LTLIBRARIES = module-cal-config-caldav.la module_cal_config_caldav_la_CPPFLAGS = \ $(AM_CPPFLAGS) \ -I$(top_srcdir) \ - -I$(top_srcdir)/widgets \ -DG_LOG_DOMAIN=\"evolution-cal-config-caldav\" \ $(EVOLUTION_DATA_SERVER_CFLAGS) \ $(GNOME_PLATFORM_CFLAGS) \ + $(CHAMPLAIN_CFLAGS) \ + $(GTKHTML_CFLAGS) \ $(LIBSOUP_CFLAGS) module_cal_config_caldav_la_SOURCES = \ @@ -18,9 +19,10 @@ module_cal_config_caldav_la_SOURCES = \ module_cal_config_caldav_la_LIBADD = \ $(top_builddir)/e-util/libeutil.la \ - $(top_builddir)/widgets/misc/libemiscwidgets.la \ $(EVOLUTION_DATA_SERVER_LIBS) \ $(GNOME_PLATFORM_LIBS) \ + $(CHAMPLAIN_LIBS) \ + $(GTKHTML_LIBS) \ $(LIBSOUP_LIBS) module_cal_config_caldav_la_LDFLAGS = \ diff --git a/modules/cal-config-caldav/e-caldav-chooser.c b/modules/cal-config-caldav/e-caldav-chooser.c index b9176c4143..8bb5fae8a9 100644 --- a/modules/cal-config-caldav/e-caldav-chooser.c +++ b/modules/cal-config-caldav/e-caldav-chooser.c @@ -28,7 +28,7 @@ #include <libxml/xpath.h> #include <libxml/xpathInternals.h> -#include <libedataserverui/libedataserverui.h> +#include <e-util/e-util.h> #define E_CALDAV_CHOOSER_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ diff --git a/modules/cal-config-caldav/evolution-cal-config-caldav.c b/modules/cal-config-caldav/evolution-cal-config-caldav.c index 0ca90cb5e6..249892eb5e 100644 --- a/modules/cal-config-caldav/evolution-cal-config-caldav.c +++ b/modules/cal-config-caldav/evolution-cal-config-caldav.c @@ -21,9 +21,7 @@ #include <libebackend/libebackend.h> -#include <misc/e-cal-source-config.h> -#include <misc/e-interval-chooser.h> -#include <misc/e-source-config-backend.h> +#include <e-util/e-util.h> #include "e-caldav-chooser.h" #include "e-caldav-chooser-dialog.h" diff --git a/modules/cal-config-contacts/Makefile.am b/modules/cal-config-contacts/Makefile.am index d27d3a06c0..166773a521 100644 --- a/modules/cal-config-contacts/Makefile.am +++ b/modules/cal-config-contacts/Makefile.am @@ -3,10 +3,11 @@ module_LTLIBRARIES = module-cal-config-contacts.la module_cal_config_contacts_la_CPPFLAGS = \ $(AM_CPPFLAGS) \ -I$(top_srcdir) \ - -I$(top_srcdir)/widgets \ -DG_LOG_DOMAIN=\"evolution-cal-config-contacts\" \ $(EVOLUTION_DATA_SERVER_CFLAGS) \ - $(GNOME_PLATFORM_CFLAGS) + $(GNOME_PLATFORM_CFLAGS) \ + $(CHAMPLAIN_CFLAGS) \ + $(GTKHTML_CFLAGS) module_cal_config_contacts_la_SOURCES = \ evolution-cal-config-contacts.c \ @@ -17,9 +18,10 @@ module_cal_config_contacts_la_SOURCES = \ module_cal_config_contacts_la_LIBADD = \ $(top_builddir)/e-util/libeutil.la \ - $(top_builddir)/widgets/misc/libemiscwidgets.la \ $(EVOLUTION_DATA_SERVER_LIBS) \ - $(GNOME_PLATFORM_LIBS) + $(GNOME_PLATFORM_LIBS) \ + $(CHAMPLAIN_LIBS) \ + $(GTKHTML_LIBS) module_cal_config_contacts_la_LDFLAGS = \ -module -avoid-version $(NO_UNDEFINED) diff --git a/modules/cal-config-contacts/e-contacts-selector.h b/modules/cal-config-contacts/e-contacts-selector.h index 5ba1ea9dca..7d567cd4ae 100644 --- a/modules/cal-config-contacts/e-contacts-selector.h +++ b/modules/cal-config-contacts/e-contacts-selector.h @@ -19,7 +19,7 @@ #ifndef E_CONTACTS_SELECTOR_H #define E_CONTACTS_SELECTOR_H -#include <libedataserverui/libedataserverui.h> +#include <e-util/e-util.h> /* Standard GObject macros */ #define E_TYPE_CONTACTS_SELECTOR \ diff --git a/modules/cal-config-contacts/evolution-cal-config-contacts.c b/modules/cal-config-contacts/evolution-cal-config-contacts.c index 5efc8b04e8..e61d6afbec 100644 --- a/modules/cal-config-contacts/evolution-cal-config-contacts.c +++ b/modules/cal-config-contacts/evolution-cal-config-contacts.c @@ -21,9 +21,7 @@ #include <libebackend/libebackend.h> -#include <misc/e-cal-source-config.h> -#include <misc/e-book-source-config.h> -#include <misc/e-source-config-backend.h> +#include <e-util/e-util.h> #include "e-contacts-selector.h" #include "e-source-contacts.h" diff --git a/modules/cal-config-google/Makefile.am b/modules/cal-config-google/Makefile.am index 6467c436f0..3477c61a83 100644 --- a/modules/cal-config-google/Makefile.am +++ b/modules/cal-config-google/Makefile.am @@ -3,10 +3,11 @@ module_LTLIBRARIES = module-cal-config-google.la module_cal_config_google_la_CPPFLAGS = \ $(AM_CPPFLAGS) \ -I$(top_srcdir) \ - -I$(top_srcdir)/widgets \ -DG_LOG_DOMAIN=\"evolution-cal-config-google\" \ $(EVOLUTION_DATA_SERVER_CFLAGS) \ $(GNOME_PLATFORM_CFLAGS) \ + $(CHAMPLAIN_CFLAGS) \ + $(GTKHTML_CFLAGS) \ $(GDATA_CFLAGS) module_cal_config_google_la_SOURCES = \ @@ -20,9 +21,10 @@ module_cal_config_google_la_SOURCES = \ module_cal_config_google_la_LIBADD = \ $(top_builddir)/e-util/libeutil.la \ - $(top_builddir)/widgets/misc/libemiscwidgets.la \ $(EVOLUTION_DATA_SERVER_LIBS) \ $(GNOME_PLATFORM_LIBS) \ + $(CHAMPLAIN_LIBS) \ + $(GTKHTML_LIBS) \ $(GDATA_LIBS) module_cal_config_google_la_LDFLAGS = \ diff --git a/modules/cal-config-google/e-google-chooser.c b/modules/cal-config-google/e-google-chooser.c index 9dd2b326e7..d03c5dce8f 100644 --- a/modules/cal-config-google/e-google-chooser.c +++ b/modules/cal-config-google/e-google-chooser.c @@ -23,7 +23,7 @@ #include <gdata/gdata.h> #include <glib/gi18n-lib.h> -#include <libedataserverui/libedataserverui.h> +#include <e-util/e-util.h> #define E_GOOGLE_CHOOSER_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ diff --git a/modules/cal-config-google/evolution-cal-config-google.c b/modules/cal-config-google/evolution-cal-config-google.c index 2447e70b8a..97b4c7eeea 100644 --- a/modules/cal-config-google/evolution-cal-config-google.c +++ b/modules/cal-config-google/evolution-cal-config-google.c @@ -21,8 +21,7 @@ #include <libebackend/libebackend.h> -#include <misc/e-cal-source-config.h> -#include <misc/e-source-config-backend.h> +#include <e-util/e-util.h> #include "e-google-chooser-button.h" #include "e-google-chooser-dialog.h" diff --git a/modules/cal-config-local/Makefile.am b/modules/cal-config-local/Makefile.am index 477d31b7eb..84a478dfaf 100644 --- a/modules/cal-config-local/Makefile.am +++ b/modules/cal-config-local/Makefile.am @@ -3,10 +3,11 @@ module_LTLIBRARIES = module-cal-config-local.la module_cal_config_local_la_CPPFLAGS = \ $(AM_CPPFLAGS) \ -I$(top_srcdir) \ - -I$(top_srcdir)/widgets \ -DG_LOG_DOMAIN=\"evolution-cal-config-local\" \ $(EVOLUTION_DATA_SERVER_CFLAGS) \ - $(GNOME_PLATFORM_CFLAGS) + $(GNOME_PLATFORM_CFLAGS) \ + $(CHAMPLAIN_CFLAGS) \ + $(GTKHTML_CFLAGS) module_cal_config_local_la_SOURCES = \ evolution-cal-config-local.c \ @@ -15,9 +16,10 @@ module_cal_config_local_la_SOURCES = \ module_cal_config_local_la_LIBADD = \ $(top_builddir)/e-util/libeutil.la \ - $(top_builddir)/widgets/misc/libemiscwidgets.la \ $(EVOLUTION_DATA_SERVER_LIBS) \ - $(GNOME_PLATFORM_LIBS) + $(GNOME_PLATFORM_LIBS) \ + $(CHAMPLAIN_LIBS) \ + $(GTKHTML_LIBS) module_cal_config_local_la_LDFLAGS = \ -module -avoid-version $(NO_UNDEFINED) diff --git a/modules/cal-config-local/evolution-cal-config-local.c b/modules/cal-config-local/evolution-cal-config-local.c index 2e1200ae02..13b066e742 100644 --- a/modules/cal-config-local/evolution-cal-config-local.c +++ b/modules/cal-config-local/evolution-cal-config-local.c @@ -21,8 +21,7 @@ #include <libebackend/libebackend.h> -#include <misc/e-cal-source-config.h> -#include <misc/e-source-config-backend.h> +#include <e-util/e-util.h> #include "e-source-local.h" diff --git a/modules/cal-config-weather/Makefile.am b/modules/cal-config-weather/Makefile.am index 7276a9d2c0..ef72e26f0c 100644 --- a/modules/cal-config-weather/Makefile.am +++ b/modules/cal-config-weather/Makefile.am @@ -3,10 +3,11 @@ module_LTLIBRARIES = module-cal-config-weather.la module_cal_config_weather_la_CPPFLAGS = \ $(AM_CPPFLAGS) \ -I$(top_srcdir) \ - -I$(top_srcdir)/widgets \ -DG_LOG_DOMAIN=\"evolution-cal-config-weather\" \ $(EVOLUTION_DATA_SERVER_CFLAGS) \ $(GNOME_PLATFORM_CFLAGS) \ + $(CHAMPLAIN_CFLAGS) \ + $(GTKHTML_CFLAGS) \ $(GWEATHER_CFLAGS) module_cal_config_weather_la_SOURCES = \ @@ -16,9 +17,10 @@ module_cal_config_weather_la_SOURCES = \ module_cal_config_weather_la_LIBADD = \ $(top_builddir)/e-util/libeutil.la \ - $(top_builddir)/widgets/misc/libemiscwidgets.la \ $(EVOLUTION_DATA_SERVER_LIBS) \ $(GNOME_PLATFORM_LIBS) \ + $(CHAMPLAIN_LIBS) \ + $(GTKHTML_LIBS) \ $(GWEATHER_LIBS) module_cal_config_weather_la_LDFLAGS = \ diff --git a/modules/cal-config-weather/evolution-cal-config-weather.c b/modules/cal-config-weather/evolution-cal-config-weather.c index d5a4e2ca8d..2e5532e5c8 100644 --- a/modules/cal-config-weather/evolution-cal-config-weather.c +++ b/modules/cal-config-weather/evolution-cal-config-weather.c @@ -25,8 +25,7 @@ #include <libgweather/location-entry.h> #undef GWEATHER_I_KNOW_THIS_IS_UNSTABLE -#include <misc/e-cal-source-config.h> -#include <misc/e-source-config-backend.h> +#include <e-util/e-util.h> #include "e-source-weather.h" diff --git a/modules/cal-config-webcal/Makefile.am b/modules/cal-config-webcal/Makefile.am index 29f9cf27a5..aedc04b66f 100644 --- a/modules/cal-config-webcal/Makefile.am +++ b/modules/cal-config-webcal/Makefile.am @@ -3,19 +3,21 @@ module_LTLIBRARIES = module-cal-config-webcal.la module_cal_config_webcal_la_CPPFLAGS = \ $(AM_CPPFLAGS) \ -I$(top_srcdir) \ - -I$(top_srcdir)/widgets \ -DG_LOG_DOMAIN=\"evolution-cal-config-webcal\" \ $(EVOLUTION_DATA_SERVER_CFLAGS) \ - $(GNOME_PLATFORM_CFLAGS) + $(GNOME_PLATFORM_CFLAGS) \ + $(CHAMPLAIN_CFLAGS) \ + $(GTKHTML_CFLAGS) module_cal_config_webcal_la_SOURCES = \ evolution-cal-config-webcal.c module_cal_config_webcal_la_LIBADD = \ $(top_builddir)/e-util/libeutil.la \ - $(top_builddir)/widgets/misc/libemiscwidgets.la \ $(EVOLUTION_DATA_SERVER_LIBS) \ - $(GNOME_PLATFORM_LIBS) + $(GNOME_PLATFORM_LIBS) \ + $(CHAMPLAIN_LIBS) \ + $(GTKHTML_LIBS) module_cal_config_webcal_la_LDFLAGS = \ -module -avoid-version $(NO_UNDEFINED) diff --git a/modules/cal-config-webcal/evolution-cal-config-webcal.c b/modules/cal-config-webcal/evolution-cal-config-webcal.c index 70eb06caf5..82a40ee923 100644 --- a/modules/cal-config-webcal/evolution-cal-config-webcal.c +++ b/modules/cal-config-webcal/evolution-cal-config-webcal.c @@ -21,9 +21,7 @@ #include <libebackend/libebackend.h> -#include <misc/e-cal-source-config.h> -#include <misc/e-interval-chooser.h> -#include <misc/e-source-config-backend.h> +#include <e-util/e-util.h> typedef ESourceConfigBackend ECalConfigWebcal; typedef ESourceConfigBackendClass ECalConfigWebcalClass; diff --git a/modules/calendar/Makefile.am b/modules/calendar/Makefile.am index c5e547549a..7425f0d632 100644 --- a/modules/calendar/Makefile.am +++ b/modules/calendar/Makefile.am @@ -6,10 +6,10 @@ module_calendar_la_CPPFLAGS = \ -DEVOLUTION_BINDIR=\""$(bindir)"\" \ -DEVOLUTION_PRIVLIBEXECDIR=\""$(PRIVLIBEXECDIR)"\" \ -I$(top_srcdir) \ - -I$(top_srcdir)/widgets \ -DEVOLUTION_ETSPECDIR=\""$(etspecdir)"\" \ $(EVOLUTION_DATA_SERVER_CFLAGS) \ $(GNOME_PLATFORM_CFLAGS) \ + $(CHAMPLAIN_CFLAGS) \ $(GTKHTML_CFLAGS) module_calendar_la_SOURCES = \ @@ -90,15 +90,10 @@ module_calendar_la_LIBADD = \ $(top_builddir)/mail/libevolution-mail.la \ $(top_builddir)/addressbook/gui/contact-editor/libecontacteditor.la \ $(top_builddir)/addressbook/gui/contact-list-editor/libecontactlisteditor.la \ - $(top_builddir)/libemail-utils/libemail-utils.la \ $(top_builddir)/e-util/libeutil.la \ - $(top_builddir)/filter/libfilter.la \ - $(top_builddir)/widgets/menus/libmenus.la \ - $(top_builddir)/widgets/misc/libemiscwidgets.la \ - $(top_builddir)/widgets/table/libetable.la \ - $(top_builddir)/libevolution-utils/libevolution-utils.la \ $(EVOLUTION_DATA_SERVER_LIBS) \ $(GNOME_PLATFORM_LIBS) \ + $(CHAMPLAIN_LIBS) \ $(GTKHTML_LIBS) module_calendar_la_LDFLAGS = \ diff --git a/modules/calendar/e-cal-attachment-handler.c b/modules/calendar/e-cal-attachment-handler.c index efe087da3f..372b826e51 100644 --- a/modules/calendar/e-cal-attachment-handler.c +++ b/modules/calendar/e-cal-attachment-handler.c @@ -29,7 +29,6 @@ #include <libical/ical.h> #include <camel/camel.h> #include <libecal/libecal.h> -#include <libedataserverui/libedataserverui.h> #include <shell/e-shell.h> diff --git a/modules/calendar/e-cal-attachment-handler.h b/modules/calendar/e-cal-attachment-handler.h index b792fbf765..549199ec35 100644 --- a/modules/calendar/e-cal-attachment-handler.h +++ b/modules/calendar/e-cal-attachment-handler.h @@ -22,7 +22,7 @@ #ifndef E_CAL_ATTACHMENT_HANDLER_H #define E_CAL_ATTACHMENT_HANDLER_H -#include <misc/e-attachment-handler.h> +#include <e-util/e-util.h> /* Standard GObject macros */ #define E_TYPE_CAL_ATTACHMENT_HANDLER \ diff --git a/modules/calendar/e-cal-config-calendar-item.c b/modules/calendar/e-cal-config-calendar-item.c index 1efc8a91cd..ddf6835893 100644 --- a/modules/calendar/e-cal-config-calendar-item.c +++ b/modules/calendar/e-cal-config-calendar-item.c @@ -23,7 +23,6 @@ #include "e-cal-config-calendar-item.h" #include <shell/e-shell.h> -#include <misc/e-calendar-item.h> #define E_CAL_CONFIG_CALENDAR_ITEM_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ diff --git a/modules/calendar/e-cal-config-date-edit.c b/modules/calendar/e-cal-config-date-edit.c index 3f28520bb0..0ac7e6e2cf 100644 --- a/modules/calendar/e-cal-config-date-edit.c +++ b/modules/calendar/e-cal-config-date-edit.c @@ -23,7 +23,6 @@ #include "e-cal-config-date-edit.h" #include <shell/e-shell.h> -#include <misc/e-dateedit.h> #define E_CAL_CONFIG_DATE_EDIT_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ diff --git a/modules/calendar/e-cal-config-hook.c b/modules/calendar/e-cal-config-hook.c index 80050fc0d0..57fb8b8cc5 100644 --- a/modules/calendar/e-cal-config-hook.c +++ b/modules/calendar/e-cal-config-hook.c @@ -25,7 +25,6 @@ #include "e-cal-config-hook.h" -#include "e-util/e-config.h" #include "calendar/gui/e-cal-config.h" static const EConfigHookTargetMask no_masks[] = { diff --git a/modules/calendar/e-cal-event-hook.c b/modules/calendar/e-cal-event-hook.c index 67db069d82..9f38e7005b 100644 --- a/modules/calendar/e-cal-event-hook.c +++ b/modules/calendar/e-cal-event-hook.c @@ -25,7 +25,6 @@ #include "e-cal-event-hook.h" -#include "e-util/e-event.h" #include "calendar/gui/e-cal-event.h" static const EEventHookTargetMask masks[] = { diff --git a/modules/calendar/e-cal-shell-backend.c b/modules/calendar/e-cal-shell-backend.c index 84193d9623..476831987a 100644 --- a/modules/calendar/e-cal-shell-backend.c +++ b/modules/calendar/e-cal-shell-backend.c @@ -28,15 +28,10 @@ #include <string.h> #include <glib/gi18n.h> #include <libecal/libecal.h> -#include <libedataserverui/libedataserverui.h> -#include "e-util/e-import.h" #include "shell/e-shell.h" #include "shell/e-shell-backend.h" #include "shell/e-shell-window.h" -#include "widgets/misc/e-cal-source-config.h" -#include "widgets/misc/e-preferences-window.h" -#include "widgets/misc/e-source-config-dialog.h" #include "calendar/gui/comp-util.h" #include "calendar/gui/dialogs/event-editor.h" diff --git a/modules/calendar/e-cal-shell-content.c b/modules/calendar/e-cal-shell-content.c index 5d8e7e6b8f..66ea4a460e 100644 --- a/modules/calendar/e-cal-shell-content.c +++ b/modules/calendar/e-cal-shell-content.c @@ -28,10 +28,6 @@ #include <string.h> #include <glib/gi18n.h> -#include "widgets/menus/gal-view-etable.h" -#include "widgets/misc/e-paned.h" -#include "widgets/misc/e-selectable.h" - #include "calendar/gui/calendar-config.h" #include "calendar/gui/calendar-view.h" #include "calendar/gui/e-cal-list-view.h" diff --git a/modules/calendar/e-cal-shell-content.h b/modules/calendar/e-cal-shell-content.h index 21e971b159..45aedf90c2 100644 --- a/modules/calendar/e-cal-shell-content.h +++ b/modules/calendar/e-cal-shell-content.h @@ -29,7 +29,6 @@ #include <calendar/gui/e-memo-table.h> #include <calendar/gui/e-task-table.h> #include <calendar/gui/gnome-cal.h> -#include <menus/gal-view-instance.h> /* Standard GObject macros */ #define E_TYPE_CAL_SHELL_CONTENT \ diff --git a/modules/calendar/e-cal-shell-sidebar.c b/modules/calendar/e-cal-shell-sidebar.c index 809ccb569f..7555950cd1 100644 --- a/modules/calendar/e-cal-shell-sidebar.c +++ b/modules/calendar/e-cal-shell-sidebar.c @@ -27,10 +27,6 @@ #include <string.h> #include <glib/gi18n.h> -#include <libedataserverui/libedataserverui.h> - -#include "libevolution-utils/e-alert-dialog.h" -#include "widgets/misc/e-paned.h" #include "calendar/gui/e-calendar-selector.h" #include "calendar/gui/misc.h" diff --git a/modules/calendar/e-cal-shell-sidebar.h b/modules/calendar/e-cal-shell-sidebar.h index 4a4ab6d482..6daabe25ca 100644 --- a/modules/calendar/e-cal-shell-sidebar.h +++ b/modules/calendar/e-cal-shell-sidebar.h @@ -23,11 +23,9 @@ #define E_CAL_SHELL_SIDEBAR_H #include <libecal/libecal.h> -#include <libedataserverui/libedataserverui.h> #include <shell/e-shell-sidebar.h> #include <shell/e-shell-view.h> -#include <misc/e-calendar.h> /* Standard GObject macros */ #define E_TYPE_CAL_SHELL_SIDEBAR \ diff --git a/modules/calendar/e-cal-shell-view-actions.c b/modules/calendar/e-cal-shell-view-actions.c index f72e765b3b..f3523c9d8b 100644 --- a/modules/calendar/e-cal-shell-view-actions.c +++ b/modules/calendar/e-cal-shell-view-actions.c @@ -23,7 +23,6 @@ #include <config.h> #endif -#include "libevolution-utils/e-alert-dialog.h" #include "e-cal-shell-view-private.h" /* This is for radio action groups whose value is persistent. We diff --git a/modules/calendar/e-cal-shell-view-private.c b/modules/calendar/e-cal-shell-view-private.c index 8159e3d22b..d62b977b94 100644 --- a/modules/calendar/e-cal-shell-view-private.c +++ b/modules/calendar/e-cal-shell-view-private.c @@ -28,7 +28,6 @@ #include "e-cal-shell-view-private.h" #include "calendar/gui/calendar-view-factory.h" -#include "widgets/menus/gal-view-factory-etable.h" #define CHECK_NB 5 diff --git a/modules/calendar/e-cal-shell-view-private.h b/modules/calendar/e-cal-shell-view-private.h index 97641389d7..b589907dad 100644 --- a/modules/calendar/e-cal-shell-view-private.h +++ b/modules/calendar/e-cal-shell-view-private.h @@ -28,20 +28,9 @@ #include <glib/gi18n.h> #include <libecal/libecal.h> -#include <libedataserverui/libedataserverui.h> - -#include <e-util/e-selection.h> -#include <e-util/e-dialog-utils.h> -#include <e-util/e-file-utils.h> -#include <e-util/e-util.h> #include <shell/e-shell-utils.h> -#include <misc/e-cal-source-config.h> -#include <misc/e-popup-action.h> -#include <misc/e-selectable.h> -#include <misc/e-source-config-dialog.h> - #include <calendar/gui/calendar-config.h> #include <calendar/gui/comp-util.h> #include <calendar/gui/e-cal-list-view.h> diff --git a/modules/calendar/e-calendar-preferences.c b/modules/calendar/e-calendar-preferences.c index b11a943957..2902a50a58 100644 --- a/modules/calendar/e-calendar-preferences.c +++ b/modules/calendar/e-calendar-preferences.c @@ -34,12 +34,6 @@ #include "calendar/gui/e-cal-config.h" #include "calendar/gui/e-timezone-entry.h" #include "calendar/gui/calendar-config.h" -#include "widgets/misc/e-alarm-selector.h" -#include "widgets/misc/e-dateedit.h" -#include "e-util/e-util.h" -#include "e-util/e-datetime-format.h" -#include "e-util/e-dialog-widgets.h" -#include "e-util/e-util-private.h" #include "shell/e-shell-utils.h" /* same is used for Birthdays & Anniversaries calendar */ diff --git a/modules/calendar/e-calendar-preferences.h b/modules/calendar/e-calendar-preferences.h index e7b954303c..d1e8ede3b7 100644 --- a/modules/calendar/e-calendar-preferences.h +++ b/modules/calendar/e-calendar-preferences.h @@ -24,10 +24,7 @@ #ifndef CAL_PREFERENCES_H #define CAL_PREFERENCES_H -#include <libedataserverui/libedataserverui.h> - #include <shell/e-shell.h> -#include <widgets/misc/e-preferences-window.h> /* Standard GObject macros */ #define E_TYPE_CALENDAR_PREFERENCES \ diff --git a/modules/calendar/e-memo-shell-backend.c b/modules/calendar/e-memo-shell-backend.c index fa4884bfc6..75fabd6d83 100644 --- a/modules/calendar/e-memo-shell-backend.c +++ b/modules/calendar/e-memo-shell-backend.c @@ -28,13 +28,10 @@ #include <string.h> #include <glib/gi18n.h> #include <libecal/libecal.h> -#include <libedataserverui/libedataserverui.h> #include "shell/e-shell.h" #include "shell/e-shell-backend.h" #include "shell/e-shell-window.h" -#include "widgets/misc/e-cal-source-config.h" -#include "widgets/misc/e-source-config-dialog.h" #include "calendar/gui/comp-util.h" #include "calendar/gui/dialogs/memo-editor.h" diff --git a/modules/calendar/e-memo-shell-content.c b/modules/calendar/e-memo-shell-content.c index bb92852956..abb1adadf4 100644 --- a/modules/calendar/e-memo-shell-content.c +++ b/modules/calendar/e-memo-shell-content.c @@ -27,11 +27,7 @@ #include <glib/gi18n.h> -#include "e-util/e-selection.h" #include "shell/e-shell-utils.h" -#include "widgets/menus/gal-view-etable.h" -#include "widgets/misc/e-paned.h" -#include "widgets/misc/e-preview-pane.h" #include "calendar/gui/comp-util.h" #include "calendar/gui/e-cal-component-preview.h" diff --git a/modules/calendar/e-memo-shell-content.h b/modules/calendar/e-memo-shell-content.h index 18ee590fc7..03a7fdc2eb 100644 --- a/modules/calendar/e-memo-shell-content.h +++ b/modules/calendar/e-memo-shell-content.h @@ -28,9 +28,6 @@ #include <calendar/gui/e-memo-table.h> -#include <menus/gal-view-instance.h> -#include <misc/e-preview-pane.h> - /* Standard GObject macros */ #define E_TYPE_MEMO_SHELL_CONTENT \ (e_memo_shell_content_get_type ()) diff --git a/modules/calendar/e-memo-shell-sidebar.c b/modules/calendar/e-memo-shell-sidebar.c index 7d46384f82..64e74663c1 100644 --- a/modules/calendar/e-memo-shell-sidebar.c +++ b/modules/calendar/e-memo-shell-sidebar.c @@ -27,9 +27,7 @@ #include <string.h> #include <glib/gi18n.h> -#include <libedataserverui/libedataserverui.h> -#include "libevolution-utils/e-alert-dialog.h" #include "e-util/e-util.h" #include "calendar/gui/e-memo-list-selector.h" #include "calendar/gui/misc.h" diff --git a/modules/calendar/e-memo-shell-sidebar.h b/modules/calendar/e-memo-shell-sidebar.h index ed9e051c48..17814ebaea 100644 --- a/modules/calendar/e-memo-shell-sidebar.h +++ b/modules/calendar/e-memo-shell-sidebar.h @@ -23,7 +23,6 @@ #define E_MEMO_SHELL_SIDEBAR_H #include <libecal/libecal.h> -#include <libedataserverui/libedataserverui.h> #include <shell/e-shell-sidebar.h> #include <shell/e-shell-view.h> diff --git a/modules/calendar/e-memo-shell-view-actions.c b/modules/calendar/e-memo-shell-view-actions.c index f1ae7ffefb..0e0d28e885 100644 --- a/modules/calendar/e-memo-shell-view-actions.c +++ b/modules/calendar/e-memo-shell-view-actions.c @@ -23,7 +23,6 @@ #include <config.h> #endif -#include "libevolution-utils/e-alert-dialog.h" #include "e-memo-shell-view-private.h" static void diff --git a/modules/calendar/e-memo-shell-view-private.c b/modules/calendar/e-memo-shell-view-private.c index 9f31e446ac..27ffad3dde 100644 --- a/modules/calendar/e-memo-shell-view-private.c +++ b/modules/calendar/e-memo-shell-view-private.c @@ -27,8 +27,6 @@ #include "e-memo-shell-view-private.h" -#include "widgets/menus/gal-view-factory-etable.h" - static void memo_shell_view_model_row_appended_cb (EMemoShellView *memo_shell_view, ECalModel *model) diff --git a/modules/calendar/e-memo-shell-view-private.h b/modules/calendar/e-memo-shell-view-private.h index 4e65d009de..0e0a2daae2 100644 --- a/modules/calendar/e-memo-shell-view-private.h +++ b/modules/calendar/e-memo-shell-view-private.h @@ -27,14 +27,7 @@ #include <string.h> #include <glib/gi18n.h> -#include "e-util/e-dialog-utils.h" -#include "e-util/e-file-utils.h" -#include "e-util/e-util.h" #include "shell/e-shell-utils.h" -#include "misc/e-cal-source-config.h" -#include "misc/e-popup-action.h" -#include "misc/e-selectable.h" -#include "misc/e-source-config-dialog.h" #include "calendar/gui/comp-util.h" #include "calendar/gui/e-cal-component-preview.h" diff --git a/modules/calendar/e-task-shell-backend.c b/modules/calendar/e-task-shell-backend.c index 4d76e50b8b..90ffb3cc6e 100644 --- a/modules/calendar/e-task-shell-backend.c +++ b/modules/calendar/e-task-shell-backend.c @@ -28,13 +28,10 @@ #include <string.h> #include <glib/gi18n.h> #include <libecal/libecal.h> -#include <libedataserverui/libedataserverui.h> #include "shell/e-shell.h" #include "shell/e-shell-backend.h" #include "shell/e-shell-window.h" -#include "widgets/misc/e-cal-source-config.h" -#include "widgets/misc/e-source-config-dialog.h" #include "calendar/gui/comp-util.h" #include "calendar/gui/dialogs/task-editor.h" diff --git a/modules/calendar/e-task-shell-content.c b/modules/calendar/e-task-shell-content.c index 89d4bde096..07d11a4b5b 100644 --- a/modules/calendar/e-task-shell-content.c +++ b/modules/calendar/e-task-shell-content.c @@ -27,11 +27,7 @@ #include <glib/gi18n.h> -#include "e-util/e-selection.h" #include "shell/e-shell-utils.h" -#include "widgets/menus/gal-view-etable.h" -#include "widgets/misc/e-paned.h" -#include "widgets/misc/e-preview-pane.h" #include "calendar/gui/comp-util.h" #include "calendar/gui/e-cal-component-preview.h" diff --git a/modules/calendar/e-task-shell-content.h b/modules/calendar/e-task-shell-content.h index 84a5f675da..778dbde875 100644 --- a/modules/calendar/e-task-shell-content.h +++ b/modules/calendar/e-task-shell-content.h @@ -29,9 +29,6 @@ #include <calendar/gui/e-cal-model.h> #include <calendar/gui/e-task-table.h> -#include <menus/gal-view-instance.h> -#include <misc/e-preview-pane.h> - /* Standard GObject macros */ #define E_TYPE_TASK_SHELL_CONTENT \ (e_task_shell_content_get_type ()) diff --git a/modules/calendar/e-task-shell-sidebar.c b/modules/calendar/e-task-shell-sidebar.c index d88d5e7028..1f46e2932e 100644 --- a/modules/calendar/e-task-shell-sidebar.c +++ b/modules/calendar/e-task-shell-sidebar.c @@ -27,9 +27,7 @@ #include <string.h> #include <glib/gi18n.h> -#include <libedataserverui/libedataserverui.h> -#include "libevolution-utils/e-alert-dialog.h" #include "e-util/e-util.h" #include "calendar/gui/e-task-list-selector.h" #include "calendar/gui/misc.h" diff --git a/modules/calendar/e-task-shell-sidebar.h b/modules/calendar/e-task-shell-sidebar.h index d3c5358336..d9a143e278 100644 --- a/modules/calendar/e-task-shell-sidebar.h +++ b/modules/calendar/e-task-shell-sidebar.h @@ -23,7 +23,6 @@ #define E_TASK_SHELL_SIDEBAR_H #include <libecal/libecal.h> -#include <libedataserverui/libedataserverui.h> #include <shell/e-shell-sidebar.h> #include <shell/e-shell-view.h> diff --git a/modules/calendar/e-task-shell-view-actions.c b/modules/calendar/e-task-shell-view-actions.c index 21043fb998..6709a6e7d7 100644 --- a/modules/calendar/e-task-shell-view-actions.c +++ b/modules/calendar/e-task-shell-view-actions.c @@ -23,7 +23,6 @@ #include <config.h> #endif -#include "libevolution-utils/e-alert-dialog.h" #include "e-task-shell-view-private.h" static void diff --git a/modules/calendar/e-task-shell-view-private.c b/modules/calendar/e-task-shell-view-private.c index ba66c59caa..816b853ef2 100644 --- a/modules/calendar/e-task-shell-view-private.c +++ b/modules/calendar/e-task-shell-view-private.c @@ -25,8 +25,6 @@ #include "e-task-shell-view-private.h" -#include "widgets/menus/gal-view-factory-etable.h" - #include "e-util/e-util-private.h" static void diff --git a/modules/calendar/e-task-shell-view-private.h b/modules/calendar/e-task-shell-view-private.h index 062ac4564b..45bf20bd1d 100644 --- a/modules/calendar/e-task-shell-view-private.h +++ b/modules/calendar/e-task-shell-view-private.h @@ -27,16 +27,8 @@ #include <string.h> #include <glib/gi18n.h> #include <libecal/libecal.h> -#include <libedataserverui/libedataserverui.h> -#include "e-util/e-dialog-utils.h" -#include "e-util/e-file-utils.h" -#include "e-util/e-util.h" #include "shell/e-shell-utils.h" -#include "misc/e-cal-source-config.h" -#include "misc/e-popup-action.h" -#include "misc/e-selectable.h" -#include "misc/e-source-config-dialog.h" #include "calendar/gui/calendar-config.h" #include "calendar/gui/comp-util.h" diff --git a/modules/composer-autosave/Makefile.am b/modules/composer-autosave/Makefile.am index 3f62e4c05c..b1175a5e75 100644 --- a/modules/composer-autosave/Makefile.am +++ b/modules/composer-autosave/Makefile.am @@ -3,10 +3,10 @@ module_LTLIBRARIES = module-composer-autosave.la module_composer_autosave_la_CPPFLAGS = \ $(AM_CPPFLAGS) \ -I$(top_srcdir) \ - -I$(top_srcdir)/widgets \ -DG_LOG_DOMAIN=\"evolution-composer-autosave\" \ $(EVOLUTION_DATA_SERVER_CFLAGS) \ $(GNOME_PLATFORM_CFLAGS) \ + $(CHAMPLAIN_CFLAGS) \ $(GTKHTML_CFLAGS) module_composer_autosave_la_SOURCES = \ @@ -19,11 +19,10 @@ module_composer_autosave_la_SOURCES = \ module_composer_autosave_la_LIBADD = \ $(top_builddir)/shell/libeshell.la \ $(top_builddir)/composer/libcomposer.la \ - $(top_builddir)/widgets/misc/libemiscwidgets.la \ $(top_builddir)/e-util/libeutil.la \ - $(top_builddir)/libevolution-utils/libevolution-utils.la \ $(EVOLUTION_DATA_SERVER_LIBS) \ $(GNOME_PLATFORM_LIBS) \ + $(CHAMPLAIN_LIBS) \ $(GTKHTML_LIBS) module_composer_autosave_la_LDFLAGS = \ diff --git a/modules/composer-autosave/e-composer-autosave.c b/modules/composer-autosave/e-composer-autosave.c index e24b1640c0..cf0dd3b94a 100644 --- a/modules/composer-autosave/e-composer-autosave.c +++ b/modules/composer-autosave/e-composer-autosave.c @@ -22,7 +22,6 @@ #include <libebackend/libebackend.h> -#include <libevolution-utils/e-alert-dialog.h> #include <composer/e-msg-composer.h> #include "e-autosave-utils.h" diff --git a/modules/composer-autosave/e-composer-registry.c b/modules/composer-autosave/e-composer-registry.c index 76736c8fe6..bd4bb933dd 100644 --- a/modules/composer-autosave/e-composer-registry.c +++ b/modules/composer-autosave/e-composer-registry.c @@ -25,7 +25,6 @@ #include <shell/e-shell.h> #include <shell/e-shell-window.h> -#include <libevolution-utils/e-alert-dialog.h> #include <composer/e-msg-composer.h> #include "e-autosave-utils.h" diff --git a/modules/imap-features/Makefile.am b/modules/imap-features/Makefile.am index d49ddfa287..b88161cd84 100644 --- a/modules/imap-features/Makefile.am +++ b/modules/imap-features/Makefile.am @@ -5,10 +5,11 @@ module_LTLIBRARIES = module-imap-features.la module_imap_features_la_CPPFLAGS = \ $(AM_CPPFLAGS) \ -I$(top_srcdir) \ - -I$(top_srcdir)/widgets \ -DG_LOG_DOMAIN=\"evolution-imap-features\" \ $(EVOLUTION_DATA_SERVER_CFLAGS) \ $(GNOME_PLATFORM_CFLAGS) \ + $(CHAMPLAIN_CFLAGS) \ + $(GTKHTML_CFLAGS) \ $(NULL) module_imap_features_la_SOURCES = \ @@ -21,10 +22,11 @@ module_imap_features_la_SOURCES = \ module_imap_features_la_LIBADD = \ $(top_builddir)/mail/libevolution-mail.la \ - $(top_builddir)/widgets/misc/libemiscwidgets.la \ $(top_builddir)/libemail-engine/libemail-engine.la \ $(EVOLUTION_DATA_SERVER_LIBS) \ $(GNOME_PLATFORM_LIBS) \ + $(CHAMPLAIN_LIBS) \ + $(GTKHTML_LIBS) \ $(NULL) module_imap_features_la_LDFLAGS = \ diff --git a/modules/itip-formatter/Makefile.am b/modules/itip-formatter/Makefile.am index 76464ca455..596cc6a39b 100644 --- a/modules/itip-formatter/Makefile.am +++ b/modules/itip-formatter/Makefile.am @@ -7,11 +7,12 @@ module_LTLIBRARIES = module-itip-formatter.la module_itip_formatter_la_CPPFLAGS = \ $(AM_CPPFLAGS) \ -I$(top_srcdir) \ - -I$(top_srcdir)/widgets \ -DEVOLUTION_PRIVDATADIR=\""$(privdatadir)"\" \ -DG_LOG_DOMAIN=\"evolution-module-itip-formatter\" \ $(EVOLUTION_DATA_SERVER_CFLAGS) \ - $(GNOME_PLATFORM_CFLAGS) + $(GNOME_PLATFORM_CFLAGS) \ + $(CHAMPLAIN_CFLAGS) \ + $(GTKHTML_CFLAGS) module_itip_formatter_la_SOURCES = \ e-conflict-search-selector.c \ @@ -33,12 +34,11 @@ module_itip_formatter_la_LIBADD = \ $(top_builddir)/mail/libevolution-mail.la \ $(top_builddir)/shell/libeshell.la \ $(top_builddir)/em-format/libemformat.la \ - $(top_builddir)/widgets/misc/libemiscwidgets.la \ - $(top_builddir)/libemail-utils/libemail-utils.la \ $(top_builddir)/libemail-engine/libemail-engine.la \ - $(top_builddir)/libevolution-utils/libevolution-utils.la \ $(EVOLUTION_DATA_SERVER_LIBS) \ - $(GNOME_PLATFORM_LIBS) + $(GNOME_PLATFORM_LIBS) \ + $(CHAMPLAIN_LIBS) \ + $(GTKHTML_LIBS) module_itip_formatter_la_LDFLAGS = \ -avoid-version -module $(NO_UNDEFINED) diff --git a/modules/itip-formatter/e-conflict-search-selector.h b/modules/itip-formatter/e-conflict-search-selector.h index 091e1c9328..bcd3ce195f 100644 --- a/modules/itip-formatter/e-conflict-search-selector.h +++ b/modules/itip-formatter/e-conflict-search-selector.h @@ -19,7 +19,7 @@ #ifndef E_CONFLICT_SEARCH_SELECTOR_H #define E_CONFLICT_SEARCH_SELECTOR_H -#include <libedataserverui/libedataserverui.h> +#include <e-util/e-util.h> /* Standard GObject macros */ #define E_TYPE_CONFLICT_SEARCH_SELECTOR \ diff --git a/modules/itip-formatter/e-mail-parser-itip.c b/modules/itip-formatter/e-mail-parser-itip.c index d0ab563dcc..9e5ff46e45 100644 --- a/modules/itip-formatter/e-mail-parser-itip.c +++ b/modules/itip-formatter/e-mail-parser-itip.c @@ -30,15 +30,14 @@ #include "e-mail-parser-itip.h" +#include <shell/e-shell.h> + #include <em-format/e-mail-extension-registry.h> #include <em-format/e-mail-parser-extension.h> #include <em-format/e-mail-part.h> -#include <misc/e-attachment.h> - #include "e-mail-part-itip.h" #include "itip-view.h" -#include <shell/e-shell.h> #define CONF_KEY_DELETE "delete-processed" diff --git a/modules/itip-formatter/e-mail-part-itip.h b/modules/itip-formatter/e-mail-part-itip.h index d2e681b467..7a9cbd7830 100644 --- a/modules/itip-formatter/e-mail-part-itip.h +++ b/modules/itip-formatter/e-mail-part-itip.h @@ -22,7 +22,6 @@ #endif #include <libecal/libecal.h> -#include <libedataserverui/libedataserverui.h> #include <libebackend/libebackend.h> #include <em-format/e-mail-part.h> diff --git a/modules/itip-formatter/itip-view.c b/modules/itip-formatter/itip-view.c index f155e7295f..1ee2dffe98 100644 --- a/modules/itip-formatter/itip-view.c +++ b/modules/itip-formatter/itip-view.c @@ -26,23 +26,16 @@ #include <string.h> #include <glib/gi18n.h> -#include <libedataserverui/libedataserverui.h> -#include <libedataserver/libedataserver.h> - -#include <e-util/e-util.h> -#include <e-util/e-unicode.h> -#include <calendar/gui/itip-utils.h> #include <webkit/webkitdom.h> - -#include <libevolution-utils/e-alert-dialog.h> -#include <e-util/e-mktemp.h> +#include <libedataserver/libedataserver.h> #include <shell/e-shell.h> #include <shell/e-shell-utils.h> -#include <libemail-utils/mail-mt.h> +#include <calendar/gui/itip-utils.h> #include <libemail-engine/mail-folder-cache.h> +#include <libemail-engine/mail-mt.h> #include <libemail-engine/mail-tools.h> #include <mail/em-config.h> diff --git a/modules/itip-formatter/plugin/Makefile.am b/modules/itip-formatter/plugin/Makefile.am index 31c886a264..6777219944 100644 --- a/modules/itip-formatter/plugin/Makefile.am +++ b/modules/itip-formatter/plugin/Makefile.am @@ -6,11 +6,12 @@ plugin_LTLIBRARIES = liborg-gnome-itip-formatter.la liborg_gnome_itip_formatter_la_CPPFLAGS = \ $(AM_CPPFLAGS) \ -I$(top_srcdir) \ - -I$(top_srcdir)/widgets \ -I$(top_srcdir)/modules/itip-formatter \ -DEVOLUTION_PRIVDATADIR=\""$(privdatadir)"\" \ $(EVOLUTION_DATA_SERVER_CFLAGS) \ - $(GNOME_PLATFORM_CFLAGS) + $(GNOME_PLATFORM_CFLAGS) \ + $(CHAMPLAIN_CFLAGS) \ + $(GTKHTML_CFLAGS) liborg_gnome_itip_formatter_la_SOURCES = \ config-ui.c \ @@ -27,9 +28,10 @@ liborg_gnome_itip_formatter_la_LIBADD = \ $(top_builddir)/mail/libevolution-mail.la \ $(top_builddir)/shell/libeshell.la \ $(top_builddir)/em-format/libemformat.la \ - $(top_builddir)/widgets/misc/libemiscwidgets.la \ $(EVOLUTION_DATA_SERVER_LIBS) \ - $(GNOME_PLATFORM_LIBS) + $(GNOME_PLATFORM_LIBS) \ + $(CHAMPLAIN_LIBS) \ + $(GTKHTML_LIBS) BUILT_SOURCES = $(plugin_DATA) diff --git a/modules/mail-config/Makefile.am b/modules/mail-config/Makefile.am index 1efd510c42..e42e3a2a08 100644 --- a/modules/mail-config/Makefile.am +++ b/modules/mail-config/Makefile.am @@ -5,10 +5,11 @@ module_LTLIBRARIES = module-mail-config.la module_mail_config_la_CPPFLAGS = \ $(AM_CPPFLAGS) \ -I$(top_srcdir) \ - -I$(top_srcdir)/widgets \ -DG_LOG_DOMAIN=\"evolution-mail-config\" \ $(EVOLUTION_DATA_SERVER_CFLAGS) \ $(GNOME_PLATFORM_CFLAGS) \ + $(CHAMPLAIN_CFLAGS) \ + $(GTKHTML_CFLAGS) \ $(NULL) module_mail_config_la_SOURCES = \ @@ -26,11 +27,13 @@ module_mail_config_la_SOURCES = \ $(NULL) module_mail_config_la_LIBADD = \ + $(top_builddir)/e-util/libeutil.la \ $(top_builddir)/mail/libevolution-mail.la \ - $(top_builddir)/widgets/misc/libemiscwidgets.la \ $(top_builddir)/libemail-engine/libemail-engine.la \ $(EVOLUTION_DATA_SERVER_LIBS) \ $(GNOME_PLATFORM_LIBS) \ + $(CHAMPLAIN_LIBS) \ + $(GTKHTML_LIBS) \ $(NULL) module_mail_config_la_LDFLAGS = \ diff --git a/modules/mail-config/e-mail-config-remote-accounts.c b/modules/mail-config/e-mail-config-remote-accounts.c index 491db0207f..aac3edeb03 100644 --- a/modules/mail-config/e-mail-config-remote-accounts.c +++ b/modules/mail-config/e-mail-config-remote-accounts.c @@ -22,8 +22,6 @@ #include <camel/camel.h> #include <libebackend/libebackend.h> -#include <misc/e-port-entry.h> - #include <mail/e-mail-config-auth-check.h> #include <mail/e-mail-config-service-page.h> diff --git a/modules/mail-config/e-mail-config-smtp-backend.c b/modules/mail-config/e-mail-config-smtp-backend.c index fe992b3507..ac54cd4148 100644 --- a/modules/mail-config/e-mail-config-smtp-backend.c +++ b/modules/mail-config/e-mail-config-smtp-backend.c @@ -24,8 +24,6 @@ #include <camel/camel.h> #include <libebackend/libebackend.h> -#include <misc/e-port-entry.h> - #include <mail/e-mail-config-auth-check.h> #include <mail/e-mail-config-service-page.h> diff --git a/modules/mail/Makefile.am b/modules/mail/Makefile.am index 97050ae10d..de1aa7c5c4 100644 --- a/modules/mail/Makefile.am +++ b/modules/mail/Makefile.am @@ -3,13 +3,13 @@ module_LTLIBRARIES = module-mail.la module_mail_la_CPPFLAGS = \ $(AM_CPPFLAGS) \ -I$(top_srcdir) \ - -I$(top_srcdir)/widgets \ -DEVOLUTION_ETSPECDIR=\""$(etspecdir)"\" \ -DEVOLUTION_UIDIR=\""$(uidir)"\" \ -DEVOLUTION_PRIVDATADIR=\""$(privdatadir)"\" \ -DG_LOG_DOMAIN=\"evolution-module-mail\" \ $(EVOLUTION_DATA_SERVER_CFLAGS) \ $(GNOME_PLATFORM_CFLAGS) \ + $(CHAMPLAIN_CFLAGS) \ $(GTKHTML_CFLAGS) module_mail_la_SOURCES = \ @@ -52,26 +52,18 @@ module_mail_la_SOURCES = \ em-network-prefs.h module_mail_la_LIBADD = \ - $(top_builddir)/libemail-utils/libemail-utils.la \ $(top_builddir)/libemail-engine/libemail-engine.la \ $(top_builddir)/e-util/libeutil.la \ $(top_builddir)/em-format/libemformat.la \ - $(top_builddir)/filter/libfilter.la \ $(top_builddir)/shell/libeshell.la \ $(top_builddir)/composer/libcomposer.la \ - $(top_builddir)/widgets/table/libetable.la \ - $(top_builddir)/widgets/text/libetext.la \ - $(top_builddir)/widgets/misc/libemiscwidgets.la \ - $(top_builddir)/widgets/menus/libmenus.la \ $(top_builddir)/mail/libevolution-mail.la \ $(top_builddir)/mail/importers/libevolution-mail-importers.la \ $(top_builddir)/em-format/libemformat.la \ - $(top_builddir)/widgets/menus/libmenus.la \ - $(top_builddir)/filter/libfilter.la \ - $(top_builddir)/libevolution-utils/libevolution-utils.la \ $(libevolution_mail_settings_la) \ $(EVOLUTION_DATA_SERVER_LIBS) \ $(GNOME_PLATFORM_LIBS) \ + $(CHAMPLAIN_LIBS) \ $(GTKHTML_LIBS) module_mail_la_LDFLAGS = \ diff --git a/modules/mail/e-mail-attachment-handler.c b/modules/mail/e-mail-attachment-handler.c index 8bc2aad12d..887ab53def 100644 --- a/modules/mail/e-mail-attachment-handler.c +++ b/modules/mail/e-mail-attachment-handler.c @@ -27,7 +27,6 @@ #include <glib/gi18n.h> -#include "libevolution-utils/e-alert-dialog.h" #include "mail/e-mail-backend.h" #include "mail/em-composer-utils.h" diff --git a/modules/mail/e-mail-attachment-handler.h b/modules/mail/e-mail-attachment-handler.h index 13032b488c..52e1b3073e 100644 --- a/modules/mail/e-mail-attachment-handler.h +++ b/modules/mail/e-mail-attachment-handler.h @@ -22,7 +22,7 @@ #ifndef E_MAIL_ATTACHMENT_HANDLER_H #define E_MAIL_ATTACHMENT_HANDLER_H -#include <widgets/misc/e-attachment-handler.h> +#include <e-util/e-util.h> /* Standard GObject macros */ #define E_TYPE_MAIL_ATTACHMENT_HANDLER \ diff --git a/modules/mail/e-mail-config-hook.c b/modules/mail/e-mail-config-hook.c index cc9734647b..2dee70e99b 100644 --- a/modules/mail/e-mail-config-hook.c +++ b/modules/mail/e-mail-config-hook.c @@ -25,7 +25,6 @@ #include "e-mail-config-hook.h" -#include "e-util/e-config.h" #include "mail/em-config.h" static const EConfigHookTargetMask no_masks[] = { diff --git a/modules/mail/e-mail-config-web-view-gtkhtml.c b/modules/mail/e-mail-config-web-view-gtkhtml.c index 2721d5edd1..40360d4e48 100644 --- a/modules/mail/e-mail-config-web-view-gtkhtml.c +++ b/modules/mail/e-mail-config-web-view-gtkhtml.c @@ -26,7 +26,6 @@ #include "e-mail-config-web-view-gtkhtml.h" #include <shell/e-shell.h> -#include <misc/e-web-view-gtkhtml.h> #define E_MAIL_CONFIG_WEB_VIEW_GTKHTML_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ diff --git a/modules/mail/e-mail-config-web-view.c b/modules/mail/e-mail-config-web-view.c index 7a5bc4da98..5d2fb9296d 100644 --- a/modules/mail/e-mail-config-web-view.c +++ b/modules/mail/e-mail-config-web-view.c @@ -26,7 +26,6 @@ #include "e-mail-config-web-view.h" #include <shell/e-shell.h> -#include <misc/e-web-view.h> #define E_MAIL_CONFIG_WEB_VIEW_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ diff --git a/modules/mail/e-mail-event-hook.c b/modules/mail/e-mail-event-hook.c index cd1dc63dd0..376a5e8561 100644 --- a/modules/mail/e-mail-event-hook.c +++ b/modules/mail/e-mail-event-hook.c @@ -25,7 +25,6 @@ #include "e-mail-event-hook.h" -#include "e-util/e-event.h" #include "mail/em-event.h" static const EEventHookTargetMask folder_masks[] = { diff --git a/modules/mail/e-mail-shell-backend.c b/modules/mail/e-mail-shell-backend.c index 9a56c00357..1abcb8a136 100644 --- a/modules/mail/e-mail-shell-backend.c +++ b/modules/mail/e-mail-shell-backend.c @@ -27,17 +27,11 @@ #include <glib/gi18n.h> -#include <e-util/e-import.h> -#include <e-util/e-util.h> - #include <shell/e-shell.h> #include <shell/e-shell-window.h> #include <composer/e-msg-composer.h> -#include <widgets/misc/e-preferences-window.h> -#include <widgets/misc/e-web-view.h> - #include <libemail-engine/e-mail-folder-utils.h> #include <libemail-engine/e-mail-session.h> #include <libemail-engine/mail-config.h> @@ -858,7 +852,6 @@ e_mail_shell_backend_edit_account (EMailShellBackend *mail_shell_backend, /******************* Code below here belongs elsewhere. *******************/ -#include "filter/e-filter-option.h" #include "shell/e-shell-settings.h" static GSList * diff --git a/modules/mail/e-mail-shell-backend.h b/modules/mail/e-mail-shell-backend.h index 5b2da24e5f..7ee68af3c8 100644 --- a/modules/mail/e-mail-shell-backend.h +++ b/modules/mail/e-mail-shell-backend.h @@ -22,9 +22,8 @@ #ifndef E_MAIL_SHELL_BACKEND_H #define E_MAIL_SHELL_BACKEND_H +#include <e-util/e-util.h> #include <mail/e-mail-backend.h> -#include <filter/e-filter-element.h> -#include <filter/e-filter-rule.h> /* Standard GObject macros */ #define E_TYPE_MAIL_SHELL_BACKEND \ diff --git a/modules/mail/e-mail-shell-content.c b/modules/mail/e-mail-shell-content.c index 15d477a3c0..12667c2761 100644 --- a/modules/mail/e-mail-shell-content.c +++ b/modules/mail/e-mail-shell-content.c @@ -29,12 +29,6 @@ #include <e-util/e-util-private.h> -#include <widgets/menus/gal-view-etable.h> -#include <widgets/menus/gal-view-instance.h> -#include <widgets/misc/e-paned.h> -#include <widgets/misc/e-preview-pane.h> -#include <widgets/misc/e-search-bar.h> - #include <libemail-engine/mail-ops.h> #include <mail/e-mail-paned-view.h> diff --git a/modules/mail/e-mail-shell-view-private.c b/modules/mail/e-mail-shell-view-private.c index 9752461191..cb37b6e374 100644 --- a/modules/mail/e-mail-shell-view-private.c +++ b/modules/mail/e-mail-shell-view-private.c @@ -25,9 +25,6 @@ #include "e-mail-shell-view-private.h" -#include "widgets/menus/gal-view-factory-etable.h" -#include "widgets/misc/e-menu-tool-button.h" - #include "e-util/e-util-private.h" typedef struct _AsyncContext AsyncContext; diff --git a/modules/mail/e-mail-shell-view-private.h b/modules/mail/e-mail-shell-view-private.h index 0e9feb2e10..bd9db02b10 100644 --- a/modules/mail/e-mail-shell-view-private.h +++ b/modules/mail/e-mail-shell-view-private.h @@ -28,11 +28,6 @@ #include <gtkhtml/gtkhtml.h> #include <camel/camel-search-private.h> /* for camel_search_word */ -#include <e-util/e-util.h> -#include <e-util/e-ui-manager.h> - -#include <filter/e-filter-part.h> - #include <libemail-engine/e-mail-folder-utils.h> #include <libemail-engine/e-mail-session.h> #include <libemail-engine/e-mail-session-utils.h> @@ -41,10 +36,6 @@ #include <libemail-engine/mail-ops.h> #include <libemail-engine/mail-tools.h> -#include <misc/e-web-view.h> -#include <misc/e-popup-action.h> -#include <menus/gal-view-instance.h> - #include <mail/e-mail-label-action.h> #include <mail/e-mail-label-dialog.h> #include <mail/e-mail-label-list-store.h> diff --git a/modules/mail/e-mail-shell-view.c b/modules/mail/e-mail-shell-view.c index 419ad3edb3..4631dccecb 100644 --- a/modules/mail/e-mail-shell-view.c +++ b/modules/mail/e-mail-shell-view.c @@ -24,7 +24,6 @@ #endif #include "e-mail-shell-view-private.h" -#include "filter/e-filter-input.h" static gpointer parent_class; static GType mail_shell_view_type; diff --git a/modules/mail/em-account-prefs.c b/modules/mail/em-account-prefs.c index 17af8a41ab..7a45c2dc07 100644 --- a/modules/mail/em-account-prefs.c +++ b/modules/mail/em-account-prefs.c @@ -34,8 +34,6 @@ #include <glib/gi18n.h> -#include <libevolution-utils/e-alert-dialog.h> - #include <shell/e-shell.h> #include <mail/e-mail-backend.h> diff --git a/modules/mail/em-account-prefs.h b/modules/mail/em-account-prefs.h index d2aafdb1cf..f5cae38b3a 100644 --- a/modules/mail/em-account-prefs.h +++ b/modules/mail/em-account-prefs.h @@ -23,10 +23,8 @@ #define EM_ACCOUNT_PREFS_H #include <gtk/gtk.h> -#include <table/e-table.h> #include <mail/e-mail-backend.h> #include <mail/e-mail-account-manager.h> -#include <widgets/misc/e-preferences-window.h> /* Standard GObject macros */ #define EM_TYPE_ACCOUNT_PREFS \ diff --git a/modules/mail/em-composer-prefs.c b/modules/mail/em-composer-prefs.c index 4a7216915b..f9620096d0 100644 --- a/modules/mail/em-composer-prefs.c +++ b/modules/mail/em-composer-prefs.c @@ -38,16 +38,10 @@ #include <gtkhtml/gtkhtml.h> #include <editor/gtkhtml-spell-language.h> -#include <e-util/e-util.h> -#include <e-util/e-util-private.h> - #include <composer/e-msg-composer.h> #include <shell/e-shell-utils.h> -#include <misc/e-charset-combo-box.h> -#include <misc/e-mail-signature-manager.h> - #include <mail/em-config.h> #include <mail/em-folder-selection-button.h> #include <mail/e-mail-junk-options.h> diff --git a/modules/mail/em-composer-prefs.h b/modules/mail/em-composer-prefs.h index 945e2d7669..211f4147a7 100644 --- a/modules/mail/em-composer-prefs.h +++ b/modules/mail/em-composer-prefs.h @@ -27,7 +27,6 @@ #include <gtkhtml/gtkhtml.h> #include <shell/e-shell.h> -#include <widgets/misc/e-preferences-window.h> /* Standard GObject macros */ #define EM_TYPE_COMPOSER_PREFS \ diff --git a/modules/mail/em-mailer-prefs.c b/modules/mail/em-mailer-prefs.c index 0dd3d38147..3e5e5885bb 100644 --- a/modules/mail/em-mailer-prefs.c +++ b/modules/mail/em-mailer-prefs.c @@ -32,12 +32,6 @@ #include <gtkhtml/gtkhtml-properties.h> #include <libxml/tree.h> -#include <e-util/e-util.h> -#include <e-util/e-datetime-format.h> -#include <e-util/e-util-private.h> - -#include <misc/e-charset-combo-box.h> -#include <misc/e-port-entry.h> #include <shell/e-shell-utils.h> #include <mail/e-mail-backend.h> diff --git a/modules/mail/em-mailer-prefs.h b/modules/mail/em-mailer-prefs.h index 8e66476bcb..afd88afb1f 100644 --- a/modules/mail/em-mailer-prefs.h +++ b/modules/mail/em-mailer-prefs.h @@ -26,7 +26,6 @@ #include <gtk/gtk.h> #include <shell/e-shell.h> -#include <widgets/misc/e-preferences-window.h> /* Standard GObject macros */ #define EM_TYPE_MAILER_PREFS \ diff --git a/modules/mail/em-network-prefs.c b/modules/mail/em-network-prefs.c index b43c8a169f..fe21b27486 100644 --- a/modules/mail/em-network-prefs.c +++ b/modules/mail/em-network-prefs.c @@ -35,7 +35,6 @@ #include <glib/gstdio.h> #include <gdk/gdkkeysyms.h> -#include <e-util/e-util.h> #include <e-util/e-util-private.h> #include <mail/em-config.h> diff --git a/modules/mail/em-network-prefs.h b/modules/mail/em-network-prefs.h index 8d67530f92..8fd062f502 100644 --- a/modules/mail/em-network-prefs.h +++ b/modules/mail/em-network-prefs.h @@ -24,7 +24,7 @@ #define EM_NETWORK_PREFS_H #include <gtk/gtk.h> -#include <widgets/misc/e-preferences-window.h> +#include <e-util/e-util.h> /* Standard GObject macros */ #define EM_TYPE_NETWORK_PREFS \ diff --git a/modules/mailto-handler/Makefile.am b/modules/mailto-handler/Makefile.am index e33a120a47..c7bfe3ae2d 100644 --- a/modules/mailto-handler/Makefile.am +++ b/modules/mailto-handler/Makefile.am @@ -6,6 +6,7 @@ module_mailto_handler_la_CPPFLAGS = \ -DG_LOG_DOMAIN=\"evolution-mailto-handler\" \ $(EVOLUTION_DATA_SERVER_CFLAGS) \ $(GNOME_PLATFORM_CFLAGS) \ + $(CHAMPLAIN_CFLAGS) \ $(GTKHTML_CFLAGS) module_mailto_handler_la_SOURCES = \ @@ -16,6 +17,7 @@ module_mailto_handler_la_LIBADD = \ $(top_builddir)/shell/libeshell.la \ $(EVOLUTION_DATA_SERVER_LIBS) \ $(GNOME_PLATFORM_LIBS) \ + $(CHAMPLAIN_LIBS) \ $(GTKHTML_LIBS) module_mailto_handler_la_LDFLAGS = \ diff --git a/modules/mdn/Makefile.am b/modules/mdn/Makefile.am index bd6cbb9eb6..df5e539f56 100644 --- a/modules/mdn/Makefile.am +++ b/modules/mdn/Makefile.am @@ -3,10 +3,10 @@ module_LTLIBRARIES = module-mdn.la module_mdn_la_CPPFLAGS = \ $(AM_CPPFLAGS) \ -I$(top_srcdir) \ - -I$(top_srcdir)/widgets \ -DG_LOG_DOMAIN=\"evolution-mdn\" \ $(EVOLUTION_DATA_SERVER_CFLAGS) \ $(GNOME_PLATFORM_CFLAGS) \ + $(CHAMPLAIN_CFLAGS) \ $(GTKHTML_CFLAGS) module_mdn_la_SOURCES = \ @@ -17,9 +17,9 @@ module_mdn_la_LIBADD = \ $(top_builddir)/mail/libevolution-mail.la \ $(top_builddir)/e-util/libeutil.la \ $(top_builddir)/shell/libeshell.la \ - $(top_builddir)/libevolution-utils/libevolution-utils.la \ $(EVOLUTION_DATA_SERVER_LIBS) \ $(GNOME_PLATFORM_LIBS) \ + $(CHAMPLAIN_LIBS) \ $(GTKHTML_LIBS) module_mdn_la_LDFLAGS = \ diff --git a/modules/mdn/evolution-mdn.c b/modules/mdn/evolution-mdn.c index 5b32cd0cba..441b063dc1 100644 --- a/modules/mdn/evolution-mdn.c +++ b/modules/mdn/evolution-mdn.c @@ -22,8 +22,6 @@ #include <libebackend/libebackend.h> -#include <libevolution-utils/e-alert-dialog.h> - #include <libemail-engine/e-mail-session-utils.h> #include <mail/em-utils.h> diff --git a/modules/offline-alert/Makefile.am b/modules/offline-alert/Makefile.am index 9673a2778d..d8e9906b7b 100644 --- a/modules/offline-alert/Makefile.am +++ b/modules/offline-alert/Makefile.am @@ -3,10 +3,11 @@ module_LTLIBRARIES = module-offline-alert.la module_offline_alert_la_CPPFLAGS = \ $(AM_CPPFLAGS) \ -I$(top_srcdir) \ - -I$(top_srcdir)/widgets \ -DG_LOG_DOMAIN=\"evolution-offline-alert\" \ $(EVOLUTION_DATA_SERVER_CFLAGS) \ - $(GNOME_PLATFORM_CFLAGS) + $(GNOME_PLATFORM_CFLAGS) \ + $(CHAMPLAIN_CFLAGS) \ + $(GTKHTML_CFLAGS) module_offline_alert_la_SOURCES = \ evolution-offline-alert.c @@ -14,9 +15,10 @@ module_offline_alert_la_SOURCES = \ module_offline_alert_la_LIBADD = \ $(top_builddir)/e-util/libeutil.la \ $(top_builddir)/shell/libeshell.la \ - $(top_builddir)/libevolution-utils/libevolution-utils.la \ $(EVOLUTION_DATA_SERVER_LIBS) \ - $(GNOME_PLATFORM_LIBS) + $(GNOME_PLATFORM_LIBS) \ + $(CHAMPLAIN_LIBS) \ + $(GTKHTML_LIBS) module_offline_alert_la_LDFLAGS = \ -module -avoid-version $(NO_UNDEFINED) diff --git a/modules/offline-alert/evolution-offline-alert.c b/modules/offline-alert/evolution-offline-alert.c index 3a600c093e..767f41a757 100644 --- a/modules/offline-alert/evolution-offline-alert.c +++ b/modules/offline-alert/evolution-offline-alert.c @@ -24,7 +24,6 @@ #include <shell/e-shell-view.h> #include <shell/e-shell-window-actions.h> -#include <libevolution-utils/e-alert-sink.h> /* Standard GObject macros */ #define E_TYPE_OFFLINE_ALERT \ diff --git a/modules/online-accounts/Makefile.am b/modules/online-accounts/Makefile.am index d12fd08d03..846e5cd44d 100644 --- a/modules/online-accounts/Makefile.am +++ b/modules/online-accounts/Makefile.am @@ -8,6 +8,8 @@ module_online_accounts_la_CPPFLAGS = \ -DG_LOG_DOMAIN=\"evolution-online-accounts\" \ $(EVOLUTION_DATA_SERVER_CFLAGS) \ $(GNOME_PLATFORM_CFLAGS) \ + $(CHAMPLAIN_CFLAGS) \ + $(GTKHTML_CFLAGS) \ $(GOA_CFLAGS) \ $(NULL) @@ -23,9 +25,10 @@ module_online_accounts_la_LIBADD = \ $(top_builddir)/e-util/libeutil.la \ $(top_builddir)/shell/libeshell.la \ $(top_builddir)/libemail-engine/libemail-engine.la \ - $(top_builddir)/libemail-utils/libemail-utils.la \ $(EVOLUTION_DATA_SERVER_LIBS) \ $(GNOME_PLATFORM_LIBS) \ + $(CHAMPLAIN_LIBS) \ + $(GTKHTML_LIBS) \ $(GOA_LIBS) \ $(NULL) diff --git a/modules/plugin-lib/Makefile.am b/modules/plugin-lib/Makefile.am index 0933861156..950e472560 100644 --- a/modules/plugin-lib/Makefile.am +++ b/modules/plugin-lib/Makefile.am @@ -5,7 +5,10 @@ module_plugin_lib_la_CPPFLAGS = \ -DG_LOG_DOMAIN=\"evolution-plugin-lib\" \ -I$(top_srcdir) \ -DEVOLUTION_PREFIX=\""$(prefix)"\" \ - $(EVOLUTION_DATA_SERVER_CFLAGS) + $(EVOLUTION_DATA_SERVER_CFLAGS) \ + $(GNOME_PLATFORM_CFLAGS) \ + $(CHAMPLAIN_CFLAGS) \ + $(GTKHTML_CFLAGS) module_plugin_lib_la_SOURCES = \ evolution-module-plugin-lib.c \ @@ -14,7 +17,10 @@ module_plugin_lib_la_SOURCES = \ module_plugin_lib_la_LIBADD = \ $(top_builddir)/e-util/libeutil.la \ - $(EVOLUTION_DATA_SERVER_LIBS) + $(EVOLUTION_DATA_SERVER_LIBS) \ + $(GNOME_PLATFORM_LIBS) \ + $(CHAMPLAIN_LIBS) \ + $(GTKHTML_LIBS) module_plugin_lib_la_LDFLAGS = \ -module -avoid-version $(NO_UNDEFINED) diff --git a/modules/plugin-lib/e-plugin-lib.h b/modules/plugin-lib/e-plugin-lib.h index 91f440bf49..db1056ac93 100644 --- a/modules/plugin-lib/e-plugin-lib.h +++ b/modules/plugin-lib/e-plugin-lib.h @@ -23,7 +23,7 @@ #define E_PLUGIN_LIB_H #include <gmodule.h> -#include <e-util/e-plugin.h> +#include <e-util/e-util.h> /* Standard GObject macros */ #define E_TYPE_PLUGIN_LIB \ diff --git a/modules/plugin-manager/Makefile.am b/modules/plugin-manager/Makefile.am index 03eaa3d77a..0c6a38aab5 100644 --- a/modules/plugin-manager/Makefile.am +++ b/modules/plugin-manager/Makefile.am @@ -3,10 +3,11 @@ module_LTLIBRARIES = module-plugin-manager.la module_plugin_manager_la_CPPFLAGS = \ $(AM_CPPFLAGS) \ -I$(top_srcdir) \ - -I$(top_srcdir)/widgets \ -DG_LOG_DOMAIN=\"evolution-plugin-manager\" \ $(EVOLUTION_DATA_SERVER_CFLAGS) \ - $(GNOME_PLATFORM_CFLAGS) + $(GNOME_PLATFORM_CFLAGS) \ + $(CHAMPLAIN_CFLAGS) \ + $(GTKHTML_CFLAGS) module_plugin_manager_la_SOURCES = \ evolution-plugin-manager.c @@ -15,7 +16,9 @@ module_plugin_manager_la_LIBADD = \ $(top_builddir)/e-util/libeutil.la \ $(top_builddir)/shell/libeshell.la \ $(EVOLUTION_DATA_SERVER_LIBS) \ - $(GNOME_PLATFORM_LIBS) + $(GNOME_PLATFORM_LIBS) \ + $(CHAMPLAIN_LIBS) \ + $(GTKHTML_LIBS) module_plugin_manager_la_LDFLAGS = \ -module -avoid-version $(NO_UNDEFINED) diff --git a/modules/plugin-manager/evolution-plugin-manager.c b/modules/plugin-manager/evolution-plugin-manager.c index 39bc9b9ea3..759b3fdd86 100644 --- a/modules/plugin-manager/evolution-plugin-manager.c +++ b/modules/plugin-manager/evolution-plugin-manager.c @@ -25,7 +25,6 @@ #include <glib/gi18n-lib.h> #include <libebackend/libebackend.h> -#include <e-util/e-plugin.h> #include <shell/e-shell-window.h> #include <shell/e-shell-window-actions.h> diff --git a/modules/prefer-plain/Makefile.am b/modules/prefer-plain/Makefile.am index ac471dfcbd..1b0289ec9e 100644 --- a/modules/prefer-plain/Makefile.am +++ b/modules/prefer-plain/Makefile.am @@ -5,11 +5,12 @@ module_LTLIBRARIES = module-prefer-plain.la module_prefer_plain_la_CPPFLAGS = \ $(AM_CPPFLAGS) \ -I$(top_srcdir) \ - -I$(top_srcdir)/widgets \ -DEVOLUTION_PRIVDATADIR=\""$(privdatadir)"\" \ -DG_LOG_DOMAIN=\"evolution-module-prefer-plain\" \ $(EVOLUTION_DATA_SERVER_CFLAGS) \ - $(GNOME_PLATFORM_CFLAGS) + $(GNOME_PLATFORM_CFLAGS) \ + $(CHAMPLAIN_CFLAGS) \ + $(GTKHTML_CFLAGS) module_prefer_plain_la_SOURCES = \ e-mail-parser-prefer-plain.c \ @@ -19,12 +20,14 @@ module_prefer_plain_la_SOURCES = \ evolution-module-prefer-plain.c module_prefer_plain_la_LIBADD = \ + $(top_builddir)/e-util/libeutil.la \ $(top_builddir)/mail/libevolution-mail.la \ $(top_builddir)/em-format/libemformat.la \ $(top_builddir)/shell/libeshell.la \ - $(top_builddir)/widgets/misc/libemiscwidgets.la \ $(EVOLUTION_DATA_SERVER_LIBS) \ - $(GNOME_PLATFORM_LIBS) + $(GNOME_PLATFORM_LIBS) \ + $(CHAMPLAIN_LIBS) \ + $(GTKHTML_LIBS) module_prefer_plain_la_LDFLAGS = \ -avoid-version -module $(NO_UNDEFINED) diff --git a/modules/prefer-plain/plugin/Makefile.am b/modules/prefer-plain/plugin/Makefile.am index d1064cb352..255b914646 100644 --- a/modules/prefer-plain/plugin/Makefile.am +++ b/modules/prefer-plain/plugin/Makefile.am @@ -6,10 +6,11 @@ plugin_LTLIBRARIES = liborg-gnome-prefer-plain.la liborg_gnome_prefer_plain_la_CPPFLAGS = \ $(AM_CPPFLAGS) \ -I$(top_srcdir) \ - -I$(top_srcdir)/widgets \ -DEVOLUTION_PRIVDATADIR=\""$(privdatadir)"\" \ $(EVOLUTION_DATA_SERVER_CFLAGS) \ - $(GNOME_PLATFORM_CFLAGS) + $(GNOME_PLATFORM_CFLAGS) \ + $(CHAMPLAIN_CFLAGS) \ + $(GTKHTML_CFLAGS) liborg_gnome_prefer_plain_la_SOURCES = \ config-ui.c @@ -18,7 +19,9 @@ liborg_gnome_prefer_plain_la_LDFLAGS = -module -avoid-version $(NO_UNDEFINED) liborg_gnome_prefer_plain_la_LIBADD = \ $(EVOLUTION_DATA_SERVER_LIBS) \ - $(GNOME_PLATFORM_LIBS) + $(GNOME_PLATFORM_LIBS) \ + $(CHAMPLAIN_LIBS) \ + $(GTKHTML_LIBS) BUILT_SOURCES = $(plugin_DATA) diff --git a/modules/prefer-plain/plugin/config-ui.c b/modules/prefer-plain/plugin/config-ui.c index 411ef24dbd..5ed58914d3 100644 --- a/modules/prefer-plain/plugin/config-ui.c +++ b/modules/prefer-plain/plugin/config-ui.c @@ -23,8 +23,6 @@ #include <mail/em-config.h> -#include <libedataserverui/libedataserverui.h> - GtkWidget *prefer_plain_page_factory (EPlugin *ep, EConfigHookItemFactoryData *hook_data); enum { diff --git a/modules/spamassassin/Makefile.am b/modules/spamassassin/Makefile.am index 8475660319..c5ce4c23ce 100644 --- a/modules/spamassassin/Makefile.am +++ b/modules/spamassassin/Makefile.am @@ -5,7 +5,9 @@ module_spamassassin_la_CPPFLAGS = \ -I$(top_srcdir) \ -DG_LOG_DOMAIN=\"evolution-spamassassin\" \ $(EVOLUTION_DATA_SERVER_CFLAGS) \ - $(GNOME_PLATFORM_CFLAGS) + $(GNOME_PLATFORM_CFLAGS) \ + $(CHAMPLAIN_CFLAGS) \ + $(GTKHTML_CFLAGS) module_spamassassin_la_SOURCES = \ evolution-spamassassin.c @@ -15,9 +17,10 @@ module_spamassassin_la_LIBADD = \ $(top_builddir)/mail/libevolution-mail.la \ $(top_builddir)/shell/libeshell.la \ $(top_builddir)/libemail-engine/libemail-engine.la \ - $(top_builddir)/libemail-utils/libemail-utils.la \ $(EVOLUTION_DATA_SERVER_LIBS) \ - $(GNOME_PLATFORM_LIBS) + $(GNOME_PLATFORM_LIBS) \ + $(CHAMPLAIN_LIBS) \ + $(GTKHTML_LIBS) module_spamassassin_la_LDFLAGS = \ -module -avoid-version $(NO_UNDEFINED) diff --git a/modules/spamassassin/evolution-spamassassin.c b/modules/spamassassin/evolution-spamassassin.c index 2202f71003..fa08c56e3b 100644 --- a/modules/spamassassin/evolution-spamassassin.c +++ b/modules/spamassassin/evolution-spamassassin.c @@ -26,7 +26,6 @@ #include <camel/camel.h> #include <shell/e-shell.h> -#include <e-util/e-mktemp.h> #include <libemail-engine/e-mail-junk-filter.h> /* Standard GObject macros */ diff --git a/modules/startup-wizard/Makefile.am b/modules/startup-wizard/Makefile.am index 0642691c49..747b90a7fd 100644 --- a/modules/startup-wizard/Makefile.am +++ b/modules/startup-wizard/Makefile.am @@ -5,10 +5,11 @@ module_LTLIBRARIES = module-startup-wizard.la module_startup_wizard_la_CPPFLAGS = \ $(AM_CPPFLAGS) \ -I$(top_srcdir) \ - -I$(top_srcdir)/widgets \ -DG_LOG_DOMAIN=\"evolution-startup-wizard\" \ $(EVOLUTION_DATA_SERVER_CFLAGS) \ $(GNOME_PLATFORM_CFLAGS) \ + $(CHAMPLAIN_CFLAGS) \ + $(GTKHTML_CFLAGS) \ $(NULL) module_startup_wizard_la_SOURCES = \ @@ -24,15 +25,14 @@ module_startup_wizard_la_SOURCES = \ module_startup_wizard_la_LIBADD = \ $(top_builddir)/e-util/libeutil.la \ $(top_builddir)/shell/libeshell.la \ - $(top_builddir)/widgets/e-timezone-dialog/libetimezonedialog.la \ - $(top_builddir)/widgets/misc/libemiscwidgets.la \ $(top_builddir)/calendar/gui/libevolution-calendar.la \ $(top_builddir)/mail/libevolution-mail.la \ $(top_builddir)/libemail-engine/libemail-engine.la \ - $(top_builddir)/libemail-utils/libemail-utils.la \ $(libevolution_mail_settings_la) \ $(EVOLUTION_DATA_SERVER_LIBS) \ $(GNOME_PLATFORM_LIBS) \ + $(CHAMPLAIN_LIBS) \ + $(GTKHTML_LIBS) \ $(NULL) module_startup_wizard_la_LDFLAGS = \ diff --git a/modules/startup-wizard/e-mail-config-import-page.c b/modules/startup-wizard/e-mail-config-import-page.c index 8d2ad1f2f1..4028fee1fa 100644 --- a/modules/startup-wizard/e-mail-config-import-page.c +++ b/modules/startup-wizard/e-mail-config-import-page.c @@ -21,8 +21,6 @@ #include <config.h> #include <glib/gi18n-lib.h> -#include <e-util/e-import.h> - #define E_MAIL_CONFIG_IMPORT_PAGE_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ ((obj), E_TYPE_MAIL_CONFIG_IMPORT_PAGE, EMailConfigImportPagePrivate)) diff --git a/modules/startup-wizard/e-mail-config-import-page.h b/modules/startup-wizard/e-mail-config-import-page.h index 9f378079c6..79dce20e57 100644 --- a/modules/startup-wizard/e-mail-config-import-page.h +++ b/modules/startup-wizard/e-mail-config-import-page.h @@ -21,7 +21,7 @@ #include <gtk/gtk.h> -#include <e-util/e-activity.h> +#include <e-util/e-util.h> #include <mail/e-mail-config-page.h> #include <mail/e-mail-config-summary-page.h> diff --git a/modules/startup-wizard/e-mail-config-import-progress-page.h b/modules/startup-wizard/e-mail-config-import-progress-page.h index 387e6cc19a..f95a937125 100644 --- a/modules/startup-wizard/e-mail-config-import-progress-page.h +++ b/modules/startup-wizard/e-mail-config-import-progress-page.h @@ -21,8 +21,6 @@ #include <gtk/gtk.h> -#include <e-util/e-activity.h> - #include <mail/e-mail-config-page.h> #include "e-mail-config-import-page.h" diff --git a/modules/startup-wizard/e-startup-assistant.c b/modules/startup-wizard/e-startup-assistant.c index 86d6de17b5..19023244fd 100644 --- a/modules/startup-wizard/e-startup-assistant.c +++ b/modules/startup-wizard/e-startup-assistant.c @@ -21,6 +21,8 @@ #include <config.h> #include <glib/gi18n-lib.h> +#include <e-util/e-util.h> + #include <mail/e-mail-config-welcome-page.h> #include "e-mail-config-import-page.h" diff --git a/modules/startup-wizard/evolution-startup-wizard.c b/modules/startup-wizard/evolution-startup-wizard.c index 1ddeaa5168..03c70b7e66 100644 --- a/modules/startup-wizard/evolution-startup-wizard.c +++ b/modules/startup-wizard/evolution-startup-wizard.c @@ -25,9 +25,6 @@ #include <shell/e-shell.h> -#include <libevolution-utils/e-alert-dialog.h> -#include <e-util/e-import.h> - #include <mail/e-mail-backend.h> #include <mail/e-mail-config-assistant.h> #include <mail/e-mail-config-welcome-page.h> diff --git a/modules/text-highlight/Makefile.am b/modules/text-highlight/Makefile.am index fb0094aa0e..8086663b5c 100644 --- a/modules/text-highlight/Makefile.am +++ b/modules/text-highlight/Makefile.am @@ -3,11 +3,12 @@ module_LTLIBRARIES = module-text-highlight.la module_text_highlight_la_CPPFLAGS = \ $(AM_CPPFLAGS) \ -I$(top_srcdir) \ - -I$(top_srcdir)/widgets \ -DEVOLUTION_PRIVDATADIR=\""$(privdatadir)"\" \ -DG_LOG_DOMAIN=\"evolution-module-text-highlight\" \ $(EVOLUTION_DATA_SERVER_CFLAGS) \ - $(GNOME_PLATFORM_CFLAGS) + $(GNOME_PLATFORM_CFLAGS) \ + $(CHAMPLAIN_CFLAGS) \ + $(GTKHTML_CFLAGS) module_text_highlight_la_SOURCES = \ e-mail-display-popup-text-highlight.c \ @@ -25,9 +26,10 @@ module_text_highlight_la_LIBADD = \ $(top_builddir)/mail/libevolution-mail.la \ $(top_builddir)/em-format/libemformat.la \ $(top_builddir)/shell/libeshell.la \ - $(top_builddir)/widgets/misc/libemiscwidgets.la \ $(EVOLUTION_DATA_SERVER_LIBS) \ - $(GNOME_PLATFORM_LIBS) + $(GNOME_PLATFORM_LIBS) \ + $(CHAMPLAIN_LIBS) \ + $(GTKHTML_LIBS) module_text_highlight_la_LDFLAGS = \ -avoid-version -module $(NO_UNDEFINED) diff --git a/modules/tnef-attachment/Makefile.am b/modules/tnef-attachment/Makefile.am index ff5b412275..b8ff625455 100644 --- a/modules/tnef-attachment/Makefile.am +++ b/modules/tnef-attachment/Makefile.am @@ -9,11 +9,12 @@ module_LTLIBRARIES = module-tnef-attachment.la module_tnef_attachment_la_CPPFLAGS = \ $(AM_CPPFLAGS) \ -I$(top_srcdir) \ - -I$(top_srcdir)/widgets \ -DEVOLUTION_PRIVDATADIR=\""$(privdatadir)"\" \ -DG_LOG_DOMAIN=\"evolution-module-tnef-attachment\" \ $(EVOLUTION_DATA_SERVER_CFLAGS) \ $(GNOME_PLATFORM_CFLAGS) \ + $(CHAMPLAIN_CFLAGS) \ + $(GTKHTML_CFLAGS) \ $(TNEF_CFLAGS) module_tnef_attachment_la_SOURCES = \ @@ -26,6 +27,8 @@ module_tnef_attachment_la_LIBADD = \ $(top_builddir)/em-format/libemformat.la \ $(EVOLUTION_DATA_SERVER_LIBS) \ $(GNOME_PLATFORM_LIBS) \ + $(CHAMPLAIN_LIBS) \ + $(GTKHTML_LIBS) \ -lytnef module_tnef_attachment_la_LDFLAGS = \ diff --git a/modules/tnef-attachment/e-mail-parser-tnef-attachment.c b/modules/tnef-attachment/e-mail-parser-tnef-attachment.c index 6ff54b062c..dc93b91955 100644 --- a/modules/tnef-attachment/e-mail-parser-tnef-attachment.c +++ b/modules/tnef-attachment/e-mail-parser-tnef-attachment.c @@ -17,19 +17,14 @@ #include <config.h> #endif +#include "e-mail-parser-tnef-attachment.h" + #include <string.h> #include <gtk/gtk.h> #include <glib/gi18n.h> #include <glib/gprintf.h> #include <stdio.h> -#include "e-mail-parser-tnef-attachment.h" - -#include <em-format/e-mail-extension-registry.h> -#include <em-format/e-mail-parser-extension.h> -#include <em-format/e-mail-part.h> -#include <em-format/e-mail-part-utils.h> - #include <sys/types.h> #include <dirent.h> #include <sys/stat.h> @@ -42,11 +37,15 @@ #include <libytnef/ytnef.h> #endif -#include <mail/em-utils.h> -#include <e-util/e-mktemp.h> - #include <libebackend/libebackend.h> +#include <em-format/e-mail-extension-registry.h> +#include <em-format/e-mail-parser-extension.h> +#include <em-format/e-mail-part.h> +#include <em-format/e-mail-part-utils.h> + +#include <mail/em-utils.h> + #define d(x) typedef struct _EMailParserTnefAttachment { diff --git a/modules/vcard-inline/Makefile.am b/modules/vcard-inline/Makefile.am index 18423f2069..452c977f9a 100644 --- a/modules/vcard-inline/Makefile.am +++ b/modules/vcard-inline/Makefile.am @@ -3,11 +3,12 @@ module_LTLIBRARIES = module-vcard-inline.la module_vcard_inline_la_CPPFLAGS = \ $(AM_CPPFLAGS) \ -I$(top_srcdir) \ - -I$(top_srcdir)/widgets \ -DEVOLUTION_PRIVDATADIR=\""$(privdatadir)"\" \ -DG_LOG_DOMAIN=\"evolution-module-vcard-inline\" \ $(EVOLUTION_DATA_SERVER_CFLAGS) \ - $(GNOME_PLATFORM_CFLAGS) + $(GNOME_PLATFORM_CFLAGS) \ + $(CHAMPLAIN_CFLAGS) \ + $(GTKHTML_CFLAGS) module_vcard_inline_la_SOURCES = \ e-mail-formatter-vcard-inline.c \ @@ -25,7 +26,9 @@ module_vcard_inline_la_LIBADD = \ $(top_builddir)/addressbook/gui/merging/libeabbookmerging.la \ $(top_builddir)/addressbook/printing/libecontactprint.la \ $(EVOLUTION_DATA_SERVER_LIBS) \ - $(GNOME_PLATFORM_LIBS) + $(GNOME_PLATFORM_LIBS) \ + $(CHAMPLAIN_LIBS) \ + $(GTKHTML_LIBS) module_vcard_inline_la_LDFLAGS = \ -avoid-version -module $(NO_UNDEFINED) diff --git a/modules/vcard-inline/e-mail-parser-vcard-inline.c b/modules/vcard-inline/e-mail-parser-vcard-inline.c index bd4050287a..44032d4376 100644 --- a/modules/vcard-inline/e-mail-parser-vcard-inline.c +++ b/modules/vcard-inline/e-mail-parser-vcard-inline.c @@ -38,7 +38,6 @@ #include <libebook/libebook.h> #include <libedataserver/libedataserver.h> -#include <libedataserverui/libedataserverui.h> #include <shell/e-shell.h> #include <addressbook/gui/merging/eab-contact-merging.h> diff --git a/modules/web-inspector/Makefile.am b/modules/web-inspector/Makefile.am index dfd999c213..90da25e594 100644 --- a/modules/web-inspector/Makefile.am +++ b/modules/web-inspector/Makefile.am @@ -3,19 +3,21 @@ module_LTLIBRARIES = module-web-inspector.la module_web_inspector_la_CPPFLAGS = \ $(AM_CPPFLAGS) \ -I$(top_srcdir) \ - -I$(top_srcdir)/widgets \ -DG_LOG_DOMAIN=\"evolution-web-inspector\" \ $(EVOLUTION_DATA_SERVER_CFLAGS) \ - $(GNOME_PLATFORM_CFLAGS) + $(GNOME_PLATFORM_CFLAGS) \ + $(CHAMPLAIN_CFLAGS) \ + $(GTKHTML_CFLAGS) module_web_inspector_la_SOURCES = \ evolution-web-inspector.c module_web_inspector_la_LIBADD = \ $(top_builddir)/e-util/libeutil.la \ - $(top_builddir)/widgets/misc/libemiscwidgets.la \ $(EVOLUTION_DATA_SERVER_LIBS) \ - $(GNOME_PLATFORM_LIBS) + $(GNOME_PLATFORM_LIBS) \ + $(CHAMPLAIN_LIBS) \ + $(GTKHTML_LIBS) module_web_inspector_la_LDFLAGS = \ -module -avoid-version $(NO_UNDEFINED) diff --git a/modules/web-inspector/evolution-web-inspector.c b/modules/web-inspector/evolution-web-inspector.c index 5a7585fbbb..8028ec7465 100644 --- a/modules/web-inspector/evolution-web-inspector.c +++ b/modules/web-inspector/evolution-web-inspector.c @@ -19,9 +19,10 @@ #include <config.h> #include <glib/gi18n-lib.h> -#include <misc/e-web-view.h> #include <libebackend/libebackend.h> +#include <e-util/e-util.h> + /* Standard GObject macros */ #define E_TYPE_WEB_INSPECTOR \ (e_web_inspector_get_type ()) diff --git a/plugins/attachment-reminder/Makefile.am b/plugins/attachment-reminder/Makefile.am index 0339e01f9c..393f4d33c9 100644 --- a/plugins/attachment-reminder/Makefile.am +++ b/plugins/attachment-reminder/Makefile.am @@ -13,10 +13,10 @@ liborg_gnome_evolution_attachment_reminder_la_CPPFLAGS = \ $(AM_CPPFLAGS) \ -I$(top_builddir)/composer \ -I$(top_srcdir) \ - -I$(top_srcdir)/widgets \ -DEVOLUTION_PLUGINDIR="\"$(plugindir)\"" \ $(EVOLUTION_DATA_SERVER_CFLAGS) \ $(GNOME_PLATFORM_CFLAGS) \ + $(CHAMPLAIN_CFLAGS) \ $(GTKHTML_CFLAGS) liborg_gnome_evolution_attachment_reminder_la_SOURCES = attachment-reminder.c @@ -29,11 +29,10 @@ liborg_gnome_evolution_attachment_reminder_la_LIBADD = \ $(top_builddir)/addressbook/gui/contact-editor/libecontacteditor.la \ $(top_builddir)/addressbook/gui/contact-list-editor/libecontactlisteditor.la \ $(top_builddir)/e-util/libeutil.la \ - $(top_builddir)/widgets/misc/libemiscwidgets.la \ $(top_builddir)/mail/libevolution-mail.la \ - $(top_builddir)/libevolution-utils/libevolution-utils.la \ $(EVOLUTION_DATA_SERVER_LIBS) \ $(GNOME_PLATFORM_LIBS) \ + $(CHAMPLAIN_LIBS) \ $(GTKHTML_LIBS) EXTRA_DIST = org-gnome-evolution-attachment-reminder.eplug.xml \ diff --git a/plugins/attachment-reminder/attachment-reminder.c b/plugins/attachment-reminder/attachment-reminder.c index 0079014c5b..e005fbdfdf 100644 --- a/plugins/attachment-reminder/attachment-reminder.c +++ b/plugins/attachment-reminder/attachment-reminder.c @@ -28,20 +28,13 @@ #include <glib/gi18n.h> #include <string.h> -#include <e-util/e-util.h> -#include <e-util/e-config.h> #include <mail/em-config.h> #include <mail/em-event.h> -#include <libevolution-utils/e-alert-dialog.h> -#include <e-util/e-plugin.h> - #include <mail/em-utils.h> #include "composer/e-msg-composer.h" #include "composer/e-composer-actions.h" -#include "widgets/misc/e-attachment-view.h" -#include "widgets/misc/e-attachment-store.h" #define CONF_KEY_ATTACH_REMINDER_CLUES "attachment-reminder-clues" diff --git a/plugins/bbdb/Makefile.am b/plugins/bbdb/Makefile.am index d3e006e80d..c2b58db08e 100644 --- a/plugins/bbdb/Makefile.am +++ b/plugins/bbdb/Makefile.am @@ -15,9 +15,9 @@ liborg_gnome_evolution_bbdb_la_CPPFLAGS = \ $(AM_CPPFLAGS) \ -I$(top_builddir)/composer \ -I$(top_srcdir) \ - -I$(top_srcdir)/widgets \ $(EVOLUTION_DATA_SERVER_CFLAGS) \ $(GNOME_PLATFORM_CFLAGS) \ + $(CHAMPLAIN_CFLAGS) \ $(GTKHTML_CFLAGS) liborg_gnome_evolution_bbdb_la_SOURCES = bbdb.c bbdb.h gaimbuddies.c @@ -30,9 +30,9 @@ liborg_gnome_evolution_bbdb_la_LIBADD = \ $(top_builddir)/composer/libcomposer.la \ $(top_builddir)/addressbook/gui/contact-editor/libecontacteditor.la \ $(top_builddir)/addressbook/gui/contact-list-editor/libecontactlisteditor.la \ - $(top_builddir)/libevolution-utils/libevolution-utils.la \ $(EVOLUTION_DATA_SERVER_LIBS) \ $(GNOME_PLATFORM_LIBS) \ + $(CHAMPLAIN_LIBS) \ $(GTKHTML_LIBS) EXTRA_DIST = org-gnome-evolution-bbdb.eplug.xml diff --git a/plugins/bbdb/bbdb.c b/plugins/bbdb/bbdb.c index c19551944b..c6e60b005a 100644 --- a/plugins/bbdb/bbdb.c +++ b/plugins/bbdb/bbdb.c @@ -28,9 +28,6 @@ #include <glib/gi18n.h> #include <string.h> -#include <libedataserverui/libedataserverui.h> - -#include <e-util/e-config.h> #include <addressbook/gui/widgets/eab-config.h> #include <mail/em-event.h> #include <composer/e-msg-composer.h> diff --git a/plugins/bbdb/gaimbuddies.c b/plugins/bbdb/gaimbuddies.c index b59e683c8e..d9a0cd9bd3 100644 --- a/plugins/bbdb/gaimbuddies.c +++ b/plugins/bbdb/gaimbuddies.c @@ -36,18 +36,15 @@ #include <libxml/tree.h> #include <libxml/parser.h> #include <libxml/xmlmemory.h> -#include <libevolution-utils/e-xml-utils.h> #include <gtk/gtk.h> #include <glib/gi18n.h> #include <string.h> -#include <libedataserverui/libedataserverui.h> - #include <sys/time.h> #include <sys/stat.h> -#include <e-util/e-config.h> +#include <e-util/e-util.h> #include "bbdb.h" diff --git a/plugins/dbx-import/Makefile.am b/plugins/dbx-import/Makefile.am index 5bead7d3fd..011f10f349 100644 --- a/plugins/dbx-import/Makefile.am +++ b/plugins/dbx-import/Makefile.am @@ -13,10 +13,11 @@ plugin_LTLIBRARIES = liborg-gnome-dbx-import.la liborg_gnome_dbx_import_la_CPPFLAGS = \ $(AM_CPPFLAGS) \ -I$(top_srcdir) \ - -I$(top_srcdir)/widgets \ -I$(top_builddir) \ $(EVOLUTION_DATA_SERVER_CFLAGS) \ - $(GNOME_PLATFORM_CFLAGS) + $(GNOME_PLATFORM_CFLAGS) \ + $(CHAMPLAIN_CFLAGS) \ + $(GTKHTML_CFLAGS) liborg_gnome_dbx_import_la_SOURCES = dbx-importer.c @@ -27,9 +28,10 @@ liborg_gnome_dbx_import_la_LIBADD = \ $(top_builddir)/e-util/libeutil.la \ $(top_builddir)/shell/libeshell.la \ $(top_builddir)/libemail-engine/libemail-engine.la \ - $(top_builddir)/libemail-utils/libemail-utils.la \ $(EVOLUTION_DATA_SERVER_LIBS) \ - $(GNOME_PLATFORM_LIBS) + $(GNOME_PLATFORM_LIBS) \ + $(CHAMPLAIN_LIBS) \ + $(GTKHTML_LIBS) EXTRA_DIST = org-gnome-dbx-import.eplug.xml diff --git a/plugins/dbx-import/dbx-importer.c b/plugins/dbx-import/dbx-importer.c index 5d00da5e19..0eb5f4f94c 100644 --- a/plugins/dbx-import/dbx-importer.c +++ b/plugins/dbx-import/dbx-importer.c @@ -49,17 +49,12 @@ #include <gtk/gtk.h> #include <libecal/libecal.h> #include <libebook/libebook.h> -#include <libedataserverui/libedataserverui.h> - -#include <e-util/e-import.h> -#include <e-util/e-plugin.h> -#include <e-util/e-mktemp.h> #include <shell/e-shell.h> #include <shell/e-shell-window.h> #include <shell/e-shell-view.h> -#include <libemail-utils/mail-mt.h> +#include <libemail-engine/mail-mt.h> #include <libemail-engine/mail-tools.h> #include <mail/e-mail-backend.h> diff --git a/plugins/email-custom-header/Makefile.am b/plugins/email-custom-header/Makefile.am index a8d601658e..446a528c6a 100644 --- a/plugins/email-custom-header/Makefile.am +++ b/plugins/email-custom-header/Makefile.am @@ -8,12 +8,11 @@ liborg_gnome_email_custom_header_la_CPPFLAGS = \ $(AM_CPPFLAGS) \ -I. \ -I$(top_srcdir) \ - -I$(top_srcdir)/widgets \ - -I$(top_srcdir)/widgets/misc \ -I$(top_builddir)/mail \ -I$(top_builddir)/composer \ $(EVOLUTION_DATA_SERVER_CFLAGS) \ $(GNOME_PLATFORM_CFLAGS) \ + $(CHAMPLAIN_CFLAGS) \ $(GTKHTML_CFLAGS) liborg_gnome_email_custom_header_la_SOURCES = \ @@ -23,11 +22,10 @@ liborg_gnome_email_custom_header_la_SOURCES = \ liborg_gnome_email_custom_header_la_LIBADD = \ $(top_builddir)/e-util/libeutil.la \ $(top_builddir)/composer/libcomposer.la \ - $(top_builddir)/widgets/misc/libemiscwidgets.la \ $(top_builddir)/mail/libevolution-mail.la \ - $(top_builddir)/libevolution-utils/libevolution-utils.la \ $(EVOLUTION_DATA_SERVER_LIBS) \ $(GNOME_PLATFORM_LIBS) \ + $(CHAMPLAIN_LIBS) \ $(GTKHTML_LIBS) liborg_gnome_email_custom_header_la_LDFLAGS = -module -avoid-version $(NO_UNDEFINED) diff --git a/plugins/email-custom-header/email-custom-header.c b/plugins/email-custom-header/email-custom-header.c index 5f66489c07..25f1feff63 100644 --- a/plugins/email-custom-header/email-custom-header.c +++ b/plugins/email-custom-header/email-custom-header.c @@ -26,11 +26,10 @@ #include <string.h> #include <glib/gi18n.h> + #include "mail/em-utils.h" #include "mail/em-event.h" #include "composer/e-msg-composer.h" -#include "e-util/e-config.h" -#include "e-util/e-util.h" #include "email-custom-header.h" #define d(x) diff --git a/plugins/external-editor/Makefile.am b/plugins/external-editor/Makefile.am index f0ffd1ac67..080e4e0b8e 100644 --- a/plugins/external-editor/Makefile.am +++ b/plugins/external-editor/Makefile.am @@ -26,9 +26,9 @@ liborg_gnome_external_editor_la_CPPFLAGS = \ -DLIBDIR=\""$(libdir)"\" \ -I$(top_srcdir) \ -I$(top_srcdir)/composer \ - -I$(top_srcdir)/widgets \ $(EVOLUTION_DATA_SERVER_CFLAGS) \ $(GNOME_PLATFORM_CFLAGS) \ + $(CHAMPLAIN_CFLAGS) \ $(GTKHTML_CFLAGS) liborg_gnome_external_editor_la_SOURCES = \ @@ -43,9 +43,9 @@ liborg_gnome_external_editor_la_LIBADD = \ $(top_builddir)/addressbook/gui/contact-editor/libecontacteditor.la \ $(top_builddir)/addressbook/gui/contact-list-editor/libecontactlisteditor.la \ $(top_builddir)/mail/libevolution-mail.la \ - $(top_builddir)/libevolution-utils/libevolution-utils.la \ $(EVOLUTION_DATA_SERVER_LIBS) \ $(GNOME_PLATFORM_LIBS) \ + $(CHAMPLAIN_LIBS) \ $(GTKHTML_LIBS) EXTRA_DIST = \ diff --git a/plugins/external-editor/external-editor.c b/plugins/external-editor/external-editor.c index 0c43acbfdc..19a8159e56 100644 --- a/plugins/external-editor/external-editor.c +++ b/plugins/external-editor/external-editor.c @@ -28,7 +28,6 @@ #include <mail/em-config.h> #include <mail/em-composer-utils.h> -#include <libevolution-utils/e-alert-dialog.h> #include <e-msg-composer.h> #include <glib/gi18n-lib.h> diff --git a/plugins/face/Makefile.am b/plugins/face/Makefile.am index 0522cc0f82..1fe52d0989 100644 --- a/plugins/face/Makefile.am +++ b/plugins/face/Makefile.am @@ -8,12 +8,11 @@ liborg_gnome_face_la_CPPFLAGS = \ $(AM_CPPFLAGS) \ -I. \ -I$(top_srcdir) \ - -I$(top_srcdir)/widgets \ - -I$(top_srcdir)/widgets/misc \ -I$(top_builddir)/mail \ -I$(top_builddir)/composer \ $(EVOLUTION_DATA_SERVER_CFLAGS) \ $(GNOME_PLATFORM_CFLAGS) \ + $(CHAMPLAIN_CFLAGS) \ $(GTKHTML_CFLAGS) liborg_gnome_face_la_SOURCES = face.c @@ -21,11 +20,10 @@ liborg_gnome_face_la_SOURCES = face.c liborg_gnome_face_la_LIBADD = \ $(top_builddir)/e-util/libeutil.la \ $(top_builddir)/composer/libcomposer.la \ - $(top_builddir)/widgets/misc/libemiscwidgets.la \ $(top_builddir)/mail/libevolution-mail.la \ - $(top_builddir)/libevolution-utils/libevolution-utils.la \ $(EVOLUTION_DATA_SERVER_LIBS) \ $(GNOME_PLATFORM_LIBS) \ + $(CHAMPLAIN_LIBS) \ $(GTKHTML_LIBS) liborg_gnome_face_la_LDFLAGS = -module -avoid-version $(NO_UNDEFINED) diff --git a/plugins/face/face.c b/plugins/face/face.c index c9023dc69b..45d3d2ada9 100644 --- a/plugins/face/face.c +++ b/plugins/face/face.c @@ -29,9 +29,6 @@ #include <gtk/gtk.h> #include <glib/gi18n-lib.h> #include <mail/em-event.h> -#include <libevolution-utils/e-alert-dialog.h> -#include <e-util/e-util.h> -#include <e-util/e-icon-factory.h> #define d(x) diff --git a/plugins/mail-notification/Makefile.am b/plugins/mail-notification/Makefile.am index 042dcd0c9e..c04d64483b 100644 --- a/plugins/mail-notification/Makefile.am +++ b/plugins/mail-notification/Makefile.am @@ -14,11 +14,11 @@ plugin_LTLIBRARIES = liborg-gnome-mail-notification.la liborg_gnome_mail_notification_la_CPPFLAGS = \ $(AM_CPPFLAGS) \ -I$(top_srcdir) \ - -I$(top_srcdir)/widgets \ $(EVOLUTION_DATA_SERVER_CFLAGS) \ $(GNOME_PLATFORM_CFLAGS) \ $(LIBNOTIFY_CFLAGS) \ $(CANBERRA_CFLAGS) \ + $(CHAMPLAIN_CFLAGS) \ $(GTKHTML_CFLAGS) liborg_gnome_mail_notification_la_SOURCES = mail-notification.c @@ -29,12 +29,12 @@ liborg_gnome_mail_notification_la_LIBADD = \ $(top_builddir)/e-util/libeutil.la \ $(top_builddir)/mail/libevolution-mail.la \ $(top_builddir)/shell/libeshell.la \ - $(top_builddir)/libemail-utils/libemail-utils.la \ $(top_builddir)/libemail-engine/libemail-engine.la \ $(EVOLUTION_DATA_SERVER_LIBS) \ $(GNOME_PLATFORM_LIBS) \ $(LIBNOTIFY_LIBS) \ $(CANBERRA_LIBS) \ + $(CHAMPLAIN_LIBS) \ $(GTKHTML_LIBS) BUILT_SOURCES = $(plugin_DATA) diff --git a/plugins/mail-notification/mail-notification.c b/plugins/mail-notification/mail-notification.c index cc01d65c30..e0973d22fa 100644 --- a/plugins/mail-notification/mail-notification.c +++ b/plugins/mail-notification/mail-notification.c @@ -35,7 +35,6 @@ #include <time.h> -#include <e-util/e-config.h> #include <libemail-engine/e-mail-folder-utils.h> #include <mail/em-utils.h> #include <mail/em-event.h> diff --git a/plugins/mail-to-task/Makefile.am b/plugins/mail-to-task/Makefile.am index da78753556..a8bdfefd9e 100644 --- a/plugins/mail-to-task/Makefile.am +++ b/plugins/mail-to-task/Makefile.am @@ -7,9 +7,10 @@ plugin_LTLIBRARIES = liborg-gnome-mail-to-task.la liborg_gnome_mail_to_task_la_CPPFLAGS = \ $(AM_CPPFLAGS) \ -I$(top_srcdir) \ - -I$(top_srcdir)/widgets \ $(EVOLUTION_DATA_SERVER_CFLAGS) \ - $(GNOME_PLATFORM_CFLAGS) + $(GNOME_PLATFORM_CFLAGS) \ + $(CHAMPLAIN_CFLAGS) \ + $(GTKHTML_CFLAGS) liborg_gnome_mail_to_task_la_SOURCES = mail-to-task.c @@ -21,11 +22,11 @@ liborg_gnome_mail_to_task_la_LIBADD = \ $(top_builddir)/em-format/libemformat.la \ $(top_builddir)/calendar/gui/libevolution-calendar.la \ $(top_builddir)/mail/libevolution-mail.la \ - $(top_builddir)/widgets/misc/libemiscwidgets.la \ - $(top_builddir)/libemail-utils/libemail-utils.la \ $(top_builddir)/libemail-engine/libemail-engine.la \ $(EVOLUTION_DATA_SERVER_LIBS) \ - $(GNOME_PLATFORM_LIBS) + $(GNOME_PLATFORM_LIBS) \ + $(CHAMPLAIN_LIBS) \ + $(GTKHTML_LIBS) EXTRA_DIST = org-gnome-mail-to-task.eplug.xml diff --git a/plugins/mail-to-task/mail-to-task.c b/plugins/mail-to-task/mail-to-task.c index 042c2d3e7d..cf15d4056d 100644 --- a/plugins/mail-to-task/mail-to-task.c +++ b/plugins/mail-to-task/mail-to-task.c @@ -33,15 +33,9 @@ #include <glib/gi18n-lib.h> #include <libecal/libecal.h> -#include <libedataserverui/libedataserverui.h> #include <libemail-engine/e-mail-utils.h> -#include <e-util/e-dialog-utils.h> - -#include <misc/e-popup-action.h> -#include <misc/e-attachment-store.h> - #include <shell/e-shell-view.h> #include <shell/e-shell-window-actions.h> diff --git a/plugins/mailing-list-actions/Makefile.am b/plugins/mailing-list-actions/Makefile.am index ea1ce2ed26..f40cd9d2e6 100644 --- a/plugins/mailing-list-actions/Makefile.am +++ b/plugins/mailing-list-actions/Makefile.am @@ -6,10 +6,10 @@ plugin_LTLIBRARIES = liborg-gnome-mailing-list-actions.la liborg_gnome_mailing_list_actions_la_CPPFLAGS = \ $(AM_CPPFLAGS) \ -I$(top_srcdir) \ - -I$(top_srcdir)/widgets \ -I$(top_builddir)/composer \ $(EVOLUTION_DATA_SERVER_CFLAGS) \ $(GNOME_PLATFORM_CFLAGS) \ + $(CHAMPLAIN_CFLAGS) \ $(GTKHTML_CFLAGS) liborg_gnome_mailing_list_actions_la_SOURCES = mailing-list-actions.c @@ -22,10 +22,9 @@ liborg_gnome_mailing_list_actions_la_LIBADD = \ $(top_builddir)/mail/libevolution-mail.la \ $(top_builddir)/shell/libeshell.la \ $(top_builddir)/libemail-engine/libemail-engine.la \ - $(top_builddir)/libemail-utils/libemail-utils.la \ - $(top_builddir)/libevolution-utils/libevolution-utils.la \ $(EVOLUTION_DATA_SERVER_LIBS) \ $(GNOME_PLATFORM_LIBS) \ + $(CHAMPLAIN_LIBS) \ $(GTKHTML_LIBS) error_DATA = org-gnome-mailing-list-actions.error diff --git a/plugins/mailing-list-actions/mailing-list-actions.c b/plugins/mailing-list-actions/mailing-list-actions.c index fb6be6ba1d..c6a3cab235 100644 --- a/plugins/mailing-list-actions/mailing-list-actions.c +++ b/plugins/mailing-list-actions/mailing-list-actions.c @@ -30,7 +30,6 @@ #include <glib/gi18n-lib.h> #include <e-util/e-util.h> -#include <libevolution-utils/e-alert-dialog.h> #include <shell/e-shell-view.h> #include <shell/e-shell-window.h> @@ -38,7 +37,7 @@ #include <composer/e-msg-composer.h> -#include <libemail-utils/mail-mt.h> +#include <libemail-engine/mail-mt.h> #include <libemail-engine/mail-ops.h> #include <mail/e-mail-browser.h> diff --git a/plugins/mark-all-read/Makefile.am b/plugins/mark-all-read/Makefile.am index 4740bff5fb..2f1f34018e 100644 --- a/plugins/mark-all-read/Makefile.am +++ b/plugins/mark-all-read/Makefile.am @@ -7,9 +7,10 @@ plugin_LTLIBRARIES = liborg-gnome-mark-all-read.la liborg_gnome_mark_all_read_la_CPPFLAGS = \ $(AM_CPPFLAGS) \ -I$(top_srcdir) \ - -I$(top_srcdir)/widgets \ $(EVOLUTION_DATA_SERVER_CFLAGS) \ - $(GNOME_PLATFORM_CFLAGS) + $(GNOME_PLATFORM_CFLAGS) \ + $(CHAMPLAIN_CFLAGS) \ + $(GTKHTML_CFLAGS) liborg_gnome_mark_all_read_la_SOURCES = mark-all-read.c @@ -19,9 +20,10 @@ liborg_gnome_mark_all_read_la_LIBADD = \ $(top_builddir)/e-util/libeutil.la \ $(top_builddir)/mail/libevolution-mail.la \ $(top_builddir)/shell/libeshell.la \ - $(top_builddir)/libevolution-utils/libevolution-utils.la \ $(EVOLUTION_DATA_SERVER_LIBS) \ - $(GNOME_PLATFORM_LIBS) + $(GNOME_PLATFORM_LIBS) \ + $(CHAMPLAIN_LIBS) \ + $(GTKHTML_LIBS) EXTRA_DIST = org-gnome-mark-all-read.eplug.xml diff --git a/plugins/mark-all-read/mark-all-read.c b/plugins/mark-all-read/mark-all-read.c index 45969492c9..e4213fd324 100644 --- a/plugins/mark-all-read/mark-all-read.c +++ b/plugins/mark-all-read/mark-all-read.c @@ -28,7 +28,6 @@ #include <string.h> #include <gtk/gtk.h> #include <glib/gi18n.h> -#include <e-util/e-plugin-ui.h> #include <libemail-engine/e-mail-folder-utils.h> diff --git a/plugins/pst-import/Makefile.am b/plugins/pst-import/Makefile.am index b81e0d29c2..8d5d294e33 100644 --- a/plugins/pst-import/Makefile.am +++ b/plugins/pst-import/Makefile.am @@ -14,10 +14,11 @@ plugin_LTLIBRARIES = liborg-gnome-pst-import.la liborg_gnome_pst_import_la_CPPFLAGS = \ $(AM_CPPFLAGS) \ -I$(top_srcdir) \ - -I$(top_srcdir)/widgets \ -I$(top_builddir) \ $(EVOLUTION_DATA_SERVER_CFLAGS) \ $(GNOME_PLATFORM_CFLAGS) \ + $(CHAMPLAIN_CFLAGS) \ + $(GTKHTML_CFLAGS) \ $(LIBPST_CFLAGS) liborg_gnome_pst_import_la_SOURCES = pst-importer.c @@ -29,10 +30,10 @@ liborg_gnome_pst_import_la_LIBADD = \ $(top_builddir)/mail/libevolution-mail.la \ $(top_builddir)/e-util/libeutil.la \ $(top_builddir)/libemail-engine/libemail-engine.la \ - $(top_builddir)/libemail-utils/libemail-utils.la \ - $(top_builddir)/libevolution-utils/libevolution-utils.la \ $(EVOLUTION_DATA_SERVER_LIBS) \ $(GNOME_PLATFORM_LIBS) \ + $(CHAMPLAIN_LIBS) \ + $(GTKHTML_LIBS) \ $(LIBPST_LIBS) EXTRA_DIST = org-gnome-pst-import.eplug.xml diff --git a/plugins/pst-import/pst-importer.c b/plugins/pst-import/pst-importer.c index 768d1b17c0..eced3ba259 100644 --- a/plugins/pst-import/pst-importer.c +++ b/plugins/pst-import/pst-importer.c @@ -41,22 +41,19 @@ #include <gtk/gtk.h> #include <libecal/libecal.h> #include <libebook/libebook.h> -#include <libedataserverui/libedataserverui.h> -#include <e-util/e-import.h> -#include <e-util/e-plugin.h> - -#include <libemail-utils/mail-mt.h> +#include <libemail-engine/mail-mt.h> #include <libemail-engine/mail-tools.h> -#include <mail/e-mail-backend.h> -#include <mail/em-folder-selection-button.h> -#include <mail/em-utils.h> #include <shell/e-shell.h> #include <shell/e-shell-window.h> #include <shell/e-shell-view.h> #include <shell/e-shell-sidebar.h> +#include <mail/e-mail-backend.h> +#include <mail/em-folder-selection-button.h> +#include <mail/em-utils.h> + #include <libpst/libpst.h> #include <libpst/timeconv.h> diff --git a/plugins/publish-calendar/Makefile.am b/plugins/publish-calendar/Makefile.am index 2005866c4d..0786c40ac8 100644 --- a/plugins/publish-calendar/Makefile.am +++ b/plugins/publish-calendar/Makefile.am @@ -11,13 +11,14 @@ plugin_LTLIBRARIES = liborg-gnome-publish-calendar.la liborg_gnome_publish_calendar_la_CPPFLAGS = \ $(AM_CPPFLAGS) \ -I$(top_srcdir) \ - -I$(top_srcdir)/widgets \ -I$(top_builddir)/shell \ + -DEVOLUTION_PLUGINDIR="\"$(plugindir)\"" \ + -DEVOLUTION_UIDIR=\""$(uidir)"\" \ $(EVOLUTION_DATA_SERVER_CFLAGS) \ $(GNOME_PLATFORM_CFLAGS) \ - $(LIBNOTIFY_CFLAGS) \ - -DEVOLUTION_PLUGINDIR="\"$(plugindir)\"" \ - -DEVOLUTION_UIDIR=\""$(uidir)"\" + $(CHAMPLAIN_CFLAGS) \ + $(GTKHTML_CFLAGS) \ + $(LIBNOTIFY_CFLAGS) liborg_gnome_publish_calendar_la_SOURCES = \ publish-calendar.c \ @@ -36,9 +37,10 @@ liborg_gnome_publish_calendar_la_LIBADD = \ $(top_builddir)/e-util/libeutil.la \ $(top_builddir)/shell/libeshell.la \ $(top_builddir)/calendar/gui/libevolution-calendar.la \ - $(top_builddir)/libevolution-utils/libevolution-utils.la \ $(EVOLUTION_DATA_SERVER_LIBS) \ $(GNOME_PLATFORM_LIBS) \ + $(CHAMPLAIN_LIBS) \ + $(GTKHTML_LIBS) \ $(LIBNOTIFY_LIBS) EXTRA_DIST = \ diff --git a/plugins/publish-calendar/publish-calendar.c b/plugins/publish-calendar/publish-calendar.c index 7175050aff..00afe6be17 100644 --- a/plugins/publish-calendar/publish-calendar.c +++ b/plugins/publish-calendar/publish-calendar.c @@ -31,9 +31,6 @@ #include <calendar/gui/e-cal-config.h> #include <shell/es-event.h> -#include <e-util/e-util.h> -#include <e-util/e-util-private.h> -#include <e-util/e-dialog-utils.h> #include <shell/e-shell.h> #include <shell/e-shell-view.h> diff --git a/plugins/publish-calendar/publish-location.c b/plugins/publish-calendar/publish-location.c index 465fff103c..f84d589287 100644 --- a/plugins/publish-calendar/publish-location.c +++ b/plugins/publish-calendar/publish-location.c @@ -29,7 +29,8 @@ #include <string.h> #include <libxml/tree.h> -#include <libedataserverui/libedataserverui.h> + +#include "e-util/e-util.h" static EPublishUri * migrateURI (const gchar *xml, diff --git a/plugins/publish-calendar/url-editor-dialog.h b/plugins/publish-calendar/url-editor-dialog.h index 96fb154c6f..0f2217289e 100644 --- a/plugins/publish-calendar/url-editor-dialog.h +++ b/plugins/publish-calendar/url-editor-dialog.h @@ -24,7 +24,6 @@ #define URL_EDITOR_DIALOG_H #include <gtk/gtk.h> -#include <libedataserverui/libedataserverui.h> #include "publish-location.h" G_BEGIN_DECLS diff --git a/plugins/save-calendar/Makefile.am b/plugins/save-calendar/Makefile.am index b9bbc93e7c..7203ece4c1 100644 --- a/plugins/save-calendar/Makefile.am +++ b/plugins/save-calendar/Makefile.am @@ -7,9 +7,10 @@ plugin_LTLIBRARIES = liborg-gnome-save-calendar.la liborg_gnome_save_calendar_la_CPPFLAGS = \ $(AM_CPPFLAGS) \ -I$(top_srcdir) \ - -I$(top_srcdir)/widgets \ $(EVOLUTION_DATA_SERVER_CFLAGS) \ - $(GNOME_PLATFORM_CFLAGS) + $(GNOME_PLATFORM_CFLAGS) \ + $(CHAMPLAIN_CFLAGS) \ + $(GTKHTML_CFLAGS) liborg_gnome_save_calendar_la_SOURCES = \ save-calendar.c \ @@ -22,9 +23,10 @@ liborg_gnome_save_calendar_la_LDFLAGS = -module -avoid-version $(NO_UNDEFINED) liborg_gnome_save_calendar_la_LIBADD = \ $(top_builddir)/e-util/libeutil.la \ $(top_builddir)/shell/libeshell.la \ - $(top_builddir)/libevolution-utils/libevolution-utils.la \ $(EVOLUTION_DATA_SERVER_LIBS) \ - $(GNOME_PLATFORM_LIBS) + $(GNOME_PLATFORM_LIBS) \ + $(CHAMPLAIN_LIBS) \ + $(GTKHTML_LIBS) EXTRA_DIST = org-gnome-save-calendar.eplug.xml diff --git a/plugins/save-calendar/format-handler.h b/plugins/save-calendar/format-handler.h index 4a2dbab985..8381258b48 100644 --- a/plugins/save-calendar/format-handler.h +++ b/plugins/save-calendar/format-handler.h @@ -20,8 +20,10 @@ * */ +#include <gtk/gtk.h> #include <libecal/libecal.h> -#include <libedataserverui/libedataserverui.h> + +#include <e-util/e-util.h> typedef struct _FormatHandler FormatHandler; diff --git a/plugins/save-calendar/save-calendar.c b/plugins/save-calendar/save-calendar.c index 9e2c99754e..8e8ca93507 100644 --- a/plugins/save-calendar/save-calendar.c +++ b/plugins/save-calendar/save-calendar.c @@ -30,9 +30,6 @@ #include <string.h> #include <glib/gi18n.h> -#include <libevolution-utils/e-alert-dialog.h> -#include <e-util/e-plugin.h> - #include <shell/e-shell-sidebar.h> #include <shell/e-shell-view.h> #include <shell/e-shell-window.h> diff --git a/plugins/templates/Makefile.am b/plugins/templates/Makefile.am index d4a637d0c3..b20f11f242 100644 --- a/plugins/templates/Makefile.am +++ b/plugins/templates/Makefile.am @@ -7,11 +7,11 @@ plugin_LTLIBRARIES = liborg-gnome-templates.la liborg_gnome_templates_la_CPPFLAGS = \ $(AM_CPPFLAGS) \ -I$(top_srcdir) \ - -I$(top_srcdir)/widgets \ -I$(top_builddir) \ -I$(top_builddir)/composer \ $(EVOLUTION_DATA_SERVER_CFLAGS) \ $(GNOME_PLATFORM_CFLAGS) \ + $(CHAMPLAIN_CFLAGS) \ $(GTKHTML_CFLAGS) liborg_gnome_templates_la_SOURCES = templates.c @@ -24,9 +24,9 @@ liborg_gnome_templates_la_LIBADD = \ $(top_builddir)/shell/libeshell.la \ $(top_builddir)/mail/libevolution-mail.la \ $(top_builddir)/libemail-engine/libemail-engine.la \ - $(top_builddir)/libevolution-utils/libevolution-utils.la \ $(EVOLUTION_DATA_SERVER_LIBS) \ $(GNOME_PLATFORM_LIBS) \ + $(CHAMPLAIN_LIBS) \ $(GTKHTML_LIBS) EXTRA_DIST = org-gnome-templates.eplug.xml diff --git a/plugins/templates/templates.c b/plugins/templates/templates.c index 5416a8f8f9..e5c05259a6 100644 --- a/plugins/templates/templates.c +++ b/plugins/templates/templates.c @@ -30,11 +30,6 @@ #include <glib/gi18n.h> #include <string.h> -#include <libevolution-utils/e-alert-dialog.h> -#include <e-util/e-config.h> -#include <e-util/e-plugin.h> -#include <e-util/e-util.h> - #include <shell/e-shell-view.h> #include <libemail-engine/e-mail-session-utils.h> diff --git a/po/POTFILES.in b/po/POTFILES.in index cb65d2e8d8..bb98e793d8 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -196,16 +196,15 @@ filter/filter.error.xml libemail-engine/camel-null-store.c libemail-engine/e-mail-authenticator.c libemail-engine/e-mail-folder-utils.c -libemail-engine/e-mail-session.c libemail-engine/e-mail-session-utils.c +libemail-engine/e-mail-session.c libemail-engine/e-mail-store-utils.c libemail-engine/mail-config.c libemail-engine/mail-folder-cache.c +libemail-engine/mail-mt.c libemail-engine/mail-ops.c libemail-engine/mail-tools.c libemail-engine/mail-vfolder.c -libemail-utils/mail-mt.c -libevolution-utils/e-alert-dialog.c mail/e-mail-account-manager.c mail/e-mail-account-tree-view.c mail/e-mail-autoconfig.c diff --git a/shell/Makefile.am b/shell/Makefile.am index 8e21c7eca2..16f3626733 100644 --- a/shell/Makefile.am +++ b/shell/Makefile.am @@ -36,9 +36,6 @@ eshellinclude_HEADERS = \ libeshell_la_CPPFLAGS = \ $(AM_CPPFLAGS) \ $(NM_CPPFLAGS) \ - -I$(top_srcdir)/widgets \ - -I$(top_srcdir)/widgets/menus \ - -I$(top_srcdir)/widgets/misc \ -I$(top_srcdir) \ -I$(top_srcdir)/shell \ -I$(top_builddir) \ @@ -60,8 +57,8 @@ libeshell_la_CPPFLAGS = \ -DG_LOG_DOMAIN=\"evolution-shell\" \ $(EVOLUTION_DATA_SERVER_CFLAGS) \ $(GNOME_PLATFORM_CFLAGS) \ - $(EGG_SMCLIENT_CFLAGS) \ $(GTKHTML_CFLAGS) \ + $(CHAMPLAIN_CFLAGS) \ $(CLUTTER_GTK_CFLAGS) libeshell_la_SOURCES = \ @@ -92,14 +89,9 @@ libeshell_la_LDFLAGS = -avoid-version $(NO_UNDEFINED) libeshell_la_LIBADD = \ $(top_builddir)/e-util/libeutil.la \ - $(top_builddir)/filter/libfilter.la \ - $(top_builddir)/widgets/misc/libemiscwidgets.la \ - $(top_builddir)/widgets/menus/libmenus.la \ - $(top_builddir)/libemail-utils/libemail-utils.la \ - $(top_builddir)/libevolution-utils/libevolution-utils.la \ $(EVOLUTION_DATA_SERVER_LIBS) \ $(GNOME_PLATFORM_LIBS) \ - $(EGG_SMCLIENT_LIBS) \ + $(CHAMPLAIN_LIBS) \ $(CLUTTER_GTK_LIBS) # Evolution executable @@ -111,9 +103,6 @@ endif evolution_CPPFLAGS = \ $(AM_CPPFLAGS) \ $(NM_CPPFLAGS) \ - -I$(top_srcdir)/widgets \ - -I$(top_srcdir)/widgets/menus \ - -I$(top_srcdir)/widgets/misc \ -I$(top_srcdir) \ -I$(top_srcdir)/shell \ -DEVOLUTION_BINDIR=\""$(bindir)"\" \ @@ -134,7 +123,7 @@ evolution_CPPFLAGS = \ $(EVOLUTION_DATA_SERVER_CFLAGS) \ $(GNOME_PLATFORM_CFLAGS) \ $(GTKHTML_CFLAGS) \ - $(DBUS_GLIB_CFLAGS) \ + $(CHAMPLAIN_CFLAGS) \ $(CLUTTER_GTK_CFLAGS) evolution_SOURCES = \ @@ -143,16 +132,10 @@ evolution_SOURCES = \ evolution_LDADD = \ libeshell.la \ - $(top_builddir)/widgets/e-timezone-dialog/libetimezonedialog.la \ - $(top_builddir)/widgets/menus/libmenus.la \ - $(top_builddir)/widgets/misc/libemiscwidgets.la \ - $(top_builddir)/libemail-utils/libemail-utils.la \ $(top_builddir)/e-util/libeutil.la \ - $(top_builddir)/filter/libfilter.la \ - $(top_builddir)/libevolution-utils/libevolution-utils.la \ $(EVOLUTION_DATA_SERVER_LIBS) \ $(GNOME_PLATFORM_LIBS) \ - $(DBUS_GLIB_LIBS) \ + $(CHAMPLAIN_LIBS) \ $(CLUTTER_GTK_LIBS) \ $(EVOLUTIONICON) diff --git a/shell/e-convert-local-mail.c b/shell/e-convert-local-mail.c index 7e94ee7175..f7e9ac3eea 100644 --- a/shell/e-convert-local-mail.c +++ b/shell/e-convert-local-mail.c @@ -22,7 +22,6 @@ #include <camel/camel.h> #include <shell/e-shell.h> -#include <libevolution-utils/e-alert-dialog.h> /* Forward Declarations */ void e_convert_local_mail (EShell *shell); diff --git a/shell/e-shell-backend.c b/shell/e-shell-backend.c index 3310122cb5..d546bc7c1b 100644 --- a/shell/e-shell-backend.c +++ b/shell/e-shell-backend.c @@ -502,6 +502,24 @@ e_shell_backend_is_busy (EShellBackend *shell_backend) } /** + * e_shell_backend_get_prefer_new_item: + * @shell_backend: an #EShellBackend + * + * Returns: Name of a preferred item in New toolbar button, %NULL or + * an empty string for no preference. + * + * Since: 3.4 + **/ +const gchar * +e_shell_backend_get_prefer_new_item (EShellBackend *shell_backend) +{ + g_return_val_if_fail (shell_backend != NULL, NULL); + g_return_val_if_fail (E_IS_SHELL_BACKEND (shell_backend), NULL); + + return shell_backend->priv->prefer_new_item; +} + +/** * e_shell_backend_set_prefer_new_item: * @shell_backend: an #EShellBackend * @prefer_new_item: name of an item @@ -528,24 +546,6 @@ e_shell_backend_set_prefer_new_item (EShellBackend *shell_backend, } /** - * e_shell_backend_get_prefer_new_item: - * @shell_backend: an #EShellBackend - * - * Returns: Name of a preferred item in New toolbar button, %NULL or - * an empty string for no preference. - * - * Since: 3.4 - **/ -const gchar * -e_shell_backend_get_prefer_new_item (EShellBackend *shell_backend) -{ - g_return_val_if_fail (shell_backend != NULL, NULL); - g_return_val_if_fail (E_IS_SHELL_BACKEND (shell_backend), NULL); - - return shell_backend->priv->prefer_new_item; -} - -/** * e_shell_backend_cancel_all: * @shell_backend: an #EShellBackend * diff --git a/shell/e-shell-backend.h b/shell/e-shell-backend.h index cd8cf1416e..0a68d428ca 100644 --- a/shell/e-shell-backend.h +++ b/shell/e-shell-backend.h @@ -25,7 +25,7 @@ #include <libebackend/libebackend.h> #include <shell/e-shell-common.h> -#include <e-util/e-activity.h> +#include <e-util/e-util.h> /* Standard GObject macros */ #define E_TYPE_SHELL_BACKEND \ diff --git a/shell/e-shell-content.c b/shell/e-shell-content.c index fe35f66676..942e10bba6 100644 --- a/shell/e-shell-content.c +++ b/shell/e-shell-content.c @@ -34,13 +34,6 @@ #include <glib/gi18n.h> #include <libebackend/libebackend.h> -#include "e-util/e-util.h" -#include "libevolution-utils/e-alert-dialog.h" -#include "libevolution-utils/e-alert-sink.h" -#include "filter/e-rule-editor.h" -#include "widgets/misc/e-action-combo-box.h" -#include "widgets/misc/e-alert-bar.h" - #include "e-shell-backend.h" #include "e-shell-searchbar.h" #include "e-shell-view.h" diff --git a/shell/e-shell-migrate.c b/shell/e-shell-migrate.c index 6ebc58562f..22552daeba 100644 --- a/shell/e-shell-migrate.c +++ b/shell/e-shell-migrate.c @@ -33,10 +33,6 @@ #include <glib/gi18n.h> #include <glib/gstdio.h> -#include "libevolution-utils/e-alert-dialog.h" -#include "e-util/e-file-utils.h" -#include "e-util/e-util.h" - #include "es-event.h" #include "evo-version.h" diff --git a/shell/e-shell-searchbar.c b/shell/e-shell-searchbar.c index 46fbdf2963..b5d490df25 100644 --- a/shell/e-shell-searchbar.c +++ b/shell/e-shell-searchbar.c @@ -34,9 +34,6 @@ #include <glib/gi18n-lib.h> #include <libebackend/libebackend.h> -#include "e-util/e-util.h" -#include "widgets/misc/e-action-combo-box.h" - #include "e-shell-window-actions.h" #define E_SHELL_SEARCHBAR_GET_PRIVATE(obj) \ diff --git a/shell/e-shell-searchbar.h b/shell/e-shell-searchbar.h index 6c68e72d80..965cc972e2 100644 --- a/shell/e-shell-searchbar.h +++ b/shell/e-shell-searchbar.h @@ -24,7 +24,6 @@ #include <shell/e-shell-common.h> #include <shell/e-shell-view.h> -#include <misc/e-action-combo-box.h> /* Standard GObject macros */ #define E_TYPE_SHELL_SEARCHBAR \ diff --git a/shell/e-shell-sidebar.c b/shell/e-shell-sidebar.c index 95afe576b4..b75cd8d602 100644 --- a/shell/e-shell-sidebar.c +++ b/shell/e-shell-sidebar.c @@ -33,8 +33,6 @@ #include <libebackend/libebackend.h> -#include <libevolution-utils/e-alert-sink.h> -#include <e-util/e-unicode.h> #include <shell/e-shell-view.h> #define E_SHELL_SIDEBAR_GET_PRIVATE(obj) \ diff --git a/shell/e-shell-taskbar.c b/shell/e-shell-taskbar.c index 3a3d311f7d..9a0624ffc8 100644 --- a/shell/e-shell-taskbar.c +++ b/shell/e-shell-taskbar.c @@ -34,7 +34,6 @@ #include <libebackend/libebackend.h> #include <e-shell-view.h> -#include <misc/e-activity-proxy.h> #define E_SHELL_TASKBAR_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ diff --git a/shell/e-shell-utils.c b/shell/e-shell-utils.c index 1fd63a91e3..e790d5811a 100644 --- a/shell/e-shell-utils.c +++ b/shell/e-shell-utils.c @@ -35,8 +35,6 @@ #include <libedataserver/libedataserver.h> -#include "widgets/misc/e-import-assistant.h" - /** * e_shell_configure_ui_manager: * @shell: an #EShell diff --git a/shell/e-shell-utils.h b/shell/e-shell-utils.h index 897981e0d0..fb33c3c33b 100644 --- a/shell/e-shell-utils.h +++ b/shell/e-shell-utils.h @@ -23,8 +23,6 @@ #define E_SHELL_UTILS_H #include <shell/e-shell.h> -#include <misc/e-web-view.h> -#include <e-util/e-ui-manager.h> G_BEGIN_DECLS diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c index 16d09fcb2d..e6626666b3 100644 --- a/shell/e-shell-view.c +++ b/shell/e-shell-view.c @@ -35,14 +35,6 @@ #include <glib/gi18n.h> #include <libebackend/libebackend.h> -#include "e-util/e-file-utils.h" -#include "e-util/e-plugin-ui.h" -#include "e-util/e-source-util.h" -#include "e-util/e-ui-manager.h" -#include "e-util/e-util-private.h" -#include "e-util/e-util.h" -#include "filter/e-rule-context.h" - #include "e-shell-searchbar.h" #include "e-shell-window-actions.h" diff --git a/shell/e-shell-view.h b/shell/e-shell-view.h index fe2b63c5b2..6aea66f536 100644 --- a/shell/e-shell-view.h +++ b/shell/e-shell-view.h @@ -24,6 +24,8 @@ #include <libedataserver/libedataserver.h> +#include <e-util/e-util.h> + #include <shell/e-shell-common.h> #include <shell/e-shell-backend.h> #include <shell/e-shell-content.h> @@ -31,11 +33,6 @@ #include <shell/e-shell-taskbar.h> #include <shell/e-shell-window.h> -#include <filter/e-filter-rule.h> -#include <filter/e-rule-context.h> -#include <menus/gal-view-collection.h> -#include <menus/gal-view-instance.h> - /* Standard GObject macros */ #define E_TYPE_SHELL_VIEW \ (e_shell_view_get_type ()) diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c index cecc168345..a1d6649be3 100644 --- a/shell/e-shell-window-actions.c +++ b/shell/e-shell-window-actions.c @@ -24,13 +24,6 @@ #endif #include "e-shell-window-private.h" -#include "e-preferences-window.h" - -#include <e-util/e-dialog-utils.h> -#include <e-util/e-print.h> -#include <gal-define-views-dialog.h> - -#include <libedataserverui/libedataserverui.h> #define EVOLUTION_COPYRIGHT \ "Copyright \xC2\xA9 1999 - 2008 Novell, Inc. and Others\n" \ diff --git a/shell/e-shell-window-private.h b/shell/e-shell-window-private.h index 7a2a40cc3f..d69546c440 100644 --- a/shell/e-shell-window-private.h +++ b/shell/e-shell-window-private.h @@ -29,17 +29,6 @@ #include <libebackend/libebackend.h> -#include <e-util/e-util.h> -#include <e-util/e-util-private.h> -#include <libevolution-utils/e-alert-dialog.h> -#include <libevolution-utils/e-alert-sink.h> -#include <e-util/e-plugin-ui.h> -#include <widgets/misc/e-alert-bar.h> -#include <widgets/misc/e-import-assistant.h> -#include <widgets/misc/e-menu-tool-button.h> -#include <widgets/misc/e-online-button.h> -#include <widgets/misc/e-popup-action.h> - #include <e-shell.h> #include <e-shell-content.h> #include <e-shell-view.h> diff --git a/shell/e-shell-window.c b/shell/e-shell-window.c index 2202757bb1..3e9be0f845 100644 --- a/shell/e-shell-window.c +++ b/shell/e-shell-window.c @@ -1576,59 +1576,59 @@ e_shell_window_set_toolbar_visible (EShellWindow *shell_window, } /** - * e_shell_window_set_toolbar_new_prefer_item: + * e_shell_window_get_toolbar_new_prefer_item: * @shell_window: an #EShellWindow - * @prefer_item: prefer-item name to be set * - * Sets prefer item on the New button for current view. + * Returns: name of preferred item on the New button for current view. * * Since: 3.4 **/ -void -e_shell_window_set_toolbar_new_prefer_item (EShellWindow *shell_window, - const gchar *prefer_item) +const gchar * +e_shell_window_get_toolbar_new_prefer_item (EShellWindow *shell_window) { GtkWidget *toolbar; GtkToolItem *item; - g_return_if_fail (shell_window != NULL); - g_return_if_fail (E_IS_SHELL_WINDOW (shell_window)); + g_return_val_if_fail (shell_window != NULL, NULL); + g_return_val_if_fail (E_IS_SHELL_WINDOW (shell_window), NULL); toolbar = e_shell_window_get_managed_widget (shell_window, "/main-toolbar"); - g_return_if_fail (toolbar != NULL); + g_return_val_if_fail (toolbar != NULL, NULL); item = gtk_toolbar_get_nth_item (GTK_TOOLBAR (toolbar), 0); - g_return_if_fail (item != NULL); - g_return_if_fail (E_IS_MENU_TOOL_BUTTON (item)); + g_return_val_if_fail (item != NULL, NULL); + g_return_val_if_fail (E_IS_MENU_TOOL_BUTTON (item), NULL); - e_menu_tool_button_set_prefer_item (E_MENU_TOOL_BUTTON (item), prefer_item); + return e_menu_tool_button_get_prefer_item (E_MENU_TOOL_BUTTON (item)); } /** - * e_shell_window_get_toolbar_new_prefer_item: + * e_shell_window_set_toolbar_new_prefer_item: * @shell_window: an #EShellWindow + * @prefer_item: prefer-item name to be set * - * Returns: name of preferred item on the New button for current view. + * Sets prefer item on the New button for current view. * * Since: 3.4 **/ -const gchar * -e_shell_window_get_toolbar_new_prefer_item (EShellWindow *shell_window) +void +e_shell_window_set_toolbar_new_prefer_item (EShellWindow *shell_window, + const gchar *prefer_item) { GtkWidget *toolbar; GtkToolItem *item; - g_return_val_if_fail (shell_window != NULL, NULL); - g_return_val_if_fail (E_IS_SHELL_WINDOW (shell_window), NULL); + g_return_if_fail (shell_window != NULL); + g_return_if_fail (E_IS_SHELL_WINDOW (shell_window)); toolbar = e_shell_window_get_managed_widget (shell_window, "/main-toolbar"); - g_return_val_if_fail (toolbar != NULL, NULL); + g_return_if_fail (toolbar != NULL); item = gtk_toolbar_get_nth_item (GTK_TOOLBAR (toolbar), 0); - g_return_val_if_fail (item != NULL, NULL); - g_return_val_if_fail (E_IS_MENU_TOOL_BUTTON (item), NULL); + g_return_if_fail (item != NULL); + g_return_if_fail (E_IS_MENU_TOOL_BUTTON (item)); - return e_menu_tool_button_get_prefer_item (E_MENU_TOOL_BUTTON (item)); + e_menu_tool_button_set_prefer_item (E_MENU_TOOL_BUTTON (item), prefer_item); } /** diff --git a/shell/e-shell-window.h b/shell/e-shell-window.h index 366a2186c1..abd940feb0 100644 --- a/shell/e-shell-window.h +++ b/shell/e-shell-window.h @@ -23,7 +23,6 @@ #define E_SHELL_WINDOW_H #include <shell/e-shell.h> -#include <misc/e-focus-tracker.h> /* Standard GObject macros */ #define E_TYPE_SHELL_WINDOW \ @@ -135,11 +134,11 @@ gboolean e_shell_window_get_toolbar_visible void e_shell_window_set_toolbar_visible (EShellWindow *shell_window, gboolean toolbar_visible); +const gchar * e_shell_window_get_toolbar_new_prefer_item + (EShellWindow *shell_window); void e_shell_window_set_toolbar_new_prefer_item (EShellWindow *shell_window, const gchar *prefer_item); -const gchar * e_shell_window_get_toolbar_new_prefer_item - (EShellWindow *shell_window); /* These should be called from the shell backend's window_created() handler. */ diff --git a/shell/e-shell.c b/shell/e-shell.c index b96cbb9a29..f938f45e73 100644 --- a/shell/e-shell.c +++ b/shell/e-shell.c @@ -33,11 +33,8 @@ #include <glib/gi18n.h> #include <libebackend/libebackend.h> -#include <libedataserverui/libedataserverui.h> -#include "e-util/e-util.h" #include "e-util/e-util-private.h" -#include "widgets/misc/e-preferences-window.h" #include "e-shell-backend.h" #include "e-shell-enumtypes.h" diff --git a/shell/e-shell.h b/shell/e-shell.h index 4dcd7e7921..84bb9f2d5c 100644 --- a/shell/e-shell.h +++ b/shell/e-shell.h @@ -24,8 +24,7 @@ #include <libedataserver/libedataserver.h> -#include <e-util/e-activity.h> -#include <libevolution-utils/e-alert.h> +#include <e-util/e-util.h> #include <shell/e-shell-common.h> #include <shell/e-shell-backend.h> diff --git a/shell/es-event.h b/shell/es-event.h index eba3f3d6b6..67ff1b4b87 100644 --- a/shell/es-event.h +++ b/shell/es-event.h @@ -24,7 +24,7 @@ #ifndef __ES_EVENT_H__ #define __ES_EVENT_H__ -#include "e-util/e-event.h" +#include <e-util/e-util.h> G_BEGIN_DECLS diff --git a/shell/main.c b/shell/main.c index 0869ef6f05..d4e65b1a9c 100644 --- a/shell/main.c +++ b/shell/main.c @@ -55,8 +55,6 @@ #include <libxml/parser.h> #include <libxml/tree.h> -#include <libedataserverui/libedataserverui.h> - #include <webkit/webkit.h> #include "e-shell.h" @@ -64,12 +62,6 @@ #include "e-shell-meego.h" #include "es-event.h" -#include "e-util/e-dialog-utils.h" -#include "e-util/e-import.h" -#include "e-util/e-plugin.h" -#include "e-util/e-plugin-ui.h" -#include "e-util/e-util-private.h" -#include "e-util/e-util.h" #ifdef G_OS_WIN32 #include "e-util/e-win32-defaults.h" #endif diff --git a/smime/gui/Makefile.am b/smime/gui/Makefile.am index d4e04f230b..d346bf5594 100644 --- a/smime/gui/Makefile.am +++ b/smime/gui/Makefile.am @@ -9,8 +9,6 @@ libevolution_smime_la_CPPFLAGS = \ -I$(top_builddir)/smime/lib \ -I$(top_srcdir)/shell \ -I$(top_builddir)/shell \ - -I$(top_srcdir)/widgets \ - -I$(top_builddir)/widgets \ -DEVOLUTION_DATADIR=\""$(datadir)"\" \ -DEVOLUTION_ETSPECDIR=\""$(etspecdir)"\" \ -DEVOLUTION_IMAGESDIR=\""$(imagesdir)"\" \ @@ -19,6 +17,8 @@ libevolution_smime_la_CPPFLAGS = \ -DPREFIX=\""$(prefix)"\" \ $(EVOLUTION_DATA_SERVER_CFLAGS) \ $(GNOME_PLATFORM_CFLAGS) \ + $(CHAMPLAIN_CFLAGS) \ + $(GTKHTML_CFLAGS) \ $(CERT_UI_CFLAGS) libevolution_smime_la_SOURCES = \ @@ -40,10 +40,10 @@ libevolution_smime_la_LIBADD = \ $(top_builddir)/e-util/libeutil.la \ $(top_builddir)/shell/libeshell.la \ $(top_builddir)/smime/lib/libessmime.la \ - $(top_builddir)/widgets/misc/libemiscwidgets.la \ - $(top_builddir)/libevolution-utils/libevolution-utils.la \ $(EVOLUTION_DATA_SERVER_LIBS) \ $(GNOME_PLATFORM_LIBS) \ + $(CHAMPLAIN_LIBS) \ + $(GTKHTML_LIBS) \ $(CERT_UI_LIBS) libevolution_smime_la_LDFLAGS = -avoid-version $(NO_UNDEFINED) diff --git a/smime/gui/certificate-manager.c b/smime/gui/certificate-manager.c index 109bbba515..55f951e4f9 100644 --- a/smime/gui/certificate-manager.c +++ b/smime/gui/certificate-manager.c @@ -46,10 +46,6 @@ #include <pk11func.h> #include "shell/e-shell.h" -#include "e-util/e-dialog-utils.h" -#include "e-util/e-util.h" -#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 \ diff --git a/smime/gui/certificate-manager.h b/smime/gui/certificate-manager.h index 0f74d30694..0b873f81da 100644 --- a/smime/gui/certificate-manager.h +++ b/smime/gui/certificate-manager.h @@ -25,7 +25,6 @@ #include <gtk/gtk.h> #include <shell/e-shell.h> -#include <widgets/misc/e-preferences-window.h> /* Standard GObject macros */ #define E_TYPE_CERT_MANAGER_CONFIG \ diff --git a/smime/gui/component.c b/smime/gui/component.c index bf172194c1..576d890955 100644 --- a/smime/gui/component.c +++ b/smime/gui/component.c @@ -29,7 +29,8 @@ #include <gtk/gtk.h> #include <glib/gi18n.h> -#include <libedataserverui/libedataserverui.h> + +#include "e-util/e-util.h" #include "ca-trust-dialog.h" #include "e-cert-db.h" diff --git a/smime/lib/Makefile.am b/smime/lib/Makefile.am index 5ef47070d4..ed052bfca9 100644 --- a/smime/lib/Makefile.am +++ b/smime/lib/Makefile.am @@ -14,6 +14,8 @@ libessmime_la_CPPFLAGS = \ -DPREFIX=\""$(prefix)"\" \ $(EVOLUTION_DATA_SERVER_CFLAGS) \ $(GNOME_PLATFORM_CFLAGS) \ + $(CHAMPLAIN_CFLAGS) \ + $(GTKHTML_CFLAGS) \ $(CERT_UI_CFLAGS) libessmime_la_SOURCES = \ @@ -29,10 +31,11 @@ libessmime_la_SOURCES = \ e-pkcs12.h libessmime_la_LIBADD = \ - $(top_builddir)/libemail-utils/libemail-utils.la \ $(top_builddir)/e-util/libeutil.la \ $(EVOLUTION_DATA_SERVER_LIBS) \ $(GNOME_PLATFORM_LIBS) \ + $(CHAMPLAIN_LIBS) \ + $(GTKHTML_LIBS) \ $(CERT_UI_LIBS) libessmime_la_LDFLAGS = -avoid-version $(NO_UNDEFINED) diff --git a/smime/lib/e-cert-db.c b/smime/lib/e-cert-db.c index a98d085c43..1a5803fda1 100644 --- a/smime/lib/e-cert-db.c +++ b/smime/lib/e-cert-db.c @@ -48,9 +48,7 @@ #include <glib/gi18n.h> #include <glib/gstdio.h> -#include <camel/camel.h> /* FIXME: this is where camel_init is defined; it shouldn't include everything else */ - -#include <libedataserverui/libedataserverui.h> +#include <camel/camel.h> /* private NSS defines used by PSM */ /* (must be declated before cert.h) */ diff --git a/smime/lib/e-pkcs12.c b/smime/lib/e-pkcs12.c index fa61033151..eef6acd32f 100644 --- a/smime/lib/e-pkcs12.c +++ b/smime/lib/e-pkcs12.c @@ -51,7 +51,7 @@ #include <fcntl.h> #include <unistd.h> -#include <libedataserverui/libedataserverui.h> +#include "e-util/e-util.h" #include "e-cert-db.h" #include "e-pkcs12.h" diff --git a/widgets/LICENSE b/widgets/LICENSE deleted file mode 100644 index b1f6ae08a4..0000000000 --- a/widgets/LICENSE +++ /dev/null @@ -1 +0,0 @@ -This code is released under the terms of the GNU GPL. diff --git a/widgets/Makefile.am b/widgets/Makefile.am deleted file mode 100644 index 137446c00e..0000000000 --- a/widgets/Makefile.am +++ /dev/null @@ -1,9 +0,0 @@ - -SUBDIRS = \ - misc \ - text \ - e-timezone-dialog \ - table \ - menus - --include $(top_srcdir)/git.mk diff --git a/widgets/e-timezone-dialog/Makefile.am b/widgets/e-timezone-dialog/Makefile.am deleted file mode 100644 index 4ae74a24f5..0000000000 --- a/widgets/e-timezone-dialog/Makefile.am +++ /dev/null @@ -1,29 +0,0 @@ -privsolib_LTLIBRARIES = libetimezonedialog.la - -libetimezonedialog_la_CPPFLAGS = \ - $(AM_CPPFLAGS) \ - -I$(top_srcdir) \ - -I$(top_srcdir)/widgets \ - -DEVOLUTION_UIDIR=\""$(uidir)"\" \ - -DG_LOG_DOMAIN=__FILE__ \ - $(EVOLUTION_DATA_SERVER_CFLAGS) \ - $(GNOME_PLATFORM_CFLAGS) - -libetimezonedialog_la_SOURCES = \ - e-timezone-dialog.c \ - e-timezone-dialog.h - -libetimezonedialog_la_LDFLAGS = -avoid-version $(NO_UNDEFINED) - -libetimezonedialog_la_LIBADD = \ - $(top_builddir)/widgets/misc/libemiscwidgets.la \ - $(top_builddir)/e-util/libeutil.la \ - $(top_builddir)/libevolution-utils/libevolution-utils.la \ - $(EVOLUTION_DATA_SERVER_LIBS) \ - $(GNOME_PLATFORM_LIBS) - -ui_DATA = e-timezone-dialog.ui - -EXTRA_DIST = $(ui_DATA) - --include $(top_srcdir)/git.mk diff --git a/widgets/menus/Makefile.am b/widgets/menus/Makefile.am deleted file mode 100644 index aa3bb75b73..0000000000 --- a/widgets/menus/Makefile.am +++ /dev/null @@ -1,58 +0,0 @@ -privsolib_LTLIBRARIES = libmenus.la - -libmenus_la_CPPFLAGS = \ - $(AM_CPPFLAGS) \ - -I$(top_srcdir) \ - -I$(top_srcdir)/widgets \ - -DEVOLUTION_UIDIR=\""$(uidir)"\" \ - -DG_LOG_DOMAIN=\"menus\" \ - $(EVOLUTION_DATA_SERVER_CFLAGS) \ - $(GNOME_PLATFORM_CFLAGS) - -libmenus_la_SOURCES = \ - gal-define-views-dialog.c \ - gal-define-views-model.c \ - gal-view-collection.c \ - gal-view-etable.c \ - gal-view-factory-etable.c \ - gal-view-factory.c \ - gal-view-instance-save-as-dialog.c \ - gal-view-instance.c \ - gal-view-new-dialog.c \ - gal-view.c - -ui_DATA = \ - gal-define-views.ui \ - gal-view-new-dialog.ui \ - gal-view-instance-save-as-dialog.ui - -libmenusincludedir = $(privincludedir)/menus - -libmenusinclude_HEADERS = \ - gal-define-views-dialog.h \ - gal-define-views-model.h \ - gal-view-collection.h \ - gal-view-etable.h \ - gal-view-factory-etable.h \ - gal-view-factory.h \ - gal-view-instance-save-as-dialog.h \ - gal-view-instance.h \ - gal-view-new-dialog.h \ - gal-view.h - -libmenus_la_LDFLAGS = -avoid-version $(NO_UNDEFINED) - -libmenus_la_LIBADD = \ - $(top_builddir)/e-util/libeutil.la \ - $(top_builddir)/widgets/table/libetable.la \ - $(top_builddir)/widgets/misc/libemiscwidgets.la \ - $(top_builddir)/libevolution-utils/libevolution-utils.la \ - $(EVOLUTION_DATA_SERVER_LIBS) \ - $(GNOME_PLATFORM_LIBS) - -icons = -EXTRA_DIST = \ - $(icons) \ - $(ui_DATA) - --include $(top_srcdir)/git.mk diff --git a/widgets/misc/Makefile.am b/widgets/misc/Makefile.am deleted file mode 100644 index 4f4a5a17b1..0000000000 --- a/widgets/misc/Makefile.am +++ /dev/null @@ -1,289 +0,0 @@ -privsolib_LTLIBRARIES = libemiscwidgets.la - -widgetsincludedir = $(privincludedir)/misc - -ui_DATA = e-send-options.ui - -widgetsinclude_HEADERS = \ - e-action-combo-box.h \ - e-activity-bar.h \ - e-activity-proxy.h \ - e-alarm-selector.h \ - e-alert-bar.h \ - e-attachment.h \ - e-attachment-bar.h \ - e-attachment-button.h \ - e-attachment-dialog.h \ - e-attachment-handler.h \ - e-attachment-handler-image.h \ - e-attachment-handler-sendto.h \ - e-attachment-icon-view.h \ - e-attachment-paned.h \ - e-attachment-store.h \ - e-attachment-tree-view.h \ - e-attachment-view.h \ - e-auth-combo-box.h \ - e-autocomplete-selector.h \ - e-book-source-config.h \ - e-buffer-tagger.h \ - e-cal-source-config.h \ - e-calendar.h \ - e-calendar-item.h \ - e-canvas.h \ - e-canvas-background.h \ - e-canvas-utils.h \ - e-canvas-vbox.h \ - e-charset-combo-box.h \ - e-contact-map.h \ - e-contact-map-window.h \ - e-contact-marker.h \ - e-dateedit.h \ - e-focus-tracker.h \ - e-image-chooser.h \ - e-import-assistant.h \ - e-interval-chooser.h \ - e-mail-identity-combo-box.h \ - e-mail-signature-combo-box.h \ - e-mail-signature-editor.h \ - e-mail-signature-manager.h \ - e-mail-signature-preview.h \ - e-mail-signature-script-dialog.h \ - e-mail-signature-tree-view.h \ - e-map.h \ - e-menu-tool-action.h \ - e-menu-tool-button.h \ - e-online-button.h \ - e-paned.h \ - e-picture-gallery.h \ - e-popup-action.h \ - e-port-entry.h \ - e-preferences-window.h \ - e-preview-pane.h \ - e-printable.h \ - e-search-bar.h \ - e-selectable.h \ - e-selection-model.h \ - e-selection-model-array.h \ - e-selection-model-simple.h \ - e-send-options.h \ - e-source-config.h \ - e-source-config-backend.h \ - e-source-config-dialog.h \ - e-spell-entry.h \ - e-url-entry.h \ - e-web-view.h \ - e-web-view-gtkhtml.h \ - e-web-view-preview.h \ - ea-calendar-cell.h \ - ea-calendar-item.h \ - ea-cell-table.h \ - ea-widgets.h - -libemiscwidgets_la_CPPFLAGS = \ - $(AM_CPPFLAGS) \ - -I$(top_srcdir) \ - -I$(top_srcdir)/filter \ - -I$(top_srcdir)/widgets \ - -DEVOLUTION_IMAGESDIR=\""$(imagesdir)"\" \ - -DEVOLUTION_UIDIR=\""$(uidir)"\" \ - -DEVOLUTION_PRIVDATADIR=\""$(privdatadir)"\" \ - -DG_LOG_DOMAIN=__FILE__ \ - $(EVOLUTION_DATA_SERVER_CFLAGS) \ - $(GNOME_PLATFORM_CFLAGS) \ - $(GTKHTML_CFLAGS) \ - $(CHAMPLAIN_CFLAGS) \ - $(GEO_CFLAGS) \ - $(CLUTTER_CFLAGS) - -libemiscwidgets_la_SOURCES = \ - $(widgetsinclude_HEADERS) \ - e-action-combo-box.c \ - e-activity-bar.c \ - e-activity-proxy.c \ - e-alarm-selector.c \ - e-alert-bar.c \ - e-attachment.c \ - e-attachment-bar.c \ - e-attachment-button.c \ - e-attachment-dialog.c \ - e-attachment-handler.c \ - e-attachment-handler-image.c \ - e-attachment-handler-sendto.c \ - e-attachment-icon-view.c \ - e-attachment-paned.c \ - e-attachment-store.c \ - e-attachment-tree-view.c \ - e-attachment-view.c \ - e-auth-combo-box.c \ - e-autocomplete-selector.c \ - e-book-source-config.c \ - e-buffer-tagger.c \ - e-cal-source-config.c \ - e-calendar.c \ - e-calendar-item.c \ - e-canvas.c \ - e-canvas-background.c \ - e-canvas-utils.c \ - e-canvas-vbox.c \ - e-charset-combo-box.c \ - e-contact-map.c \ - e-contact-map-window.c \ - e-contact-marker.c \ - e-dateedit.c \ - e-focus-tracker.c \ - e-image-chooser.c \ - e-import-assistant.c \ - e-interval-chooser.c \ - e-mail-identity-combo-box.c \ - e-mail-signature-combo-box.c \ - e-mail-signature-editor.c \ - e-mail-signature-manager.c \ - e-mail-signature-preview.c \ - e-mail-signature-script-dialog.c \ - e-mail-signature-tree-view.c \ - e-map.c \ - e-menu-tool-action.c \ - e-menu-tool-button.c \ - e-online-button.c \ - e-paned.c \ - e-picture-gallery.c \ - e-popup-action.c \ - e-port-entry.c \ - e-preferences-window.c \ - e-preview-pane.c \ - e-printable.c \ - e-search-bar.c \ - e-selectable.c \ - e-selection-model.c \ - e-selection-model-array.c \ - e-selection-model-simple.c \ - e-send-options.c \ - e-source-config.c \ - e-source-config-backend.c \ - e-source-config-dialog.c \ - e-spell-entry.c \ - e-url-entry.c \ - e-web-view.c \ - e-web-view-gtkhtml.c \ - e-web-view-preview.c \ - ea-calendar-cell.c \ - ea-calendar-item.c \ - ea-cell-table.c \ - ea-widgets.c - -libemiscwidgets_la_LDFLAGS = -avoid-version $(NO_UNDEFINED) - -libemiscwidgets_la_LIBADD = \ - $(top_builddir)/e-util/libeutil.la \ - $(top_builddir)/filter/libfilter.la \ - $(top_builddir)/a11y/libevolution-a11y.la \ - $(top_builddir)/libgnomecanvas/libgnomecanvas.la \ - $(top_builddir)/libemail-utils/libemail-utils.la \ - $(top_builddir)/libevolution-utils/libevolution-utils.la \ - $(EVOLUTION_DATA_SERVER_LIBS) \ - $(GNOME_PLATFORM_LIBS) \ - $(MATH_LIB) \ - $(ICONV_LIBS) \ - $(CHAMPLAIN_LIBS) \ - $(GEO_LIBS) \ - $(CLUTTER_LIBS) \ - $(GTKHTML_LIBS) - -error_DATA = widgets.error -errordir = $(privdatadir)/errors -# provides error rules too -@EVO_PLUGIN_RULE@ - -noinst_PROGRAMS = \ - test-calendar \ - test-dateedit \ - test-mail-signatures \ - test-preferences-window \ - test-source-config - -test_widgets_misc_CPPFLAGS= \ - $(AM_CPPFLAGS) \ - -I$(top_srcdir) \ - -I$(top_srcdir)/filter \ - -I$(top_srcdir)/widgets \ - -DEVOLUTION_IMAGESDIR=\""$(imagesdir)"\" \ - -DG_LOG_DOMAIN=__FILE__ \ - $(EVOLUTION_DATA_SERVER_CFLAGS) \ - $(GNOME_PLATFORM_CFLAGS) - -# test-calendar - -test_calendar_CPPFLAGS = $(test_widgets_misc_CPPFLAGS) - -test_calendar_SOURCES = test-calendar.c - -test_calendar_LDADD = \ - libemiscwidgets.la \ - $(top_builddir)/e-util/libeutil.la \ - $(top_builddir)/filter/libfilter.la \ - $(EVOLUTION_DATA_SERVER_LIBS) \ - $(GNOME_PLATFORM_LIBS) - -# test-dateedit - -test_dateedit_CPPFLAGS = $(test_widgets_misc_CPPFLAGS) - -test_dateedit_SOURCES = test-dateedit.c - -test_dateedit_LDADD = \ - libemiscwidgets.la \ - $(top_builddir)/e-util/libeutil.la \ - $(top_builddir)/filter/libfilter.la \ - $(EVOLUTION_DATA_SERVER_LIBS) \ - $(GNOME_PLATFORM_LIBS) - -# test-mail-signatures - -test_mail_signatures_CPPFLAGS = \ - $(test_widgets_misc_CPPFLAGS) \ - $(GTKHTML_CFLAGS) - -test_mail_signatures_SOURCES = test-mail-signatures.c - -test_mail_signatures_LDADD = \ - libemiscwidgets.la \ - $(top_builddir)/e-util/libeutil.la \ - $(top_builddir)/filter/libfilter.la \ - $(top_builddir)/libevolution-utils/libevolution-utils.la \ - $(EVOLUTION_DATA_SERVER_LIBS) \ - $(GNOME_PLATFORM_LIBS) \ - $(GTKHTML_LIBS) - -# test-preferences-window - -test_preferences_window_CPPFLAGS = $(test_widgets_misc_CPPFLAGS) - -test_preferences_window_SOURCES = test-preferences-window.c - -test_preferences_window_LDADD = \ - libemiscwidgets.la \ - $(top_builddir)/e-util/libeutil.la \ - $(top_builddir)/filter/libfilter.la \ - $(EVOLUTION_DATA_SERVER_LIBS) \ - $(GNOME_PLATFORM_LIBS) - -# test-source-config - -test_source_config_CPPFLAGS = $(test_widgets_misc_CPPFLAGS) - -test_source_config_SOURCES = test-source-config.c - -test_source_config_LDADD = \ - libemiscwidgets.la \ - $(top_builddir)/e-util/libeutil.la \ - $(top_builddir)/filter/libfilter.la \ - $(EVOLUTION_DATA_SERVER_LIBS) \ - $(GNOME_PLATFORM_LIBS) - -BUILT_SOURCES = $(error_DATA) - -CLEANFILES = $(BUILT_SOURCES) - -EXTRA_DIST = $(ui_DATA) widgets.error.xml - --include $(top_srcdir)/git.mk diff --git a/widgets/misc/e-canvas-background.h b/widgets/misc/e-canvas-background.h deleted file mode 100644 index 3c07770701..0000000000 --- a/widgets/misc/e-canvas-background.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * e-canvas-background.h - background color for canvas. - * - * 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: - * Chris Lahey <clahey@ximian.com> - * - * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) - * - */ - -#ifndef E_CANVAS_BACKGROUND_H -#define E_CANVAS_BACKGROUND_H - -#include <libgnomecanvas/gnome-canvas.h> - -G_BEGIN_DECLS - -/* - * name type read/write description - * ------------------------------------------------------------------------------------------ - * fill_color string W X color specification for fill color, - * or NULL pointer for no color (transparent) - * fill_color_gdk GdkColor* RW Allocated GdkColor for fill - * x1 gdouble RW Coordinates for edges of background rectangle - * x2 gdouble RW Default is all of them = -1. - * y1 gdouble RW Which means that the entire space is shown. - * y2 gdouble RW If you need the rectangle to have negative coordinates, use an affine. - */ - -#define E_CANVAS_BACKGROUND_TYPE (e_canvas_background_get_type ()) -#define E_CANVAS_BACKGROUND(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_CANVAS_BACKGROUND_TYPE, ECanvasBackground)) -#define E_CANVAS_BACKGROUND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_CANVAS_BACKGROUND_TYPE, ECanvasBackgroundClass)) -#define E_IS_CANVAS_BACKGROUND(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_CANVAS_BACKGROUND_TYPE)) -#define E_IS_CANVAS_BACKGROUND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), E_CANVAS_BACKGROUND_TYPE)) - -typedef struct _ECanvasBackground ECanvasBackground; -typedef struct _ECanvasBackgroundClass ECanvasBackgroundClass; -typedef struct _ECanvasBackgroundPrivate ECanvasBackgroundPrivate; - -struct _ECanvasBackground { - GnomeCanvasItem item; - - ECanvasBackgroundPrivate *priv; -}; - -struct _ECanvasBackgroundClass { - GnomeCanvasItemClass parent_class; - void (*style_set) (ECanvasBackground *eti, GtkStyle *previous_style); -}; - -/* Standard Gtk function */ -GType e_canvas_background_get_type (void); - -G_END_DECLS - -#endif diff --git a/widgets/misc/e-canvas-vbox.h b/widgets/misc/e-canvas-vbox.h deleted file mode 100644 index 7f0110ce9e..0000000000 --- a/widgets/misc/e-canvas-vbox.h +++ /dev/null @@ -1,85 +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: - * Chris Lahey <clahey@ximian.com> - * - * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) - * - */ - -#ifndef __E_CANVAS_VBOX_H__ -#define __E_CANVAS_VBOX_H__ - -#include <gtk/gtk.h> -#include <libgnomecanvas/gnome-canvas.h> - -G_BEGIN_DECLS - -/* ECanvasVbox - A canvas item container. - * - * The following arguments are available: - * - * name type read/write description - * -------------------------------------------------------------------------------- - * width gdouble RW width of the CanvasVbox - * height gdouble R height of the CanvasVbox - * spacing gdouble RW Spacing between items. - */ - -#define E_CANVAS_VBOX_TYPE (e_canvas_vbox_get_type ()) -#define E_CANVAS_VBOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_CANVAS_VBOX_TYPE, ECanvasVbox)) -#define E_CANVAS_VBOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_CANVAS_VBOX_TYPE, ECanvasVboxClass)) -#define E_IS_CANVAS_VBOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_CANVAS_VBOX_TYPE)) -#define E_IS_CANVAS_VBOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), E_CANVAS_VBOX_TYPE)) - -typedef struct _ECanvasVbox ECanvasVbox; -typedef struct _ECanvasVboxClass ECanvasVboxClass; - -struct _ECanvasVbox -{ - GnomeCanvasGroup parent; - - /* item specific fields */ - GList *items; /* Of type GnomeCanvasItem */ - - gdouble width; - gdouble minimum_width; - gdouble height; - gdouble spacing; -}; - -struct _ECanvasVboxClass -{ - GnomeCanvasGroupClass parent_class; - - /* Virtual methods. */ - void (* add_item) (ECanvasVbox *CanvasVbox, GnomeCanvasItem *item); - void (* add_item_start) (ECanvasVbox *CanvasVbox, GnomeCanvasItem *item); -}; - -/* - * To be added to a CanvasVbox, an item must have the argument "width" as - * a Read/Write argument and "height" as a Read Only argument. It - * should also do an ECanvas parent CanvasVbox request if its size - * changes. - */ -void e_canvas_vbox_add_item (ECanvasVbox *e_canvas_vbox, GnomeCanvasItem *item); -void e_canvas_vbox_add_item_start (ECanvasVbox *e_canvas_vbox, GnomeCanvasItem *item); -GType e_canvas_vbox_get_type (void); - -G_END_DECLS - -#endif /* __E_CANVAS_VBOX_H__ */ diff --git a/widgets/table/Makefile.am b/widgets/table/Makefile.am deleted file mode 100644 index 216a9fee98..0000000000 --- a/widgets/table/Makefile.am +++ /dev/null @@ -1,193 +0,0 @@ -ui_DATA = \ - e-table-config.ui - -privsolib_LTLIBRARIES = libetable.la - -libetable_la_CPPFLAGS = \ - $(AM_CPPFLAGS) \ - -I$(top_srcdir) \ - -I$(top_srcdir)/widgets \ - $(EVOLUTION_DATA_SERVER_CFLAGS) \ - $(GNOME_PLATFORM_CFLAGS) \ - -DEVOLUTION_UIDIR=\"$(uidir)\" \ - -DG_LOG_DOMAIN=\"e-table\" - -libetable_la_SOURCES = \ - e-cell.c \ - e-cell-checkbox.c \ - e-cell-combo.c \ - e-cell-date.c \ - e-cell-date-edit.c \ - e-cell-number.c \ - e-cell-percent.c \ - e-cell-pixbuf.c \ - e-cell-popup.c \ - e-cell-size.c \ - e-cell-text.c \ - e-cell-toggle.c \ - e-cell-tree.c \ - e-cell-vbox.c \ - e-cell-hbox.c \ - e-popup-menu.c \ - e-table-click-to-add.c \ - e-table-col.c \ - e-table-column-specification.c \ - e-table-config.c \ - e-table-extras.c \ - e-table-field-chooser-dialog.c \ - e-table-field-chooser-item.c \ - e-table-field-chooser.c \ - e-table-group.c \ - e-table-group-container.c \ - e-table-group-leaf.c \ - e-table-header.c \ - e-table-header-item.c \ - e-table-header-utils.c \ - e-table-item.c \ - e-table-memory-callbacks.c \ - e-table-memory-store.c \ - e-table-memory.c \ - e-table-model.c \ - e-table-one.c \ - e-table-search.c \ - e-table-selection-model.c \ - e-table-sort-info.c \ - e-table-sorted.c \ - e-table-sorted-variable.c \ - e-table-sorter.c \ - e-table-sorting-utils.c \ - e-table-specification.c \ - e-table-state.c \ - e-table-subset.c \ - e-table-subset-variable.c \ - e-table-utils.c \ - e-table-without.c \ - e-table.c \ - e-tree-memory-callbacks.c \ - e-tree-memory.c \ - e-tree-model.c \ - e-tree-selection-model.c \ - e-tree-sorted.c \ - e-tree-table-adapter.c \ - e-tree.c \ - gal-a11y-e-cell.c \ - gal-a11y-e-cell-popup.c \ - gal-a11y-e-cell-registry.c \ - gal-a11y-e-cell-toggle.c \ - gal-a11y-e-cell-tree.c \ - gal-a11y-e-cell-vbox.c \ - gal-a11y-e-table.c \ - gal-a11y-e-table-click-to-add.c \ - gal-a11y-e-table-click-to-add-factory.c \ - gal-a11y-e-table-column-header.c \ - gal-a11y-e-table-factory.c \ - gal-a11y-e-table-item.c \ - gal-a11y-e-table-item-factory.c \ - gal-a11y-e-tree.c \ - gal-a11y-e-tree-factory.c - -libetableincludedir = $(privincludedir)/table - -libetableinclude_HEADERS = \ - e-cell.h \ - e-cell-checkbox.h \ - e-cell-combo.h \ - e-cell-date.h \ - e-cell-date-edit.h \ - e-cell-number.h \ - e-cell-percent.h \ - e-cell-pixbuf.h \ - e-cell-popup.h \ - e-cell-size.h \ - e-cell-text.h \ - e-cell-toggle.h \ - e-cell-tree.h \ - e-cell-vbox.h \ - e-cell-hbox.h \ - e-popup-menu.h \ - e-table-click-to-add.h \ - e-table-col-dnd.h \ - e-table-col.h \ - e-table-column-specification.h \ - e-table-config.h \ - e-table-defines.h \ - e-table-extras.h \ - e-table-field-chooser-dialog.h \ - e-table-field-chooser-item.h \ - e-table-field-chooser.h \ - e-table-group.h \ - e-table-group-container.h \ - e-table-group-leaf.h \ - e-table-header.h \ - e-table-header-item.h \ - e-table-header-utils.h \ - e-table-item.h \ - e-table-memory-callbacks.h \ - e-table-memory-store.h \ - e-table-memory.h \ - e-table-model.h \ - e-table-one.h \ - e-table-search.h \ - e-table-selection-model.h \ - e-table-sort-info.h \ - e-table-sorted.h \ - e-table-sorted-variable.h \ - e-table-sorter.h \ - e-table-sorting-utils.h \ - e-table-specification.h \ - e-table-state.h \ - e-table-subset.h \ - e-table-subset-variable.h \ - e-table-utils.h \ - e-table-without.h \ - e-table.h \ - e-tree-memory-callbacks.h \ - e-tree-memory.h \ - e-tree-model.h \ - e-tree-selection-model.h \ - e-tree-sorted.h \ - e-tree-table-adapter.h \ - e-tree.h \ - gal-a11y-e-cell.h \ - gal-a11y-e-cell-popup.h \ - gal-a11y-e-cell-registry.h \ - gal-a11y-e-cell-toggle.h \ - gal-a11y-e-cell-tree.h \ - gal-a11y-e-cell-vbox.h \ - gal-a11y-e-table.h \ - gal-a11y-e-table-click-to-add.h \ - gal-a11y-e-table-click-to-add-factory.h \ - gal-a11y-e-table-column-header.h \ - gal-a11y-e-table-factory.h \ - gal-a11y-e-table-item.h \ - gal-a11y-e-table-item-factory.h \ - gal-a11y-e-tree.h \ - gal-a11y-e-tree-factory.h - -libetable_la_LDFLAGS = -avoid-version $(NO_UNDEFINED) - -libetable_la_LIBADD = \ - $(top_builddir)/a11y/libevolution-a11y.la \ - $(top_builddir)/e-util/libeutil.la \ - $(top_builddir)/widgets/misc/libemiscwidgets.la \ - $(top_builddir)/widgets/text/libetext.la \ - $(top_builddir)/libgnomecanvas/libgnomecanvas.la \ - $(top_builddir)/libemail-utils/libemail-utils.la \ - $(top_builddir)/libevolution-utils/libevolution-utils.la \ - $(EVOLUTION_DATA_SERVER_LIBS) \ - $(GNOME_PLATFORM_LIBS) \ - $(MATH_LIB) - -icons = \ - arrow-down.xpm \ - arrow-up.xpm \ - check-empty.xpm \ - check-filled.xpm \ - tree-expanded.xpm \ - tree-unexpanded.xpm - -EXTRA_DIST = \ - $(icons) \ - $(ui_DATA) - --include $(top_srcdir)/git.mk diff --git a/widgets/table/e-table.dia b/widgets/table/e-table.dia Binary files differdeleted file mode 100644 index 5aeb01228c..0000000000 --- a/widgets/table/e-table.dia +++ /dev/null diff --git a/widgets/table/sample.table b/widgets/table/sample.table deleted file mode 100644 index e1909a2bf7..0000000000 --- a/widgets/table/sample.table +++ /dev/null @@ -1,45 +0,0 @@ -Col1 Col2 Address Title Dorks -c1.a c2.a a.a tit-1 DorkA -c1.b c2.b a.b tit-2 DDork -c1.c c2.c a.c tit-1 DorkB -c1.d c2.d a.d tit-2 ADork -c1.e c2.e a.e tit-1 DorkC -c1.f c2.f a.f tit-2 UDork -c1.g c2.g a.g tit-3 Dork--- -j k k tit-1 DorkA -aaa1 bbb ccc ddd eee -aaa2 bbb ccc ddd eee -aaa3 bbb ccc ddd eee -aaa4 bbb ccc ddd eee -aaa5 bbb ccc ddd eee -aaa6 bbb ccc ddd eee -aaa7 bbb ccc ddd eee -aaa8 bbb ccc ddd eee -aaa9 bbb ccc ddd eee -aaa10 bbb ccc ddd eee -aaa11 bbb ccc ddd eee -aaa12 bbb ccc ddd eee -aaa13 bbb ccc ddd eee -aaa14 bbb ccc ddd eee -aaa15 bbb ccc ddd eee -aaa16 bbb ccc ddd eee -aaa17 bbb ccc ddd eee -aaa18 bbb ccc ddd eee -aaa19 bbb ccc ddd eee -aaa20 bbb ccc ddd eee -aaa21 bbb ccc ddd eee -aaa22 bbb ccc ddd eee -aaa23 bbb ccc ddd eee -aaa24 bbb ccc ddd eee -aaa25 bbb ccc ddd eee -aaa26 bbb ccc ddd eee -aaa27 bbb ccc ddd eee -aaa28 bbb ccc ddd eee -aaa29 bbb ccc ddd eee -aaa30 bbb ccc ddd eee -aaa31 bbb ccc ddd eee -aaa32 bbb ccc ddd eee -aaa33 bbb ccc ddd eee -aaa34 bbb ccc ddd eee -aaa35 bbb ccc ddd eee -aaa36 bbb ccc ddd eee diff --git a/widgets/table/spec.xml b/widgets/table/spec.xml deleted file mode 100644 index a8e524484c..0000000000 --- a/widgets/table/spec.xml +++ /dev/null @@ -1,21 +0,0 @@ -<ETableSpecification no-headers="false" click-to-add="false" - draw-grid="true" cursor-mode="simple" - _click-to-add-message=""> - <ETableColumn model_col="0" _title="Email" expansion="1.0" minimum_width="20" resizable="true" cell="cell_left_just" compare="string"/> - <ETableColumn model_col="1" _title="Full Name" expansion="1.0" minimum_width="20" resizable="true" cell="cell_left_just" compare="string"/> - <ETableColumn model_col="2" _title="Address" expansion="1.0" minimum_width="20" resizable="true" cell="cell_left_just" compare="string"/> - <ETableColumn model_col="3" _title="Phone" expansion="1.0" minimum_width="20" resizable="true" cell="cell_left_just" compare="string"/> - <ETableState> - <column source="0"/> - <column source="3"/> - <column source="1"/> - <column source="2"/> - <grouping> - <group column="2" ascending="true"> - <leaf column="1" ascending="true"/> - </group> - </grouping> - <!-- Column that's been added by hand. Not implemented yet. - <ETableColumn model_col="custom-string" _title="Custom" expansion="1.0" minimum_widgth="20" resizable="true" cell="string" compare="string"/> --> - </ETableState> -</ETableSpecification> diff --git a/widgets/text/Makefile.am b/widgets/text/Makefile.am deleted file mode 100644 index 9f8e852dd0..0000000000 --- a/widgets/text/Makefile.am +++ /dev/null @@ -1,44 +0,0 @@ -privsolib_LTLIBRARIES = libetext.la - -libetext_la_CPPFLAGS = \ - $(AM_CPPFLAGS) \ - -I$(top_srcdir) \ - -I$(top_srcdir)/widgets \ - $(EVOLUTION_DATA_SERVER_CFLAGS) \ - $(GNOME_PLATFORM_CFLAGS) \ - -DG_LOG_DOMAIN=\"e-text\" - -libetext_la_SOURCES = \ - e-text-model-repos.c \ - e-text-model.c \ - e-text.c \ - e-reflow.c \ - e-reflow-model.c \ - gal-a11y-e-text-factory.c \ - gal-a11y-e-text.c - -libetextincludedir = $(privincludedir)/text - -libetextinclude_HEADERS = \ - e-text-model-repos.h \ - e-text-model.h \ - e-text.h \ - e-reflow.h \ - e-reflow-model.h \ - gal-a11y-e-text-factory.h \ - gal-a11y-e-text.h - -libetext_la_LDFLAGS = -avoid-version $(NO_UNDEFINED) - -libetext_la_LIBADD = \ - $(top_builddir)/a11y/libevolution-a11y.la \ - $(top_builddir)/e-util/libeutil.la \ - $(top_builddir)/widgets/misc/libemiscwidgets.la \ - $(top_builddir)/libgnomecanvas/libgnomecanvas.la \ - $(top_builddir)/libemail-utils/libemail-utils.la \ - $(EVOLUTION_DATA_SERVER_LIBS) \ - $(GNOME_PLATFORM_LIBS) \ - $(REGEX_LIBS) \ - $(MATH_LIB) - --include $(top_srcdir)/git.mk |