[evolution] Reorganize directory structure
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution] Reorganize directory structure
- Date: Tue, 11 Oct 2016 17:39:21 +0000 (UTC)
commit d17f923f928a7622053bb520728c2c37746ef7b8
Author: Milan Crha <mcrha redhat com>
Date: Tue Oct 11 19:09:48 2016 +0200
Reorganize directory structure
Let's have it as it's common to be, which means top level src/ for
sources, single data/ for data, and so on.
CMakeLists.txt | 27 +-
addressbook/gui/contact-editor/CMakeLists.txt | 60 -
addressbook/gui/contact-list-editor/CMakeLists.txt | 55 -
addressbook/gui/widgets/CMakeLists.txt | 117 -
addressbook/importers/CMakeLists.txt | 48 -
addressbook/printing/CMakeLists.txt | 55 -
addressbook/util/CMakeLists.txt | 46 -
calendar/alarm-notify/CMakeLists.txt | 91 -
calendar/gui/CMakeLists.txt | 218 -
calendar/gui/e-week-view.c | 5193 --------------------
calendar/gui/print.c | 3860 ---------------
calendar/importers/CMakeLists.txt | 47 -
composer/CMakeLists.txt | 85 -
data/CMakeLists.txt | 4 +
{art => data/images}/CMakeLists.txt | 0
{art => data/images}/README | 0
{art => data/images}/confidential-stamp.jpg | Bin 5708 -> 5708 bytes
{art => data/images}/draft-paper.png | Bin 597 -> 597 bytes
{art => data/images}/draft-stamp.jpg | Bin 4660 -> 4660 bytes
{art => data/images}/midnight-stars.jpg | Bin 7190 -> 7190 bytes
{art => data/images}/minus.png | Bin 344 -> 344 bytes
{art => data/images}/paper.png | Bin 266 -> 266 bytes
{art => data/images}/plus.png | Bin 406 -> 406 bytes
{art => data/images}/rect.png | Bin 3795 -> 3795 bytes
{art => data/images}/ribbon.jpg | Bin 3193 -> 3193 bytes
{art => data/images}/texture.png | Bin 137 -> 137 bytes
{art => data/images}/working.png | Bin 5689 -> 5689 bytes
{art => data/images}/world_map-960.png | Bin 111584 -> 111584 bytes
{sounds => data/sounds}/CMakeLists.txt | 0
{sounds => data/sounds}/default_alarm.wav | Bin 8624 -> 8624 bytes
{ui => data/ui}/CMakeLists.txt | 0
{ui => data/ui}/evolution-calendars.ui | 0
{ui => data/ui}/evolution-contacts.ui | 0
{ui => data/ui}/evolution-mail-reader.ui | 0
{ui => data/ui}/evolution-mail.ui | 0
{ui => data/ui}/evolution-memos.ui | 0
{ui => data/ui}/evolution-shell.ui | 0
{ui => data/ui}/evolution-tasks.ui | 0
{views => data/views}/CMakeLists.txt | 0
.../views}/addressbook/Address_Cards.galview | 0
.../views}/addressbook/By_Company.galview | 0
{views => data/views}/addressbook/CMakeLists.txt | 0
.../views}/addressbook/Phone_List.galview | 0
{views => data/views}/addressbook/galview.xml | 0
{views => data/views}/calendar/CMakeLists.txt | 0
{views => data/views}/calendar/List_View.galview | 0
{views => data/views}/calendar/galview.xml | 0
{views => data/views}/mail/As_Sent_Folder.galview | 0
.../views}/mail/By_Follow_Up_Flag.galview | 0
{views => data/views}/mail/By_Sender.galview | 0
{views => data/views}/mail/By_Status.galview | 0
{views => data/views}/mail/By_Subject.galview | 0
{views => data/views}/mail/CMakeLists.txt | 0
{views => data/views}/mail/Messages.galview | 0
.../views}/mail/Wide_View_Normal.galview | 0
{views => data/views}/mail/Wide_View_Sent.galview | 0
{views => data/views}/mail/galview.xml | 0
{views => data/views}/memos/CMakeLists.txt | 0
{views => data/views}/memos/Memos.galview | 0
{views => data/views}/memos/galview.xml | 0
{views => data/views}/tasks/CMakeLists.txt | 0
{views => data/views}/tasks/Tasks.galview | 0
{views => data/views}/tasks/With_DueDate.galview | 0
{views => data/views}/tasks/With_Status.galview | 0
{views => data/views}/tasks/galview.xml | 0
{e-util => data/xpm}/arrow-down.xpm | 0
{e-util => data/xpm}/arrow-up.xpm | 0
{e-util => data/xpm}/check-empty.xpm | 0
{e-util => data/xpm}/check-filled.xpm | 0
{art => data/xpm}/empty.xpm | 0
{art => data/xpm}/jump.xpm | 0
designs/OOA/Comments | 3 -
designs/OOA/ooa.ui | 350 --
designs/OOA/oooa_question.png | Bin 16230 -> 0 bytes
designs/OOA/oooa_screenshot.png | Bin 14630 -> 0 bytes
designs/OOA/outlook_question.png | Bin 9421 -> 0 bytes
designs/OOA/outlook_screenshot.png | Bin 54458 -> 0 bytes
designs/OOA/spec.txt | 29 -
designs/read_receipts/Comments | 3 -
.../read_receipts/notification-of-rr-request.jpg | Bin 26853 -> 0 bytes
designs/read_receipts/proposal.png | Bin 26147 -> 0 bytes
designs/read_receipts/read.gladep | 7 -
designs/read_receipts/read.ui | 314 --
designs/read_receipts/read_receipt_options.jpg | Bin 40847 -> 0 bytes
designs/read_receipts/receipt.jpg | Bin 103530 -> 0 bytes
designs/read_receipts/secure_options.jpg | Bin 18181 -> 0 bytes
designs/read_receipts/spec.txt | 67 -
.../evolution-mail-composer/CMakeLists.txt | 14 -
doc/reference/evolution-mail-engine/CMakeLists.txt | 13 -
.../evolution-mail-formatter/CMakeLists.txt | 13 -
doc/reference/evolution-shell/CMakeLists.txt | 17 -
doc/reference/evolution-util/CMakeLists.txt | 49 -
{doc => docs}/CMakeLists.txt | 0
{doc => docs}/COPYING-DOCS.CCBYSA | 0
{doc => docs}/COPYING-DOCS.GFDL | 0
{doc => docs}/devel/build-eplugin-manual.pl | 0
{doc => docs}/devel/evolution-devel-guide.sgml | 0
{doc => docs}/devel/evolution-plugin-manual.xml | 0
.../executive-summary/evolution-services.hierarchy | 0
{doc => docs}/devel/fdl.sgml | 0
{doc => docs}/devel/images/Makefile | 0
{doc => docs}/devel/images/e-config-build-1.png | Bin 16402 -> 16402 bytes
{doc => docs}/devel/images/e-config-build-2.png | Bin 19889 -> 19889 bytes
{doc => docs}/devel/images/e-config-build-3.png | Bin 7281 -> 7281 bytes
{doc => docs}/devel/images/e-config-flow.pic | 0
{doc => docs}/devel/images/e-popup-merge-1.pic | 0
{doc => docs}/devel/images/e-popup-merge-2.pic | 0
{devel-docs => docs/devel}/misc/errors.txt | 0
.../devel}/misc/ref_and_id_proposition.txt | 0
{doc => docs}/devel/preface.sgml | 0
.../devel}/query/virtual-folder-in-depth.sgml | 0
.../devel}/query/virtual-folder-in-depth.txt | 0
{doc => docs}/devel/reference.sgml | 0
{doc => docs}/reference/CMakeLists.txt | 0
.../evolution-mail-composer/CMakeLists.txt | 14 +
.../evolution-mail-composer-docs.sgml.in | 0
.../reference/evolution-mail-engine/CMakeLists.txt | 13 +
.../evolution-mail-engine-docs.sgml.in | 0
.../evolution-mail-formatter/CMakeLists.txt | 13 +
.../evolution-mail-formatter-docs.sgml.in | 0
docs/reference/evolution-shell/CMakeLists.txt | 17 +
.../evolution-shell/evolution-shell-docs.sgml.in | 0
docs/reference/evolution-util/CMakeLists.txt | 49 +
.../evolution-util/evolution-util-docs.sgml.in | 0
e-util/CMakeLists.txt | 769 ---
e-util/e-cell-checkbox.c | 99 -
e-util/e-cell-toggle.c | 506 --
e-util/e-table-header-item.c | 2298 ---------
em-format/CMakeLists.txt | 146 -
libemail-engine/CMakeLists.txt | 94 -
libgnomecanvas/CMakeLists.txt | 71 -
mail/CMakeLists.txt | 297 --
mail/importers/CMakeLists.txt | 56 -
maint/CMakeLists.txt | 52 -
modules/CMakeLists.txt | 140 -
modules/addressbook/CMakeLists.txt | 67 -
modules/backup-restore/CMakeLists.txt | 79 -
modules/prefer-plain/plugin/CMakeLists.txt | 44 -
plugins/attachment-reminder/CMakeLists.txt | 50 -
plugins/bbdb/CMakeLists.txt | 52 -
plugins/dbx-import/CMakeLists.txt | 47 -
plugins/email-custom-header/CMakeLists.txt | 54 -
plugins/external-editor/CMakeLists.txt | 50 -
plugins/face/CMakeLists.txt | 50 -
plugins/mail-notification/CMakeLists.txt | 53 -
plugins/mail-to-task/CMakeLists.txt | 49 -
plugins/mailing-list-actions/CMakeLists.txt | 51 -
plugins/pst-import/CMakeLists.txt | 51 -
plugins/publish-calendar/CMakeLists.txt | 61 -
plugins/save-calendar/CMakeLists.txt | 49 -
plugins/templates/CMakeLists.txt | 50 -
po/POTFILES.in | 1022 ++--
po/POTFILES.skip | 7 +-
shell/CMakeLists.txt | 221 -
smime/gui/CMakeLists.txt | 61 -
smime/lib/CMakeLists.txt | 52 -
src/CMakeLists.txt | 20 +
{addressbook => src/addressbook}/CMakeLists.txt | 0
.../addressbook}/addressbook.error.xml | 0
.../addressbook}/gui/CMakeLists.txt | 0
src/addressbook/gui/contact-editor/CMakeLists.txt | 61 +
.../gui/contact-editor/contact-editor.ui | 0
.../gui/contact-editor/e-contact-editor-dyntable.c | 0
.../gui/contact-editor/e-contact-editor-dyntable.h | 0
.../gui/contact-editor/e-contact-editor-fullname.c | 0
.../gui/contact-editor/e-contact-editor-fullname.h | 0
.../gui/contact-editor/e-contact-editor.c | 0
.../gui/contact-editor/e-contact-editor.h | 0
.../gui/contact-editor/e-contact-quick-add.c | 0
.../gui/contact-editor/e-contact-quick-add.h | 0
.../addressbook}/gui/contact-editor/eab-editor.c | 0
.../addressbook}/gui/contact-editor/eab-editor.h | 0
.../addressbook}/gui/contact-editor/fullname.ui | 0
.../addressbook}/gui/contact-editor/test-editor.c | 0
.../gui/contact-list-editor/CMakeLists.txt | 56 +
.../gui/contact-list-editor/contact-list-editor.ui | 0
.../contact-list-editor/e-contact-list-editor.c | 0
.../contact-list-editor/e-contact-list-editor.h | 0
.../gui/contact-list-editor/e-contact-list-model.c | 0
.../gui/contact-list-editor/e-contact-list-model.h | 0
src/addressbook/gui/widgets/CMakeLists.txt | 118 +
.../addressbook}/gui/widgets/address_formats.dat | 0
.../addressbook}/gui/widgets/addresstypes.xml | 0
.../addressbook}/gui/widgets/countrytransl.map | 0
.../addressbook}/gui/widgets/e-addressbook-model.c | 0
.../addressbook}/gui/widgets/e-addressbook-model.h | 0
.../gui/widgets/e-addressbook-reflow-adapter.c | 0
.../gui/widgets/e-addressbook-reflow-adapter.h | 0
.../gui/widgets/e-addressbook-selector.c | 0
.../gui/widgets/e-addressbook-selector.h | 0
.../gui/widgets/e-addressbook-table-adapter.c | 0
.../gui/widgets/e-addressbook-table-adapter.h | 0
.../addressbook}/gui/widgets/e-addressbook-view.c | 0
.../gui/widgets/e-addressbook-view.etspec | 0
.../addressbook}/gui/widgets/e-addressbook-view.h | 0
.../gui/widgets/e-contact-map-window.c | 0
.../gui/widgets/e-contact-map-window.h | 0
.../addressbook}/gui/widgets/e-contact-map.c | 0
.../addressbook}/gui/widgets/e-contact-map.h | 0
.../addressbook}/gui/widgets/e-minicard-label.c | 0
.../addressbook}/gui/widgets/e-minicard-label.h | 0
.../gui/widgets/e-minicard-view-widget.c | 0
.../gui/widgets/e-minicard-view-widget.h | 0
.../addressbook}/gui/widgets/e-minicard-view.c | 0
.../addressbook}/gui/widgets/e-minicard-view.h | 0
.../addressbook}/gui/widgets/e-minicard.c | 0
.../addressbook}/gui/widgets/e-minicard.h | 0
.../addressbook}/gui/widgets/ea-addressbook-view.c | 0
.../addressbook}/gui/widgets/ea-addressbook-view.h | 0
.../addressbook}/gui/widgets/ea-addressbook.c | 0
.../addressbook}/gui/widgets/ea-addressbook.h | 0
.../addressbook}/gui/widgets/ea-minicard-view.c | 0
.../addressbook}/gui/widgets/ea-minicard-view.h | 0
.../addressbook}/gui/widgets/ea-minicard.c | 0
.../addressbook}/gui/widgets/ea-minicard.h | 0
.../addressbook}/gui/widgets/eab-config.c | 0
.../addressbook}/gui/widgets/eab-config.h | 0
.../addressbook}/gui/widgets/eab-contact-compare.c | 0
.../addressbook}/gui/widgets/eab-contact-compare.h | 0
.../addressbook}/gui/widgets/eab-contact-display.c | 0
.../addressbook}/gui/widgets/eab-contact-display.h | 0
.../gui/widgets/eab-contact-formatter.c | 0
.../gui/widgets/eab-contact-formatter.h | 0
.../addressbook}/gui/widgets/eab-contact-merging.c | 0
.../addressbook}/gui/widgets/eab-contact-merging.h | 0
.../addressbook}/gui/widgets/eab-gui-util.c | 0
.../addressbook}/gui/widgets/eab-gui-util.h | 0
.../addressbook}/gui/widgets/gal-view-minicard.c | 0
.../addressbook}/gui/widgets/gal-view-minicard.h | 0
src/addressbook/importers/CMakeLists.txt | 49 +
.../importers/evolution-addressbook-importers.h | 0
.../importers/evolution-csv-importer.c | 0
.../importers/evolution-ldif-importer.c | 0
.../importers/evolution-vcard-importer.c | 0
src/addressbook/printing/CMakeLists.txt | 56 +
.../addressbook}/printing/e-contact-print-types.h | 0
.../addressbook}/printing/e-contact-print.c | 0
.../addressbook}/printing/e-contact-print.h | 0
.../addressbook}/printing/medbook.ecps | 0
.../addressbook}/printing/phonelist.ecps | 0
.../addressbook}/printing/smallbook.ecps | 0
src/addressbook/util/CMakeLists.txt | 47 +
.../addressbook}/util/eab-book-util.c | 0
.../addressbook}/util/eab-book-util.h | 0
{calendar => src/calendar}/AUTHORS | 0
{calendar => src/calendar}/CMakeLists.txt | 0
src/calendar/alarm-notify/CMakeLists.txt | 92 +
.../calendar}/alarm-notify/alarm-notify-dialog.c | 0
.../calendar}/alarm-notify/alarm-notify-dialog.h | 0
.../calendar}/alarm-notify/alarm-notify.c | 0
.../calendar}/alarm-notify/alarm-notify.h | 0
.../calendar}/alarm-notify/alarm-notify.ui | 0
.../calendar}/alarm-notify/alarm-queue.c | 0
.../calendar}/alarm-notify/alarm-queue.h | 0
{calendar => src/calendar}/alarm-notify/alarm.c | 0
{calendar => src/calendar}/alarm-notify/alarm.h | 0
.../calendar}/alarm-notify/config-data.c | 0
.../calendar}/alarm-notify/config-data.h | 0
.../alarm-notify/evolution-alarm-notify-icon.rc | 0
.../alarm-notify/evolution-alarm-notify.ico | Bin 17542 -> 17542 bytes
.../calendar}/alarm-notify/notify-main.c | 0
{calendar => src/calendar}/alarm-notify/util.c | 0
{calendar => src/calendar}/alarm-notify/util.h | 0
{calendar => src/calendar}/calendar.error.xml | 0
src/calendar/gui/CMakeLists.txt | 220 +
.../calendar}/gui/calendar-config-keys.h | 0
{calendar => src/calendar}/gui/calendar-config.c | 0
{calendar => src/calendar}/gui/calendar-config.h | 0
{calendar => src/calendar}/gui/calendar-view.c | 0
{calendar => src/calendar}/gui/calendar-view.h | 0
{calendar => src/calendar}/gui/caltypes.xml.in | 0
{calendar => src/calendar}/gui/comp-util.c | 0
{calendar => src/calendar}/gui/comp-util.h | 0
{calendar => src/calendar}/gui/e-alarm-list.c | 0
{calendar => src/calendar}/gui/e-alarm-list.h | 0
.../calendar}/gui/e-cal-component-preview.c | 0
.../calendar}/gui/e-cal-component-preview.h | 0
{calendar => src/calendar}/gui/e-cal-config.c | 0
{calendar => src/calendar}/gui/e-cal-config.h | 0
.../calendar}/gui/e-cal-data-model-subscriber.c | 0
.../calendar}/gui/e-cal-data-model-subscriber.h | 0
{calendar => src/calendar}/gui/e-cal-data-model.c | 0
{calendar => src/calendar}/gui/e-cal-data-model.h | 0
{calendar => src/calendar}/gui/e-cal-dialogs.c | 0
{calendar => src/calendar}/gui/e-cal-dialogs.h | 0
{calendar => src/calendar}/gui/e-cal-event.c | 0
{calendar => src/calendar}/gui/e-cal-event.h | 0
{calendar => src/calendar}/gui/e-cal-list-view.c | 0
.../calendar}/gui/e-cal-list-view.etspec | 0
{calendar => src/calendar}/gui/e-cal-list-view.h | 0
.../calendar}/gui/e-cal-model-calendar.c | 0
.../calendar}/gui/e-cal-model-calendar.h | 0
{calendar => src/calendar}/gui/e-cal-model-memos.c | 0
{calendar => src/calendar}/gui/e-cal-model-memos.h | 0
{calendar => src/calendar}/gui/e-cal-model-tasks.c | 0
{calendar => src/calendar}/gui/e-cal-model-tasks.h | 0
{calendar => src/calendar}/gui/e-cal-model.c | 0
{calendar => src/calendar}/gui/e-cal-model.h | 0
{calendar => src/calendar}/gui/e-cal-ops.c | 0
{calendar => src/calendar}/gui/e-cal-ops.h | 0
{calendar => src/calendar}/gui/e-calendar-view.c | 0
{calendar => src/calendar}/gui/e-calendar-view.h | 0
.../calendar}/gui/e-cell-date-edit-text.c | 0
.../calendar}/gui/e-cell-date-edit-text.h | 0
.../calendar}/gui/e-comp-editor-event.c | 0
.../calendar}/gui/e-comp-editor-event.h | 0
.../calendar}/gui/e-comp-editor-memo.c | 0
.../calendar}/gui/e-comp-editor-memo.h | 0
.../calendar}/gui/e-comp-editor-page-attachments.c | 0
.../calendar}/gui/e-comp-editor-page-attachments.h | 0
.../calendar}/gui/e-comp-editor-page-general.c | 0
.../calendar}/gui/e-comp-editor-page-general.h | 0
.../calendar}/gui/e-comp-editor-page-recurrence.c | 0
.../calendar}/gui/e-comp-editor-page-recurrence.h | 0
.../calendar}/gui/e-comp-editor-page-reminders.c | 0
.../calendar}/gui/e-comp-editor-page-reminders.h | 0
.../calendar}/gui/e-comp-editor-page-schedule.c | 0
.../calendar}/gui/e-comp-editor-page-schedule.h | 0
.../calendar}/gui/e-comp-editor-page.c | 0
.../calendar}/gui/e-comp-editor-page.h | 0
.../calendar}/gui/e-comp-editor-property-part.c | 0
.../calendar}/gui/e-comp-editor-property-part.h | 0
.../calendar}/gui/e-comp-editor-property-parts.c | 0
.../calendar}/gui/e-comp-editor-property-parts.h | 0
.../calendar}/gui/e-comp-editor-task.c | 0
.../calendar}/gui/e-comp-editor-task.h | 0
{calendar => src/calendar}/gui/e-comp-editor.c | 0
{calendar => src/calendar}/gui/e-comp-editor.h | 0
{calendar => src/calendar}/gui/e-date-time-list.c | 0
{calendar => src/calendar}/gui/e-date-time-list.h | 0
{calendar => src/calendar}/gui/e-day-view-layout.c | 0
{calendar => src/calendar}/gui/e-day-view-layout.h | 0
.../calendar}/gui/e-day-view-main-item.c | 0
.../calendar}/gui/e-day-view-main-item.h | 0
.../calendar}/gui/e-day-view-time-item.c | 0
.../calendar}/gui/e-day-view-time-item.h | 0
.../calendar}/gui/e-day-view-top-item.c | 0
.../calendar}/gui/e-day-view-top-item.h | 0
{calendar => src/calendar}/gui/e-day-view.c | 0
{calendar => src/calendar}/gui/e-day-view.h | 0
.../calendar}/gui/e-meeting-attendee.c | 0
.../calendar}/gui/e-meeting-attendee.h | 0
.../calendar}/gui/e-meeting-list-view.c | 0
.../calendar}/gui/e-meeting-list-view.h | 0
{calendar => src/calendar}/gui/e-meeting-store.c | 0
{calendar => src/calendar}/gui/e-meeting-store.h | 0
.../calendar}/gui/e-meeting-time-sel-item.c | 0
.../calendar}/gui/e-meeting-time-sel-item.h | 0
.../calendar}/gui/e-meeting-time-sel.c | 0
.../calendar}/gui/e-meeting-time-sel.etspec | 0
.../calendar}/gui/e-meeting-time-sel.h | 0
{calendar => src/calendar}/gui/e-meeting-types.h | 0
{calendar => src/calendar}/gui/e-meeting-utils.c | 0
{calendar => src/calendar}/gui/e-meeting-utils.h | 0
{calendar => src/calendar}/gui/e-memo-table.c | 0
{calendar => src/calendar}/gui/e-memo-table.etspec | 0
{calendar => src/calendar}/gui/e-memo-table.h | 0
{calendar => src/calendar}/gui/e-month-view.c | 0
{calendar => src/calendar}/gui/e-month-view.h | 0
.../calendar}/gui/e-select-names-editable.c | 0
.../calendar}/gui/e-select-names-editable.h | 0
.../calendar}/gui/e-select-names-renderer.c | 0
.../calendar}/gui/e-select-names-renderer.h | 0
.../calendar}/gui/e-send-options-utils.c | 0
.../calendar}/gui/e-send-options-utils.h | 0
{calendar => src/calendar}/gui/e-task-table.c | 0
{calendar => src/calendar}/gui/e-task-table.etspec | 0
{calendar => src/calendar}/gui/e-task-table.h | 0
{calendar => src/calendar}/gui/e-timezone-entry.c | 0
{calendar => src/calendar}/gui/e-timezone-entry.h | 0
.../calendar}/gui/e-week-view-event-item.c | 0
.../calendar}/gui/e-week-view-event-item.h | 0
.../calendar}/gui/e-week-view-layout.c | 0
.../calendar}/gui/e-week-view-layout.h | 0
.../calendar}/gui/e-week-view-main-item.c | 0
.../calendar}/gui/e-week-view-main-item.h | 0
.../calendar}/gui/e-week-view-titles-item.c | 0
.../calendar}/gui/e-week-view-titles-item.h | 0
src/calendar/gui/e-week-view.c | 5193 ++++++++++++++++++++
{calendar => src/calendar}/gui/e-week-view.h | 0
{calendar => src/calendar}/gui/e-weekday-chooser.c | 0
{calendar => src/calendar}/gui/e-weekday-chooser.h | 0
{calendar => src/calendar}/gui/ea-cal-view-event.c | 0
{calendar => src/calendar}/gui/ea-cal-view-event.h | 0
{calendar => src/calendar}/gui/ea-cal-view.c | 0
{calendar => src/calendar}/gui/ea-cal-view.h | 0
.../calendar}/gui/ea-calendar-helpers.c | 0
.../calendar}/gui/ea-calendar-helpers.h | 0
{calendar => src/calendar}/gui/ea-calendar.c | 0
{calendar => src/calendar}/gui/ea-calendar.h | 0
{calendar => src/calendar}/gui/ea-day-view-cell.c | 0
{calendar => src/calendar}/gui/ea-day-view-cell.h | 0
.../calendar}/gui/ea-day-view-main-item.c | 0
.../calendar}/gui/ea-day-view-main-item.h | 0
{calendar => src/calendar}/gui/ea-day-view.c | 0
{calendar => src/calendar}/gui/ea-day-view.h | 0
{calendar => src/calendar}/gui/ea-jump-button.c | 0
{calendar => src/calendar}/gui/ea-jump-button.h | 0
{calendar => src/calendar}/gui/ea-week-view-cell.c | 0
{calendar => src/calendar}/gui/ea-week-view-cell.h | 0
.../calendar}/gui/ea-week-view-main-item.c | 0
.../calendar}/gui/ea-week-view-main-item.h | 0
{calendar => src/calendar}/gui/ea-week-view.c | 0
{calendar => src/calendar}/gui/ea-week-view.h | 0
{calendar => src/calendar}/gui/itip-utils.c | 0
{calendar => src/calendar}/gui/itip-utils.h | 0
{calendar => src/calendar}/gui/memotypes.xml.in | 0
{calendar => src/calendar}/gui/misc.c | 0
{calendar => src/calendar}/gui/misc.h | 0
src/calendar/gui/print.c | 3860 +++++++++++++++
{calendar => src/calendar}/gui/print.h | 0
{calendar => src/calendar}/gui/tag-calendar.c | 0
{calendar => src/calendar}/gui/tag-calendar.h | 0
{calendar => src/calendar}/gui/tasktypes.xml.in | 0
src/calendar/importers/CMakeLists.txt | 48 +
.../importers/evolution-calendar-importer.h | 0
.../calendar}/importers/icalendar-importer.c | 0
{calendar => src/calendar}/zones.h | 0
src/composer/CMakeLists.txt | 86 +
{composer => src/composer}/e-composer-actions.c | 0
{composer => src/composer}/e-composer-actions.h | 0
{composer => src/composer}/e-composer-common.h | 0
.../composer}/e-composer-from-header.c | 0
.../composer}/e-composer-from-header.h | 0
.../composer}/e-composer-header-table.c | 0
.../composer}/e-composer-header-table.h | 0
{composer => src/composer}/e-composer-header.c | 0
{composer => src/composer}/e-composer-header.h | 0
.../composer}/e-composer-name-header.c | 0
.../composer}/e-composer-name-header.h | 0
.../composer}/e-composer-post-header.c | 0
.../composer}/e-composer-post-header.h | 0
{composer => src/composer}/e-composer-private.c | 0
{composer => src/composer}/e-composer-private.h | 0
.../composer}/e-composer-spell-header.c | 0
.../composer}/e-composer-spell-header.h | 0
.../composer}/e-composer-text-header.c | 0
.../composer}/e-composer-text-header.h | 0
{composer => src/composer}/e-msg-composer.c | 0
{composer => src/composer}/e-msg-composer.h | 0
{composer => src/composer}/evolution-composer.ui | 0
{composer => src/composer}/mail-composer.error.xml | 0
src/e-util/CMakeLists.txt | 773 +++
{e-util => src/e-util}/e-action-combo-box.c | 0
{e-util => src/e-util}/e-action-combo-box.h | 0
{e-util => src/e-util}/e-activity-bar.c | 0
{e-util => src/e-util}/e-activity-bar.h | 0
{e-util => src/e-util}/e-activity-proxy.c | 0
{e-util => src/e-util}/e-activity-proxy.h | 0
{e-util => src/e-util}/e-activity.c | 0
{e-util => src/e-util}/e-activity.h | 0
{e-util => src/e-util}/e-alarm-selector.c | 0
{e-util => src/e-util}/e-alarm-selector.h | 0
{e-util => src/e-util}/e-alert-bar.c | 0
{e-util => src/e-util}/e-alert-bar.h | 0
{e-util => src/e-util}/e-alert-dialog.c | 0
{e-util => src/e-util}/e-alert-dialog.h | 0
{e-util => src/e-util}/e-alert-sink.c | 0
{e-util => src/e-util}/e-alert-sink.h | 0
{e-util => src/e-util}/e-alert.c | 0
{e-util => src/e-util}/e-alert.h | 0
{e-util => src/e-util}/e-attachment-bar.c | 0
{e-util => src/e-util}/e-attachment-bar.h | 0
{e-util => src/e-util}/e-attachment-dialog.c | 0
{e-util => src/e-util}/e-attachment-dialog.h | 0
.../e-util}/e-attachment-handler-image.c | 0
.../e-util}/e-attachment-handler-image.h | 0
{e-util => src/e-util}/e-attachment-handler.c | 0
{e-util => src/e-util}/e-attachment-handler.h | 0
{e-util => src/e-util}/e-attachment-icon-view.c | 0
{e-util => src/e-util}/e-attachment-icon-view.h | 0
{e-util => src/e-util}/e-attachment-paned.c | 0
{e-util => src/e-util}/e-attachment-paned.h | 0
{e-util => src/e-util}/e-attachment-store.c | 0
{e-util => src/e-util}/e-attachment-store.h | 0
{e-util => src/e-util}/e-attachment-tree-view.c | 0
{e-util => src/e-util}/e-attachment-tree-view.h | 0
{e-util => src/e-util}/e-attachment-view.c | 0
{e-util => src/e-util}/e-attachment-view.h | 0
{e-util => src/e-util}/e-attachment.c | 0
{e-util => src/e-util}/e-attachment.h | 0
{e-util => src/e-util}/e-auth-combo-box.c | 0
{e-util => src/e-util}/e-auth-combo-box.h | 0
{e-util => src/e-util}/e-autocomplete-selector.c | 0
{e-util => src/e-util}/e-autocomplete-selector.h | 0
{e-util => src/e-util}/e-bit-array.c | 0
{e-util => src/e-util}/e-bit-array.h | 0
{e-util => src/e-util}/e-book-source-config.c | 0
{e-util => src/e-util}/e-book-source-config.h | 0
{e-util => src/e-util}/e-buffer-tagger.c | 0
{e-util => src/e-util}/e-buffer-tagger.h | 0
{e-util => src/e-util}/e-cal-source-config.c | 0
{e-util => src/e-util}/e-cal-source-config.h | 0
{e-util => src/e-util}/e-calendar-item.c | 0
{e-util => src/e-util}/e-calendar-item.h | 0
{e-util => src/e-util}/e-calendar.c | 0
{e-util => src/e-util}/e-calendar.h | 0
{e-util => src/e-util}/e-canvas-background.c | 0
{e-util => src/e-util}/e-canvas-background.h | 0
{e-util => src/e-util}/e-canvas-utils.c | 0
{e-util => src/e-util}/e-canvas-utils.h | 0
{e-util => src/e-util}/e-canvas-vbox.c | 0
{e-util => src/e-util}/e-canvas-vbox.h | 0
{e-util => src/e-util}/e-canvas.c | 0
{e-util => src/e-util}/e-canvas.h | 0
{e-util => src/e-util}/e-categories-config.c | 0
{e-util => src/e-util}/e-categories-config.h | 0
{e-util => src/e-util}/e-categories-dialog.c | 0
{e-util => src/e-util}/e-categories-dialog.h | 0
{e-util => src/e-util}/e-categories-editor.c | 0
{e-util => src/e-util}/e-categories-editor.h | 0
{e-util => src/e-util}/e-categories-selector.c | 0
{e-util => src/e-util}/e-categories-selector.h | 0
{e-util => src/e-util}/e-category-completion.c | 0
{e-util => src/e-util}/e-category-completion.h | 0
{e-util => src/e-util}/e-category-editor.c | 0
{e-util => src/e-util}/e-category-editor.h | 0
src/e-util/e-cell-checkbox.c | 99 +
{e-util => src/e-util}/e-cell-checkbox.h | 0
{e-util => src/e-util}/e-cell-combo.c | 0
{e-util => src/e-util}/e-cell-combo.h | 0
{e-util => src/e-util}/e-cell-date-edit.c | 0
{e-util => src/e-util}/e-cell-date-edit.h | 0
{e-util => src/e-util}/e-cell-date-int.c | 0
{e-util => src/e-util}/e-cell-date-int.h | 0
{e-util => src/e-util}/e-cell-date.c | 0
{e-util => src/e-util}/e-cell-date.h | 0
{e-util => src/e-util}/e-cell-hbox.c | 0
{e-util => src/e-util}/e-cell-hbox.h | 0
{e-util => src/e-util}/e-cell-number.c | 0
{e-util => src/e-util}/e-cell-number.h | 0
{e-util => src/e-util}/e-cell-percent.c | 0
{e-util => src/e-util}/e-cell-percent.h | 0
{e-util => src/e-util}/e-cell-pixbuf.c | 0
{e-util => src/e-util}/e-cell-pixbuf.h | 0
{e-util => src/e-util}/e-cell-popup.c | 0
{e-util => src/e-util}/e-cell-popup.h | 0
{e-util => src/e-util}/e-cell-size.c | 0
{e-util => src/e-util}/e-cell-size.h | 0
{e-util => src/e-util}/e-cell-text.c | 0
{e-util => src/e-util}/e-cell-text.h | 0
src/e-util/e-cell-toggle.c | 506 ++
{e-util => src/e-util}/e-cell-toggle.h | 0
{e-util => src/e-util}/e-cell-tree.c | 0
{e-util => src/e-util}/e-cell-tree.h | 0
{e-util => src/e-util}/e-cell-vbox.c | 0
{e-util => src/e-util}/e-cell-vbox.h | 0
{e-util => src/e-util}/e-cell.c | 0
{e-util => src/e-util}/e-cell.h | 0
{e-util => src/e-util}/e-charset-combo-box.c | 0
{e-util => src/e-util}/e-charset-combo-box.h | 0
{e-util => src/e-util}/e-charset.c | 0
{e-util => src/e-util}/e-charset.h | 0
{e-util => src/e-util}/e-client-cache.c | 0
{e-util => src/e-util}/e-client-cache.h | 0
{e-util => src/e-util}/e-client-combo-box.c | 0
{e-util => src/e-util}/e-client-combo-box.h | 0
{e-util => src/e-util}/e-client-selector.c | 0
{e-util => src/e-util}/e-client-selector.h | 0
{e-util => src/e-util}/e-color-chooser-widget.c | 0
{e-util => src/e-util}/e-color-chooser-widget.h | 0
{e-util => src/e-util}/e-color-combo.c | 0
{e-util => src/e-util}/e-color-combo.h | 0
{e-util => src/e-util}/e-config.c | 0
{e-util => src/e-util}/e-config.h | 0
.../e-util}/e-conflict-search-selector.c | 0
.../e-util}/e-conflict-search-selector.h | 0
{e-util => src/e-util}/e-contact-store.c | 0
{e-util => src/e-util}/e-contact-store.h | 0
{e-util => src/e-util}/e-content-editor.c | 0
{e-util => src/e-util}/e-content-editor.h | 0
{e-util => src/e-util}/e-content-request.c | 0
{e-util => src/e-util}/e-content-request.h | 0
{e-util => src/e-util}/e-data-capture.c | 0
{e-util => src/e-util}/e-data-capture.h | 0
{e-util => src/e-util}/e-dateedit.c | 0
{e-util => src/e-util}/e-dateedit.h | 0
{e-util => src/e-util}/e-datetime-format.c | 0
{e-util => src/e-util}/e-datetime-format.h | 0
{e-util => src/e-util}/e-destination-store.c | 0
{e-util => src/e-util}/e-destination-store.h | 0
{e-util => src/e-util}/e-dialog-utils.c | 0
{e-util => src/e-util}/e-dialog-utils.h | 0
{e-util => src/e-util}/e-dialog-widgets.c | 0
{e-util => src/e-util}/e-dialog-widgets.h | 0
{e-util => src/e-util}/e-emoticon-action.c | 0
{e-util => src/e-util}/e-emoticon-action.h | 0
{e-util => src/e-util}/e-emoticon-chooser-menu.c | 0
{e-util => src/e-util}/e-emoticon-chooser-menu.h | 0
{e-util => src/e-util}/e-emoticon-chooser.c | 0
{e-util => src/e-util}/e-emoticon-chooser.h | 0
{e-util => src/e-util}/e-emoticon-tool-button.c | 0
{e-util => src/e-util}/e-emoticon-tool-button.h | 0
{e-util => src/e-util}/e-emoticon.c | 0
{e-util => src/e-util}/e-emoticon.h | 0
{e-util => src/e-util}/e-event.c | 0
{e-util => src/e-util}/e-event.h | 0
{e-util => src/e-util}/e-file-request.c | 0
{e-util => src/e-util}/e-file-request.h | 0
{e-util => src/e-util}/e-file-utils.c | 0
{e-util => src/e-util}/e-file-utils.h | 0
{e-util => src/e-util}/e-filter-code.c | 0
{e-util => src/e-util}/e-filter-code.h | 0
{e-util => src/e-util}/e-filter-color.c | 0
{e-util => src/e-util}/e-filter-color.h | 0
{e-util => src/e-util}/e-filter-datespec.c | 0
{e-util => src/e-util}/e-filter-datespec.h | 0
{e-util => src/e-util}/e-filter-element.c | 0
{e-util => src/e-util}/e-filter-element.h | 0
{e-util => src/e-util}/e-filter-file.c | 0
{e-util => src/e-util}/e-filter-file.h | 0
{e-util => src/e-util}/e-filter-input.c | 0
{e-util => src/e-util}/e-filter-input.h | 0
{e-util => src/e-util}/e-filter-int.c | 0
{e-util => src/e-util}/e-filter-int.h | 0
{e-util => src/e-util}/e-filter-option.c | 0
{e-util => src/e-util}/e-filter-option.h | 0
{e-util => src/e-util}/e-filter-part.c | 0
{e-util => src/e-util}/e-filter-part.h | 0
{e-util => src/e-util}/e-filter-rule.c | 0
{e-util => src/e-util}/e-filter-rule.h | 0
{e-util => src/e-util}/e-focus-tracker.c | 0
{e-util => src/e-util}/e-focus-tracker.h | 0
{e-util => src/e-util}/e-html-editor-actions.c | 0
{e-util => src/e-util}/e-html-editor-actions.h | 0
{e-util => src/e-util}/e-html-editor-cell-dialog.c | 0
{e-util => src/e-util}/e-html-editor-cell-dialog.h | 0
{e-util => src/e-util}/e-html-editor-dialog.c | 0
{e-util => src/e-util}/e-html-editor-dialog.h | 0
{e-util => src/e-util}/e-html-editor-find-dialog.c | 0
{e-util => src/e-util}/e-html-editor-find-dialog.h | 0
.../e-util}/e-html-editor-hrule-dialog.c | 0
.../e-util}/e-html-editor-hrule-dialog.h | 0
.../e-util}/e-html-editor-image-dialog.c | 0
.../e-util}/e-html-editor-image-dialog.h | 0
{e-util => src/e-util}/e-html-editor-link-dialog.c | 0
{e-util => src/e-util}/e-html-editor-link-dialog.h | 0
{e-util => src/e-util}/e-html-editor-manager.ui | 0
{e-util => src/e-util}/e-html-editor-page-dialog.c | 0
{e-util => src/e-util}/e-html-editor-page-dialog.h | 0
.../e-util}/e-html-editor-paragraph-dialog.c | 0
.../e-util}/e-html-editor-paragraph-dialog.h | 0
{e-util => src/e-util}/e-html-editor-private.h | 0
.../e-util}/e-html-editor-replace-dialog.c | 0
.../e-util}/e-html-editor-replace-dialog.h | 0
.../e-util}/e-html-editor-spell-check-dialog.c | 0
.../e-util}/e-html-editor-spell-check-dialog.h | 0
.../e-util}/e-html-editor-table-dialog.c | 0
.../e-util}/e-html-editor-table-dialog.h | 0
{e-util => src/e-util}/e-html-editor-text-dialog.c | 0
{e-util => src/e-util}/e-html-editor-text-dialog.h | 0
{e-util => src/e-util}/e-html-editor.c | 0
{e-util => src/e-util}/e-html-editor.h | 0
{e-util => src/e-util}/e-html-utils.c | 0
{e-util => src/e-util}/e-html-utils.h | 0
{e-util => src/e-util}/e-icon-factory.c | 0
{e-util => src/e-util}/e-icon-factory.h | 0
{e-util => src/e-util}/e-image-chooser-dialog.c | 0
{e-util => src/e-util}/e-image-chooser-dialog.h | 0
{e-util => src/e-util}/e-image-chooser.c | 0
{e-util => src/e-util}/e-image-chooser.h | 0
{e-util => src/e-util}/e-import-assistant.c | 0
{e-util => src/e-util}/e-import-assistant.h | 0
{e-util => src/e-util}/e-import.c | 0
{e-util => src/e-util}/e-import.h | 0
{e-util => src/e-util}/e-interval-chooser.c | 0
{e-util => src/e-util}/e-interval-chooser.h | 0
{e-util => src/e-util}/e-mail-identity-combo-box.c | 0
{e-util => src/e-util}/e-mail-identity-combo-box.h | 0
.../e-util}/e-mail-signature-combo-box.c | 0
.../e-util}/e-mail-signature-combo-box.h | 0
{e-util => src/e-util}/e-mail-signature-editor.c | 0
{e-util => src/e-util}/e-mail-signature-editor.h | 0
{e-util => src/e-util}/e-mail-signature-manager.c | 0
{e-util => src/e-util}/e-mail-signature-manager.h | 0
{e-util => src/e-util}/e-mail-signature-preview.c | 0
{e-util => src/e-util}/e-mail-signature-preview.h | 0
.../e-util}/e-mail-signature-script-dialog.c | 0
.../e-util}/e-mail-signature-script-dialog.h | 0
.../e-util}/e-mail-signature-tree-view.c | 0
.../e-util}/e-mail-signature-tree-view.h | 0
{e-util => src/e-util}/e-map.c | 0
{e-util => src/e-util}/e-map.h | 0
{e-util => src/e-util}/e-marshal.list | 0
{e-util => src/e-util}/e-menu-tool-action.c | 0
{e-util => src/e-util}/e-menu-tool-action.h | 0
{e-util => src/e-util}/e-menu-tool-button.c | 0
{e-util => src/e-util}/e-menu-tool-button.h | 0
{e-util => src/e-util}/e-misc-utils.c | 0
{e-util => src/e-util}/e-misc-utils.h | 0
{e-util => src/e-util}/e-mktemp.c | 0
{e-util => src/e-util}/e-mktemp.h | 0
{e-util => src/e-util}/e-name-selector-dialog.c | 0
{e-util => src/e-util}/e-name-selector-dialog.h | 0
{e-util => src/e-util}/e-name-selector-entry.c | 0
{e-util => src/e-util}/e-name-selector-entry.h | 0
{e-util => src/e-util}/e-name-selector-list.c | 0
{e-util => src/e-util}/e-name-selector-list.h | 0
{e-util => src/e-util}/e-name-selector-model.c | 0
{e-util => src/e-util}/e-name-selector-model.h | 0
{e-util => src/e-util}/e-name-selector.c | 0
{e-util => src/e-util}/e-name-selector.h | 0
{e-util => src/e-util}/e-online-button.c | 0
{e-util => src/e-util}/e-online-button.h | 0
{e-util => src/e-util}/e-paned.c | 0
{e-util => src/e-util}/e-paned.h | 0
{e-util => src/e-util}/e-passwords.c | 0
{e-util => src/e-util}/e-passwords.h | 0
{e-util => src/e-util}/e-photo-cache.c | 0
{e-util => src/e-util}/e-photo-cache.h | 0
{e-util => src/e-util}/e-photo-source.c | 0
{e-util => src/e-util}/e-photo-source.h | 0
{e-util => src/e-util}/e-picture-gallery.c | 0
{e-util => src/e-util}/e-picture-gallery.h | 0
{e-util => src/e-util}/e-plugin-ui.c | 0
{e-util => src/e-util}/e-plugin-ui.h | 0
{e-util => src/e-util}/e-plugin.c | 0
{e-util => src/e-util}/e-plugin.h | 0
{e-util => src/e-util}/e-poolv.c | 0
{e-util => src/e-util}/e-poolv.h | 0
{e-util => src/e-util}/e-popup-action.c | 0
{e-util => src/e-util}/e-popup-action.h | 0
{e-util => src/e-util}/e-popup-menu.c | 0
{e-util => src/e-util}/e-popup-menu.h | 0
{e-util => src/e-util}/e-port-entry.c | 0
{e-util => src/e-util}/e-port-entry.h | 0
{e-util => src/e-util}/e-preferences-window.c | 0
{e-util => src/e-util}/e-preferences-window.h | 0
{e-util => src/e-util}/e-preview-pane.c | 0
{e-util => src/e-util}/e-preview-pane.h | 0
{e-util => src/e-util}/e-print.c | 0
{e-util => src/e-util}/e-print.h | 0
{e-util => src/e-util}/e-printable.c | 0
{e-util => src/e-util}/e-printable.h | 0
{e-util => src/e-util}/e-proxy-combo-box.c | 0
{e-util => src/e-util}/e-proxy-combo-box.h | 0
{e-util => src/e-util}/e-proxy-editor.c | 0
{e-util => src/e-util}/e-proxy-editor.h | 0
{e-util => src/e-util}/e-proxy-link-selector.c | 0
{e-util => src/e-util}/e-proxy-link-selector.h | 0
{e-util => src/e-util}/e-proxy-preferences.c | 0
{e-util => src/e-util}/e-proxy-preferences.h | 0
{e-util => src/e-util}/e-proxy-selector.c | 0
{e-util => src/e-util}/e-proxy-selector.h | 0
{e-util => src/e-util}/e-reflow-model.c | 0
{e-util => src/e-util}/e-reflow-model.h | 0
{e-util => src/e-util}/e-reflow.c | 0
{e-util => src/e-util}/e-reflow.h | 0
{e-util => src/e-util}/e-rule-context.c | 0
{e-util => src/e-util}/e-rule-context.h | 0
{e-util => src/e-util}/e-rule-editor.c | 0
{e-util => src/e-util}/e-rule-editor.h | 0
{e-util => src/e-util}/e-search-bar.c | 0
{e-util => src/e-util}/e-search-bar.h | 0
{e-util => src/e-util}/e-selectable.c | 0
{e-util => src/e-util}/e-selectable.h | 0
{e-util => src/e-util}/e-selection-model-array.c | 0
{e-util => src/e-util}/e-selection-model-array.h | 0
{e-util => src/e-util}/e-selection-model-simple.c | 0
{e-util => src/e-util}/e-selection-model-simple.h | 0
{e-util => src/e-util}/e-selection-model.c | 0
{e-util => src/e-util}/e-selection-model.h | 0
{e-util => src/e-util}/e-selection.c | 0
{e-util => src/e-util}/e-selection.h | 0
{e-util => src/e-util}/e-send-options.c | 0
{e-util => src/e-util}/e-send-options.h | 0
{e-util => src/e-util}/e-send-options.ui | 0
{e-util => src/e-util}/e-simple-async-result.c | 0
{e-util => src/e-util}/e-simple-async-result.h | 0
{e-util => src/e-util}/e-sorter-array.c | 0
{e-util => src/e-util}/e-sorter-array.h | 0
{e-util => src/e-util}/e-sorter.c | 0
{e-util => src/e-util}/e-sorter.h | 0
{e-util => src/e-util}/e-source-combo-box.c | 0
{e-util => src/e-util}/e-source-combo-box.h | 0
{e-util => src/e-util}/e-source-config-backend.c | 0
{e-util => src/e-util}/e-source-config-backend.h | 0
{e-util => src/e-util}/e-source-config-dialog.c | 0
{e-util => src/e-util}/e-source-config-dialog.h | 0
{e-util => src/e-util}/e-source-config.c | 0
{e-util => src/e-util}/e-source-config.h | 0
{e-util => src/e-util}/e-source-conflict-search.c | 0
{e-util => src/e-util}/e-source-conflict-search.h | 0
{e-util => src/e-util}/e-source-selector-dialog.c | 0
{e-util => src/e-util}/e-source-selector-dialog.h | 0
{e-util => src/e-util}/e-source-selector.c | 0
{e-util => src/e-util}/e-source-selector.h | 0
{e-util => src/e-util}/e-source-util.c | 0
{e-util => src/e-util}/e-source-util.h | 0
{e-util => src/e-util}/e-spell-checker.c | 0
{e-util => src/e-util}/e-spell-checker.h | 0
{e-util => src/e-util}/e-spell-dictionary.c | 0
{e-util => src/e-util}/e-spell-dictionary.h | 0
{e-util => src/e-util}/e-spell-entry.c | 0
{e-util => src/e-util}/e-spell-entry.h | 0
{e-util => src/e-util}/e-spell-text-view.c | 0
{e-util => src/e-util}/e-spell-text-view.h | 0
{e-util => src/e-util}/e-spinner.c | 0
{e-util => src/e-util}/e-spinner.h | 0
{e-util => src/e-util}/e-stock-request.c | 0
{e-util => src/e-util}/e-stock-request.h | 0
{e-util => src/e-util}/e-system.error.xml | 0
{e-util => src/e-util}/e-table-click-to-add.c | 0
{e-util => src/e-util}/e-table-click-to-add.h | 0
{e-util => src/e-util}/e-table-col-dnd.h | 0
{e-util => src/e-util}/e-table-col.c | 0
{e-util => src/e-util}/e-table-col.h | 0
{e-util => src/e-util}/e-table-column-selector.c | 0
{e-util => src/e-util}/e-table-column-selector.h | 0
.../e-util}/e-table-column-specification.c | 0
.../e-util}/e-table-column-specification.h | 0
{e-util => src/e-util}/e-table-config.c | 0
{e-util => src/e-util}/e-table-config.h | 0
{e-util => src/e-util}/e-table-config.ui | 0
{e-util => src/e-util}/e-table-defines.h | 0
{e-util => src/e-util}/e-table-extras.c | 0
{e-util => src/e-util}/e-table-extras.h | 0
.../e-util}/e-table-field-chooser-dialog.c | 0
.../e-util}/e-table-field-chooser-dialog.h | 0
.../e-util}/e-table-field-chooser-item.c | 0
.../e-util}/e-table-field-chooser-item.h | 0
{e-util => src/e-util}/e-table-field-chooser.c | 0
{e-util => src/e-util}/e-table-field-chooser.h | 0
{e-util => src/e-util}/e-table-group-container.c | 0
{e-util => src/e-util}/e-table-group-container.h | 0
{e-util => src/e-util}/e-table-group-leaf.c | 0
{e-util => src/e-util}/e-table-group-leaf.h | 0
{e-util => src/e-util}/e-table-group.c | 0
{e-util => src/e-util}/e-table-group.h | 0
src/e-util/e-table-header-item.c | 2298 +++++++++
{e-util => src/e-util}/e-table-header-item.h | 0
{e-util => src/e-util}/e-table-header-utils.c | 0
{e-util => src/e-util}/e-table-header-utils.h | 0
{e-util => src/e-util}/e-table-header.c | 0
{e-util => src/e-util}/e-table-header.h | 0
{e-util => src/e-util}/e-table-item.c | 0
{e-util => src/e-util}/e-table-item.h | 0
{e-util => src/e-util}/e-table-model.c | 0
{e-util => src/e-util}/e-table-model.h | 0
{e-util => src/e-util}/e-table-one.c | 0
{e-util => src/e-util}/e-table-one.h | 0
{e-util => src/e-util}/e-table-search.c | 0
{e-util => src/e-util}/e-table-search.h | 0
{e-util => src/e-util}/e-table-selection-model.c | 0
{e-util => src/e-util}/e-table-selection-model.h | 0
{e-util => src/e-util}/e-table-sort-info.c | 0
{e-util => src/e-util}/e-table-sort-info.h | 0
{e-util => src/e-util}/e-table-sorted-variable.c | 0
{e-util => src/e-util}/e-table-sorted-variable.h | 0
{e-util => src/e-util}/e-table-sorted.c | 0
{e-util => src/e-util}/e-table-sorted.h | 0
{e-util => src/e-util}/e-table-sorter.c | 0
{e-util => src/e-util}/e-table-sorter.h | 0
{e-util => src/e-util}/e-table-sorting-utils.c | 0
{e-util => src/e-util}/e-table-sorting-utils.h | 0
{e-util => src/e-util}/e-table-specification.c | 0
{e-util => src/e-util}/e-table-specification.h | 0
{e-util => src/e-util}/e-table-state.c | 0
{e-util => src/e-util}/e-table-state.h | 0
{e-util => src/e-util}/e-table-subset-variable.c | 0
{e-util => src/e-util}/e-table-subset-variable.h | 0
{e-util => src/e-util}/e-table-subset.c | 0
{e-util => src/e-util}/e-table-subset.h | 0
{e-util => src/e-util}/e-table-utils.c | 0
{e-util => src/e-util}/e-table-utils.h | 0
{e-util => src/e-util}/e-table.c | 0
{e-util => src/e-util}/e-table.h | 0
.../e-util}/e-text-event-processor-emacs-like.c | 0
.../e-util}/e-text-event-processor-emacs-like.h | 0
.../e-util}/e-text-event-processor-types.h | 0
{e-util => src/e-util}/e-text-event-processor.c | 0
{e-util => src/e-util}/e-text-event-processor.h | 0
{e-util => src/e-util}/e-text-model-repos.c | 0
{e-util => src/e-util}/e-text-model-repos.h | 0
{e-util => src/e-util}/e-text-model.c | 0
{e-util => src/e-util}/e-text-model.h | 0
{e-util => src/e-util}/e-text.c | 0
{e-util => src/e-util}/e-text.h | 0
{e-util => src/e-util}/e-timezone-dialog.c | 0
{e-util => src/e-util}/e-timezone-dialog.h | 0
{e-util => src/e-util}/e-timezone-dialog.ui | 0
{e-util => src/e-util}/e-tree-model-generator.c | 0
{e-util => src/e-util}/e-tree-model-generator.h | 0
{e-util => src/e-util}/e-tree-model.c | 0
{e-util => src/e-util}/e-tree-model.h | 0
{e-util => src/e-util}/e-tree-selection-model.c | 0
{e-util => src/e-util}/e-tree-selection-model.h | 0
{e-util => src/e-util}/e-tree-table-adapter.c | 0
{e-util => src/e-util}/e-tree-table-adapter.h | 0
{e-util => src/e-util}/e-tree-view-frame.c | 0
{e-util => src/e-util}/e-tree-view-frame.h | 0
{e-util => src/e-util}/e-tree.c | 0
{e-util => src/e-util}/e-tree.h | 0
{e-util => src/e-util}/e-unicode.c | 0
{e-util => src/e-util}/e-unicode.h | 0
{e-util => src/e-util}/e-url-entry.c | 0
{e-util => src/e-util}/e-url-entry.h | 0
{e-util => src/e-util}/e-util-enums.h | 0
{e-util => src/e-util}/e-util-private.h | 0
{e-util => src/e-util}/e-util.h | 0
{e-util => src/e-util}/e-web-view-preview.c | 0
{e-util => src/e-util}/e-web-view-preview.h | 0
{e-util => src/e-util}/e-web-view.c | 0
{e-util => src/e-util}/e-web-view.h | 0
{e-util => src/e-util}/e-widget-undo.c | 0
{e-util => src/e-util}/e-widget-undo.h | 0
{e-util => src/e-util}/e-win32-defaults.c | 0
{e-util => src/e-util}/e-win32-defaults.h | 0
{e-util => src/e-util}/e-win32-reloc.c | 0
{e-util => src/e-util}/e-xml-utils.c | 0
{e-util => src/e-util}/e-xml-utils.h | 0
{e-util => src/e-util}/ea-calendar-cell.c | 0
{e-util => src/e-util}/ea-calendar-cell.h | 0
{e-util => src/e-util}/ea-calendar-item.c | 0
{e-util => src/e-util}/ea-calendar-item.h | 0
{e-util => src/e-util}/ea-cell-table.c | 0
{e-util => src/e-util}/ea-cell-table.h | 0
{e-util => src/e-util}/ea-factory.h | 0
{e-util => src/e-util}/ea-widgets.c | 0
{e-util => src/e-util}/ea-widgets.h | 0
{e-util => src/e-util}/evolution-source-viewer.c | 0
{e-util => src/e-util}/filter.error.xml | 0
{e-util => src/e-util}/filter.ui | 0
{e-util => src/e-util}/gal-a11y-e-cell-popup.c | 0
{e-util => src/e-util}/gal-a11y-e-cell-popup.h | 0
{e-util => src/e-util}/gal-a11y-e-cell-registry.c | 0
{e-util => src/e-util}/gal-a11y-e-cell-registry.h | 0
{e-util => src/e-util}/gal-a11y-e-cell-text.c | 0
{e-util => src/e-util}/gal-a11y-e-cell-text.h | 0
{e-util => src/e-util}/gal-a11y-e-cell-toggle.c | 0
{e-util => src/e-util}/gal-a11y-e-cell-toggle.h | 0
{e-util => src/e-util}/gal-a11y-e-cell-tree.c | 0
{e-util => src/e-util}/gal-a11y-e-cell-tree.h | 0
{e-util => src/e-util}/gal-a11y-e-cell-vbox.c | 0
{e-util => src/e-util}/gal-a11y-e-cell-vbox.h | 0
{e-util => src/e-util}/gal-a11y-e-cell.c | 0
{e-util => src/e-util}/gal-a11y-e-cell.h | 0
.../gal-a11y-e-table-click-to-add-factory.c | 0
.../gal-a11y-e-table-click-to-add-factory.h | 0
.../e-util}/gal-a11y-e-table-click-to-add.c | 0
.../e-util}/gal-a11y-e-table-click-to-add.h | 0
.../e-util}/gal-a11y-e-table-column-header.c | 0
.../e-util}/gal-a11y-e-table-column-header.h | 0
{e-util => src/e-util}/gal-a11y-e-table-factory.c | 0
{e-util => src/e-util}/gal-a11y-e-table-factory.h | 0
.../e-util}/gal-a11y-e-table-item-factory.c | 0
.../e-util}/gal-a11y-e-table-item-factory.h | 0
{e-util => src/e-util}/gal-a11y-e-table-item.c | 0
{e-util => src/e-util}/gal-a11y-e-table-item.h | 0
{e-util => src/e-util}/gal-a11y-e-table.c | 0
{e-util => src/e-util}/gal-a11y-e-table.h | 0
{e-util => src/e-util}/gal-a11y-e-text-factory.c | 0
{e-util => src/e-util}/gal-a11y-e-text-factory.h | 0
{e-util => src/e-util}/gal-a11y-e-text.c | 0
{e-util => src/e-util}/gal-a11y-e-text.h | 0
{e-util => src/e-util}/gal-a11y-e-tree-factory.c | 0
{e-util => src/e-util}/gal-a11y-e-tree-factory.h | 0
{e-util => src/e-util}/gal-a11y-e-tree.c | 0
{e-util => src/e-util}/gal-a11y-e-tree.h | 0
{e-util => src/e-util}/gal-a11y-factory.h | 0
{e-util => src/e-util}/gal-a11y-util.c | 0
{e-util => src/e-util}/gal-a11y-util.h | 0
{e-util => src/e-util}/gal-view-collection.c | 0
{e-util => src/e-util}/gal-view-collection.h | 0
{e-util => src/e-util}/gal-view-etable.c | 0
{e-util => src/e-util}/gal-view-etable.h | 0
.../e-util}/gal-view-instance-save-as-dialog.c | 0
.../e-util}/gal-view-instance-save-as-dialog.h | 0
.../e-util}/gal-view-instance-save-as-dialog.ui | 0
{e-util => src/e-util}/gal-view-instance.c | 0
{e-util => src/e-util}/gal-view-instance.h | 0
{e-util => src/e-util}/gal-view.c | 0
{e-util => src/e-util}/gal-view.h | 0
{e-util => src/e-util}/test-calendar.c | 0
{e-util => src/e-util}/test-category-completion.c | 0
{e-util => src/e-util}/test-contact-store.c | 0
{e-util => src/e-util}/test-dateedit.c | 0
.../e-util}/test-html-editor-units-bugs.c | 0
.../e-util}/test-html-editor-units-bugs.h | 0
.../e-util}/test-html-editor-units-utils.c | 0
.../e-util}/test-html-editor-units-utils.h | 0
{e-util => src/e-util}/test-html-editor-units.c | 0
{e-util => src/e-util}/test-html-editor.c | 0
.../e-util}/test-keyfile-settings-backend.c | 0
.../e-util}/test-keyfile-settings-backend.h | 0
{e-util => src/e-util}/test-mail-signatures.c | 0
{e-util => src/e-util}/test-name-selector.c | 0
{e-util => src/e-util}/test-preferences-window.c | 0
{e-util => src/e-util}/test-proxy-preferences.c | 0
{e-util => src/e-util}/test-source-combo-box.c | 0
{e-util => src/e-util}/test-source-config.c | 0
{e-util => src/e-util}/test-source-selector.c | 0
{e-util => src/e-util}/test-tree-view-frame.c | 0
{e-util => src/e-util}/widgets.error.xml | 0
src/em-format/CMakeLists.txt | 147 +
.../em-format}/e-mail-extension-registry.c | 0
.../em-format}/e-mail-extension-registry.h | 0
.../em-format}/e-mail-formatter-attachment.c | 0
.../em-format}/e-mail-formatter-audio.c | 0
.../em-format}/e-mail-formatter-enums.h | 0
.../em-format}/e-mail-formatter-error.c | 0
.../em-format}/e-mail-formatter-extension.c | 0
.../em-format}/e-mail-formatter-extension.h | 0
.../em-format}/e-mail-formatter-headers.c | 0
.../em-format}/e-mail-formatter-image.c | 0
.../em-format}/e-mail-formatter-message-rfc822.c | 0
.../em-format}/e-mail-formatter-print-headers.c | 0
.../em-format}/e-mail-formatter-print.c | 0
.../em-format}/e-mail-formatter-print.h | 0
.../em-format}/e-mail-formatter-quote-headers.c | 0
.../e-mail-formatter-quote-message-rfc822.c | 0
.../e-mail-formatter-quote-text-enriched.c | 0
.../em-format}/e-mail-formatter-quote-text-html.c | 0
.../em-format}/e-mail-formatter-quote-text-plain.c | 0
.../em-format}/e-mail-formatter-quote.c | 0
.../em-format}/e-mail-formatter-quote.h | 0
.../em-format}/e-mail-formatter-secure-button.c | 0
.../em-format}/e-mail-formatter-source.c | 0
.../em-format}/e-mail-formatter-text-enriched.c | 0
.../em-format}/e-mail-formatter-text-html.c | 0
.../em-format}/e-mail-formatter-text-plain.c | 0
.../em-format}/e-mail-formatter-utils.c | 0
.../em-format}/e-mail-formatter-utils.h | 0
{em-format => src/em-format}/e-mail-formatter.c | 0
{em-format => src/em-format}/e-mail-formatter.h | 0
.../em-format}/e-mail-inline-filter.c | 0
.../em-format}/e-mail-inline-filter.h | 0
.../em-format}/e-mail-parser-application-mbox.c | 0
.../em-format}/e-mail-parser-application-smime.c | 0
{em-format => src/em-format}/e-mail-parser-audio.c | 0
.../em-format}/e-mail-parser-extension.c | 0
.../em-format}/e-mail-parser-extension.h | 0
.../em-format}/e-mail-parser-headers.c | 0
{em-format => src/em-format}/e-mail-parser-image.c | 0
.../em-format}/e-mail-parser-inlinepgp-encrypted.c | 0
.../em-format}/e-mail-parser-inlinepgp-signed.c | 0
.../e-mail-parser-message-deliverystatus.c | 0
.../em-format}/e-mail-parser-message-external.c | 0
.../em-format}/e-mail-parser-message-rfc822.c | 0
.../em-format}/e-mail-parser-message.c | 0
.../e-mail-parser-multipart-alternative.c | 0
.../e-mail-parser-multipart-appledouble.c | 0
.../em-format}/e-mail-parser-multipart-digest.c | 0
.../em-format}/e-mail-parser-multipart-encrypted.c | 0
.../em-format}/e-mail-parser-multipart-mixed.c | 0
.../em-format}/e-mail-parser-multipart-related.c | 0
.../em-format}/e-mail-parser-multipart-signed.c | 0
.../em-format}/e-mail-parser-secure-button.c | 0
.../em-format}/e-mail-parser-source.c | 0
.../em-format}/e-mail-parser-text-enriched.c | 0
.../em-format}/e-mail-parser-text-html.c | 0
.../em-format}/e-mail-parser-text-plain.c | 0
{em-format => src/em-format}/e-mail-parser.c | 0
{em-format => src/em-format}/e-mail-parser.h | 0
.../em-format}/e-mail-part-attachment.c | 0
.../em-format}/e-mail-part-attachment.h | 0
{em-format => src/em-format}/e-mail-part-audio.c | 0
{em-format => src/em-format}/e-mail-part-audio.h | 0
{em-format => src/em-format}/e-mail-part-headers.c | 0
{em-format => src/em-format}/e-mail-part-headers.h | 0
{em-format => src/em-format}/e-mail-part-image.c | 0
{em-format => src/em-format}/e-mail-part-image.h | 0
{em-format => src/em-format}/e-mail-part-list.c | 0
{em-format => src/em-format}/e-mail-part-list.h | 0
.../em-format}/e-mail-part-secure-button.c | 0
.../em-format}/e-mail-part-secure-button.h | 0
{em-format => src/em-format}/e-mail-part-utils.c | 0
{em-format => src/em-format}/e-mail-part-utils.h | 0
{em-format => src/em-format}/e-mail-part.c | 0
{em-format => src/em-format}/e-mail-part.h | 0
.../em-format}/e-mail-stripsig-filter.c | 0
.../em-format}/e-mail-stripsig-filter.h | 0
src/glade/CMakeLists.txt | 53 +
{maint => src/glade}/evolution.xml | 0
{maint => src/glade}/gladeevolution.c | 0
src/libemail-engine/CMakeLists.txt | 95 +
.../libemail-engine}/camel-null-store.c | 0
.../libemail-engine}/camel-null-store.h | 0
.../libemail-engine}/camel-sasl-oauth2-google.c | 0
.../libemail-engine}/camel-sasl-oauth2-google.h | 0
.../libemail-engine}/camel-sasl-xoauth2.c | 0
.../libemail-engine}/camel-sasl-xoauth2.h | 0
.../libemail-engine}/e-mail-engine-enums.h | 0
.../libemail-engine}/e-mail-folder-utils.c | 0
.../libemail-engine}/e-mail-folder-utils.h | 0
.../libemail-engine}/e-mail-junk-filter.c | 0
.../libemail-engine}/e-mail-junk-filter.h | 0
.../libemail-engine}/e-mail-session-utils.c | 0
.../libemail-engine}/e-mail-session-utils.h | 0
.../libemail-engine}/e-mail-session.c | 0
.../libemail-engine}/e-mail-session.h | 0
.../libemail-engine}/e-mail-store-utils.c | 0
.../libemail-engine}/e-mail-store-utils.h | 0
.../libemail-engine}/e-mail-utils.c | 0
.../libemail-engine}/e-mail-utils.h | 0
.../libemail-engine}/em-filter-folder-element.c | 0
.../libemail-engine}/em-filter-folder-element.h | 0
.../libemail-engine}/em-vfolder-context.c | 0
.../libemail-engine}/em-vfolder-context.h | 0
.../libemail-engine}/em-vfolder-rule.c | 0
.../libemail-engine}/em-vfolder-rule.h | 0
.../libemail-engine}/libemail-engine.h | 0
.../libemail-engine}/libemail-engine.pc.in | 0
.../libemail-engine}/mail-config.c | 0
.../libemail-engine}/mail-config.h | 0
.../libemail-engine}/mail-folder-cache.c | 0
.../libemail-engine}/mail-folder-cache.h | 0
{libemail-engine => src/libemail-engine}/mail-mt.c | 0
{libemail-engine => src/libemail-engine}/mail-mt.h | 0
.../libemail-engine}/mail-ops.c | 0
.../libemail-engine}/mail-ops.h | 0
.../libemail-engine}/mail-tools.c | 0
.../libemail-engine}/mail-tools.h | 0
.../libemail-engine}/mail-vfolder.c | 0
.../libemail-engine}/mail-vfolder.h | 0
src/libgnomecanvas/CMakeLists.txt | 72 +
.../libgnomecanvas}/gailcanvas.c | 0
.../libgnomecanvas}/gailcanvas.h | 0
.../libgnomecanvas}/gailcanvasgroup.c | 0
.../libgnomecanvas}/gailcanvasgroup.h | 0
.../libgnomecanvas}/gailcanvasgroupfactory.c | 0
.../libgnomecanvas}/gailcanvasgroupfactory.h | 0
.../libgnomecanvas}/gailcanvasitem.c | 0
.../libgnomecanvas}/gailcanvasitem.h | 0
.../libgnomecanvas}/gailcanvasitemfactory.c | 0
.../libgnomecanvas}/gailcanvasitemfactory.h | 0
.../libgnomecanvas}/gailcanvastext.c | 0
.../libgnomecanvas}/gailcanvastext.h | 0
.../libgnomecanvas}/gailcanvastextfactory.c | 0
.../libgnomecanvas}/gailcanvastextfactory.h | 0
.../libgnomecanvas}/gailcanvaswidget.c | 0
.../libgnomecanvas}/gailcanvaswidget.h | 0
.../libgnomecanvas}/gailcanvaswidgetfactory.c | 0
.../libgnomecanvas}/gailcanvaswidgetfactory.h | 0
.../libgnomecanvas}/gnome-canvas-i18n.h | 0
.../libgnomecanvas}/gnome-canvas-pixbuf.c | 0
.../libgnomecanvas}/gnome-canvas-pixbuf.h | 0
.../libgnomecanvas}/gnome-canvas-rect.c | 0
.../libgnomecanvas}/gnome-canvas-rect.h | 0
.../libgnomecanvas}/gnome-canvas-text.c | 0
.../libgnomecanvas}/gnome-canvas-text.h | 0
.../libgnomecanvas}/gnome-canvas-util.c | 0
.../libgnomecanvas}/gnome-canvas-util.h | 0
.../libgnomecanvas}/gnome-canvas-widget.c | 0
.../libgnomecanvas}/gnome-canvas-widget.h | 0
.../libgnomecanvas}/gnome-canvas.c | 0
.../libgnomecanvas}/gnome-canvas.h | 0
.../libgnomecanvas}/libgnomecanvas.h | 0
src/mail/CMakeLists.txt | 299 ++
{mail => src/mail}/README.async | 0
{mail => src/mail}/default/C/Inbox | 0
{mail => src/mail}/default/CMakeLists.txt | 0
{mail => src/mail}/default/ca/Inbox | 0
{mail => src/mail}/default/cs/Inbox | 0
{mail => src/mail}/default/de/Inbox | 0
{mail => src/mail}/default/es/Inbox | 0
{mail => src/mail}/default/fi/Inbox | 0
{mail => src/mail}/default/fr/Inbox | 0
{mail => src/mail}/default/hu/Inbox | 0
{mail => src/mail}/default/id/Inbox | 0
{mail => src/mail}/default/it/Inbox | 0
{mail => src/mail}/default/ja/Inbox | 0
{mail => src/mail}/default/ko/Inbox | 0
{mail => src/mail}/default/lt/Inbox | 0
{mail => src/mail}/default/mk/Inbox | 0
{mail => src/mail}/default/nl/Inbox | 0
{mail => src/mail}/default/pl/Inbox | 0
{mail => src/mail}/default/pt/Inbox | 0
{mail => src/mail}/default/ro/Inbox | 0
{mail => src/mail}/default/sr/Inbox | 0
{mail => src/mail}/default/sr@latin/Inbox | 0
{mail => src/mail}/default/sv/Inbox | 0
{mail => src/mail}/default/zh_CN/Inbox | 0
{mail => src/mail}/e-cid-request.c | 0
{mail => src/mail}/e-cid-request.h | 0
{mail => src/mail}/e-http-request.c | 0
{mail => src/mail}/e-http-request.h | 0
{mail => src/mail}/e-mail-account-manager.c | 0
{mail => src/mail}/e-mail-account-manager.h | 0
{mail => src/mail}/e-mail-account-store.c | 0
{mail => src/mail}/e-mail-account-store.h | 0
{mail => src/mail}/e-mail-account-tree-view.c | 0
{mail => src/mail}/e-mail-account-tree-view.h | 0
{mail => src/mail}/e-mail-autoconfig.c | 0
{mail => src/mail}/e-mail-autoconfig.h | 0
{mail => src/mail}/e-mail-backend.c | 0
{mail => src/mail}/e-mail-backend.h | 0
{mail => src/mail}/e-mail-browser.c | 0
{mail => src/mail}/e-mail-browser.h | 0
{mail => src/mail}/e-mail-config-activity-page.c | 0
{mail => src/mail}/e-mail-config-activity-page.h | 0
{mail => src/mail}/e-mail-config-assistant.c | 0
{mail => src/mail}/e-mail-config-assistant.h | 0
{mail => src/mail}/e-mail-config-auth-check.c | 0
{mail => src/mail}/e-mail-config-auth-check.h | 0
{mail => src/mail}/e-mail-config-confirm-page.c | 0
{mail => src/mail}/e-mail-config-confirm-page.h | 0
{mail => src/mail}/e-mail-config-defaults-page.c | 0
{mail => src/mail}/e-mail-config-defaults-page.h | 0
{mail => src/mail}/e-mail-config-identity-page.c | 0
{mail => src/mail}/e-mail-config-identity-page.h | 0
{mail => src/mail}/e-mail-config-lookup-page.c | 0
{mail => src/mail}/e-mail-config-lookup-page.h | 0
{mail => src/mail}/e-mail-config-notebook.c | 0
{mail => src/mail}/e-mail-config-notebook.h | 0
{mail => src/mail}/e-mail-config-page.c | 0
{mail => src/mail}/e-mail-config-page.h | 0
{mail => src/mail}/e-mail-config-provider-page.c | 0
{mail => src/mail}/e-mail-config-provider-page.h | 0
{mail => src/mail}/e-mail-config-receiving-page.c | 0
{mail => src/mail}/e-mail-config-receiving-page.h | 0
{mail => src/mail}/e-mail-config-security-page.c | 0
{mail => src/mail}/e-mail-config-security-page.h | 0
{mail => src/mail}/e-mail-config-sending-page.c | 0
{mail => src/mail}/e-mail-config-sending-page.h | 0
{mail => src/mail}/e-mail-config-service-backend.c | 0
{mail => src/mail}/e-mail-config-service-backend.h | 0
.../mail}/e-mail-config-service-notebook.c | 0
.../mail}/e-mail-config-service-notebook.h | 0
{mail => src/mail}/e-mail-config-service-page.c | 0
{mail => src/mail}/e-mail-config-service-page.h | 0
{mail => src/mail}/e-mail-config-sidebar.c | 0
{mail => src/mail}/e-mail-config-sidebar.h | 0
{mail => src/mail}/e-mail-config-summary-page.c | 0
{mail => src/mail}/e-mail-config-summary-page.h | 0
{mail => src/mail}/e-mail-config-welcome-page.c | 0
{mail => src/mail}/e-mail-config-welcome-page.h | 0
{mail => src/mail}/e-mail-config-window.c | 0
{mail => src/mail}/e-mail-config-window.h | 0
.../mail}/e-mail-display-popup-extension.c | 0
.../mail}/e-mail-display-popup-extension.h | 0
{mail => src/mail}/e-mail-display.c | 0
{mail => src/mail}/e-mail-display.h | 0
{mail => src/mail}/e-mail-enums.h | 0
{mail => src/mail}/e-mail-folder-create-dialog.c | 0
{mail => src/mail}/e-mail-folder-create-dialog.h | 0
{mail => src/mail}/e-mail-folder-pane.c | 0
{mail => src/mail}/e-mail-folder-pane.h | 0
{mail => src/mail}/e-mail-free-form-exp.c | 0
{mail => src/mail}/e-mail-free-form-exp.h | 0
{mail => src/mail}/e-mail-junk-options.c | 0
{mail => src/mail}/e-mail-junk-options.h | 0
{mail => src/mail}/e-mail-label-action.c | 0
{mail => src/mail}/e-mail-label-action.h | 0
{mail => src/mail}/e-mail-label-dialog.c | 0
{mail => src/mail}/e-mail-label-dialog.h | 0
{mail => src/mail}/e-mail-label-list-store.c | 0
{mail => src/mail}/e-mail-label-list-store.h | 0
{mail => src/mail}/e-mail-label-manager.c | 0
{mail => src/mail}/e-mail-label-manager.h | 0
{mail => src/mail}/e-mail-label-tree-view.c | 0
{mail => src/mail}/e-mail-label-tree-view.h | 0
{mail => src/mail}/e-mail-message-pane.c | 0
{mail => src/mail}/e-mail-message-pane.h | 0
{mail => src/mail}/e-mail-migrate.c | 0
{mail => src/mail}/e-mail-migrate.h | 0
{mail => src/mail}/e-mail-notes.c | 0
{mail => src/mail}/e-mail-notes.h | 0
{mail => src/mail}/e-mail-paned-view.c | 0
{mail => src/mail}/e-mail-paned-view.h | 0
{mail => src/mail}/e-mail-print-config-headers.c | 0
{mail => src/mail}/e-mail-print-config-headers.h | 0
{mail => src/mail}/e-mail-printer.c | 0
{mail => src/mail}/e-mail-printer.h | 0
{mail => src/mail}/e-mail-properties.c | 0
{mail => src/mail}/e-mail-properties.h | 0
{mail => src/mail}/e-mail-reader-utils.c | 0
{mail => src/mail}/e-mail-reader-utils.h | 0
{mail => src/mail}/e-mail-reader.c | 0
{mail => src/mail}/e-mail-reader.h | 0
{mail => src/mail}/e-mail-remote-content.c | 0
{mail => src/mail}/e-mail-remote-content.h | 0
{mail => src/mail}/e-mail-request.c | 0
{mail => src/mail}/e-mail-request.h | 0
{mail => src/mail}/e-mail-send-account-override.c | 0
{mail => src/mail}/e-mail-send-account-override.h | 0
{mail => src/mail}/e-mail-sidebar.c | 0
{mail => src/mail}/e-mail-sidebar.h | 0
{mail => src/mail}/e-mail-tag-editor.c | 0
{mail => src/mail}/e-mail-tag-editor.h | 0
{mail => src/mail}/e-mail-ui-session.c | 0
{mail => src/mail}/e-mail-ui-session.h | 0
{mail => src/mail}/e-mail-view.c | 0
{mail => src/mail}/e-mail-view.h | 0
{mail => src/mail}/e-mail.h | 0
{mail => src/mail}/em-composer-utils.c | 0
{mail => src/mail}/em-composer-utils.h | 0
{mail => src/mail}/em-config.c | 0
{mail => src/mail}/em-config.h | 0
{mail => src/mail}/em-event.c | 0
{mail => src/mail}/em-event.h | 0
{mail => src/mail}/em-filter-context.c | 0
{mail => src/mail}/em-filter-context.h | 0
.../mail}/em-filter-editor-folder-element.c | 0
.../mail}/em-filter-editor-folder-element.h | 0
{mail => src/mail}/em-filter-editor.c | 0
{mail => src/mail}/em-filter-editor.h | 0
{mail => src/mail}/em-filter-rule.c | 0
{mail => src/mail}/em-filter-rule.h | 0
{mail => src/mail}/em-filter-source-element.c | 0
{mail => src/mail}/em-filter-source-element.h | 0
{mail => src/mail}/em-folder-properties.c | 0
{mail => src/mail}/em-folder-properties.h | 0
{mail => src/mail}/em-folder-selection-button.c | 0
{mail => src/mail}/em-folder-selection-button.h | 0
{mail => src/mail}/em-folder-selector.c | 0
{mail => src/mail}/em-folder-selector.h | 0
{mail => src/mail}/em-folder-tree-model.c | 0
{mail => src/mail}/em-folder-tree-model.h | 0
{mail => src/mail}/em-folder-tree.c | 0
{mail => src/mail}/em-folder-tree.h | 0
{mail => src/mail}/em-folder-utils.c | 0
{mail => src/mail}/em-folder-utils.h | 0
{mail => src/mail}/em-search-context.c | 0
{mail => src/mail}/em-search-context.h | 0
{mail => src/mail}/em-subscription-editor.c | 0
{mail => src/mail}/em-subscription-editor.h | 0
{mail => src/mail}/em-utils.c | 0
{mail => src/mail}/em-utils.h | 0
{mail => src/mail}/em-vfolder-editor-context.c | 0
{mail => src/mail}/em-vfolder-editor-context.h | 0
{mail => src/mail}/em-vfolder-editor-rule.c | 0
{mail => src/mail}/em-vfolder-editor-rule.h | 0
{mail => src/mail}/em-vfolder-editor.c | 0
{mail => src/mail}/em-vfolder-editor.h | 0
{mail => src/mail}/filtertypes.xml.in | 0
src/mail/importers/CMakeLists.txt | 57 +
{mail => src/mail}/importers/elm-importer.c | 0
.../mail}/importers/evolution-mbox-importer.c | 0
{mail => src/mail}/importers/kmail-importer.c | 0
{mail => src/mail}/importers/kmail-libs.c | 0
{mail => src/mail}/importers/kmail-libs.h | 0
{mail => src/mail}/importers/mail-importer.c | 0
{mail => src/mail}/importers/mail-importer.h | 0
{mail => src/mail}/importers/pine-importer.c | 0
{mail => src/mail}/mail-autofilter.c | 0
{mail => src/mail}/mail-autofilter.h | 0
{mail => src/mail}/mail-config.ui | 0
{mail => src/mail}/mail-dialogs.ui | 0
{mail => src/mail}/mail-send-recv.c | 0
{mail => src/mail}/mail-send-recv.h | 0
{mail => src/mail}/mail-vfolder-ui.c | 0
{mail => src/mail}/mail-vfolder-ui.h | 0
{mail => src/mail}/mail.error.xml | 0
{mail => src/mail}/message-list.c | 0
{mail => src/mail}/message-list.etspec | 0
{mail => src/mail}/message-list.h | 0
{mail => src/mail}/searchtypes.xml.in | 0
{mail => src/mail}/test-mail-autoconfig.c | 0
{mail => src/mail}/vfoldertypes.xml.in | 0
src/modules/CMakeLists.txt | 141 +
src/modules/addressbook/CMakeLists.txt | 67 +
.../modules}/addressbook/autocompletion-config.c | 0
.../modules}/addressbook/autocompletion-config.h | 0
.../modules}/addressbook/e-book-config-hook.c | 0
.../modules}/addressbook/e-book-config-hook.h | 0
.../modules}/addressbook/e-book-shell-backend.c | 0
.../modules}/addressbook/e-book-shell-backend.h | 0
.../modules}/addressbook/e-book-shell-content.c | 0
.../modules}/addressbook/e-book-shell-content.h | 0
.../modules}/addressbook/e-book-shell-migrate.c | 0
.../modules}/addressbook/e-book-shell-migrate.h | 0
.../modules}/addressbook/e-book-shell-sidebar.c | 0
.../modules}/addressbook/e-book-shell-sidebar.h | 0
.../addressbook/e-book-shell-view-actions.c | 0
.../addressbook/e-book-shell-view-actions.h | 0
.../addressbook/e-book-shell-view-private.c | 0
.../addressbook/e-book-shell-view-private.h | 0
.../modules}/addressbook/e-book-shell-view.c | 0
.../modules}/addressbook/e-book-shell-view.h | 0
.../modules}/addressbook/eab-composer-util.c | 0
.../modules}/addressbook/eab-composer-util.h | 0
.../addressbook/evolution-module-addressbook.c | 0
.../modules}/addressbook/openldap-extract.h | 0
src/modules/backup-restore/CMakeLists.txt | 80 +
.../backup-restore/e-mail-config-restore-page.c | 0
.../backup-restore/e-mail-config-restore-page.h | 0
.../e-mail-config-restore-ready-page.c | 0
.../e-mail-config-restore-ready-page.h | 0
.../backup-restore/evolution-backup-restore.c | 0
.../backup-restore/evolution-backup-tool.c | 0
.../org-gnome-backup-restore.error.xml | 0
{modules => src/modules}/bogofilter/CMakeLists.txt | 0
.../modules}/bogofilter/evolution-bogofilter.c | 0
.../evolution-bogofilter.metainfo.xml.in | 0
.../modules}/book-config-google/CMakeLists.txt | 0
.../evolution-book-config-google.c | 0
.../modules}/book-config-ldap/CMakeLists.txt | 0
.../book-config-ldap/evolution-book-config-ldap.c | 0
.../modules}/book-config-local/CMakeLists.txt | 0
.../evolution-book-config-local.c | 0
.../modules}/book-config-webdav/CMakeLists.txt | 0
.../evolution-book-config-webdav.c | 0
.../modules}/cal-config-caldav/CMakeLists.txt | 0
.../evolution-cal-config-caldav.c | 0
.../modules}/cal-config-contacts/CMakeLists.txt | 0
.../cal-config-contacts/e-contacts-selector.c | 0
.../cal-config-contacts/e-contacts-selector.h | 0
.../evolution-cal-config-contacts.c | 0
.../modules}/cal-config-google/CMakeLists.txt | 0
.../cal-config-google/e-cal-config-google.c | 0
.../cal-config-google/e-cal-config-gtasks.c | 0
.../cal-config-google/e-google-chooser-button.c | 0
.../cal-config-google/e-google-chooser-button.h | 0
.../cal-config-google/module-cal-config-google.c | 0
.../cal-config-google/module-cal-config-google.h | 0
.../modules}/cal-config-local/CMakeLists.txt | 0
.../cal-config-local/evolution-cal-config-local.c | 0
.../modules}/cal-config-weather/CMakeLists.txt | 0
.../evolution-cal-config-weather.c | 0
.../modules}/cal-config-webcal/CMakeLists.txt | 0
.../evolution-cal-config-webcal.c | 0
{modules => src/modules}/calendar/CMakeLists.txt | 0
.../modules}/calendar/e-cal-attachment-handler.c | 0
.../modules}/calendar/e-cal-attachment-handler.h | 0
.../modules}/calendar/e-cal-base-shell-backend.c | 0
.../modules}/calendar/e-cal-base-shell-backend.h | 0
.../modules}/calendar/e-cal-base-shell-content.c | 0
.../modules}/calendar/e-cal-base-shell-content.h | 0
.../modules}/calendar/e-cal-base-shell-sidebar.c | 0
.../modules}/calendar/e-cal-base-shell-sidebar.h | 0
.../modules}/calendar/e-cal-base-shell-view.c | 0
.../modules}/calendar/e-cal-base-shell-view.h | 0
.../modules}/calendar/e-cal-config-hook.c | 0
.../modules}/calendar/e-cal-config-hook.h | 0
.../modules}/calendar/e-cal-event-hook.c | 0
.../modules}/calendar/e-cal-event-hook.h | 0
.../modules}/calendar/e-cal-shell-backend.c | 0
.../modules}/calendar/e-cal-shell-backend.h | 0
.../modules}/calendar/e-cal-shell-content.c | 0
.../modules}/calendar/e-cal-shell-content.h | 0
.../modules}/calendar/e-cal-shell-migrate.c | 0
.../modules}/calendar/e-cal-shell-migrate.h | 0
.../modules}/calendar/e-cal-shell-view-actions.c | 0
.../modules}/calendar/e-cal-shell-view-actions.h | 0
.../modules}/calendar/e-cal-shell-view-memopad.c | 0
.../modules}/calendar/e-cal-shell-view-private.c | 0
.../modules}/calendar/e-cal-shell-view-private.h | 0
.../modules}/calendar/e-cal-shell-view-taskpad.c | 0
.../modules}/calendar/e-cal-shell-view.c | 0
.../modules}/calendar/e-cal-shell-view.h | 0
.../modules}/calendar/e-calendar-preferences.c | 0
.../modules}/calendar/e-calendar-preferences.h | 0
.../modules}/calendar/e-calendar-preferences.ui | 0
.../modules}/calendar/e-memo-shell-backend.c | 0
.../modules}/calendar/e-memo-shell-backend.h | 0
.../modules}/calendar/e-memo-shell-content.c | 0
.../modules}/calendar/e-memo-shell-content.h | 0
.../modules}/calendar/e-memo-shell-migrate.c | 0
.../modules}/calendar/e-memo-shell-migrate.h | 0
.../modules}/calendar/e-memo-shell-view-actions.c | 0
.../modules}/calendar/e-memo-shell-view-actions.h | 0
.../modules}/calendar/e-memo-shell-view-private.c | 0
.../modules}/calendar/e-memo-shell-view-private.h | 0
.../modules}/calendar/e-memo-shell-view.c | 0
.../modules}/calendar/e-memo-shell-view.h | 0
.../modules}/calendar/e-task-shell-backend.c | 0
.../modules}/calendar/e-task-shell-backend.h | 0
.../modules}/calendar/e-task-shell-content.c | 0
.../modules}/calendar/e-task-shell-content.h | 0
.../modules}/calendar/e-task-shell-migrate.c | 0
.../modules}/calendar/e-task-shell-migrate.h | 0
.../modules}/calendar/e-task-shell-view-actions.c | 0
.../modules}/calendar/e-task-shell-view-actions.h | 0
.../modules}/calendar/e-task-shell-view-private.c | 0
.../modules}/calendar/e-task-shell-view-private.h | 0
.../modules}/calendar/e-task-shell-view.c | 0
.../modules}/calendar/e-task-shell-view.h | 0
.../modules}/calendar/evolution-module-calendar.c | 0
.../modules}/composer-autosave/CMakeLists.txt | 0
.../modules}/composer-autosave/e-autosave-utils.c | 0
.../modules}/composer-autosave/e-autosave-utils.h | 0
.../composer-autosave/e-composer-autosave.c | 0
.../composer-autosave/e-composer-autosave.h | 0
.../composer-autosave/e-composer-registry.c | 0
.../composer-autosave/e-composer-registry.h | 0
.../evolution-composer-autosave.c | 0
.../modules}/contact-photos/CMakeLists.txt | 0
.../contact-photos/e-contact-photo-source.c | 0
.../contact-photos/e-contact-photo-source.h | 0
.../contact-photos/e-photo-cache-contact-loader.c | 0
.../contact-photos/e-photo-cache-contact-loader.h | 0
.../contact-photos/evolution-contact-photos.c | 0
{modules => src/modules}/gravatar/CMakeLists.txt | 0
.../modules}/gravatar/e-gravatar-photo-source.c | 0
.../modules}/gravatar/e-gravatar-photo-source.h | 0
.../gravatar/e-photo-cache-gravatar-loader.c | 0
.../gravatar/e-photo-cache-gravatar-loader.h | 0
.../modules}/gravatar/evolution-module-gravatar.c | 0
.../modules}/itip-formatter/CMakeLists.txt | 0
.../itip-formatter/e-mail-formatter-itip.c | 0
.../itip-formatter/e-mail-formatter-itip.h | 0
.../modules}/itip-formatter/e-mail-parser-itip.c | 0
.../modules}/itip-formatter/e-mail-parser-itip.h | 0
.../modules}/itip-formatter/e-mail-part-itip.c | 0
.../modules}/itip-formatter/e-mail-part-itip.h | 0
.../evolution-module-itip-formatter.c | 0
.../itip-formatter/itip-view-elements-defines.h | 0
.../modules}/itip-formatter/itip-view.c | 0
.../modules}/itip-formatter/itip-view.h | 0
.../org-gnome-itip-formatter.error.xml | 0
.../itip-formatter/web-extension/CMakeLists.txt | 0
.../module-itip-formatter-dom-utils.c | 0
.../module-itip-formatter-dom-utils.h | 0
.../module-itip-formatter-web-extension.c | 0
.../module-itip-formatter-web-extension.h | 0
.../modules}/mail-config/CMakeLists.txt | 0
.../mail-config/e-mail-config-google-summary.c | 0
.../mail-config/e-mail-config-google-summary.h | 0
.../mail-config/e-mail-config-local-accounts.c | 0
.../mail-config/e-mail-config-remote-accounts.c | 0
.../mail-config/e-mail-config-sendmail-backend.c | 0
.../mail-config/e-mail-config-sendmail-backend.h | 0
.../mail-config/e-mail-config-smtp-backend.c | 0
.../mail-config/e-mail-config-smtp-backend.h | 0
.../mail-config/e-mail-config-yahoo-summary.c | 0
.../mail-config/e-mail-config-yahoo-summary.h | 0
.../modules}/mail-config/evolution-mail-config.c | 0
{modules => src/modules}/mail/CMakeLists.txt | 0
.../modules}/mail/e-mail-attachment-handler.c | 0
.../modules}/mail/e-mail-attachment-handler.h | 0
{modules => src/modules}/mail/e-mail-config-hook.c | 0
{modules => src/modules}/mail/e-mail-config-hook.h | 0
{modules => src/modules}/mail/e-mail-event-hook.c | 0
{modules => src/modules}/mail/e-mail-event-hook.h | 0
.../modules}/mail/e-mail-shell-backend.c | 0
.../modules}/mail/e-mail-shell-backend.h | 0
.../modules}/mail/e-mail-shell-content.c | 0
.../modules}/mail/e-mail-shell-content.h | 0
.../modules}/mail/e-mail-shell-sidebar.c | 0
.../modules}/mail/e-mail-shell-sidebar.h | 0
.../modules}/mail/e-mail-shell-view-actions.c | 0
.../modules}/mail/e-mail-shell-view-actions.h | 0
.../modules}/mail/e-mail-shell-view-private.c | 0
.../modules}/mail/e-mail-shell-view-private.h | 0
{modules => src/modules}/mail/e-mail-shell-view.c | 0
{modules => src/modules}/mail/e-mail-shell-view.h | 0
{modules => src/modules}/mail/em-account-prefs.c | 0
{modules => src/modules}/mail/em-account-prefs.h | 0
{modules => src/modules}/mail/em-composer-prefs.c | 0
{modules => src/modules}/mail/em-composer-prefs.h | 0
{modules => src/modules}/mail/em-mailer-prefs.c | 0
{modules => src/modules}/mail/em-mailer-prefs.h | 0
.../modules}/mail/evolution-module-mail.c | 0
.../modules}/mailto-handler/CMakeLists.txt | 0
.../mailto-handler/evolution-mailto-handler.c | 0
{modules => src/modules}/mdn/CMakeLists.txt | 0
{modules => src/modules}/mdn/evolution-mdn.c | 0
.../modules}/mdn/evolution-mdn.error.xml | 0
.../modules}/offline-alert/CMakeLists.txt | 0
.../offline-alert/evolution-offline-alert.c | 0
.../evolution-offline-alert.error.xml | 0
{modules => src/modules}/plugin-lib/CMakeLists.txt | 0
{modules => src/modules}/plugin-lib/e-plugin-lib.c | 0
{modules => src/modules}/plugin-lib/e-plugin-lib.h | 0
.../plugin-lib/evolution-module-plugin-lib.c | 0
.../modules}/plugin-manager/CMakeLists.txt | 0
.../plugin-manager/evolution-plugin-manager.c | 0
.../modules}/prefer-plain/CMakeLists.txt | 0
.../e-mail-display-popup-prefer-plain.c | 0
.../e-mail-display-popup-prefer-plain.h | 0
.../prefer-plain/e-mail-parser-prefer-plain.c | 0
.../prefer-plain/e-mail-parser-prefer-plain.h | 0
.../prefer-plain/evolution-module-prefer-plain.c | 0
src/modules/prefer-plain/plugin/CMakeLists.txt | 45 +
.../modules}/prefer-plain/plugin/config-ui.c | 0
.../plugin/org-gnome-prefer-plain.eplug.xml | 0
{modules => src/modules}/settings/CMakeLists.txt | 0
.../modules}/settings/e-settings-cal-model.c | 0
.../modules}/settings/e-settings-cal-model.h | 0
.../modules}/settings/e-settings-calendar-item.c | 0
.../modules}/settings/e-settings-calendar-item.h | 0
.../modules}/settings/e-settings-calendar-view.c | 0
.../modules}/settings/e-settings-calendar-view.h | 0
.../modules}/settings/e-settings-client-cache.c | 0
.../modules}/settings/e-settings-client-cache.h | 0
.../modules}/settings/e-settings-content-editor.c | 0
.../modules}/settings/e-settings-content-editor.h | 0
.../modules}/settings/e-settings-date-edit.c | 0
.../modules}/settings/e-settings-date-edit.h | 0
.../modules}/settings/e-settings-deprecated.c | 0
.../modules}/settings/e-settings-deprecated.h | 0
.../modules}/settings/e-settings-mail-browser.c | 0
.../modules}/settings/e-settings-mail-browser.h | 0
.../modules}/settings/e-settings-mail-formatter.c | 0
.../modules}/settings/e-settings-mail-formatter.h | 0
.../settings/e-settings-mail-part-headers.c | 0
.../settings/e-settings-mail-part-headers.h | 0
.../modules}/settings/e-settings-mail-reader.c | 0
.../modules}/settings/e-settings-mail-reader.h | 0
.../modules}/settings/e-settings-mail-session.c | 0
.../modules}/settings/e-settings-mail-session.h | 0
.../modules}/settings/e-settings-meeting-store.c | 0
.../modules}/settings/e-settings-meeting-store.h | 0
.../settings/e-settings-meeting-time-selector.c | 0
.../settings/e-settings-meeting-time-selector.h | 0
.../modules}/settings/e-settings-message-list.c | 0
.../modules}/settings/e-settings-message-list.h | 0
.../settings/e-settings-name-selector-entry.c | 0
.../settings/e-settings-name-selector-entry.h | 0
.../modules}/settings/e-settings-spell-checker.c | 0
.../modules}/settings/e-settings-spell-checker.h | 0
.../modules}/settings/e-settings-spell-entry.c | 0
.../modules}/settings/e-settings-spell-entry.h | 0
.../modules}/settings/e-settings-weekday-chooser.c | 0
.../modules}/settings/e-settings-weekday-chooser.h | 0
.../modules}/settings/evolution-module-settings.c | 0
.../modules}/spamassassin/CMakeLists.txt | 0
.../modules}/spamassassin/evolution-spamassassin.c | 0
.../evolution-spamassassin.metainfo.xml.in | 0
.../modules}/startup-wizard/CMakeLists.txt | 0
.../startup-wizard/e-mail-config-import-page.c | 0
.../startup-wizard/e-mail-config-import-page.h | 0
.../e-mail-config-import-progress-page.c | 0
.../e-mail-config-import-progress-page.h | 0
.../modules}/startup-wizard/e-startup-assistant.c | 0
.../modules}/startup-wizard/e-startup-assistant.h | 0
.../startup-wizard/evolution-startup-wizard.c | 0
.../modules}/text-highlight/CMakeLists.txt | 0
.../e-mail-display-popup-text-highlight.c | 0
.../e-mail-display-popup-text-highlight.h | 0
.../e-mail-formatter-text-highlight.c | 0
.../e-mail-formatter-text-highlight.h | 0
.../text-highlight/e-mail-parser-text-highlight.c | 0
.../text-highlight/e-mail-parser-text-highlight.h | 0
.../evolution-module-text-highlight.c | 0
.../modules}/text-highlight/languages.c | 0
.../modules}/text-highlight/languages.h | 0
.../modules}/tnef-attachment/CMakeLists.txt | 0
.../e-mail-parser-tnef-attachment.c | 0
.../e-mail-parser-tnef-attachment.h | 0
.../evolution-module-tnef-attachment.c | 0
.../modules}/vcard-inline/CMakeLists.txt | 0
.../modules}/vcard-inline/e-mail-formatter-vcard.c | 0
.../modules}/vcard-inline/e-mail-formatter-vcard.h | 0
.../modules}/vcard-inline/e-mail-parser-vcard.c | 0
.../modules}/vcard-inline/e-mail-parser-vcard.h | 0
.../modules}/vcard-inline/e-mail-part-vcard.c | 0
.../modules}/vcard-inline/e-mail-part-vcard.h | 0
.../vcard-inline/evolution-module-vcard-inline.c | 0
.../modules}/webkit-editor/CMakeLists.txt | 0
.../webkit-editor/e-webkit-editor-extension.c | 0
.../webkit-editor/e-webkit-editor-extension.h | 0
.../modules}/webkit-editor/e-webkit-editor.c | 0
.../modules}/webkit-editor/e-webkit-editor.h | 0
.../webkit-editor/evolution-module-webkit-editor.c | 0
.../webkit-editor/web-extension/CMakeLists.txt | 0
.../web-extension/e-composer-dom-functions.c | 0
.../web-extension/e-composer-dom-functions.h | 0
.../web-extension/e-dialogs-dom-functions.c | 0
.../web-extension/e-dialogs-dom-functions.h | 0
.../web-extension/e-editor-dom-functions.c | 0
.../web-extension/e-editor-dom-functions.h | 0
.../webkit-editor/web-extension/e-editor-page.c | 0
.../webkit-editor/web-extension/e-editor-page.h | 0
.../web-extension/e-editor-undo-redo-manager.c | 0
.../web-extension/e-editor-undo-redo-manager.h | 0
.../web-extension/e-editor-web-extension-main.c | 0
.../web-extension/e-editor-web-extension-names.h | 0
.../web-extension/e-editor-web-extension.c | 0
.../web-extension/e-editor-web-extension.h | 0
.../modules}/webkit-inspector/CMakeLists.txt | 0
.../webkit-inspector/evolution-webkit-inspector.c | 0
{plugins => src/plugins}/CMakeLists.txt | 0
src/plugins/attachment-reminder/CMakeLists.txt | 51 +
.../attachment-reminder/attachment-reminder.c | 0
.../org-gnome-attachment-reminder.error.xml | 0
...g-gnome-evolution-attachment-reminder.eplug.xml | 0
src/plugins/bbdb/CMakeLists.txt | 53 +
{plugins => src/plugins}/bbdb/bbdb.c | 0
{plugins => src/plugins}/bbdb/bbdb.h | 0
{plugins => src/plugins}/bbdb/gaimbuddies.c | 0
.../bbdb/org-gnome-evolution-bbdb.eplug.xml | 0
{plugins => src/plugins}/bbdb/test-evobuddy.c | 0
src/plugins/dbx-import/CMakeLists.txt | 48 +
{plugins => src/plugins}/dbx-import/dbx-importer.c | 0
.../dbx-import/org-gnome-dbx-import.eplug.xml | 0
src/plugins/email-custom-header/CMakeLists.txt | 55 +
.../email-custom-header/email-custom-header.c | 0
.../email-custom-header/email-custom-header.h | 0
.../org-gnome-email-custom-header.eplug.xml | 0
.../org-gnome-email-custom-header.ui | 0
src/plugins/external-editor/CMakeLists.txt | 51 +
.../plugins}/external-editor/external-editor.c | 0
.../org-gnome-external-editor.eplug.xml | 0
.../org-gnome-external-editor.error.xml | 0
src/plugins/face/CMakeLists.txt | 51 +
{plugins => src/plugins}/face/face.c | 0
.../plugins}/face/org-gnome-face.eplug.xml | 0
.../plugins}/face/org-gnome-face.error.xml | 0
src/plugins/mail-notification/CMakeLists.txt | 54 +
.../plugins}/mail-notification/mail-notification.c | 0
.../org-gnome-mail-notification.eplug.xml | 0
src/plugins/mail-to-task/CMakeLists.txt | 50 +
.../plugins}/mail-to-task/mail-to-task.c | 0
.../mail-to-task/org-gnome-mail-to-task.eplug.xml | 0
src/plugins/mailing-list-actions/CMakeLists.txt | 52 +
.../mailing-list-actions/mailing-list-actions.c | 0
.../org-gnome-mailing-list-actions.eplug.xml | 0
.../org-gnome-mailing-list-actions.error.xml | 0
src/plugins/pst-import/CMakeLists.txt | 52 +
.../pst-import/evolution-pst.metainfo.xml.in | 0
.../pst-import/org-gnome-pst-import.eplug.xml | 0
{plugins => src/plugins}/pst-import/pst-importer.c | 0
src/plugins/publish-calendar/CMakeLists.txt | 62 +
.../org-gnome-publish-calendar.eplug.xml | 0
.../plugins}/publish-calendar/publish-calendar.c | 0
.../plugins}/publish-calendar/publish-calendar.ui | 0
.../plugins}/publish-calendar/publish-format-fb.c | 0
.../plugins}/publish-calendar/publish-format-fb.h | 0
.../publish-calendar/publish-format-ical.c | 0
.../publish-calendar/publish-format-ical.h | 0
.../plugins}/publish-calendar/publish-location.c | 0
.../plugins}/publish-calendar/publish-location.h | 0
.../plugins}/publish-calendar/url-editor-dialog.c | 0
.../plugins}/publish-calendar/url-editor-dialog.h | 0
src/plugins/save-calendar/CMakeLists.txt | 50 +
.../plugins}/save-calendar/csv-format.c | 0
.../plugins}/save-calendar/format-handler.h | 0
.../plugins}/save-calendar/ical-format.c | 0
.../org-gnome-save-calendar.eplug.xml | 0
.../plugins}/save-calendar/rdf-format.c | 0
.../plugins}/save-calendar/save-calendar.c | 0
src/plugins/templates/CMakeLists.txt | 51 +
.../plugins}/templates/e-templates-store.c | 0
.../plugins}/templates/e-templates-store.h | 0
.../templates/org-gnome-templates.eplug.xml | 0
{plugins => src/plugins}/templates/templates.c | 0
src/shell/CMakeLists.txt | 224 +
{shell => src/shell}/e-convert-local-mail.c | 0
{shell => src/shell}/e-migrate-base-dirs.c | 0
{shell => src/shell}/e-shell-backend.c | 0
{shell => src/shell}/e-shell-backend.h | 0
{shell => src/shell}/e-shell-common.h | 0
{shell => src/shell}/e-shell-content.c | 0
{shell => src/shell}/e-shell-content.h | 0
{shell => src/shell}/e-shell-migrate.c | 0
{shell => src/shell}/e-shell-migrate.h | 0
{shell => src/shell}/e-shell-searchbar.c | 0
{shell => src/shell}/e-shell-searchbar.h | 0
{shell => src/shell}/e-shell-sidebar.c | 0
{shell => src/shell}/e-shell-sidebar.h | 0
{shell => src/shell}/e-shell-switcher.c | 0
{shell => src/shell}/e-shell-switcher.h | 0
{shell => src/shell}/e-shell-taskbar.c | 0
{shell => src/shell}/e-shell-taskbar.h | 0
{shell => src/shell}/e-shell-utils.c | 0
{shell => src/shell}/e-shell-utils.h | 0
{shell => src/shell}/e-shell-view.c | 0
{shell => src/shell}/e-shell-view.h | 0
{shell => src/shell}/e-shell-window-actions.c | 0
{shell => src/shell}/e-shell-window-actions.h | 0
{shell => src/shell}/e-shell-window-private.c | 0
{shell => src/shell}/e-shell-window-private.h | 0
{shell => src/shell}/e-shell-window.c | 0
{shell => src/shell}/e-shell-window.h | 0
{shell => src/shell}/e-shell.c | 0
{shell => src/shell}/e-shell.h | 0
{shell => src/shell}/evo-version.h.in | 0
{shell => src/shell}/evolution-icon.rc | 0
{shell => src/shell}/evolution-mail.ico | Bin 19622 -> 19622 bytes
{shell => src/shell}/evolution-memos.ico | Bin 19622 -> 19622 bytes
{shell => src/shell}/evolution-tasks.ico | Bin 19622 -> 19622 bytes
{shell => src/shell}/evolution.ico | Bin 19622 -> 19622 bytes
{shell => src/shell}/killev.c | 0
{shell => src/shell}/main.c | 0
{shell => src/shell}/shell.error.xml | 0
{smime => src/smime}/CMakeLists.txt | 0
src/smime/gui/CMakeLists.txt | 62 +
{smime => src/smime}/gui/ca-trust-dialog.c | 0
{smime => src/smime}/gui/ca-trust-dialog.h | 0
{smime => src/smime}/gui/cert-trust-dialog.c | 0
{smime => src/smime}/gui/cert-trust-dialog.h | 0
{smime => src/smime}/gui/certificate-manager.c | 0
{smime => src/smime}/gui/certificate-manager.h | 0
{smime => src/smime}/gui/component.c | 0
{smime => src/smime}/gui/component.h | 0
{smime => src/smime}/gui/e-cert-selector.c | 0
{smime => src/smime}/gui/e-cert-selector.h | 0
{smime => src/smime}/gui/smime-ui.ui | 0
src/smime/lib/CMakeLists.txt | 53 +
{smime => src/smime}/lib/e-cert-db.c | 0
{smime => src/smime}/lib/e-cert-db.h | 0
{smime => src/smime}/lib/e-cert-trust.c | 0
{smime => src/smime}/lib/e-cert-trust.h | 0
{smime => src/smime}/lib/e-cert.c | 0
{smime => src/smime}/lib/e-cert.h | 0
{smime => src/smime}/lib/e-pkcs12.c | 0
{smime => src/smime}/lib/e-pkcs12.h | 0
{smime => src/smime}/tests/import-cert.c | 0
src/web-extensions/CMakeLists.txt | 94 +
.../web-extensions}/e-dom-utils.c | 0
.../web-extensions}/e-dom-utils.h | 0
.../web-extensions}/e-web-extension-main.c | 0
.../web-extensions}/e-web-extension-names.h | 0
.../web-extensions}/e-web-extension.c | 0
.../web-extensions}/e-web-extension.h | 0
web-extensions/CMakeLists.txt | 92 -
1798 files changed, 16378 insertions(+), 17104 deletions(-)
---
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9ff5472..77853af 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -664,38 +664,15 @@ add_pkgconfig_file(evolution-shell.pc.in evolution-shell-${INTERFACE_VERSION}.pc
add_appdata_file(evolution.appdata.xml.in evolution.appdata.xml)
-add_subdirectory(addressbook)
-add_subdirectory(art)
-add_subdirectory(calendar)
-add_subdirectory(composer)
add_subdirectory(data)
-add_subdirectory(em-format)
-add_subdirectory(e-util)
-add_subdirectory(libemail-engine)
-add_subdirectory(libgnomecanvas)
-add_subdirectory(mail)
-add_subdirectory(modules)
-add_subdirectory(plugins)
add_subdirectory(po)
-add_subdirectory(shell)
-add_subdirectory(sounds)
+add_subdirectory(src)
add_subdirectory(tests)
-add_subdirectory(ui)
-add_subdirectory(views)
-add_subdirectory(web-extensions)
if(ENABLE_GTK_DOC)
- add_subdirectory(doc)
+ add_subdirectory(docs)
endif(ENABLE_GTK_DOC)
if(WITH_HELP)
add_subdirectory(help)
endif(WITH_HELP)
-
-if(WITH_GLADE_CATALOG)
- add_subdirectory(maint)
-endif(WITH_GLADE_CATALOG)
-
-if(ENABLE_SMIME)
- add_subdirectory(smime)
-endif(ENABLE_SMIME)
diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt
index 486e9b0..e6fb9cd 100644
--- a/data/CMakeLists.txt
+++ b/data/CMakeLists.txt
@@ -77,3 +77,7 @@ install(FILES evolution.convert
)
add_subdirectory(icons)
+add_subdirectory(images)
+add_subdirectory(sounds)
+add_subdirectory(ui)
+add_subdirectory(views)
diff --git a/art/CMakeLists.txt b/data/images/CMakeLists.txt
similarity index 100%
rename from art/CMakeLists.txt
rename to data/images/CMakeLists.txt
diff --git a/art/README b/data/images/README
similarity index 100%
rename from art/README
rename to data/images/README
diff --git a/sounds/CMakeLists.txt b/data/sounds/CMakeLists.txt
similarity index 100%
rename from sounds/CMakeLists.txt
rename to data/sounds/CMakeLists.txt
diff --git a/ui/CMakeLists.txt b/data/ui/CMakeLists.txt
similarity index 100%
rename from ui/CMakeLists.txt
rename to data/ui/CMakeLists.txt
diff --git a/ui/evolution-calendars.ui b/data/ui/evolution-calendars.ui
similarity index 100%
rename from ui/evolution-calendars.ui
rename to data/ui/evolution-calendars.ui
diff --git a/ui/evolution-contacts.ui b/data/ui/evolution-contacts.ui
similarity index 100%
rename from ui/evolution-contacts.ui
rename to data/ui/evolution-contacts.ui
diff --git a/ui/evolution-mail-reader.ui b/data/ui/evolution-mail-reader.ui
similarity index 100%
rename from ui/evolution-mail-reader.ui
rename to data/ui/evolution-mail-reader.ui
diff --git a/ui/evolution-mail.ui b/data/ui/evolution-mail.ui
similarity index 100%
rename from ui/evolution-mail.ui
rename to data/ui/evolution-mail.ui
diff --git a/ui/evolution-memos.ui b/data/ui/evolution-memos.ui
similarity index 100%
rename from ui/evolution-memos.ui
rename to data/ui/evolution-memos.ui
diff --git a/ui/evolution-shell.ui b/data/ui/evolution-shell.ui
similarity index 100%
rename from ui/evolution-shell.ui
rename to data/ui/evolution-shell.ui
diff --git a/ui/evolution-tasks.ui b/data/ui/evolution-tasks.ui
similarity index 100%
rename from ui/evolution-tasks.ui
rename to data/ui/evolution-tasks.ui
diff --git a/views/CMakeLists.txt b/data/views/CMakeLists.txt
similarity index 100%
rename from views/CMakeLists.txt
rename to data/views/CMakeLists.txt
diff --git a/views/addressbook/Address_Cards.galview b/data/views/addressbook/Address_Cards.galview
similarity index 100%
rename from views/addressbook/Address_Cards.galview
rename to data/views/addressbook/Address_Cards.galview
diff --git a/views/addressbook/By_Company.galview b/data/views/addressbook/By_Company.galview
similarity index 100%
rename from views/addressbook/By_Company.galview
rename to data/views/addressbook/By_Company.galview
diff --git a/views/addressbook/CMakeLists.txt b/data/views/addressbook/CMakeLists.txt
similarity index 100%
rename from views/addressbook/CMakeLists.txt
rename to data/views/addressbook/CMakeLists.txt
diff --git a/views/addressbook/Phone_List.galview b/data/views/addressbook/Phone_List.galview
similarity index 100%
rename from views/addressbook/Phone_List.galview
rename to data/views/addressbook/Phone_List.galview
diff --git a/views/addressbook/galview.xml b/data/views/addressbook/galview.xml
similarity index 100%
rename from views/addressbook/galview.xml
rename to data/views/addressbook/galview.xml
diff --git a/views/calendar/CMakeLists.txt b/data/views/calendar/CMakeLists.txt
similarity index 100%
rename from views/calendar/CMakeLists.txt
rename to data/views/calendar/CMakeLists.txt
diff --git a/views/calendar/List_View.galview b/data/views/calendar/List_View.galview
similarity index 100%
rename from views/calendar/List_View.galview
rename to data/views/calendar/List_View.galview
diff --git a/views/calendar/galview.xml b/data/views/calendar/galview.xml
similarity index 100%
rename from views/calendar/galview.xml
rename to data/views/calendar/galview.xml
diff --git a/views/mail/As_Sent_Folder.galview b/data/views/mail/As_Sent_Folder.galview
similarity index 100%
rename from views/mail/As_Sent_Folder.galview
rename to data/views/mail/As_Sent_Folder.galview
diff --git a/views/mail/By_Follow_Up_Flag.galview b/data/views/mail/By_Follow_Up_Flag.galview
similarity index 100%
rename from views/mail/By_Follow_Up_Flag.galview
rename to data/views/mail/By_Follow_Up_Flag.galview
diff --git a/views/mail/By_Sender.galview b/data/views/mail/By_Sender.galview
similarity index 100%
rename from views/mail/By_Sender.galview
rename to data/views/mail/By_Sender.galview
diff --git a/views/mail/By_Status.galview b/data/views/mail/By_Status.galview
similarity index 100%
rename from views/mail/By_Status.galview
rename to data/views/mail/By_Status.galview
diff --git a/views/mail/By_Subject.galview b/data/views/mail/By_Subject.galview
similarity index 100%
rename from views/mail/By_Subject.galview
rename to data/views/mail/By_Subject.galview
diff --git a/views/mail/CMakeLists.txt b/data/views/mail/CMakeLists.txt
similarity index 100%
rename from views/mail/CMakeLists.txt
rename to data/views/mail/CMakeLists.txt
diff --git a/views/mail/Messages.galview b/data/views/mail/Messages.galview
similarity index 100%
rename from views/mail/Messages.galview
rename to data/views/mail/Messages.galview
diff --git a/views/mail/Wide_View_Normal.galview b/data/views/mail/Wide_View_Normal.galview
similarity index 100%
rename from views/mail/Wide_View_Normal.galview
rename to data/views/mail/Wide_View_Normal.galview
diff --git a/views/mail/Wide_View_Sent.galview b/data/views/mail/Wide_View_Sent.galview
similarity index 100%
rename from views/mail/Wide_View_Sent.galview
rename to data/views/mail/Wide_View_Sent.galview
diff --git a/views/mail/galview.xml b/data/views/mail/galview.xml
similarity index 100%
rename from views/mail/galview.xml
rename to data/views/mail/galview.xml
diff --git a/views/memos/CMakeLists.txt b/data/views/memos/CMakeLists.txt
similarity index 100%
rename from views/memos/CMakeLists.txt
rename to data/views/memos/CMakeLists.txt
diff --git a/views/memos/Memos.galview b/data/views/memos/Memos.galview
similarity index 100%
rename from views/memos/Memos.galview
rename to data/views/memos/Memos.galview
diff --git a/views/memos/galview.xml b/data/views/memos/galview.xml
similarity index 100%
rename from views/memos/galview.xml
rename to data/views/memos/galview.xml
diff --git a/views/tasks/CMakeLists.txt b/data/views/tasks/CMakeLists.txt
similarity index 100%
rename from views/tasks/CMakeLists.txt
rename to data/views/tasks/CMakeLists.txt
diff --git a/views/tasks/Tasks.galview b/data/views/tasks/Tasks.galview
similarity index 100%
rename from views/tasks/Tasks.galview
rename to data/views/tasks/Tasks.galview
diff --git a/views/tasks/With_DueDate.galview b/data/views/tasks/With_DueDate.galview
similarity index 100%
rename from views/tasks/With_DueDate.galview
rename to data/views/tasks/With_DueDate.galview
diff --git a/views/tasks/With_Status.galview b/data/views/tasks/With_Status.galview
similarity index 100%
rename from views/tasks/With_Status.galview
rename to data/views/tasks/With_Status.galview
diff --git a/views/tasks/galview.xml b/data/views/tasks/galview.xml
similarity index 100%
rename from views/tasks/galview.xml
rename to data/views/tasks/galview.xml
diff --git a/e-util/arrow-down.xpm b/data/xpm/arrow-down.xpm
similarity index 100%
rename from e-util/arrow-down.xpm
rename to data/xpm/arrow-down.xpm
diff --git a/e-util/arrow-up.xpm b/data/xpm/arrow-up.xpm
similarity index 100%
rename from e-util/arrow-up.xpm
rename to data/xpm/arrow-up.xpm
diff --git a/e-util/check-empty.xpm b/data/xpm/check-empty.xpm
similarity index 100%
rename from e-util/check-empty.xpm
rename to data/xpm/check-empty.xpm
diff --git a/e-util/check-filled.xpm b/data/xpm/check-filled.xpm
similarity index 100%
rename from e-util/check-filled.xpm
rename to data/xpm/check-filled.xpm
diff --git a/art/empty.xpm b/data/xpm/empty.xpm
similarity index 100%
rename from art/empty.xpm
rename to data/xpm/empty.xpm
diff --git a/art/jump.xpm b/data/xpm/jump.xpm
similarity index 100%
rename from art/jump.xpm
rename to data/xpm/jump.xpm
diff --git a/doc/CMakeLists.txt b/docs/CMakeLists.txt
similarity index 100%
rename from doc/CMakeLists.txt
rename to docs/CMakeLists.txt
diff --git a/doc/COPYING-DOCS.CCBYSA b/docs/COPYING-DOCS.CCBYSA
similarity index 100%
rename from doc/COPYING-DOCS.CCBYSA
rename to docs/COPYING-DOCS.CCBYSA
diff --git a/doc/COPYING-DOCS.GFDL b/docs/COPYING-DOCS.GFDL
similarity index 100%
rename from doc/COPYING-DOCS.GFDL
rename to docs/COPYING-DOCS.GFDL
diff --git a/doc/devel/build-eplugin-manual.pl b/docs/devel/build-eplugin-manual.pl
similarity index 100%
rename from doc/devel/build-eplugin-manual.pl
rename to docs/devel/build-eplugin-manual.pl
diff --git a/doc/devel/evolution-devel-guide.sgml b/docs/devel/evolution-devel-guide.sgml
similarity index 100%
rename from doc/devel/evolution-devel-guide.sgml
rename to docs/devel/evolution-devel-guide.sgml
diff --git a/doc/devel/evolution-plugin-manual.xml b/docs/devel/evolution-plugin-manual.xml
similarity index 100%
rename from doc/devel/evolution-plugin-manual.xml
rename to docs/devel/evolution-plugin-manual.xml
diff --git a/doc/devel/executive-summary/evolution-services.hierarchy
b/docs/devel/executive-summary/evolution-services.hierarchy
similarity index 100%
rename from doc/devel/executive-summary/evolution-services.hierarchy
rename to docs/devel/executive-summary/evolution-services.hierarchy
diff --git a/doc/devel/fdl.sgml b/docs/devel/fdl.sgml
similarity index 100%
rename from doc/devel/fdl.sgml
rename to docs/devel/fdl.sgml
diff --git a/doc/devel/images/Makefile b/docs/devel/images/Makefile
similarity index 100%
rename from doc/devel/images/Makefile
rename to docs/devel/images/Makefile
diff --git a/doc/devel/images/e-config-flow.pic b/docs/devel/images/e-config-flow.pic
similarity index 100%
rename from doc/devel/images/e-config-flow.pic
rename to docs/devel/images/e-config-flow.pic
diff --git a/doc/devel/images/e-popup-merge-1.pic b/docs/devel/images/e-popup-merge-1.pic
similarity index 100%
rename from doc/devel/images/e-popup-merge-1.pic
rename to docs/devel/images/e-popup-merge-1.pic
diff --git a/doc/devel/images/e-popup-merge-2.pic b/docs/devel/images/e-popup-merge-2.pic
similarity index 100%
rename from doc/devel/images/e-popup-merge-2.pic
rename to docs/devel/images/e-popup-merge-2.pic
diff --git a/devel-docs/misc/errors.txt b/docs/devel/misc/errors.txt
similarity index 100%
rename from devel-docs/misc/errors.txt
rename to docs/devel/misc/errors.txt
diff --git a/devel-docs/misc/ref_and_id_proposition.txt b/docs/devel/misc/ref_and_id_proposition.txt
similarity index 100%
rename from devel-docs/misc/ref_and_id_proposition.txt
rename to docs/devel/misc/ref_and_id_proposition.txt
diff --git a/doc/devel/preface.sgml b/docs/devel/preface.sgml
similarity index 100%
rename from doc/devel/preface.sgml
rename to docs/devel/preface.sgml
diff --git a/devel-docs/query/virtual-folder-in-depth.sgml b/docs/devel/query/virtual-folder-in-depth.sgml
similarity index 100%
rename from devel-docs/query/virtual-folder-in-depth.sgml
rename to docs/devel/query/virtual-folder-in-depth.sgml
diff --git a/devel-docs/query/virtual-folder-in-depth.txt b/docs/devel/query/virtual-folder-in-depth.txt
similarity index 100%
rename from devel-docs/query/virtual-folder-in-depth.txt
rename to docs/devel/query/virtual-folder-in-depth.txt
diff --git a/doc/devel/reference.sgml b/docs/devel/reference.sgml
similarity index 100%
rename from doc/devel/reference.sgml
rename to docs/devel/reference.sgml
diff --git a/doc/reference/CMakeLists.txt b/docs/reference/CMakeLists.txt
similarity index 100%
rename from doc/reference/CMakeLists.txt
rename to docs/reference/CMakeLists.txt
diff --git a/docs/reference/evolution-mail-composer/CMakeLists.txt
b/docs/reference/evolution-mail-composer/CMakeLists.txt
new file mode 100644
index 0000000..c140ae4
--- /dev/null
+++ b/docs/reference/evolution-mail-composer/CMakeLists.txt
@@ -0,0 +1,14 @@
+set(SOURCEDIRS
+ ${CMAKE_SOURCE_DIR}/src/composer
+)
+
+set(DEPENDENCIES
+ evolution-mail-composer
+)
+
+set(IGNORE_HEADERS
+ e-composer-actions.h
+ e-composer-private.h
+)
+
+add_gtkdoc(evolution-mail-composer composer "" SOURCEDIRS DEPENDENCIES IGNORE_HEADERS)
diff --git a/doc/reference/evolution-mail-composer/evolution-mail-composer-docs.sgml.in
b/docs/reference/evolution-mail-composer/evolution-mail-composer-docs.sgml.in
similarity index 100%
rename from doc/reference/evolution-mail-composer/evolution-mail-composer-docs.sgml.in
rename to docs/reference/evolution-mail-composer/evolution-mail-composer-docs.sgml.in
diff --git a/docs/reference/evolution-mail-engine/CMakeLists.txt
b/docs/reference/evolution-mail-engine/CMakeLists.txt
new file mode 100644
index 0000000..bbdcba0
--- /dev/null
+++ b/docs/reference/evolution-mail-engine/CMakeLists.txt
@@ -0,0 +1,13 @@
+set(SOURCEDIRS
+ ${CMAKE_SOURCE_DIR}/src/libemail-engine
+)
+
+set(DEPENDENCIES
+ email-engine
+)
+
+set(IGNORE_HEADERS
+ e-mail-engine-enumtypes.h
+)
+
+add_gtkdoc(evolution-mail-engine email-engine "" SOURCEDIRS DEPENDENCIES IGNORE_HEADERS)
diff --git a/doc/reference/evolution-mail-engine/evolution-mail-engine-docs.sgml.in
b/docs/reference/evolution-mail-engine/evolution-mail-engine-docs.sgml.in
similarity index 100%
rename from doc/reference/evolution-mail-engine/evolution-mail-engine-docs.sgml.in
rename to docs/reference/evolution-mail-engine/evolution-mail-engine-docs.sgml.in
diff --git a/docs/reference/evolution-mail-formatter/CMakeLists.txt
b/docs/reference/evolution-mail-formatter/CMakeLists.txt
new file mode 100644
index 0000000..5dc70f7
--- /dev/null
+++ b/docs/reference/evolution-mail-formatter/CMakeLists.txt
@@ -0,0 +1,13 @@
+set(SOURCEDIRS
+ ${CMAKE_SOURCE_DIR}/src/em-format
+)
+
+set(DEPENDENCIES
+ evolution-mail-formatter
+)
+
+set(IGNORE_HEADERS
+ e-mail-formatter-enumtypes.h
+)
+
+add_gtkdoc(evolution-mail-formatter em-format "" SOURCEDIRS DEPENDENCIES IGNORE_HEADERS)
diff --git a/doc/reference/evolution-mail-formatter/evolution-mail-formatter-docs.sgml.in
b/docs/reference/evolution-mail-formatter/evolution-mail-formatter-docs.sgml.in
similarity index 100%
rename from doc/reference/evolution-mail-formatter/evolution-mail-formatter-docs.sgml.in
rename to docs/reference/evolution-mail-formatter/evolution-mail-formatter-docs.sgml.in
diff --git a/docs/reference/evolution-shell/CMakeLists.txt b/docs/reference/evolution-shell/CMakeLists.txt
new file mode 100644
index 0000000..327b5d1
--- /dev/null
+++ b/docs/reference/evolution-shell/CMakeLists.txt
@@ -0,0 +1,17 @@
+set(SOURCEDIRS
+ ${CMAKE_SOURCE_DIR}/src/shell
+)
+
+set(DEPENDENCIES
+ email-engine
+ evolution-util
+ evolution-shell
+)
+
+set(IGNORE_HEADERS
+ evo-version.h
+ e-shell-window-private.h
+ e-shell-enumtypes.h
+)
+
+add_gtkdoc(evolution-shell shell "" SOURCEDIRS DEPENDENCIES IGNORE_HEADERS)
diff --git a/doc/reference/evolution-shell/evolution-shell-docs.sgml.in
b/docs/reference/evolution-shell/evolution-shell-docs.sgml.in
similarity index 100%
rename from doc/reference/evolution-shell/evolution-shell-docs.sgml.in
rename to docs/reference/evolution-shell/evolution-shell-docs.sgml.in
diff --git a/docs/reference/evolution-util/CMakeLists.txt b/docs/reference/evolution-util/CMakeLists.txt
new file mode 100644
index 0000000..355d2fd
--- /dev/null
+++ b/docs/reference/evolution-util/CMakeLists.txt
@@ -0,0 +1,49 @@
+set(SOURCEDIRS
+ ${CMAKE_SOURCE_DIR}/src/e-util
+)
+
+set(DEPENDENCIES
+ email-engine
+ evolution-util
+ evolution-shell
+)
+
+set(IGNORE_HEADERS
+ e-html-editor-actions.h
+ e-html-editor-private.h
+ e-marshal.h
+ e-table-col-dnd.h
+ e-table-defines.h
+ e-util-enumtypes.h
+ e-util-private.h
+ ea-calendar-cell.h
+ ea-calendar-item.h
+ ea-cell-table.h
+ ea-factory.h
+ ea-widgets.h
+ gal-a11y-e-cell.h
+ gal-a11y-e-cell-popup.h
+ gal-a11y-e-cell-registry.h
+ gal-a11y-e-cell-text.h
+ gal-a11y-e-cell-toggle.h
+ gal-a11y-e-cell-tree.h
+ gal-a11y-e-cell-vbox.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
+ test-html-editor-units-bugs.h
+ test-html-editor-units-utils.h
+ test-keyfile-settings-backend.h
+)
+
+add_gtkdoc(evolution-util e-util "" SOURCEDIRS DEPENDENCIES IGNORE_HEADERS)
diff --git a/doc/reference/evolution-util/evolution-util-docs.sgml.in
b/docs/reference/evolution-util/evolution-util-docs.sgml.in
similarity index 100%
rename from doc/reference/evolution-util/evolution-util-docs.sgml.in
rename to docs/reference/evolution-util/evolution-util-docs.sgml.in
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 39107a7..d52cf97 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,104 +1,6 @@
# List of source files containing translatable strings.
# Please keep this list in alphabetic order.
-addressbook/addressbook.error.xml
-[type: gettext/glade]addressbook/gui/contact-editor/contact-editor.ui
-addressbook/gui/contact-editor/eab-editor.c
-addressbook/gui/contact-editor/e-contact-editor.c
-addressbook/gui/contact-editor/e-contact-editor-fullname.c
-addressbook/gui/contact-editor/e-contact-quick-add.c
-[type: gettext/glade]addressbook/gui/contact-editor/fullname.ui
-[type: gettext/glade]addressbook/gui/contact-list-editor/contact-list-editor.ui
-addressbook/gui/contact-list-editor/e-contact-list-editor.c
-addressbook/gui/widgets/addresstypes.xml
-addressbook/gui/widgets/ea-addressbook-view.c
-addressbook/gui/widgets/eab-contact-display.c
-addressbook/gui/widgets/eab-contact-formatter.c
-addressbook/gui/widgets/eab-contact-merging.c
-addressbook/gui/widgets/eab-gui-util.c
-addressbook/gui/widgets/e-addressbook-model.c
-addressbook/gui/widgets/e-addressbook-reflow-adapter.c
-addressbook/gui/widgets/e-addressbook-table-adapter.c
-addressbook/gui/widgets/e-addressbook-view.c
-addressbook/gui/widgets/e-addressbook-view.etspec
-addressbook/gui/widgets/ea-minicard.c
-addressbook/gui/widgets/ea-minicard-view.c
-addressbook/gui/widgets/e-contact-map.c
-addressbook/gui/widgets/e-contact-map-window.c
-addressbook/gui/widgets/e-minicard.c
-addressbook/gui/widgets/e-minicard-label.c
-addressbook/gui/widgets/e-minicard-view.c
-addressbook/gui/widgets/e-minicard-view-widget.c
-addressbook/importers/evolution-csv-importer.c
-addressbook/importers/evolution-ldif-importer.c
-addressbook/importers/evolution-vcard-importer.c
-addressbook/printing/e-contact-print.c
-addressbook/util/eab-book-util.c
-calendar/alarm-notify/alarm-notify-dialog.c
-[type: gettext/glade]calendar/alarm-notify/alarm-notify.ui
-calendar/alarm-notify/alarm-queue.c
-calendar/alarm-notify/util.c
-calendar/calendar.error.xml
-calendar/gui/caltypes.xml.in
-calendar/gui/ea-cal-view.c
-calendar/gui/ea-cal-view-event.c
-calendar/gui/ea-day-view.c
-calendar/gui/ea-day-view-main-item.c
-calendar/gui/ea-jump-button.c
-calendar/gui/e-alarm-list.c
-calendar/gui/ea-week-view.c
-calendar/gui/ea-week-view-main-item.c
-calendar/gui/e-cal-component-preview.c
-calendar/gui/e-cal-data-model.c
-calendar/gui/e-cal-dialogs.c
-calendar/gui/e-calendar-view.c
-calendar/gui/e-cal-list-view.c
-calendar/gui/e-cal-list-view.etspec
-calendar/gui/e-cal-model.c
-calendar/gui/e-cal-model-calendar.c
-calendar/gui/e-cal-model-tasks.c
-calendar/gui/e-cal-ops.c
-calendar/gui/e-cell-date-edit-text.c
-calendar/gui/e-comp-editor-event.c
-calendar/gui/e-comp-editor-memo.c
-calendar/gui/e-comp-editor-page-attachments.c
-calendar/gui/e-comp-editor-page-general.c
-calendar/gui/e-comp-editor-page-recurrence.c
-calendar/gui/e-comp-editor-page-reminders.c
-calendar/gui/e-comp-editor-page-schedule.c
-calendar/gui/e-comp-editor-property-parts.c
-calendar/gui/e-comp-editor-task.c
-calendar/gui/e-comp-editor.c
-calendar/gui/e-day-view.c
-calendar/gui/e-day-view-time-item.c
-calendar/gui/e-day-view-top-item.c
-calendar/gui/e-meeting-list-view.c
-calendar/gui/e-meeting-store.c
-calendar/gui/e-meeting-time-sel.c
-calendar/gui/e-meeting-time-sel.etspec
-calendar/gui/e-meeting-time-sel-item.c
-calendar/gui/e-memo-table.c
-calendar/gui/e-memo-table.etspec
-calendar/gui/e-task-table.c
-calendar/gui/e-task-table.etspec
-calendar/gui/e-timezone-entry.c
-calendar/gui/e-week-view.c
-calendar/gui/e-week-view-main-item.c
-calendar/gui/itip-utils.c
-calendar/gui/memotypes.xml.in
-calendar/gui/misc.c
-calendar/gui/print.c
-calendar/gui/tasktypes.xml.in
-calendar/importers/icalendar-importer.c
-calendar/zones.h
-composer/e-composer-actions.c
-composer/e-composer-from-header.c
-composer/e-composer-header.c
-composer/e-composer-header-table.c
-composer/e-composer-name-header.c
-composer/e-composer-post-header.c
-composer/e-composer-private.c
-composer/e-msg-composer.c
-composer/mail-composer.error.xml
+evolution.appdata.xml.in
data/evolution-alarm-notify.desktop.in.in
data/evolution.desktop.in.in
data/org.gnome.evolution.addressbook.gschema.xml.in
@@ -119,415 +21,513 @@ data/org.gnome.evolution.plugin.publish-calendar.gschema.xml.in
data/org.gnome.evolution.plugin.templates.gschema.xml.in
data/org.gnome.evolution.shell.gschema.xml.in
data/org.gnome.evolution.spamassassin.gschema.xml.in
-em-format/e-mail-formatter-attachment.c
-em-format/e-mail-formatter-audio.c
-em-format/e-mail-formatter.c
-em-format/e-mail-formatter-headers.c
-em-format/e-mail-formatter-image.c
-em-format/e-mail-formatter-message-rfc822.c
-em-format/e-mail-formatter-print.c
-em-format/e-mail-formatter-print-headers.c
-em-format/e-mail-formatter-quote-headers.c
-em-format/e-mail-formatter-quote-text-enriched.c
-em-format/e-mail-formatter-quote-text-html.c
-em-format/e-mail-formatter-quote-text-plain.c
-em-format/e-mail-formatter-secure-button.c
-em-format/e-mail-formatter-source.c
-em-format/e-mail-formatter-text-enriched.c
-em-format/e-mail-formatter-text-html.c
-em-format/e-mail-formatter-text-plain.c
-em-format/e-mail-formatter-utils.c
-em-format/e-mail-parser-application-mbox.c
-em-format/e-mail-parser-application-smime.c
-em-format/e-mail-parser-inlinepgp-encrypted.c
-em-format/e-mail-parser-inlinepgp-signed.c
-em-format/e-mail-parser-message-external.c
-em-format/e-mail-parser-multipart-encrypted.c
-em-format/e-mail-parser-multipart-signed.c
-em-format/e-mail-part-headers.c
-em-format/e-mail-part-secure-button.c
-em-format/e-mail-part-utils.c
-e-util/ea-calendar-item.c
-e-util/e-action-combo-box.c
-e-util/e-activity-bar.c
-e-util/e-activity.c
-e-util/e-activity-proxy.c
-e-util/e-alert-bar.c
-e-util/e-alert-dialog.c
-e-util/e-alert-sink.c
-e-util/e-attachment-bar.c
-e-util/e-attachment.c
-e-util/e-attachment-dialog.c
-e-util/e-attachment-handler-image.c
-e-util/e-attachment-icon-view.c
-e-util/e-attachment-paned.c
-e-util/e-attachment-store.c
-e-util/e-attachment-tree-view.c
-e-util/e-attachment-view.c
-e-util/e-book-source-config.c
-e-util/e-buffer-tagger.c
-e-util/e-calendar.c
-e-util/e-calendar-item.c
-e-util/e-cal-source-config.c
-e-util/e-canvas-background.c
-e-util/e-canvas-vbox.c
-e-util/e-categories-config.c
-e-util/e-categories-dialog.c
-e-util/e-categories-editor.c
-e-util/e-categories-selector.c
-e-util/e-category-completion.c
-e-util/e-category-editor.c
-e-util/e-cell-combo.c
-e-util/e-cell-date.c
-e-util/e-cell-date-edit.c
-e-util/e-cell-percent.c
-e-util/e-cell-pixbuf.c
-e-util/e-cell-text.c
-e-util/e-charset.c
-e-util/e-charset-combo-box.c
-e-util/e-client-cache.c
-e-util/e-color-chooser-widget.c
-e-util/e-color-combo.c
-e-util/e-dateedit.c
-e-util/e-datetime-format.c
-e-util/e-dialog-utils.c
-e-util/e-emoticon-chooser.c
-e-util/e-file-utils.c
-e-util/e-filter-datespec.c
-e-util/e-filter-file.c
-e-util/e-filter-input.c
-e-util/e-filter-option.c
-e-util/e-filter-part.c
-e-util/e-filter-rule.c
-e-util/e-focus-tracker.c
-e-util/e-html-editor-actions.c
-e-util/e-html-editor.c
-e-util/e-html-editor-cell-dialog.c
-e-util/e-html-editor-dialog.c
-e-util/e-html-editor-find-dialog.c
-e-util/e-html-editor-hrule-dialog.c
-e-util/e-html-editor-image-dialog.c
-e-util/e-html-editor-link-dialog.c
-e-util/e-html-editor-page-dialog.c
-e-util/e-html-editor-paragraph-dialog.c
-e-util/e-html-editor-replace-dialog.c
-e-util/e-html-editor-spell-check-dialog.c
-e-util/e-html-editor-table-dialog.c
-e-util/e-html-editor-text-dialog.c
-e-util/e-image-chooser.c
-e-util/e-image-chooser-dialog.c
-e-util/e-import-assistant.c
-e-util/e-interval-chooser.c
-e-util/e-mail-identity-combo-box.c
-e-util/e-mail-signature-combo-box.c
-e-util/e-mail-signature-editor.c
-e-util/e-mail-signature-manager.c
-e-util/e-mail-signature-script-dialog.c
-e-util/e-map.c
-e-util/e-misc-utils.c
-e-util/e-name-selector-dialog.c
-e-util/e-name-selector-entry.c
-e-util/e-name-selector-list.c
-e-util/e-online-button.c
-e-util/e-paned.c
-e-util/e-passwords.c
-e-util/e-plugin.c
-e-util/e-popup-action.c
-e-util/e-preferences-window.c
-e-util/e-print.c
-e-util/e-proxy-editor.c
-e-util/e-proxy-preferences.c
-e-util/e-proxy-selector.c
-e-util/e-rule-context.c
-e-util/e-rule-editor.c
-e-util/e-search-bar.c
-e-util/e-selection-model-array.c
-e-util/e-selection-model.c
-e-util/e-send-options.c
-[type: gettext/glade]e-util/e-send-options.ui
-e-util/e-source-config.c
-e-util/e-source-config-dialog.c
-e-util/e-source-selector.c
-e-util/e-source-selector-dialog.c
-e-util/e-spell-dictionary.c
-e-util/e-spell-entry.c
-e-util/e-system.error.xml
-e-util/e-table.c
-e-util/e-table-click-to-add.c
-e-util/e-table-col.c
-e-util/e-table-column-selector.c
-e-util/e-table-config.c
-[type: gettext/glade]e-util/e-table-config.ui
-e-util/e-table-field-chooser.c
-e-util/e-table-field-chooser-dialog.c
-e-util/e-table-field-chooser-item.c
-e-util/e-table-group-container.c
-e-util/e-table-group-leaf.c
-e-util/e-table-header-item.c
-e-util/e-table-item.c
-e-util/e-table-selection-model.c
-e-util/e-table-sorter.c
-e-util/e-table-utils.c
-e-util/e-text.c
-e-util/e-timezone-dialog.c
-[type: gettext/glade]e-util/e-timezone-dialog.ui
-e-util/e-tree.c
-e-util/e-tree-selection-model.c
-e-util/e-url-entry.c
-e-util/evolution-source-viewer.c
-e-util/e-web-view.c
-e-util/e-widget-undo.c
-e-util/filter.error.xml
-[type: gettext/glade]e-util/filter.ui
-e-util/gal-a11y-e-cell.c
-e-util/gal-a11y-e-cell-popup.c
-e-util/gal-a11y-e-cell-text.c
-e-util/gal-a11y-e-cell-toggle.c
-e-util/gal-a11y-e-cell-tree.c
-e-util/gal-a11y-e-table-click-to-add.c
-e-util/gal-a11y-e-table-column-header.c
-e-util/gal-view-instance.c
-e-util/gal-view-instance-save-as-dialog.c
-[type: gettext/glade]e-util/gal-view-instance-save-as-dialog.ui
-e-util/widgets.error.xml
-evolution.appdata.xml.in
-libemail-engine/camel-null-store.c
-libemail-engine/camel-sasl-oauth2-google.c
-libemail-engine/camel-sasl-xoauth2.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-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
-mail/e-mail-account-manager.c
-mail/e-mail-account-tree-view.c
-mail/e-mail-autoconfig.c
-mail/e-mail-backend.c
-mail/e-mail-browser.c
-mail/e-mail-config-assistant.c
-mail/e-mail-config-auth-check.c
-mail/e-mail-config-confirm-page.c
-mail/e-mail-config-defaults-page.c
-mail/e-mail-config-identity-page.c
-mail/e-mail-config-lookup-page.c
-mail/e-mail-config-page.c
-mail/e-mail-config-provider-page.c
-mail/e-mail-config-receiving-page.c
-mail/e-mail-config-security-page.c
-mail/e-mail-config-sending-page.c
-mail/e-mail-config-service-page.c
-mail/e-mail-config-summary-page.c
-mail/e-mail-config-welcome-page.c
-mail/e-mail-config-window.c
-mail/e-mail-display.c
-mail/e-mail-folder-create-dialog.c
-mail/e-mail-free-form-exp.c
-mail/e-mail-junk-options.c
-mail/e-mail-label-dialog.c
-mail/e-mail-label-list-store.c
-mail/e-mail-label-manager.c
-mail/e-mail-label-tree-view.c
-mail/e-mail-migrate.c
-mail/e-mail-notes.c
-mail/e-mail-print-config-headers.c
-mail/e-mail-printer.c
-mail/e-mail-reader.c
-mail/e-mail-reader-utils.c
-mail/e-mail-request.c
-mail/e-mail-tag-editor.c
-mail/e-mail-ui-session.c
-mail/em-composer-utils.c
-mail/em-filter-editor.c
-mail/em-filter-editor-folder-element.c
-mail/em-filter-rule.c
-mail/em-folder-properties.c
-mail/em-folder-selection-button.c
-mail/em-folder-selector.c
-mail/em-folder-tree.c
-mail/em-folder-tree-model.c
-mail/em-folder-utils.c
-mail/em-subscription-editor.c
-mail/em-utils.c
-mail/em-vfolder-editor.c
-mail/em-vfolder-editor-rule.c
-mail/filtertypes.xml.in
-mail/importers/elm-importer.c
-mail/importers/evolution-mbox-importer.c
-mail/importers/kmail-importer.c
-mail/importers/kmail-libs.c
-mail/importers/mail-importer.c
-mail/importers/pine-importer.c
-mail/mail-autofilter.c
-[type: gettext/glade]mail/mail-config.ui
-[type: gettext/glade]mail/mail-dialogs.ui
-mail/mail.error.xml
-mail/mail-send-recv.c
-mail/mail-vfolder-ui.c
-mail/message-list.c
-mail/message-list.etspec
-mail/searchtypes.xml.in
-mail/vfoldertypes.xml.in
-modules/addressbook/autocompletion-config.c
-modules/addressbook/eab-composer-util.c
-modules/addressbook/e-book-shell-backend.c
-modules/addressbook/e-book-shell-content.c
-modules/addressbook/e-book-shell-migrate.c
-modules/addressbook/e-book-shell-sidebar.c
-modules/addressbook/e-book-shell-view-actions.c
-modules/addressbook/e-book-shell-view.c
-modules/backup-restore/e-mail-config-restore-page.c
-modules/backup-restore/e-mail-config-restore-ready-page.c
-modules/backup-restore/evolution-backup-restore.c
-modules/backup-restore/evolution-backup-tool.c
-modules/backup-restore/org-gnome-backup-restore.error.xml
-modules/bogofilter/evolution-bogofilter.c
-modules/bogofilter/evolution-bogofilter.metainfo.xml.in
-modules/book-config-google/evolution-book-config-google.c
-modules/book-config-ldap/evolution-book-config-ldap.c
-modules/book-config-webdav/evolution-book-config-webdav.c
-modules/cal-config-caldav/evolution-cal-config-caldav.c
-modules/cal-config-contacts/evolution-cal-config-contacts.c
-modules/cal-config-google/e-cal-config-google.c
-modules/cal-config-google/e-cal-config-gtasks.c
-modules/cal-config-google/e-google-chooser-button.c
-modules/cal-config-local/evolution-cal-config-local.c
-modules/cal-config-weather/evolution-cal-config-weather.c
-modules/cal-config-webcal/evolution-cal-config-webcal.c
-modules/calendar/e-cal-attachment-handler.c
-modules/calendar/e-cal-base-shell-backend.c
-modules/calendar/e-cal-base-shell-content.c
-modules/calendar/e-cal-base-shell-sidebar.c
-modules/calendar/e-calendar-preferences.c
-[type: gettext/glade]modules/calendar/e-calendar-preferences.ui
-modules/calendar/e-cal-shell-backend.c
-modules/calendar/e-cal-shell-content.c
-modules/calendar/e-cal-shell-migrate.c
-modules/calendar/e-cal-shell-view-actions.c
-modules/calendar/e-cal-shell-view.c
-modules/calendar/e-cal-shell-view-memopad.c
-modules/calendar/e-cal-shell-view-private.c
-modules/calendar/e-cal-shell-view-taskpad.c
-modules/calendar/e-memo-shell-backend.c
-modules/calendar/e-memo-shell-content.c
-modules/calendar/e-memo-shell-migrate.c
-modules/calendar/e-memo-shell-view-actions.c
-modules/calendar/e-memo-shell-view.c
-modules/calendar/e-memo-shell-view-private.c
-modules/calendar/e-task-shell-backend.c
-modules/calendar/e-task-shell-content.c
-modules/calendar/e-task-shell-migrate.c
-modules/calendar/e-task-shell-view-actions.c
-modules/calendar/e-task-shell-view.c
-modules/calendar/e-task-shell-view-private.c
-modules/itip-formatter/e-mail-formatter-itip.c
-modules/itip-formatter/itip-view.c
-modules/itip-formatter/org-gnome-itip-formatter.error.xml
-modules/mail-config/e-mail-config-google-summary.c
-modules/mail-config/e-mail-config-local-accounts.c
-modules/mail-config/e-mail-config-remote-accounts.c
-modules/mail-config/e-mail-config-sendmail-backend.c
-modules/mail-config/e-mail-config-smtp-backend.c
-modules/mail-config/e-mail-config-yahoo-summary.c
-modules/mail/em-account-prefs.c
-modules/mail/e-mail-attachment-handler.c
-modules/mail/e-mail-shell-backend.c
-modules/mail/e-mail-shell-content.c
-modules/mail/e-mail-shell-view-actions.c
-modules/mail/e-mail-shell-view.c
-modules/mail/e-mail-shell-view-private.c
-modules/mail/em-composer-prefs.c
-modules/mail/em-mailer-prefs.c
-modules/mailto-handler/evolution-mailto-handler.c
-modules/mdn/evolution-mdn.c
-modules/mdn/evolution-mdn.error.xml
-modules/offline-alert/evolution-offline-alert.error.xml
-modules/plugin-manager/evolution-plugin-manager.c
-modules/prefer-plain/e-mail-display-popup-prefer-plain.c
-modules/prefer-plain/e-mail-parser-prefer-plain.c
-modules/prefer-plain/plugin/config-ui.c
-modules/prefer-plain/plugin/org-gnome-prefer-plain.eplug.xml
-modules/spamassassin/evolution-spamassassin.c
-modules/spamassassin/evolution-spamassassin.metainfo.xml.in
-modules/startup-wizard/e-mail-config-import-page.c
-modules/startup-wizard/e-mail-config-import-progress-page.c
-modules/startup-wizard/e-startup-assistant.c
-modules/startup-wizard/evolution-startup-wizard.c
-modules/text-highlight/e-mail-display-popup-text-highlight.c
-modules/text-highlight/e-mail-formatter-text-highlight.c
-modules/text-highlight/languages.c
-modules/vcard-inline/e-mail-formatter-vcard.c
-modules/vcard-inline/e-mail-parser-vcard.c
-modules/vcard-inline/e-mail-part-vcard.c
-modules/webkit-inspector/evolution-webkit-inspector.c
-plugins/attachment-reminder/attachment-reminder.c
-plugins/attachment-reminder/org-gnome-attachment-reminder.error.xml
-plugins/attachment-reminder/org-gnome-evolution-attachment-reminder.eplug.xml
-plugins/bbdb/bbdb.c
-plugins/bbdb/org-gnome-evolution-bbdb.eplug.xml
-plugins/dbx-import/dbx-importer.c
-plugins/dbx-import/org-gnome-dbx-import.eplug.xml
-plugins/email-custom-header/email-custom-header.c
-plugins/email-custom-header/org-gnome-email-custom-header.eplug.xml
-[type: gettext/glade]plugins/email-custom-header/org-gnome-email-custom-header.ui
-plugins/external-editor/external-editor.c
-plugins/external-editor/org-gnome-external-editor.eplug.xml
-plugins/external-editor/org-gnome-external-editor.error.xml
-plugins/face/face.c
-plugins/face/org-gnome-face.eplug.xml
-plugins/face/org-gnome-face.error.xml
-plugins/mailing-list-actions/mailing-list-actions.c
-plugins/mailing-list-actions/org-gnome-mailing-list-actions.eplug.xml
-plugins/mailing-list-actions/org-gnome-mailing-list-actions.error.xml
-plugins/mail-notification/mail-notification.c
-plugins/mail-notification/org-gnome-mail-notification.eplug.xml
-plugins/mail-to-task/mail-to-task.c
-plugins/mail-to-task/org-gnome-mail-to-task.eplug.xml
-plugins/pst-import/evolution-pst.metainfo.xml.in
-plugins/pst-import/org-gnome-pst-import.eplug.xml
-plugins/pst-import/pst-importer.c
-plugins/publish-calendar/org-gnome-publish-calendar.eplug.xml
-plugins/publish-calendar/publish-calendar.c
-[type: gettext/glade]plugins/publish-calendar/publish-calendar.ui
-plugins/publish-calendar/publish-format-fb.c
-plugins/publish-calendar/publish-format-ical.c
-plugins/publish-calendar/url-editor-dialog.c
-plugins/save-calendar/csv-format.c
-plugins/save-calendar/ical-format.c
-plugins/save-calendar/org-gnome-save-calendar.eplug.xml
-plugins/save-calendar/rdf-format.c
-plugins/save-calendar/save-calendar.c
-plugins/templates/e-templates-store.c
-plugins/templates/org-gnome-templates.eplug.xml
-plugins/templates/templates.c
-shell/e-shell-backend.c
-shell/e-shell.c
-shell/e-shell-content.c
-shell/e-shell-migrate.c
-shell/e-shell-searchbar.c
-shell/e-shell-switcher.c
-shell/e-shell-utils.c
-shell/e-shell-view.c
-shell/e-shell-window-actions.c
-shell/e-shell-window.c
-shell/e-shell-window-private.c
-shell/main.c
-shell/shell.error.xml
-smime/gui/ca-trust-dialog.c
-smime/gui/certificate-manager.c
-smime/gui/cert-trust-dialog.c
-smime/gui/component.c
-smime/gui/e-cert-selector.c
-[type: gettext/glade]smime/gui/smime-ui.ui
-smime/lib/e-cert.c
-smime/lib/e-cert-db.c
-smime/lib/e-pkcs12.c
-views/addressbook/galview.xml
-views/calendar/galview.xml
-views/mail/galview.xml
-views/memos/galview.xml
-views/tasks/galview.xml
+data/views/addressbook/galview.xml
+data/views/calendar/galview.xml
+data/views/mail/galview.xml
+data/views/memos/galview.xml
+data/views/tasks/galview.xml
+src/addressbook/addressbook.error.xml
+[type: gettext/glade]src/addressbook/gui/contact-editor/contact-editor.ui
+src/addressbook/gui/contact-editor/eab-editor.c
+src/addressbook/gui/contact-editor/e-contact-editor.c
+src/addressbook/gui/contact-editor/e-contact-editor-fullname.c
+src/addressbook/gui/contact-editor/e-contact-quick-add.c
+[type: gettext/glade]src/addressbook/gui/contact-editor/fullname.ui
+[type: gettext/glade]src/addressbook/gui/contact-list-editor/contact-list-editor.ui
+src/addressbook/gui/contact-list-editor/e-contact-list-editor.c
+src/addressbook/gui/widgets/addresstypes.xml
+src/addressbook/gui/widgets/ea-addressbook-view.c
+src/addressbook/gui/widgets/eab-contact-display.c
+src/addressbook/gui/widgets/eab-contact-formatter.c
+src/addressbook/gui/widgets/eab-contact-merging.c
+src/addressbook/gui/widgets/eab-gui-util.c
+src/addressbook/gui/widgets/e-addressbook-model.c
+src/addressbook/gui/widgets/e-addressbook-reflow-adapter.c
+src/addressbook/gui/widgets/e-addressbook-table-adapter.c
+src/addressbook/gui/widgets/e-addressbook-view.c
+src/addressbook/gui/widgets/e-addressbook-view.etspec
+src/addressbook/gui/widgets/ea-minicard.c
+src/addressbook/gui/widgets/ea-minicard-view.c
+src/addressbook/gui/widgets/e-contact-map.c
+src/addressbook/gui/widgets/e-contact-map-window.c
+src/addressbook/gui/widgets/e-minicard.c
+src/addressbook/gui/widgets/e-minicard-label.c
+src/addressbook/gui/widgets/e-minicard-view.c
+src/addressbook/gui/widgets/e-minicard-view-widget.c
+src/addressbook/importers/evolution-csv-importer.c
+src/addressbook/importers/evolution-ldif-importer.c
+src/addressbook/importers/evolution-vcard-importer.c
+src/addressbook/printing/e-contact-print.c
+src/addressbook/util/eab-book-util.c
+src/calendar/alarm-notify/alarm-notify-dialog.c
+[type: gettext/glade]src/calendar/alarm-notify/alarm-notify.ui
+src/calendar/alarm-notify/alarm-queue.c
+src/calendar/alarm-notify/util.c
+src/calendar/calendar.error.xml
+src/calendar/gui/caltypes.xml.in
+src/calendar/gui/ea-cal-view.c
+src/calendar/gui/ea-cal-view-event.c
+src/calendar/gui/ea-day-view.c
+src/calendar/gui/ea-day-view-main-item.c
+src/calendar/gui/ea-jump-button.c
+src/calendar/gui/e-alarm-list.c
+src/calendar/gui/ea-week-view.c
+src/calendar/gui/ea-week-view-main-item.c
+src/calendar/gui/e-cal-component-preview.c
+src/calendar/gui/e-cal-data-model.c
+src/calendar/gui/e-cal-dialogs.c
+src/calendar/gui/e-calendar-view.c
+src/calendar/gui/e-cal-list-view.c
+src/calendar/gui/e-cal-list-view.etspec
+src/calendar/gui/e-cal-model.c
+src/calendar/gui/e-cal-model-calendar.c
+src/calendar/gui/e-cal-model-tasks.c
+src/calendar/gui/e-cal-ops.c
+src/calendar/gui/e-cell-date-edit-text.c
+src/calendar/gui/e-comp-editor-event.c
+src/calendar/gui/e-comp-editor-memo.c
+src/calendar/gui/e-comp-editor-page-attachments.c
+src/calendar/gui/e-comp-editor-page-general.c
+src/calendar/gui/e-comp-editor-page-recurrence.c
+src/calendar/gui/e-comp-editor-page-reminders.c
+src/calendar/gui/e-comp-editor-page-schedule.c
+src/calendar/gui/e-comp-editor-property-parts.c
+src/calendar/gui/e-comp-editor-task.c
+src/calendar/gui/e-comp-editor.c
+src/calendar/gui/e-day-view.c
+src/calendar/gui/e-day-view-time-item.c
+src/calendar/gui/e-day-view-top-item.c
+src/calendar/gui/e-meeting-list-view.c
+src/calendar/gui/e-meeting-store.c
+src/calendar/gui/e-meeting-time-sel.c
+src/calendar/gui/e-meeting-time-sel.etspec
+src/calendar/gui/e-meeting-time-sel-item.c
+src/calendar/gui/e-memo-table.c
+src/calendar/gui/e-memo-table.etspec
+src/calendar/gui/e-task-table.c
+src/calendar/gui/e-task-table.etspec
+src/calendar/gui/e-timezone-entry.c
+src/calendar/gui/e-week-view.c
+src/calendar/gui/e-week-view-main-item.c
+src/calendar/gui/itip-utils.c
+src/calendar/gui/memotypes.xml.in
+src/calendar/gui/misc.c
+src/calendar/gui/print.c
+src/calendar/gui/tasktypes.xml.in
+src/calendar/importers/icalendar-importer.c
+src/calendar/zones.h
+src/composer/e-composer-actions.c
+src/composer/e-composer-from-header.c
+src/composer/e-composer-header.c
+src/composer/e-composer-header-table.c
+src/composer/e-composer-name-header.c
+src/composer/e-composer-post-header.c
+src/composer/e-composer-private.c
+src/composer/e-msg-composer.c
+src/composer/mail-composer.error.xml
+src/em-format/e-mail-formatter-attachment.c
+src/em-format/e-mail-formatter-audio.c
+src/em-format/e-mail-formatter.c
+src/em-format/e-mail-formatter-headers.c
+src/em-format/e-mail-formatter-image.c
+src/em-format/e-mail-formatter-message-rfc822.c
+src/em-format/e-mail-formatter-print.c
+src/em-format/e-mail-formatter-print-headers.c
+src/em-format/e-mail-formatter-quote-headers.c
+src/em-format/e-mail-formatter-quote-text-enriched.c
+src/em-format/e-mail-formatter-quote-text-html.c
+src/em-format/e-mail-formatter-quote-text-plain.c
+src/em-format/e-mail-formatter-secure-button.c
+src/em-format/e-mail-formatter-source.c
+src/em-format/e-mail-formatter-text-enriched.c
+src/em-format/e-mail-formatter-text-html.c
+src/em-format/e-mail-formatter-text-plain.c
+src/em-format/e-mail-formatter-utils.c
+src/em-format/e-mail-parser-application-mbox.c
+src/em-format/e-mail-parser-application-smime.c
+src/em-format/e-mail-parser-inlinepgp-encrypted.c
+src/em-format/e-mail-parser-inlinepgp-signed.c
+src/em-format/e-mail-parser-message-external.c
+src/em-format/e-mail-parser-multipart-encrypted.c
+src/em-format/e-mail-parser-multipart-signed.c
+src/em-format/e-mail-part-headers.c
+src/em-format/e-mail-part-secure-button.c
+src/em-format/e-mail-part-utils.c
+src/e-util/ea-calendar-item.c
+src/e-util/e-action-combo-box.c
+src/e-util/e-activity-bar.c
+src/e-util/e-activity.c
+src/e-util/e-activity-proxy.c
+src/e-util/e-alert-bar.c
+src/e-util/e-alert-dialog.c
+src/e-util/e-alert-sink.c
+src/e-util/e-attachment-bar.c
+src/e-util/e-attachment.c
+src/e-util/e-attachment-dialog.c
+src/e-util/e-attachment-handler-image.c
+src/e-util/e-attachment-icon-view.c
+src/e-util/e-attachment-paned.c
+src/e-util/e-attachment-store.c
+src/e-util/e-attachment-tree-view.c
+src/e-util/e-attachment-view.c
+src/e-util/e-book-source-config.c
+src/e-util/e-buffer-tagger.c
+src/e-util/e-calendar.c
+src/e-util/e-calendar-item.c
+src/e-util/e-cal-source-config.c
+src/e-util/e-canvas-background.c
+src/e-util/e-canvas-vbox.c
+src/e-util/e-categories-config.c
+src/e-util/e-categories-dialog.c
+src/e-util/e-categories-editor.c
+src/e-util/e-categories-selector.c
+src/e-util/e-category-completion.c
+src/e-util/e-category-editor.c
+src/e-util/e-cell-combo.c
+src/e-util/e-cell-date.c
+src/e-util/e-cell-date-edit.c
+src/e-util/e-cell-percent.c
+src/e-util/e-cell-pixbuf.c
+src/e-util/e-cell-text.c
+src/e-util/e-charset.c
+src/e-util/e-charset-combo-box.c
+src/e-util/e-client-cache.c
+src/e-util/e-color-chooser-widget.c
+src/e-util/e-color-combo.c
+src/e-util/e-dateedit.c
+src/e-util/e-datetime-format.c
+src/e-util/e-dialog-utils.c
+src/e-util/e-emoticon-chooser.c
+src/e-util/e-file-utils.c
+src/e-util/e-filter-datespec.c
+src/e-util/e-filter-file.c
+src/e-util/e-filter-input.c
+src/e-util/e-filter-option.c
+src/e-util/e-filter-part.c
+src/e-util/e-filter-rule.c
+src/e-util/e-focus-tracker.c
+src/e-util/e-html-editor-actions.c
+src/e-util/e-html-editor.c
+src/e-util/e-html-editor-cell-dialog.c
+src/e-util/e-html-editor-dialog.c
+src/e-util/e-html-editor-find-dialog.c
+src/e-util/e-html-editor-hrule-dialog.c
+src/e-util/e-html-editor-image-dialog.c
+src/e-util/e-html-editor-link-dialog.c
+src/e-util/e-html-editor-page-dialog.c
+src/e-util/e-html-editor-paragraph-dialog.c
+src/e-util/e-html-editor-replace-dialog.c
+src/e-util/e-html-editor-spell-check-dialog.c
+src/e-util/e-html-editor-table-dialog.c
+src/e-util/e-html-editor-text-dialog.c
+src/e-util/e-image-chooser.c
+src/e-util/e-image-chooser-dialog.c
+src/e-util/e-import-assistant.c
+src/e-util/e-interval-chooser.c
+src/e-util/e-mail-identity-combo-box.c
+src/e-util/e-mail-signature-combo-box.c
+src/e-util/e-mail-signature-editor.c
+src/e-util/e-mail-signature-manager.c
+src/e-util/e-mail-signature-script-dialog.c
+src/e-util/e-map.c
+src/e-util/e-misc-utils.c
+src/e-util/e-name-selector-dialog.c
+src/e-util/e-name-selector-entry.c
+src/e-util/e-name-selector-list.c
+src/e-util/e-online-button.c
+src/e-util/e-paned.c
+src/e-util/e-passwords.c
+src/e-util/e-plugin.c
+src/e-util/e-popup-action.c
+src/e-util/e-preferences-window.c
+src/e-util/e-print.c
+src/e-util/e-proxy-editor.c
+src/e-util/e-proxy-preferences.c
+src/e-util/e-proxy-selector.c
+src/e-util/e-rule-context.c
+src/e-util/e-rule-editor.c
+src/e-util/e-search-bar.c
+src/e-util/e-selection-model-array.c
+src/e-util/e-selection-model.c
+src/e-util/e-send-options.c
+[type: gettext/glade]src/e-util/e-send-options.ui
+src/e-util/e-source-config.c
+src/e-util/e-source-config-dialog.c
+src/e-util/e-source-selector.c
+src/e-util/e-source-selector-dialog.c
+src/e-util/e-spell-dictionary.c
+src/e-util/e-spell-entry.c
+src/e-util/e-system.error.xml
+src/e-util/e-table.c
+src/e-util/e-table-click-to-add.c
+src/e-util/e-table-col.c
+src/e-util/e-table-column-selector.c
+src/e-util/e-table-config.c
+[type: gettext/glade]src/e-util/e-table-config.ui
+src/e-util/e-table-field-chooser.c
+src/e-util/e-table-field-chooser-dialog.c
+src/e-util/e-table-field-chooser-item.c
+src/e-util/e-table-group-container.c
+src/e-util/e-table-group-leaf.c
+src/e-util/e-table-header-item.c
+src/e-util/e-table-item.c
+src/e-util/e-table-selection-model.c
+src/e-util/e-table-sorter.c
+src/e-util/e-table-utils.c
+src/e-util/e-text.c
+src/e-util/e-timezone-dialog.c
+[type: gettext/glade]src/e-util/e-timezone-dialog.ui
+src/e-util/e-tree.c
+src/e-util/e-tree-selection-model.c
+src/e-util/e-url-entry.c
+src/e-util/evolution-source-viewer.c
+src/e-util/e-web-view.c
+src/e-util/e-widget-undo.c
+src/e-util/filter.error.xml
+[type: gettext/glade]src/e-util/filter.ui
+src/e-util/gal-a11y-e-cell.c
+src/e-util/gal-a11y-e-cell-popup.c
+src/e-util/gal-a11y-e-cell-text.c
+src/e-util/gal-a11y-e-cell-toggle.c
+src/e-util/gal-a11y-e-cell-tree.c
+src/e-util/gal-a11y-e-table-click-to-add.c
+src/e-util/gal-a11y-e-table-column-header.c
+src/e-util/gal-view-instance.c
+src/e-util/gal-view-instance-save-as-dialog.c
+[type: gettext/glade]src/e-util/gal-view-instance-save-as-dialog.ui
+src/e-util/widgets.error.xml
+src/libemail-engine/camel-null-store.c
+src/libemail-engine/camel-sasl-oauth2-google.c
+src/libemail-engine/camel-sasl-xoauth2.c
+src/libemail-engine/e-mail-folder-utils.c
+src/libemail-engine/e-mail-session.c
+src/libemail-engine/e-mail-session-utils.c
+src/libemail-engine/e-mail-store-utils.c
+src/libemail-engine/mail-config.c
+src/libemail-engine/mail-folder-cache.c
+src/libemail-engine/mail-mt.c
+src/libemail-engine/mail-ops.c
+src/libemail-engine/mail-tools.c
+src/libemail-engine/mail-vfolder.c
+src/mail/e-mail-account-manager.c
+src/mail/e-mail-account-tree-view.c
+src/mail/e-mail-autoconfig.c
+src/mail/e-mail-backend.c
+src/mail/e-mail-browser.c
+src/mail/e-mail-config-assistant.c
+src/mail/e-mail-config-auth-check.c
+src/mail/e-mail-config-confirm-page.c
+src/mail/e-mail-config-defaults-page.c
+src/mail/e-mail-config-identity-page.c
+src/mail/e-mail-config-lookup-page.c
+src/mail/e-mail-config-page.c
+src/mail/e-mail-config-provider-page.c
+src/mail/e-mail-config-receiving-page.c
+src/mail/e-mail-config-security-page.c
+src/mail/e-mail-config-sending-page.c
+src/mail/e-mail-config-service-page.c
+src/mail/e-mail-config-summary-page.c
+src/mail/e-mail-config-welcome-page.c
+src/mail/e-mail-config-window.c
+src/mail/e-mail-display.c
+src/mail/e-mail-folder-create-dialog.c
+src/mail/e-mail-free-form-exp.c
+src/mail/e-mail-junk-options.c
+src/mail/e-mail-label-dialog.c
+src/mail/e-mail-label-list-store.c
+src/mail/e-mail-label-manager.c
+src/mail/e-mail-label-tree-view.c
+src/mail/e-mail-migrate.c
+src/mail/e-mail-notes.c
+src/mail/e-mail-print-config-headers.c
+src/mail/e-mail-printer.c
+src/mail/e-mail-reader.c
+src/mail/e-mail-reader-utils.c
+src/mail/e-mail-request.c
+src/mail/e-mail-tag-editor.c
+src/mail/e-mail-ui-session.c
+src/mail/em-composer-utils.c
+src/mail/em-filter-editor.c
+src/mail/em-filter-editor-folder-element.c
+src/mail/em-filter-rule.c
+src/mail/em-folder-properties.c
+src/mail/em-folder-selection-button.c
+src/mail/em-folder-selector.c
+src/mail/em-folder-tree.c
+src/mail/em-folder-tree-model.c
+src/mail/em-folder-utils.c
+src/mail/em-subscription-editor.c
+src/mail/em-utils.c
+src/mail/em-vfolder-editor.c
+src/mail/em-vfolder-editor-rule.c
+src/mail/filtertypes.xml.in
+src/mail/importers/elm-importer.c
+src/mail/importers/evolution-mbox-importer.c
+src/mail/importers/kmail-importer.c
+src/mail/importers/kmail-libs.c
+src/mail/importers/mail-importer.c
+src/mail/importers/pine-importer.c
+src/mail/mail-autofilter.c
+[type: gettext/glade]src/mail/mail-config.ui
+[type: gettext/glade]src/mail/mail-dialogs.ui
+src/mail/mail.error.xml
+src/mail/mail-send-recv.c
+src/mail/mail-vfolder-ui.c
+src/mail/message-list.c
+src/mail/message-list.etspec
+src/mail/searchtypes.xml.in
+src/mail/vfoldertypes.xml.in
+src/modules/addressbook/autocompletion-config.c
+src/modules/addressbook/eab-composer-util.c
+src/modules/addressbook/e-book-shell-backend.c
+src/modules/addressbook/e-book-shell-content.c
+src/modules/addressbook/e-book-shell-migrate.c
+src/modules/addressbook/e-book-shell-sidebar.c
+src/modules/addressbook/e-book-shell-view-actions.c
+src/modules/addressbook/e-book-shell-view.c
+src/modules/backup-restore/e-mail-config-restore-page.c
+src/modules/backup-restore/e-mail-config-restore-ready-page.c
+src/modules/backup-restore/evolution-backup-restore.c
+src/modules/backup-restore/evolution-backup-tool.c
+src/modules/backup-restore/org-gnome-backup-restore.error.xml
+src/modules/bogofilter/evolution-bogofilter.c
+src/modules/bogofilter/evolution-bogofilter.metainfo.xml.in
+src/modules/book-config-google/evolution-book-config-google.c
+src/modules/book-config-ldap/evolution-book-config-ldap.c
+src/modules/book-config-webdav/evolution-book-config-webdav.c
+src/modules/cal-config-caldav/evolution-cal-config-caldav.c
+src/modules/cal-config-contacts/evolution-cal-config-contacts.c
+src/modules/cal-config-google/e-cal-config-google.c
+src/modules/cal-config-google/e-cal-config-gtasks.c
+src/modules/cal-config-google/e-google-chooser-button.c
+src/modules/cal-config-local/evolution-cal-config-local.c
+src/modules/cal-config-weather/evolution-cal-config-weather.c
+src/modules/cal-config-webcal/evolution-cal-config-webcal.c
+src/modules/calendar/e-cal-attachment-handler.c
+src/modules/calendar/e-cal-base-shell-backend.c
+src/modules/calendar/e-cal-base-shell-content.c
+src/modules/calendar/e-cal-base-shell-sidebar.c
+src/modules/calendar/e-calendar-preferences.c
+[type: gettext/glade]src/modules/calendar/e-calendar-preferences.ui
+src/modules/calendar/e-cal-shell-backend.c
+src/modules/calendar/e-cal-shell-content.c
+src/modules/calendar/e-cal-shell-migrate.c
+src/modules/calendar/e-cal-shell-view-actions.c
+src/modules/calendar/e-cal-shell-view.c
+src/modules/calendar/e-cal-shell-view-memopad.c
+src/modules/calendar/e-cal-shell-view-private.c
+src/modules/calendar/e-cal-shell-view-taskpad.c
+src/modules/calendar/e-memo-shell-backend.c
+src/modules/calendar/e-memo-shell-content.c
+src/modules/calendar/e-memo-shell-migrate.c
+src/modules/calendar/e-memo-shell-view-actions.c
+src/modules/calendar/e-memo-shell-view.c
+src/modules/calendar/e-memo-shell-view-private.c
+src/modules/calendar/e-task-shell-backend.c
+src/modules/calendar/e-task-shell-content.c
+src/modules/calendar/e-task-shell-migrate.c
+src/modules/calendar/e-task-shell-view-actions.c
+src/modules/calendar/e-task-shell-view.c
+src/modules/calendar/e-task-shell-view-private.c
+src/modules/itip-formatter/e-mail-formatter-itip.c
+src/modules/itip-formatter/itip-view.c
+src/modules/itip-formatter/org-gnome-itip-formatter.error.xml
+src/modules/mail-config/e-mail-config-google-summary.c
+src/modules/mail-config/e-mail-config-local-accounts.c
+src/modules/mail-config/e-mail-config-remote-accounts.c
+src/modules/mail-config/e-mail-config-sendmail-backend.c
+src/modules/mail-config/e-mail-config-smtp-backend.c
+src/modules/mail-config/e-mail-config-yahoo-summary.c
+src/modules/mail/em-account-prefs.c
+src/modules/mail/e-mail-attachment-handler.c
+src/modules/mail/e-mail-shell-backend.c
+src/modules/mail/e-mail-shell-content.c
+src/modules/mail/e-mail-shell-view-actions.c
+src/modules/mail/e-mail-shell-view.c
+src/modules/mail/e-mail-shell-view-private.c
+src/modules/mail/em-composer-prefs.c
+src/modules/mail/em-mailer-prefs.c
+src/modules/mailto-handler/evolution-mailto-handler.c
+src/modules/mdn/evolution-mdn.c
+src/modules/mdn/evolution-mdn.error.xml
+src/modules/offline-alert/evolution-offline-alert.error.xml
+src/modules/plugin-manager/evolution-plugin-manager.c
+src/modules/prefer-plain/e-mail-display-popup-prefer-plain.c
+src/modules/prefer-plain/e-mail-parser-prefer-plain.c
+src/modules/prefer-plain/plugin/config-ui.c
+src/modules/prefer-plain/plugin/org-gnome-prefer-plain.eplug.xml
+src/modules/spamassassin/evolution-spamassassin.c
+src/modules/spamassassin/evolution-spamassassin.metainfo.xml.in
+src/modules/startup-wizard/e-mail-config-import-page.c
+src/modules/startup-wizard/e-mail-config-import-progress-page.c
+src/modules/startup-wizard/e-startup-assistant.c
+src/modules/startup-wizard/evolution-startup-wizard.c
+src/modules/text-highlight/e-mail-display-popup-text-highlight.c
+src/modules/text-highlight/e-mail-formatter-text-highlight.c
+src/modules/text-highlight/languages.c
+src/modules/vcard-inline/e-mail-formatter-vcard.c
+src/modules/vcard-inline/e-mail-parser-vcard.c
+src/modules/vcard-inline/e-mail-part-vcard.c
+src/modules/webkit-inspector/evolution-webkit-inspector.c
+src/plugins/attachment-reminder/attachment-reminder.c
+src/plugins/attachment-reminder/org-gnome-attachment-reminder.error.xml
+src/plugins/attachment-reminder/org-gnome-evolution-attachment-reminder.eplug.xml
+src/plugins/bbdb/bbdb.c
+src/plugins/bbdb/org-gnome-evolution-bbdb.eplug.xml
+src/plugins/dbx-import/dbx-importer.c
+src/plugins/dbx-import/org-gnome-dbx-import.eplug.xml
+src/plugins/email-custom-header/email-custom-header.c
+src/plugins/email-custom-header/org-gnome-email-custom-header.eplug.xml
+[type: gettext/glade]src/plugins/email-custom-header/org-gnome-email-custom-header.ui
+src/plugins/external-editor/external-editor.c
+src/plugins/external-editor/org-gnome-external-editor.eplug.xml
+src/plugins/external-editor/org-gnome-external-editor.error.xml
+src/plugins/face/face.c
+src/plugins/face/org-gnome-face.eplug.xml
+src/plugins/face/org-gnome-face.error.xml
+src/plugins/mailing-list-actions/mailing-list-actions.c
+src/plugins/mailing-list-actions/org-gnome-mailing-list-actions.eplug.xml
+src/plugins/mailing-list-actions/org-gnome-mailing-list-actions.error.xml
+src/plugins/mail-notification/mail-notification.c
+src/plugins/mail-notification/org-gnome-mail-notification.eplug.xml
+src/plugins/mail-to-task/mail-to-task.c
+src/plugins/mail-to-task/org-gnome-mail-to-task.eplug.xml
+src/plugins/pst-import/evolution-pst.metainfo.xml.in
+src/plugins/pst-import/org-gnome-pst-import.eplug.xml
+src/plugins/pst-import/pst-importer.c
+src/plugins/publish-calendar/org-gnome-publish-calendar.eplug.xml
+src/plugins/publish-calendar/publish-calendar.c
+[type: gettext/glade]src/plugins/publish-calendar/publish-calendar.ui
+src/plugins/publish-calendar/publish-format-fb.c
+src/plugins/publish-calendar/publish-format-ical.c
+src/plugins/publish-calendar/url-editor-dialog.c
+src/plugins/save-calendar/csv-format.c
+src/plugins/save-calendar/ical-format.c
+src/plugins/save-calendar/org-gnome-save-calendar.eplug.xml
+src/plugins/save-calendar/rdf-format.c
+src/plugins/save-calendar/save-calendar.c
+src/plugins/templates/e-templates-store.c
+src/plugins/templates/org-gnome-templates.eplug.xml
+src/plugins/templates/templates.c
+src/shell/e-shell-backend.c
+src/shell/e-shell.c
+src/shell/e-shell-content.c
+src/shell/e-shell-migrate.c
+src/shell/e-shell-searchbar.c
+src/shell/e-shell-switcher.c
+src/shell/e-shell-utils.c
+src/shell/e-shell-view.c
+src/shell/e-shell-window-actions.c
+src/shell/e-shell-window.c
+src/shell/e-shell-window-private.c
+src/shell/main.c
+src/shell/shell.error.xml
+src/smime/gui/ca-trust-dialog.c
+src/smime/gui/certificate-manager.c
+src/smime/gui/cert-trust-dialog.c
+src/smime/gui/component.c
+src/smime/gui/e-cert-selector.c
+[type: gettext/glade]src/smime/gui/smime-ui.ui
+src/smime/lib/e-cert.c
+src/smime/lib/e-cert-db.c
+src/smime/lib/e-pkcs12.c
diff --git a/po/POTFILES.skip b/po/POTFILES.skip
index 37818a4..ac3e45e 100644
--- a/po/POTFILES.skip
+++ b/po/POTFILES.skip
@@ -1,5 +1,6 @@
+build/
+.build/
+_build/
data/evolution-alarm-notify.desktop.in
data/evolution.desktop.in
-designs/OOA/ooa.ui
-designs/read_receipts/read.ui
-e-util/test-html-editor.c
+src/e-util/test-html-editor.c
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
new file mode 100644
index 0000000..de2c569
--- /dev/null
+++ b/src/CMakeLists.txt
@@ -0,0 +1,20 @@
+add_subdirectory(addressbook)
+add_subdirectory(calendar)
+add_subdirectory(composer)
+add_subdirectory(em-format)
+add_subdirectory(e-util)
+add_subdirectory(libemail-engine)
+add_subdirectory(libgnomecanvas)
+add_subdirectory(mail)
+add_subdirectory(modules)
+add_subdirectory(plugins)
+add_subdirectory(shell)
+add_subdirectory(web-extensions)
+
+if(WITH_GLADE_CATALOG)
+ add_subdirectory(glade)
+endif(WITH_GLADE_CATALOG)
+
+if(ENABLE_SMIME)
+ add_subdirectory(smime)
+endif(ENABLE_SMIME)
diff --git a/addressbook/CMakeLists.txt b/src/addressbook/CMakeLists.txt
similarity index 100%
rename from addressbook/CMakeLists.txt
rename to src/addressbook/CMakeLists.txt
diff --git a/addressbook/addressbook.error.xml b/src/addressbook/addressbook.error.xml
similarity index 100%
rename from addressbook/addressbook.error.xml
rename to src/addressbook/addressbook.error.xml
diff --git a/addressbook/gui/CMakeLists.txt b/src/addressbook/gui/CMakeLists.txt
similarity index 100%
rename from addressbook/gui/CMakeLists.txt
rename to src/addressbook/gui/CMakeLists.txt
diff --git a/src/addressbook/gui/contact-editor/CMakeLists.txt
b/src/addressbook/gui/contact-editor/CMakeLists.txt
new file mode 100644
index 0000000..aca6e8f
--- /dev/null
+++ b/src/addressbook/gui/contact-editor/CMakeLists.txt
@@ -0,0 +1,61 @@
+install(FILES contact-editor.ui
+ fullname.ui
+ DESTINATION ${uidir}
+)
+
+set(DEPENDENCIES
+ eabwidgets
+ evolution-shell
+ evolution-util
+)
+
+set(SOURCES
+ eab-editor.c
+ eab-editor.h
+ e-contact-editor.c
+ e-contact-editor.h
+ e-contact-editor-dyntable.c
+ e-contact-editor-dyntable.h
+ e-contact-editor-fullname.c
+ e-contact-editor-fullname.h
+ e-contact-quick-add.c
+ e-contact-quick-add.h
+)
+
+add_library(econtacteditor SHARED
+ ${SOURCES}
+)
+
+add_dependencies(econtacteditor
+ ${DEPENDENCIES}
+)
+
+target_compile_definitions(econtacteditor PRIVATE
+ -DG_LOG_DOMAIN=\"e-contact-editor\"
+)
+
+target_compile_options(econtacteditor PUBLIC
+ ${EVOLUTION_DATA_SERVER_CFLAGS}
+ ${GNOME_PLATFORM_CFLAGS}
+)
+
+target_include_directories(econtacteditor PUBLIC
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}/src
+ ${CMAKE_SOURCE_DIR}/src
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_SOURCE_DIR}/src/addressbook
+ ${CMAKE_SOURCE_DIR}/src/addressbook/gui/widgets
+ ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+ ${GNOME_PLATFORM_INCLUDE_DIRS}
+)
+
+target_link_libraries(econtacteditor
+ ${DEPENDENCIES}
+ ${EVOLUTION_DATA_SERVER_LDFLAGS}
+ ${GNOME_PLATFORM_LDFLAGS}
+)
+
+install(TARGETS econtacteditor
+ DESTINATION ${privsolibdir}
+)
diff --git a/addressbook/gui/contact-editor/contact-editor.ui
b/src/addressbook/gui/contact-editor/contact-editor.ui
similarity index 100%
rename from addressbook/gui/contact-editor/contact-editor.ui
rename to src/addressbook/gui/contact-editor/contact-editor.ui
diff --git a/addressbook/gui/contact-editor/e-contact-editor-dyntable.c
b/src/addressbook/gui/contact-editor/e-contact-editor-dyntable.c
similarity index 100%
rename from addressbook/gui/contact-editor/e-contact-editor-dyntable.c
rename to src/addressbook/gui/contact-editor/e-contact-editor-dyntable.c
diff --git a/addressbook/gui/contact-editor/e-contact-editor-dyntable.h
b/src/addressbook/gui/contact-editor/e-contact-editor-dyntable.h
similarity index 100%
rename from addressbook/gui/contact-editor/e-contact-editor-dyntable.h
rename to src/addressbook/gui/contact-editor/e-contact-editor-dyntable.h
diff --git a/addressbook/gui/contact-editor/e-contact-editor-fullname.c
b/src/addressbook/gui/contact-editor/e-contact-editor-fullname.c
similarity index 100%
rename from addressbook/gui/contact-editor/e-contact-editor-fullname.c
rename to src/addressbook/gui/contact-editor/e-contact-editor-fullname.c
diff --git a/addressbook/gui/contact-editor/e-contact-editor-fullname.h
b/src/addressbook/gui/contact-editor/e-contact-editor-fullname.h
similarity index 100%
rename from addressbook/gui/contact-editor/e-contact-editor-fullname.h
rename to src/addressbook/gui/contact-editor/e-contact-editor-fullname.h
diff --git a/addressbook/gui/contact-editor/e-contact-editor.c
b/src/addressbook/gui/contact-editor/e-contact-editor.c
similarity index 100%
rename from addressbook/gui/contact-editor/e-contact-editor.c
rename to src/addressbook/gui/contact-editor/e-contact-editor.c
diff --git a/addressbook/gui/contact-editor/e-contact-editor.h
b/src/addressbook/gui/contact-editor/e-contact-editor.h
similarity index 100%
rename from addressbook/gui/contact-editor/e-contact-editor.h
rename to src/addressbook/gui/contact-editor/e-contact-editor.h
diff --git a/addressbook/gui/contact-editor/e-contact-quick-add.c
b/src/addressbook/gui/contact-editor/e-contact-quick-add.c
similarity index 100%
rename from addressbook/gui/contact-editor/e-contact-quick-add.c
rename to src/addressbook/gui/contact-editor/e-contact-quick-add.c
diff --git a/addressbook/gui/contact-editor/e-contact-quick-add.h
b/src/addressbook/gui/contact-editor/e-contact-quick-add.h
similarity index 100%
rename from addressbook/gui/contact-editor/e-contact-quick-add.h
rename to src/addressbook/gui/contact-editor/e-contact-quick-add.h
diff --git a/addressbook/gui/contact-editor/eab-editor.c b/src/addressbook/gui/contact-editor/eab-editor.c
similarity index 100%
rename from addressbook/gui/contact-editor/eab-editor.c
rename to src/addressbook/gui/contact-editor/eab-editor.c
diff --git a/addressbook/gui/contact-editor/eab-editor.h b/src/addressbook/gui/contact-editor/eab-editor.h
similarity index 100%
rename from addressbook/gui/contact-editor/eab-editor.h
rename to src/addressbook/gui/contact-editor/eab-editor.h
diff --git a/addressbook/gui/contact-editor/fullname.ui b/src/addressbook/gui/contact-editor/fullname.ui
similarity index 100%
rename from addressbook/gui/contact-editor/fullname.ui
rename to src/addressbook/gui/contact-editor/fullname.ui
diff --git a/addressbook/gui/contact-editor/test-editor.c b/src/addressbook/gui/contact-editor/test-editor.c
similarity index 100%
rename from addressbook/gui/contact-editor/test-editor.c
rename to src/addressbook/gui/contact-editor/test-editor.c
diff --git a/src/addressbook/gui/contact-list-editor/CMakeLists.txt
b/src/addressbook/gui/contact-list-editor/CMakeLists.txt
new file mode 100644
index 0000000..02d3806
--- /dev/null
+++ b/src/addressbook/gui/contact-list-editor/CMakeLists.txt
@@ -0,0 +1,56 @@
+install(FILES contact-list-editor.ui
+ DESTINATION ${uidir}
+)
+
+set(DEPENDENCIES
+ eabutil
+ eabwidgets
+ econtacteditor
+ evolution-shell
+ evolution-util
+)
+
+set(SOURCES
+ e-contact-list-editor.c
+ e-contact-list-editor.h
+ e-contact-list-model.c
+ e-contact-list-model.h
+)
+
+add_library(econtactlisteditor SHARED
+ ${SOURCES}
+)
+
+add_dependencies(econtactlisteditor
+ ${DEPENDENCIES}
+)
+
+target_compile_definitions(econtactlisteditor PRIVATE
+ -DG_LOG_DOMAIN=\"e-contact-list-editor\"
+)
+
+target_compile_options(econtactlisteditor PUBLIC
+ ${EVOLUTION_DATA_SERVER_CFLAGS}
+ ${GNOME_PLATFORM_CFLAGS}
+)
+
+target_include_directories(econtactlisteditor PUBLIC
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}/src
+ ${CMAKE_SOURCE_DIR}/src
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_SOURCE_DIR}/src/addressbook
+ ${CMAKE_SOURCE_DIR}/src/addressbook/gui/widgets
+ ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+ ${GNOME_PLATFORM_INCLUDE_DIRS}
+)
+
+target_link_libraries(econtactlisteditor
+ ${DEPENDENCIES}
+ ${EVOLUTION_DATA_SERVER_LDFLAGS}
+ ${GNOME_PLATFORM_LDFLAGS}
+)
+
+install(TARGETS econtactlisteditor
+ DESTINATION ${privsolibdir}
+)
diff --git a/addressbook/gui/contact-list-editor/contact-list-editor.ui
b/src/addressbook/gui/contact-list-editor/contact-list-editor.ui
similarity index 100%
rename from addressbook/gui/contact-list-editor/contact-list-editor.ui
rename to src/addressbook/gui/contact-list-editor/contact-list-editor.ui
diff --git a/addressbook/gui/contact-list-editor/e-contact-list-editor.c
b/src/addressbook/gui/contact-list-editor/e-contact-list-editor.c
similarity index 100%
rename from addressbook/gui/contact-list-editor/e-contact-list-editor.c
rename to src/addressbook/gui/contact-list-editor/e-contact-list-editor.c
diff --git a/addressbook/gui/contact-list-editor/e-contact-list-editor.h
b/src/addressbook/gui/contact-list-editor/e-contact-list-editor.h
similarity index 100%
rename from addressbook/gui/contact-list-editor/e-contact-list-editor.h
rename to src/addressbook/gui/contact-list-editor/e-contact-list-editor.h
diff --git a/addressbook/gui/contact-list-editor/e-contact-list-model.c
b/src/addressbook/gui/contact-list-editor/e-contact-list-model.c
similarity index 100%
rename from addressbook/gui/contact-list-editor/e-contact-list-model.c
rename to src/addressbook/gui/contact-list-editor/e-contact-list-model.c
diff --git a/addressbook/gui/contact-list-editor/e-contact-list-model.h
b/src/addressbook/gui/contact-list-editor/e-contact-list-model.h
similarity index 100%
rename from addressbook/gui/contact-list-editor/e-contact-list-model.h
rename to src/addressbook/gui/contact-list-editor/e-contact-list-model.h
diff --git a/src/addressbook/gui/widgets/CMakeLists.txt b/src/addressbook/gui/widgets/CMakeLists.txt
new file mode 100644
index 0000000..cc48c41
--- /dev/null
+++ b/src/addressbook/gui/widgets/CMakeLists.txt
@@ -0,0 +1,118 @@
+install(FILES addresstypes.xml
+ address_formats.dat
+ countrytransl.map
+ DESTINATION ${privdatadir}
+)
+
+install(FILES e-addressbook-view.etspec
+ DESTINATION ${etspecdir}
+)
+
+set(DEPENDENCIES
+ eabutil
+ econtactprint
+ evolution-shell
+ evolution-util
+)
+
+set(SOURCES
+ eab-config.c
+ eab-contact-compare.c
+ eab-contact-compare.h
+ eab-contact-display.c
+ eab-contact-display.h
+ eab-contact-formatter.c
+ eab-contact-formatter.h
+ eab-contact-merging.c
+ eab-contact-merging.h
+ eab-gui-util.c
+ eab-gui-util.h
+ e-contact-map.c
+ e-contact-map.h
+ e-contact-map-window.c
+ e-contact-map-window.h
+ e-minicard.c
+ e-minicard.h
+ e-minicard-label.c
+ e-minicard-label.h
+ e-minicard-view.c
+ e-minicard-view.h
+ e-minicard-view-widget.c
+ e-minicard-view-widget.h
+ e-addressbook-reflow-adapter.c
+ e-addressbook-reflow-adapter.h
+ e-addressbook-table-adapter.c
+ e-addressbook-table-adapter.h
+ e-addressbook-model.c
+ e-addressbook-model.h
+ e-addressbook-selector.c
+ e-addressbook-selector.h
+ e-addressbook-view.c
+ e-addressbook-view.h
+ gal-view-minicard.c
+ gal-view-minicard.h
+ ea-minicard.c
+ ea-minicard.h
+ ea-minicard-view.c
+ ea-minicard-view.h
+ ea-addressbook-view.c
+ ea-addressbook-view.h
+ ea-addressbook.c
+ ea-addressbook.h
+)
+
+set(HEADERS
+ eab-config.h
+)
+
+add_library(eabwidgets SHARED
+ ${SOURCES}
+ ${HEADERS}
+)
+
+add_dependencies(eabwidgets
+ ${DEPENDENCIES}
+)
+
+target_compile_definitions(eabwidgets PRIVATE
+ -DG_LOG_DOMAIN=\"eabwidgets\"
+ -DEVOLUTION_ETSPECDIR=\"${etspecdir}\"
+ -DEVOLUTION_IMAGESDIR=\"${imagesdir}\"
+ -DEVOLUTION_PRIVDATADIR=\"${privdatadir}\"
+)
+
+target_compile_options(eabwidgets PUBLIC
+ ${CHAMPLAIN_CFLAGS}
+ ${EVOLUTION_DATA_SERVER_CFLAGS}
+ ${GEO_CFLAGS}
+ ${GNOME_PLATFORM_CFLAGS}
+)
+
+target_include_directories(eabwidgets PUBLIC
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}/src
+ ${CMAKE_SOURCE_DIR}/src
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_SOURCE_DIR}/src/addressbook
+ ${CMAKE_SOURCE_DIR}/src/addressbook/util
+ ${CHAMPLAIN_INCLUDE_DIRS}
+ ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+ ${GEO_INCLUDE_DIRS}
+ ${GNOME_PLATFORM_INCLUDE_DIRS}
+)
+
+target_link_libraries(eabwidgets
+ ${DEPENDENCIES}
+ ${CHAMPLAIN_LDFLAGS}
+ ${EVOLUTION_DATA_SERVER_LDFLAGS}
+ ${GEO_LDFLAGS}
+ ${GNOME_PLATFORM_LDFLAGS}
+)
+
+install(TARGETS eabwidgets
+ DESTINATION ${privsolibdir}
+)
+
+install(FILES ${HEADERS}
+ DESTINATION ${privincludedir}/addressbook/gui/widgets
+)
diff --git a/addressbook/gui/widgets/address_formats.dat b/src/addressbook/gui/widgets/address_formats.dat
similarity index 100%
rename from addressbook/gui/widgets/address_formats.dat
rename to src/addressbook/gui/widgets/address_formats.dat
diff --git a/addressbook/gui/widgets/addresstypes.xml b/src/addressbook/gui/widgets/addresstypes.xml
similarity index 100%
rename from addressbook/gui/widgets/addresstypes.xml
rename to src/addressbook/gui/widgets/addresstypes.xml
diff --git a/addressbook/gui/widgets/countrytransl.map b/src/addressbook/gui/widgets/countrytransl.map
similarity index 100%
rename from addressbook/gui/widgets/countrytransl.map
rename to src/addressbook/gui/widgets/countrytransl.map
diff --git a/addressbook/gui/widgets/e-addressbook-model.c b/src/addressbook/gui/widgets/e-addressbook-model.c
similarity index 100%
rename from addressbook/gui/widgets/e-addressbook-model.c
rename to src/addressbook/gui/widgets/e-addressbook-model.c
diff --git a/addressbook/gui/widgets/e-addressbook-model.h b/src/addressbook/gui/widgets/e-addressbook-model.h
similarity index 100%
rename from addressbook/gui/widgets/e-addressbook-model.h
rename to src/addressbook/gui/widgets/e-addressbook-model.h
diff --git a/addressbook/gui/widgets/e-addressbook-reflow-adapter.c
b/src/addressbook/gui/widgets/e-addressbook-reflow-adapter.c
similarity index 100%
rename from addressbook/gui/widgets/e-addressbook-reflow-adapter.c
rename to src/addressbook/gui/widgets/e-addressbook-reflow-adapter.c
diff --git a/addressbook/gui/widgets/e-addressbook-reflow-adapter.h
b/src/addressbook/gui/widgets/e-addressbook-reflow-adapter.h
similarity index 100%
rename from addressbook/gui/widgets/e-addressbook-reflow-adapter.h
rename to src/addressbook/gui/widgets/e-addressbook-reflow-adapter.h
diff --git a/addressbook/gui/widgets/e-addressbook-selector.c
b/src/addressbook/gui/widgets/e-addressbook-selector.c
similarity index 100%
rename from addressbook/gui/widgets/e-addressbook-selector.c
rename to src/addressbook/gui/widgets/e-addressbook-selector.c
diff --git a/addressbook/gui/widgets/e-addressbook-selector.h
b/src/addressbook/gui/widgets/e-addressbook-selector.h
similarity index 100%
rename from addressbook/gui/widgets/e-addressbook-selector.h
rename to src/addressbook/gui/widgets/e-addressbook-selector.h
diff --git a/addressbook/gui/widgets/e-addressbook-table-adapter.c
b/src/addressbook/gui/widgets/e-addressbook-table-adapter.c
similarity index 100%
rename from addressbook/gui/widgets/e-addressbook-table-adapter.c
rename to src/addressbook/gui/widgets/e-addressbook-table-adapter.c
diff --git a/addressbook/gui/widgets/e-addressbook-table-adapter.h
b/src/addressbook/gui/widgets/e-addressbook-table-adapter.h
similarity index 100%
rename from addressbook/gui/widgets/e-addressbook-table-adapter.h
rename to src/addressbook/gui/widgets/e-addressbook-table-adapter.h
diff --git a/addressbook/gui/widgets/e-addressbook-view.c b/src/addressbook/gui/widgets/e-addressbook-view.c
similarity index 100%
rename from addressbook/gui/widgets/e-addressbook-view.c
rename to src/addressbook/gui/widgets/e-addressbook-view.c
diff --git a/addressbook/gui/widgets/e-addressbook-view.etspec
b/src/addressbook/gui/widgets/e-addressbook-view.etspec
similarity index 100%
rename from addressbook/gui/widgets/e-addressbook-view.etspec
rename to src/addressbook/gui/widgets/e-addressbook-view.etspec
diff --git a/addressbook/gui/widgets/e-addressbook-view.h b/src/addressbook/gui/widgets/e-addressbook-view.h
similarity index 100%
rename from addressbook/gui/widgets/e-addressbook-view.h
rename to src/addressbook/gui/widgets/e-addressbook-view.h
diff --git a/addressbook/gui/widgets/e-contact-map-window.c
b/src/addressbook/gui/widgets/e-contact-map-window.c
similarity index 100%
rename from addressbook/gui/widgets/e-contact-map-window.c
rename to src/addressbook/gui/widgets/e-contact-map-window.c
diff --git a/addressbook/gui/widgets/e-contact-map-window.h
b/src/addressbook/gui/widgets/e-contact-map-window.h
similarity index 100%
rename from addressbook/gui/widgets/e-contact-map-window.h
rename to src/addressbook/gui/widgets/e-contact-map-window.h
diff --git a/addressbook/gui/widgets/e-contact-map.c b/src/addressbook/gui/widgets/e-contact-map.c
similarity index 100%
rename from addressbook/gui/widgets/e-contact-map.c
rename to src/addressbook/gui/widgets/e-contact-map.c
diff --git a/addressbook/gui/widgets/e-contact-map.h b/src/addressbook/gui/widgets/e-contact-map.h
similarity index 100%
rename from addressbook/gui/widgets/e-contact-map.h
rename to src/addressbook/gui/widgets/e-contact-map.h
diff --git a/addressbook/gui/widgets/e-minicard-label.c b/src/addressbook/gui/widgets/e-minicard-label.c
similarity index 100%
rename from addressbook/gui/widgets/e-minicard-label.c
rename to src/addressbook/gui/widgets/e-minicard-label.c
diff --git a/addressbook/gui/widgets/e-minicard-label.h b/src/addressbook/gui/widgets/e-minicard-label.h
similarity index 100%
rename from addressbook/gui/widgets/e-minicard-label.h
rename to src/addressbook/gui/widgets/e-minicard-label.h
diff --git a/addressbook/gui/widgets/e-minicard-view-widget.c
b/src/addressbook/gui/widgets/e-minicard-view-widget.c
similarity index 100%
rename from addressbook/gui/widgets/e-minicard-view-widget.c
rename to src/addressbook/gui/widgets/e-minicard-view-widget.c
diff --git a/addressbook/gui/widgets/e-minicard-view-widget.h
b/src/addressbook/gui/widgets/e-minicard-view-widget.h
similarity index 100%
rename from addressbook/gui/widgets/e-minicard-view-widget.h
rename to src/addressbook/gui/widgets/e-minicard-view-widget.h
diff --git a/addressbook/gui/widgets/e-minicard-view.c b/src/addressbook/gui/widgets/e-minicard-view.c
similarity index 100%
rename from addressbook/gui/widgets/e-minicard-view.c
rename to src/addressbook/gui/widgets/e-minicard-view.c
diff --git a/addressbook/gui/widgets/e-minicard-view.h b/src/addressbook/gui/widgets/e-minicard-view.h
similarity index 100%
rename from addressbook/gui/widgets/e-minicard-view.h
rename to src/addressbook/gui/widgets/e-minicard-view.h
diff --git a/addressbook/gui/widgets/e-minicard.c b/src/addressbook/gui/widgets/e-minicard.c
similarity index 100%
rename from addressbook/gui/widgets/e-minicard.c
rename to src/addressbook/gui/widgets/e-minicard.c
diff --git a/addressbook/gui/widgets/e-minicard.h b/src/addressbook/gui/widgets/e-minicard.h
similarity index 100%
rename from addressbook/gui/widgets/e-minicard.h
rename to src/addressbook/gui/widgets/e-minicard.h
diff --git a/addressbook/gui/widgets/ea-addressbook-view.c b/src/addressbook/gui/widgets/ea-addressbook-view.c
similarity index 100%
rename from addressbook/gui/widgets/ea-addressbook-view.c
rename to src/addressbook/gui/widgets/ea-addressbook-view.c
diff --git a/addressbook/gui/widgets/ea-addressbook-view.h b/src/addressbook/gui/widgets/ea-addressbook-view.h
similarity index 100%
rename from addressbook/gui/widgets/ea-addressbook-view.h
rename to src/addressbook/gui/widgets/ea-addressbook-view.h
diff --git a/addressbook/gui/widgets/ea-addressbook.c b/src/addressbook/gui/widgets/ea-addressbook.c
similarity index 100%
rename from addressbook/gui/widgets/ea-addressbook.c
rename to src/addressbook/gui/widgets/ea-addressbook.c
diff --git a/addressbook/gui/widgets/ea-addressbook.h b/src/addressbook/gui/widgets/ea-addressbook.h
similarity index 100%
rename from addressbook/gui/widgets/ea-addressbook.h
rename to src/addressbook/gui/widgets/ea-addressbook.h
diff --git a/addressbook/gui/widgets/ea-minicard-view.c b/src/addressbook/gui/widgets/ea-minicard-view.c
similarity index 100%
rename from addressbook/gui/widgets/ea-minicard-view.c
rename to src/addressbook/gui/widgets/ea-minicard-view.c
diff --git a/addressbook/gui/widgets/ea-minicard-view.h b/src/addressbook/gui/widgets/ea-minicard-view.h
similarity index 100%
rename from addressbook/gui/widgets/ea-minicard-view.h
rename to src/addressbook/gui/widgets/ea-minicard-view.h
diff --git a/addressbook/gui/widgets/ea-minicard.c b/src/addressbook/gui/widgets/ea-minicard.c
similarity index 100%
rename from addressbook/gui/widgets/ea-minicard.c
rename to src/addressbook/gui/widgets/ea-minicard.c
diff --git a/addressbook/gui/widgets/ea-minicard.h b/src/addressbook/gui/widgets/ea-minicard.h
similarity index 100%
rename from addressbook/gui/widgets/ea-minicard.h
rename to src/addressbook/gui/widgets/ea-minicard.h
diff --git a/addressbook/gui/widgets/eab-config.c b/src/addressbook/gui/widgets/eab-config.c
similarity index 100%
rename from addressbook/gui/widgets/eab-config.c
rename to src/addressbook/gui/widgets/eab-config.c
diff --git a/addressbook/gui/widgets/eab-config.h b/src/addressbook/gui/widgets/eab-config.h
similarity index 100%
rename from addressbook/gui/widgets/eab-config.h
rename to src/addressbook/gui/widgets/eab-config.h
diff --git a/addressbook/gui/widgets/eab-contact-compare.c b/src/addressbook/gui/widgets/eab-contact-compare.c
similarity index 100%
rename from addressbook/gui/widgets/eab-contact-compare.c
rename to src/addressbook/gui/widgets/eab-contact-compare.c
diff --git a/addressbook/gui/widgets/eab-contact-compare.h b/src/addressbook/gui/widgets/eab-contact-compare.h
similarity index 100%
rename from addressbook/gui/widgets/eab-contact-compare.h
rename to src/addressbook/gui/widgets/eab-contact-compare.h
diff --git a/addressbook/gui/widgets/eab-contact-display.c b/src/addressbook/gui/widgets/eab-contact-display.c
similarity index 100%
rename from addressbook/gui/widgets/eab-contact-display.c
rename to src/addressbook/gui/widgets/eab-contact-display.c
diff --git a/addressbook/gui/widgets/eab-contact-display.h b/src/addressbook/gui/widgets/eab-contact-display.h
similarity index 100%
rename from addressbook/gui/widgets/eab-contact-display.h
rename to src/addressbook/gui/widgets/eab-contact-display.h
diff --git a/addressbook/gui/widgets/eab-contact-formatter.c
b/src/addressbook/gui/widgets/eab-contact-formatter.c
similarity index 100%
rename from addressbook/gui/widgets/eab-contact-formatter.c
rename to src/addressbook/gui/widgets/eab-contact-formatter.c
diff --git a/addressbook/gui/widgets/eab-contact-formatter.h
b/src/addressbook/gui/widgets/eab-contact-formatter.h
similarity index 100%
rename from addressbook/gui/widgets/eab-contact-formatter.h
rename to src/addressbook/gui/widgets/eab-contact-formatter.h
diff --git a/addressbook/gui/widgets/eab-contact-merging.c b/src/addressbook/gui/widgets/eab-contact-merging.c
similarity index 100%
rename from addressbook/gui/widgets/eab-contact-merging.c
rename to src/addressbook/gui/widgets/eab-contact-merging.c
diff --git a/addressbook/gui/widgets/eab-contact-merging.h b/src/addressbook/gui/widgets/eab-contact-merging.h
similarity index 100%
rename from addressbook/gui/widgets/eab-contact-merging.h
rename to src/addressbook/gui/widgets/eab-contact-merging.h
diff --git a/addressbook/gui/widgets/eab-gui-util.c b/src/addressbook/gui/widgets/eab-gui-util.c
similarity index 100%
rename from addressbook/gui/widgets/eab-gui-util.c
rename to src/addressbook/gui/widgets/eab-gui-util.c
diff --git a/addressbook/gui/widgets/eab-gui-util.h b/src/addressbook/gui/widgets/eab-gui-util.h
similarity index 100%
rename from addressbook/gui/widgets/eab-gui-util.h
rename to src/addressbook/gui/widgets/eab-gui-util.h
diff --git a/addressbook/gui/widgets/gal-view-minicard.c b/src/addressbook/gui/widgets/gal-view-minicard.c
similarity index 100%
rename from addressbook/gui/widgets/gal-view-minicard.c
rename to src/addressbook/gui/widgets/gal-view-minicard.c
diff --git a/addressbook/gui/widgets/gal-view-minicard.h b/src/addressbook/gui/widgets/gal-view-minicard.h
similarity index 100%
rename from addressbook/gui/widgets/gal-view-minicard.h
rename to src/addressbook/gui/widgets/gal-view-minicard.h
diff --git a/src/addressbook/importers/CMakeLists.txt b/src/addressbook/importers/CMakeLists.txt
new file mode 100644
index 0000000..f8ce906
--- /dev/null
+++ b/src/addressbook/importers/CMakeLists.txt
@@ -0,0 +1,49 @@
+set(DEPENDENCIES
+ eabutil
+ evolution-shell
+ evolution-util
+)
+
+set(SOURCES
+ evolution-ldif-importer.c
+ evolution-vcard-importer.c
+ evolution-csv-importer.c
+ evolution-addressbook-importers.h
+)
+
+add_library(evolution-addressbook-importers SHARED
+ ${SOURCES}
+)
+
+add_dependencies(evolution-addressbook-importers
+ ${DEPENDENCIES}
+)
+
+target_compile_definitions(evolution-addressbook-importers PRIVATE
+ -DG_LOG_DOMAIN=\"evolution-addressbook-importers\"
+)
+
+target_compile_options(evolution-addressbook-importers PUBLIC
+ ${EVOLUTION_DATA_SERVER_CFLAGS}
+ ${GNOME_PLATFORM_CFLAGS}
+)
+
+target_include_directories(evolution-addressbook-importers PUBLIC
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}/src
+ ${CMAKE_SOURCE_DIR}/src
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_SOURCE_DIR}/src/addressbook
+ ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+ ${GNOME_PLATFORM_INCLUDE_DIRS}
+)
+
+target_link_libraries(evolution-addressbook-importers
+ ${DEPENDENCIES}
+ ${EVOLUTION_DATA_SERVER_LDFLAGS}
+ ${GNOME_PLATFORM_LDFLAGS}
+)
+
+install(TARGETS evolution-addressbook-importers
+ DESTINATION ${privsolibdir}
+)
diff --git a/addressbook/importers/evolution-addressbook-importers.h
b/src/addressbook/importers/evolution-addressbook-importers.h
similarity index 100%
rename from addressbook/importers/evolution-addressbook-importers.h
rename to src/addressbook/importers/evolution-addressbook-importers.h
diff --git a/addressbook/importers/evolution-csv-importer.c
b/src/addressbook/importers/evolution-csv-importer.c
similarity index 100%
rename from addressbook/importers/evolution-csv-importer.c
rename to src/addressbook/importers/evolution-csv-importer.c
diff --git a/addressbook/importers/evolution-ldif-importer.c
b/src/addressbook/importers/evolution-ldif-importer.c
similarity index 100%
rename from addressbook/importers/evolution-ldif-importer.c
rename to src/addressbook/importers/evolution-ldif-importer.c
diff --git a/addressbook/importers/evolution-vcard-importer.c
b/src/addressbook/importers/evolution-vcard-importer.c
similarity index 100%
rename from addressbook/importers/evolution-vcard-importer.c
rename to src/addressbook/importers/evolution-vcard-importer.c
diff --git a/src/addressbook/printing/CMakeLists.txt b/src/addressbook/printing/CMakeLists.txt
new file mode 100644
index 0000000..169c333
--- /dev/null
+++ b/src/addressbook/printing/CMakeLists.txt
@@ -0,0 +1,56 @@
+set(ecpsdir ${privdatadir}/ecps)
+
+install(FILES smallbook.ecps
+ medbook.ecps
+ phonelist.ecps
+ DESTINATION ${ecpsdir}
+)
+
+set(DEPENDENCIES
+ eabutil
+ evolution-util
+)
+
+set(SOURCES
+ e-contact-print-types.h
+ e-contact-print.c
+ e-contact-print.h
+)
+
+add_library(econtactprint SHARED
+ ${SOURCES}
+)
+
+add_dependencies(econtactprint
+ ${DEPENDENCIES}
+)
+
+target_compile_definitions(econtactprint PRIVATE
+ -DG_LOG_DOMAIN=\"addressbook-printing\"
+ -DEVOLUTION_ECPSDIR=\"${ecpsdir}\"
+)
+
+target_compile_options(econtactprint PUBLIC
+ ${EVOLUTION_DATA_SERVER_CFLAGS}
+ ${GNOME_PLATFORM_CFLAGS}
+)
+
+target_include_directories(econtactprint PUBLIC
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}/src
+ ${CMAKE_SOURCE_DIR}/src
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_SOURCE_DIR}/src/addressbook
+ ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+ ${GNOME_PLATFORM_INCLUDE_DIRS}
+)
+
+target_link_libraries(econtactprint
+ ${DEPENDENCIES}
+ ${EVOLUTION_DATA_SERVER_LDFLAGS}
+ ${GNOME_PLATFORM_LDFLAGS}
+)
+
+install(TARGETS econtactprint
+ DESTINATION ${privsolibdir}
+)
diff --git a/addressbook/printing/e-contact-print-types.h b/src/addressbook/printing/e-contact-print-types.h
similarity index 100%
rename from addressbook/printing/e-contact-print-types.h
rename to src/addressbook/printing/e-contact-print-types.h
diff --git a/addressbook/printing/e-contact-print.c b/src/addressbook/printing/e-contact-print.c
similarity index 100%
rename from addressbook/printing/e-contact-print.c
rename to src/addressbook/printing/e-contact-print.c
diff --git a/addressbook/printing/e-contact-print.h b/src/addressbook/printing/e-contact-print.h
similarity index 100%
rename from addressbook/printing/e-contact-print.h
rename to src/addressbook/printing/e-contact-print.h
diff --git a/addressbook/printing/medbook.ecps b/src/addressbook/printing/medbook.ecps
similarity index 100%
rename from addressbook/printing/medbook.ecps
rename to src/addressbook/printing/medbook.ecps
diff --git a/addressbook/printing/phonelist.ecps b/src/addressbook/printing/phonelist.ecps
similarity index 100%
rename from addressbook/printing/phonelist.ecps
rename to src/addressbook/printing/phonelist.ecps
diff --git a/addressbook/printing/smallbook.ecps b/src/addressbook/printing/smallbook.ecps
similarity index 100%
rename from addressbook/printing/smallbook.ecps
rename to src/addressbook/printing/smallbook.ecps
diff --git a/src/addressbook/util/CMakeLists.txt b/src/addressbook/util/CMakeLists.txt
new file mode 100644
index 0000000..2753f15
--- /dev/null
+++ b/src/addressbook/util/CMakeLists.txt
@@ -0,0 +1,47 @@
+set(DEPENDENCIES
+ evolution-shell
+ evolution-util
+)
+
+set(SOURCES
+ eab-book-util.c
+ eab-book-util.h
+)
+
+add_library(eabutil SHARED
+ ${SOURCES}
+)
+
+add_dependencies(eabutil
+ ${DEPENDENCIES}
+)
+
+target_compile_definitions(eabutil PRIVATE
+ -DG_LOG_DOMAIN=\"eabutil\"
+)
+
+target_compile_options(eabutil PUBLIC
+ ${EVOLUTION_DATA_SERVER_CFLAGS}
+ ${GNOME_PLATFORM_CFLAGS}
+)
+
+target_include_directories(eabutil PUBLIC
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}/src
+ ${CMAKE_SOURCE_DIR}/src
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_SOURCE_DIR}/src/shell
+ ${CMAKE_BINARY_DIR}/src/shell
+ ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+ ${GNOME_PLATFORM_INCLUDE_DIRS}
+)
+
+target_link_libraries(eabutil
+ ${DEPENDENCIES}
+ ${EVOLUTION_DATA_SERVER_LDFLAGS}
+ ${GNOME_PLATFORM_LDFLAGS}
+)
+
+install(TARGETS eabutil
+ DESTINATION ${privsolibdir}
+)
diff --git a/addressbook/util/eab-book-util.c b/src/addressbook/util/eab-book-util.c
similarity index 100%
rename from addressbook/util/eab-book-util.c
rename to src/addressbook/util/eab-book-util.c
diff --git a/addressbook/util/eab-book-util.h b/src/addressbook/util/eab-book-util.h
similarity index 100%
rename from addressbook/util/eab-book-util.h
rename to src/addressbook/util/eab-book-util.h
diff --git a/calendar/AUTHORS b/src/calendar/AUTHORS
similarity index 100%
rename from calendar/AUTHORS
rename to src/calendar/AUTHORS
diff --git a/calendar/CMakeLists.txt b/src/calendar/CMakeLists.txt
similarity index 100%
rename from calendar/CMakeLists.txt
rename to src/calendar/CMakeLists.txt
diff --git a/src/calendar/alarm-notify/CMakeLists.txt b/src/calendar/alarm-notify/CMakeLists.txt
new file mode 100644
index 0000000..02a7c13
--- /dev/null
+++ b/src/calendar/alarm-notify/CMakeLists.txt
@@ -0,0 +1,92 @@
+install(FILES alarm-notify.ui
+ DESTINATION ${uidir}
+)
+
+set(DEPENDENCIES
+ eabutil
+ econtacteditor
+ econtactlisteditor
+ evolution-calendar
+ evolution-calendar-importers
+ evolution-mail-composer
+ evolution-mail-formatter
+ evolution-util
+ evolution-shell
+)
+
+set(SOURCES
+ alarm.c
+ alarm.h
+ alarm-notify.c
+ alarm-notify.h
+ alarm-notify-dialog.c
+ alarm-notify-dialog.h
+ alarm-queue.c
+ alarm-queue.h
+ config-data.c
+ config-data.h
+ notify-main.c
+ util.c
+ util.h
+)
+
+add_executable(evolution-alarm-notify
+ ${SOURCES}
+)
+
+add_dependencies(evolution-alarm-notify
+ ${DEPENDENCIES}
+)
+
+target_compile_definitions(evolution-alarm-notify PRIVATE
+ -DG_LOG_DOMAIN=\"evolution-alarm-notify\"
+ -DEVOLUTION_ICONDIR=\"${icondir}\"
+ -DEVOLUTION_LOCALEDIR=\"${LOCALE_INSTALL_DIR}\"
+)
+
+target_compile_options(evolution-alarm-notify PUBLIC
+ ${CANBERRA_CFLAGS}
+ ${EVOLUTION_DATA_SERVER_CFLAGS}
+ ${GNOME_PLATFORM_CFLAGS}
+ ${LIBNOTIFY_CFLAGS}
+)
+
+target_include_directories(evolution-alarm-notify PUBLIC
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}/src
+ ${CMAKE_SOURCE_DIR}/src
+ ${CMAKE_BINARY_DIR}/src/calendar
+ ${CMAKE_SOURCE_DIR}/src/calendar
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${CANBERRA_INCLUDE_DIRS}
+ ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+ ${GNOME_PLATFORM_INCLUDE_DIRS}
+ ${LIBNOTIFY_INCLUDE_DIRS}
+)
+
+target_link_libraries(evolution-alarm-notify
+ ${DEPENDENCIES}
+ ${CANBERRA_LDFLAGS}
+ ${EVOLUTION_DATA_SERVER_LDFLAGS}
+ ${GNOME_PLATFORM_LDFLAGS}
+ ${LIBNOTIFY_LDFLAGS}
+)
+
+if(WIN32)
+ find_program(WINDRES windres)
+ if(WINDRES)
+ add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/evolution-alarm-notify-icon.o
+ COMMAND ${WINDRES} ${CMAKE_CURRENT_SOURCE_DIR}/evolution-alarm-notify-icon.rc
${CMAKE_CURRENT_BINARY_DIR}/evolution-alarm-notify-icon.o
+ DEPENDS evolution-alarm-notify-icon.rc
+ evolution-alarm-notify.ico
+ )
+
+ target_link_libraries(evolution-alarm-notify
+ ${CMAKE_CURRENT_BINARY_DIR}/evolution-alarm-notify-icon.o
+ )
+ endif(WINDRES)
+endif(WIN32)
+
+install(TARGETS evolution-alarm-notify
+ DESTINATION ${privlibexecdir}
+)
diff --git a/calendar/alarm-notify/alarm-notify-dialog.c b/src/calendar/alarm-notify/alarm-notify-dialog.c
similarity index 100%
rename from calendar/alarm-notify/alarm-notify-dialog.c
rename to src/calendar/alarm-notify/alarm-notify-dialog.c
diff --git a/calendar/alarm-notify/alarm-notify-dialog.h b/src/calendar/alarm-notify/alarm-notify-dialog.h
similarity index 100%
rename from calendar/alarm-notify/alarm-notify-dialog.h
rename to src/calendar/alarm-notify/alarm-notify-dialog.h
diff --git a/calendar/alarm-notify/alarm-notify.c b/src/calendar/alarm-notify/alarm-notify.c
similarity index 100%
rename from calendar/alarm-notify/alarm-notify.c
rename to src/calendar/alarm-notify/alarm-notify.c
diff --git a/calendar/alarm-notify/alarm-notify.h b/src/calendar/alarm-notify/alarm-notify.h
similarity index 100%
rename from calendar/alarm-notify/alarm-notify.h
rename to src/calendar/alarm-notify/alarm-notify.h
diff --git a/calendar/alarm-notify/alarm-notify.ui b/src/calendar/alarm-notify/alarm-notify.ui
similarity index 100%
rename from calendar/alarm-notify/alarm-notify.ui
rename to src/calendar/alarm-notify/alarm-notify.ui
diff --git a/calendar/alarm-notify/alarm-queue.c b/src/calendar/alarm-notify/alarm-queue.c
similarity index 100%
rename from calendar/alarm-notify/alarm-queue.c
rename to src/calendar/alarm-notify/alarm-queue.c
diff --git a/calendar/alarm-notify/alarm-queue.h b/src/calendar/alarm-notify/alarm-queue.h
similarity index 100%
rename from calendar/alarm-notify/alarm-queue.h
rename to src/calendar/alarm-notify/alarm-queue.h
diff --git a/calendar/alarm-notify/alarm.c b/src/calendar/alarm-notify/alarm.c
similarity index 100%
rename from calendar/alarm-notify/alarm.c
rename to src/calendar/alarm-notify/alarm.c
diff --git a/calendar/alarm-notify/alarm.h b/src/calendar/alarm-notify/alarm.h
similarity index 100%
rename from calendar/alarm-notify/alarm.h
rename to src/calendar/alarm-notify/alarm.h
diff --git a/calendar/alarm-notify/config-data.c b/src/calendar/alarm-notify/config-data.c
similarity index 100%
rename from calendar/alarm-notify/config-data.c
rename to src/calendar/alarm-notify/config-data.c
diff --git a/calendar/alarm-notify/config-data.h b/src/calendar/alarm-notify/config-data.h
similarity index 100%
rename from calendar/alarm-notify/config-data.h
rename to src/calendar/alarm-notify/config-data.h
diff --git a/calendar/alarm-notify/evolution-alarm-notify-icon.rc
b/src/calendar/alarm-notify/evolution-alarm-notify-icon.rc
similarity index 100%
rename from calendar/alarm-notify/evolution-alarm-notify-icon.rc
rename to src/calendar/alarm-notify/evolution-alarm-notify-icon.rc
diff --git a/calendar/alarm-notify/notify-main.c b/src/calendar/alarm-notify/notify-main.c
similarity index 100%
rename from calendar/alarm-notify/notify-main.c
rename to src/calendar/alarm-notify/notify-main.c
diff --git a/calendar/alarm-notify/util.c b/src/calendar/alarm-notify/util.c
similarity index 100%
rename from calendar/alarm-notify/util.c
rename to src/calendar/alarm-notify/util.c
diff --git a/calendar/alarm-notify/util.h b/src/calendar/alarm-notify/util.h
similarity index 100%
rename from calendar/alarm-notify/util.h
rename to src/calendar/alarm-notify/util.h
diff --git a/calendar/calendar.error.xml b/src/calendar/calendar.error.xml
similarity index 100%
rename from calendar/calendar.error.xml
rename to src/calendar/calendar.error.xml
diff --git a/src/calendar/gui/CMakeLists.txt b/src/calendar/gui/CMakeLists.txt
new file mode 100644
index 0000000..001e36b
--- /dev/null
+++ b/src/calendar/gui/CMakeLists.txt
@@ -0,0 +1,220 @@
+add_custom_xml_files(calendar ${privdatadir} filter .in ""
+ tasktypes.xml
+ memotypes.xml
+ caltypes.xml
+)
+
+install(FILES e-meeting-time-sel.etspec
+ e-cal-list-view.etspec
+ e-memo-table.etspec
+ e-task-table.etspec
+ DESTINATION ${etspecdir}
+)
+
+
+set(DEPENDENCIES
+ eabutil
+ econtacteditor
+ econtactlisteditor
+ evolution-calendar-importers
+ evolution-mail-composer
+ evolution-shell
+ evolution-util
+ gnomecanvas
+)
+
+set(SOURCES
+ calendar-config.c
+ calendar-view.c
+ comp-util.c
+ e-alarm-list.c
+ e-cal-component-preview.c
+ e-cal-config.c
+ e-cal-data-model.c
+ e-cal-data-model-subscriber.c
+ e-cal-dialogs.c
+ e-cal-event.c
+ e-cal-list-view.c
+ e-cal-model-calendar.c
+ e-cal-model.c
+ e-cal-model-memos.c
+ e-cal-model-tasks.c
+ e-cal-ops.c
+ e-calendar-view.c
+ e-cell-date-edit-text.c
+ e-comp-editor.c
+ e-comp-editor-event.c
+ e-comp-editor-memo.c
+ e-comp-editor-page-attachments.c
+ e-comp-editor-page-general.c
+ e-comp-editor-page-recurrence.c
+ e-comp-editor-page-reminders.c
+ e-comp-editor-page-schedule.c
+ e-comp-editor-page.c
+ e-comp-editor-property-part.c
+ e-comp-editor-property-parts.c
+ e-comp-editor-task.c
+ e-date-time-list.c
+ e-day-view-layout.c
+ e-day-view-main-item.c
+ e-day-view-time-item.c
+ e-day-view-top-item.c
+ e-day-view.c
+ e-meeting-attendee.c
+ e-meeting-list-view.c
+ e-meeting-store.c
+ e-meeting-time-sel.c
+ e-meeting-time-sel-item.c
+ e-meeting-utils.c
+ e-memo-table.c
+ e-month-view.c
+ e-select-names-editable.c
+ e-select-names-renderer.c
+ e-send-options-utils.c
+ e-task-table.c
+ e-week-view-event-item.c
+ e-week-view-layout.c
+ e-week-view-main-item.c
+ e-week-view-titles-item.c
+ e-week-view.c
+ e-weekday-chooser.c
+ e-timezone-entry.c
+ itip-utils.c
+ misc.c
+ print.c
+ tag-calendar.c
+ ea-calendar.c
+ ea-calendar-helpers.c
+ ea-cal-view.c
+ ea-cal-view-event.c
+ ea-day-view.c
+ ea-day-view-main-item.c
+ ea-day-view-cell.c
+ ea-week-view.c
+ ea-week-view-main-item.c
+ ea-week-view-cell.c
+ ea-jump-button.c
+)
+
+set(HEADERS
+ calendar-config.h
+ calendar-config-keys.h
+ calendar-view.h
+ comp-util.h
+ e-alarm-list.h
+ e-cal-component-preview.h
+ e-cal-config.h
+ e-cal-data-model.h
+ e-cal-data-model-subscriber.h
+ e-cal-dialogs.h
+ e-cal-event.h
+ e-cal-list-view.h
+ e-cal-model-calendar.h
+ e-cal-model.h
+ e-cal-model-memos.h
+ e-cal-model-tasks.h
+ e-cal-ops.h
+ e-calendar-view.h
+ e-cell-date-edit-text.h
+ e-comp-editor.h
+ e-comp-editor-event.h
+ e-comp-editor-memo.h
+ e-comp-editor-page-attachments.h
+ e-comp-editor-page-general.h
+ e-comp-editor-page-recurrence.h
+ e-comp-editor-page-reminders.h
+ e-comp-editor-page-schedule.h
+ e-comp-editor-page.h
+ e-comp-editor-property-part.h
+ e-comp-editor-property-parts.h
+ e-comp-editor-task.h
+ e-date-time-list.h
+ e-day-view-layout.h
+ e-day-view-main-item.h
+ e-day-view-time-item.h
+ e-day-view-top-item.h
+ e-day-view.h
+ e-meeting-attendee.h
+ e-meeting-list-view.h
+ e-meeting-store.h
+ e-meeting-time-sel.h
+ e-meeting-time-sel-item.h
+ e-meeting-types.h
+ e-meeting-utils.h
+ e-memo-table.h
+ e-month-view.h
+ e-select-names-editable.h
+ e-select-names-renderer.h
+ e-send-options-utils.h
+ e-task-table.h
+ e-week-view-event-item.h
+ e-week-view-layout.h
+ e-week-view-main-item.h
+ e-week-view-titles-item.h
+ e-week-view.h
+ e-weekday-chooser.h
+ e-timezone-entry.h
+ itip-utils.h
+ misc.h
+ print.h
+ tag-calendar.h
+ ea-calendar.h
+ ea-calendar-helpers.h
+ ea-cal-view.h
+ ea-cal-view-event.h
+ ea-day-view.h
+ ea-day-view-main-item.h
+ ea-day-view-cell.h
+ ea-week-view.h
+ ea-week-view-main-item.h
+ ea-week-view-cell.h
+ ea-jump-button.h
+)
+
+add_library(evolution-calendar SHARED
+ ${SOURCES}
+ ${HEADERS}
+)
+
+add_dependencies(evolution-calendar
+ ${DEPENDENCIES}
+)
+
+target_compile_definitions(evolution-calendar PRIVATE
+ -DG_LOG_DOMAIN=\"evolution-calendar\"
+ -DEVOLUTION_ETSPECDIR=\"${etspecdir}\"
+ -DEVOLUTION_PRIVDATADIR=\"${privdatadir}\"
+)
+
+target_compile_options(evolution-calendar PUBLIC
+ ${EVOLUTION_DATA_SERVER_CFLAGS}
+ ${GNOME_PLATFORM_CFLAGS}
+ ${LIBSOUP_CFLAGS}
+)
+
+target_include_directories(evolution-calendar PUBLIC
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}/src
+ ${CMAKE_SOURCE_DIR}
+ ${CMAKE_SOURCE_DIR}/src
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+ ${GNOME_PLATFORM_INCLUDE_DIRS}
+ ${LIBSOUP_INCLUDE_DIRS}
+)
+
+target_link_libraries(evolution-calendar
+ ${DEPENDENCIES}
+ ${EVOLUTION_DATA_SERVER_LDFLAGS}
+ ${GNOME_PLATFORM_LDFLAGS}
+ ${LIBSOUP_LDFLAGS}
+ ${MATH_LDFLAGS}
+)
+
+install(TARGETS evolution-calendar
+ DESTINATION ${privsolibdir}
+)
+
+install(FILES ${HEADERS}
+ DESTINATION ${privincludedir}/calendar/gui
+)
diff --git a/calendar/gui/calendar-config-keys.h b/src/calendar/gui/calendar-config-keys.h
similarity index 100%
rename from calendar/gui/calendar-config-keys.h
rename to src/calendar/gui/calendar-config-keys.h
diff --git a/calendar/gui/calendar-config.c b/src/calendar/gui/calendar-config.c
similarity index 100%
rename from calendar/gui/calendar-config.c
rename to src/calendar/gui/calendar-config.c
diff --git a/calendar/gui/calendar-config.h b/src/calendar/gui/calendar-config.h
similarity index 100%
rename from calendar/gui/calendar-config.h
rename to src/calendar/gui/calendar-config.h
diff --git a/calendar/gui/calendar-view.c b/src/calendar/gui/calendar-view.c
similarity index 100%
rename from calendar/gui/calendar-view.c
rename to src/calendar/gui/calendar-view.c
diff --git a/calendar/gui/calendar-view.h b/src/calendar/gui/calendar-view.h
similarity index 100%
rename from calendar/gui/calendar-view.h
rename to src/calendar/gui/calendar-view.h
diff --git a/calendar/gui/caltypes.xml.in b/src/calendar/gui/caltypes.xml.in
similarity index 100%
rename from calendar/gui/caltypes.xml.in
rename to src/calendar/gui/caltypes.xml.in
diff --git a/calendar/gui/comp-util.c b/src/calendar/gui/comp-util.c
similarity index 100%
rename from calendar/gui/comp-util.c
rename to src/calendar/gui/comp-util.c
diff --git a/calendar/gui/comp-util.h b/src/calendar/gui/comp-util.h
similarity index 100%
rename from calendar/gui/comp-util.h
rename to src/calendar/gui/comp-util.h
diff --git a/calendar/gui/e-alarm-list.c b/src/calendar/gui/e-alarm-list.c
similarity index 100%
rename from calendar/gui/e-alarm-list.c
rename to src/calendar/gui/e-alarm-list.c
diff --git a/calendar/gui/e-alarm-list.h b/src/calendar/gui/e-alarm-list.h
similarity index 100%
rename from calendar/gui/e-alarm-list.h
rename to src/calendar/gui/e-alarm-list.h
diff --git a/calendar/gui/e-cal-component-preview.c b/src/calendar/gui/e-cal-component-preview.c
similarity index 100%
rename from calendar/gui/e-cal-component-preview.c
rename to src/calendar/gui/e-cal-component-preview.c
diff --git a/calendar/gui/e-cal-component-preview.h b/src/calendar/gui/e-cal-component-preview.h
similarity index 100%
rename from calendar/gui/e-cal-component-preview.h
rename to src/calendar/gui/e-cal-component-preview.h
diff --git a/calendar/gui/e-cal-config.c b/src/calendar/gui/e-cal-config.c
similarity index 100%
rename from calendar/gui/e-cal-config.c
rename to src/calendar/gui/e-cal-config.c
diff --git a/calendar/gui/e-cal-config.h b/src/calendar/gui/e-cal-config.h
similarity index 100%
rename from calendar/gui/e-cal-config.h
rename to src/calendar/gui/e-cal-config.h
diff --git a/calendar/gui/e-cal-data-model-subscriber.c b/src/calendar/gui/e-cal-data-model-subscriber.c
similarity index 100%
rename from calendar/gui/e-cal-data-model-subscriber.c
rename to src/calendar/gui/e-cal-data-model-subscriber.c
diff --git a/calendar/gui/e-cal-data-model-subscriber.h b/src/calendar/gui/e-cal-data-model-subscriber.h
similarity index 100%
rename from calendar/gui/e-cal-data-model-subscriber.h
rename to src/calendar/gui/e-cal-data-model-subscriber.h
diff --git a/calendar/gui/e-cal-data-model.c b/src/calendar/gui/e-cal-data-model.c
similarity index 100%
rename from calendar/gui/e-cal-data-model.c
rename to src/calendar/gui/e-cal-data-model.c
diff --git a/calendar/gui/e-cal-data-model.h b/src/calendar/gui/e-cal-data-model.h
similarity index 100%
rename from calendar/gui/e-cal-data-model.h
rename to src/calendar/gui/e-cal-data-model.h
diff --git a/calendar/gui/e-cal-dialogs.c b/src/calendar/gui/e-cal-dialogs.c
similarity index 100%
rename from calendar/gui/e-cal-dialogs.c
rename to src/calendar/gui/e-cal-dialogs.c
diff --git a/calendar/gui/e-cal-dialogs.h b/src/calendar/gui/e-cal-dialogs.h
similarity index 100%
rename from calendar/gui/e-cal-dialogs.h
rename to src/calendar/gui/e-cal-dialogs.h
diff --git a/calendar/gui/e-cal-event.c b/src/calendar/gui/e-cal-event.c
similarity index 100%
rename from calendar/gui/e-cal-event.c
rename to src/calendar/gui/e-cal-event.c
diff --git a/calendar/gui/e-cal-event.h b/src/calendar/gui/e-cal-event.h
similarity index 100%
rename from calendar/gui/e-cal-event.h
rename to src/calendar/gui/e-cal-event.h
diff --git a/calendar/gui/e-cal-list-view.c b/src/calendar/gui/e-cal-list-view.c
similarity index 100%
rename from calendar/gui/e-cal-list-view.c
rename to src/calendar/gui/e-cal-list-view.c
diff --git a/calendar/gui/e-cal-list-view.etspec b/src/calendar/gui/e-cal-list-view.etspec
similarity index 100%
rename from calendar/gui/e-cal-list-view.etspec
rename to src/calendar/gui/e-cal-list-view.etspec
diff --git a/calendar/gui/e-cal-list-view.h b/src/calendar/gui/e-cal-list-view.h
similarity index 100%
rename from calendar/gui/e-cal-list-view.h
rename to src/calendar/gui/e-cal-list-view.h
diff --git a/calendar/gui/e-cal-model-calendar.c b/src/calendar/gui/e-cal-model-calendar.c
similarity index 100%
rename from calendar/gui/e-cal-model-calendar.c
rename to src/calendar/gui/e-cal-model-calendar.c
diff --git a/calendar/gui/e-cal-model-calendar.h b/src/calendar/gui/e-cal-model-calendar.h
similarity index 100%
rename from calendar/gui/e-cal-model-calendar.h
rename to src/calendar/gui/e-cal-model-calendar.h
diff --git a/calendar/gui/e-cal-model-memos.c b/src/calendar/gui/e-cal-model-memos.c
similarity index 100%
rename from calendar/gui/e-cal-model-memos.c
rename to src/calendar/gui/e-cal-model-memos.c
diff --git a/calendar/gui/e-cal-model-memos.h b/src/calendar/gui/e-cal-model-memos.h
similarity index 100%
rename from calendar/gui/e-cal-model-memos.h
rename to src/calendar/gui/e-cal-model-memos.h
diff --git a/calendar/gui/e-cal-model-tasks.c b/src/calendar/gui/e-cal-model-tasks.c
similarity index 100%
rename from calendar/gui/e-cal-model-tasks.c
rename to src/calendar/gui/e-cal-model-tasks.c
diff --git a/calendar/gui/e-cal-model-tasks.h b/src/calendar/gui/e-cal-model-tasks.h
similarity index 100%
rename from calendar/gui/e-cal-model-tasks.h
rename to src/calendar/gui/e-cal-model-tasks.h
diff --git a/calendar/gui/e-cal-model.c b/src/calendar/gui/e-cal-model.c
similarity index 100%
rename from calendar/gui/e-cal-model.c
rename to src/calendar/gui/e-cal-model.c
diff --git a/calendar/gui/e-cal-model.h b/src/calendar/gui/e-cal-model.h
similarity index 100%
rename from calendar/gui/e-cal-model.h
rename to src/calendar/gui/e-cal-model.h
diff --git a/calendar/gui/e-cal-ops.c b/src/calendar/gui/e-cal-ops.c
similarity index 100%
rename from calendar/gui/e-cal-ops.c
rename to src/calendar/gui/e-cal-ops.c
diff --git a/calendar/gui/e-cal-ops.h b/src/calendar/gui/e-cal-ops.h
similarity index 100%
rename from calendar/gui/e-cal-ops.h
rename to src/calendar/gui/e-cal-ops.h
diff --git a/calendar/gui/e-calendar-view.c b/src/calendar/gui/e-calendar-view.c
similarity index 100%
rename from calendar/gui/e-calendar-view.c
rename to src/calendar/gui/e-calendar-view.c
diff --git a/calendar/gui/e-calendar-view.h b/src/calendar/gui/e-calendar-view.h
similarity index 100%
rename from calendar/gui/e-calendar-view.h
rename to src/calendar/gui/e-calendar-view.h
diff --git a/calendar/gui/e-cell-date-edit-text.c b/src/calendar/gui/e-cell-date-edit-text.c
similarity index 100%
rename from calendar/gui/e-cell-date-edit-text.c
rename to src/calendar/gui/e-cell-date-edit-text.c
diff --git a/calendar/gui/e-cell-date-edit-text.h b/src/calendar/gui/e-cell-date-edit-text.h
similarity index 100%
rename from calendar/gui/e-cell-date-edit-text.h
rename to src/calendar/gui/e-cell-date-edit-text.h
diff --git a/calendar/gui/e-comp-editor-event.c b/src/calendar/gui/e-comp-editor-event.c
similarity index 100%
rename from calendar/gui/e-comp-editor-event.c
rename to src/calendar/gui/e-comp-editor-event.c
diff --git a/calendar/gui/e-comp-editor-event.h b/src/calendar/gui/e-comp-editor-event.h
similarity index 100%
rename from calendar/gui/e-comp-editor-event.h
rename to src/calendar/gui/e-comp-editor-event.h
diff --git a/calendar/gui/e-comp-editor-memo.c b/src/calendar/gui/e-comp-editor-memo.c
similarity index 100%
rename from calendar/gui/e-comp-editor-memo.c
rename to src/calendar/gui/e-comp-editor-memo.c
diff --git a/calendar/gui/e-comp-editor-memo.h b/src/calendar/gui/e-comp-editor-memo.h
similarity index 100%
rename from calendar/gui/e-comp-editor-memo.h
rename to src/calendar/gui/e-comp-editor-memo.h
diff --git a/calendar/gui/e-comp-editor-page-attachments.c b/src/calendar/gui/e-comp-editor-page-attachments.c
similarity index 100%
rename from calendar/gui/e-comp-editor-page-attachments.c
rename to src/calendar/gui/e-comp-editor-page-attachments.c
diff --git a/calendar/gui/e-comp-editor-page-attachments.h b/src/calendar/gui/e-comp-editor-page-attachments.h
similarity index 100%
rename from calendar/gui/e-comp-editor-page-attachments.h
rename to src/calendar/gui/e-comp-editor-page-attachments.h
diff --git a/calendar/gui/e-comp-editor-page-general.c b/src/calendar/gui/e-comp-editor-page-general.c
similarity index 100%
rename from calendar/gui/e-comp-editor-page-general.c
rename to src/calendar/gui/e-comp-editor-page-general.c
diff --git a/calendar/gui/e-comp-editor-page-general.h b/src/calendar/gui/e-comp-editor-page-general.h
similarity index 100%
rename from calendar/gui/e-comp-editor-page-general.h
rename to src/calendar/gui/e-comp-editor-page-general.h
diff --git a/calendar/gui/e-comp-editor-page-recurrence.c b/src/calendar/gui/e-comp-editor-page-recurrence.c
similarity index 100%
rename from calendar/gui/e-comp-editor-page-recurrence.c
rename to src/calendar/gui/e-comp-editor-page-recurrence.c
diff --git a/calendar/gui/e-comp-editor-page-recurrence.h b/src/calendar/gui/e-comp-editor-page-recurrence.h
similarity index 100%
rename from calendar/gui/e-comp-editor-page-recurrence.h
rename to src/calendar/gui/e-comp-editor-page-recurrence.h
diff --git a/calendar/gui/e-comp-editor-page-reminders.c b/src/calendar/gui/e-comp-editor-page-reminders.c
similarity index 100%
rename from calendar/gui/e-comp-editor-page-reminders.c
rename to src/calendar/gui/e-comp-editor-page-reminders.c
diff --git a/calendar/gui/e-comp-editor-page-reminders.h b/src/calendar/gui/e-comp-editor-page-reminders.h
similarity index 100%
rename from calendar/gui/e-comp-editor-page-reminders.h
rename to src/calendar/gui/e-comp-editor-page-reminders.h
diff --git a/calendar/gui/e-comp-editor-page-schedule.c b/src/calendar/gui/e-comp-editor-page-schedule.c
similarity index 100%
rename from calendar/gui/e-comp-editor-page-schedule.c
rename to src/calendar/gui/e-comp-editor-page-schedule.c
diff --git a/calendar/gui/e-comp-editor-page-schedule.h b/src/calendar/gui/e-comp-editor-page-schedule.h
similarity index 100%
rename from calendar/gui/e-comp-editor-page-schedule.h
rename to src/calendar/gui/e-comp-editor-page-schedule.h
diff --git a/calendar/gui/e-comp-editor-page.c b/src/calendar/gui/e-comp-editor-page.c
similarity index 100%
rename from calendar/gui/e-comp-editor-page.c
rename to src/calendar/gui/e-comp-editor-page.c
diff --git a/calendar/gui/e-comp-editor-page.h b/src/calendar/gui/e-comp-editor-page.h
similarity index 100%
rename from calendar/gui/e-comp-editor-page.h
rename to src/calendar/gui/e-comp-editor-page.h
diff --git a/calendar/gui/e-comp-editor-property-part.c b/src/calendar/gui/e-comp-editor-property-part.c
similarity index 100%
rename from calendar/gui/e-comp-editor-property-part.c
rename to src/calendar/gui/e-comp-editor-property-part.c
diff --git a/calendar/gui/e-comp-editor-property-part.h b/src/calendar/gui/e-comp-editor-property-part.h
similarity index 100%
rename from calendar/gui/e-comp-editor-property-part.h
rename to src/calendar/gui/e-comp-editor-property-part.h
diff --git a/calendar/gui/e-comp-editor-property-parts.c b/src/calendar/gui/e-comp-editor-property-parts.c
similarity index 100%
rename from calendar/gui/e-comp-editor-property-parts.c
rename to src/calendar/gui/e-comp-editor-property-parts.c
diff --git a/calendar/gui/e-comp-editor-property-parts.h b/src/calendar/gui/e-comp-editor-property-parts.h
similarity index 100%
rename from calendar/gui/e-comp-editor-property-parts.h
rename to src/calendar/gui/e-comp-editor-property-parts.h
diff --git a/calendar/gui/e-comp-editor-task.c b/src/calendar/gui/e-comp-editor-task.c
similarity index 100%
rename from calendar/gui/e-comp-editor-task.c
rename to src/calendar/gui/e-comp-editor-task.c
diff --git a/calendar/gui/e-comp-editor-task.h b/src/calendar/gui/e-comp-editor-task.h
similarity index 100%
rename from calendar/gui/e-comp-editor-task.h
rename to src/calendar/gui/e-comp-editor-task.h
diff --git a/calendar/gui/e-comp-editor.c b/src/calendar/gui/e-comp-editor.c
similarity index 100%
rename from calendar/gui/e-comp-editor.c
rename to src/calendar/gui/e-comp-editor.c
diff --git a/calendar/gui/e-comp-editor.h b/src/calendar/gui/e-comp-editor.h
similarity index 100%
rename from calendar/gui/e-comp-editor.h
rename to src/calendar/gui/e-comp-editor.h
diff --git a/calendar/gui/e-date-time-list.c b/src/calendar/gui/e-date-time-list.c
similarity index 100%
rename from calendar/gui/e-date-time-list.c
rename to src/calendar/gui/e-date-time-list.c
diff --git a/calendar/gui/e-date-time-list.h b/src/calendar/gui/e-date-time-list.h
similarity index 100%
rename from calendar/gui/e-date-time-list.h
rename to src/calendar/gui/e-date-time-list.h
diff --git a/calendar/gui/e-day-view-layout.c b/src/calendar/gui/e-day-view-layout.c
similarity index 100%
rename from calendar/gui/e-day-view-layout.c
rename to src/calendar/gui/e-day-view-layout.c
diff --git a/calendar/gui/e-day-view-layout.h b/src/calendar/gui/e-day-view-layout.h
similarity index 100%
rename from calendar/gui/e-day-view-layout.h
rename to src/calendar/gui/e-day-view-layout.h
diff --git a/calendar/gui/e-day-view-main-item.c b/src/calendar/gui/e-day-view-main-item.c
similarity index 100%
rename from calendar/gui/e-day-view-main-item.c
rename to src/calendar/gui/e-day-view-main-item.c
diff --git a/calendar/gui/e-day-view-main-item.h b/src/calendar/gui/e-day-view-main-item.h
similarity index 100%
rename from calendar/gui/e-day-view-main-item.h
rename to src/calendar/gui/e-day-view-main-item.h
diff --git a/calendar/gui/e-day-view-time-item.c b/src/calendar/gui/e-day-view-time-item.c
similarity index 100%
rename from calendar/gui/e-day-view-time-item.c
rename to src/calendar/gui/e-day-view-time-item.c
diff --git a/calendar/gui/e-day-view-time-item.h b/src/calendar/gui/e-day-view-time-item.h
similarity index 100%
rename from calendar/gui/e-day-view-time-item.h
rename to src/calendar/gui/e-day-view-time-item.h
diff --git a/calendar/gui/e-day-view-top-item.c b/src/calendar/gui/e-day-view-top-item.c
similarity index 100%
rename from calendar/gui/e-day-view-top-item.c
rename to src/calendar/gui/e-day-view-top-item.c
diff --git a/calendar/gui/e-day-view-top-item.h b/src/calendar/gui/e-day-view-top-item.h
similarity index 100%
rename from calendar/gui/e-day-view-top-item.h
rename to src/calendar/gui/e-day-view-top-item.h
diff --git a/calendar/gui/e-day-view.c b/src/calendar/gui/e-day-view.c
similarity index 100%
rename from calendar/gui/e-day-view.c
rename to src/calendar/gui/e-day-view.c
diff --git a/calendar/gui/e-day-view.h b/src/calendar/gui/e-day-view.h
similarity index 100%
rename from calendar/gui/e-day-view.h
rename to src/calendar/gui/e-day-view.h
diff --git a/calendar/gui/e-meeting-attendee.c b/src/calendar/gui/e-meeting-attendee.c
similarity index 100%
rename from calendar/gui/e-meeting-attendee.c
rename to src/calendar/gui/e-meeting-attendee.c
diff --git a/calendar/gui/e-meeting-attendee.h b/src/calendar/gui/e-meeting-attendee.h
similarity index 100%
rename from calendar/gui/e-meeting-attendee.h
rename to src/calendar/gui/e-meeting-attendee.h
diff --git a/calendar/gui/e-meeting-list-view.c b/src/calendar/gui/e-meeting-list-view.c
similarity index 100%
rename from calendar/gui/e-meeting-list-view.c
rename to src/calendar/gui/e-meeting-list-view.c
diff --git a/calendar/gui/e-meeting-list-view.h b/src/calendar/gui/e-meeting-list-view.h
similarity index 100%
rename from calendar/gui/e-meeting-list-view.h
rename to src/calendar/gui/e-meeting-list-view.h
diff --git a/calendar/gui/e-meeting-store.c b/src/calendar/gui/e-meeting-store.c
similarity index 100%
rename from calendar/gui/e-meeting-store.c
rename to src/calendar/gui/e-meeting-store.c
diff --git a/calendar/gui/e-meeting-store.h b/src/calendar/gui/e-meeting-store.h
similarity index 100%
rename from calendar/gui/e-meeting-store.h
rename to src/calendar/gui/e-meeting-store.h
diff --git a/calendar/gui/e-meeting-time-sel-item.c b/src/calendar/gui/e-meeting-time-sel-item.c
similarity index 100%
rename from calendar/gui/e-meeting-time-sel-item.c
rename to src/calendar/gui/e-meeting-time-sel-item.c
diff --git a/calendar/gui/e-meeting-time-sel-item.h b/src/calendar/gui/e-meeting-time-sel-item.h
similarity index 100%
rename from calendar/gui/e-meeting-time-sel-item.h
rename to src/calendar/gui/e-meeting-time-sel-item.h
diff --git a/calendar/gui/e-meeting-time-sel.c b/src/calendar/gui/e-meeting-time-sel.c
similarity index 100%
rename from calendar/gui/e-meeting-time-sel.c
rename to src/calendar/gui/e-meeting-time-sel.c
diff --git a/calendar/gui/e-meeting-time-sel.etspec b/src/calendar/gui/e-meeting-time-sel.etspec
similarity index 100%
rename from calendar/gui/e-meeting-time-sel.etspec
rename to src/calendar/gui/e-meeting-time-sel.etspec
diff --git a/calendar/gui/e-meeting-time-sel.h b/src/calendar/gui/e-meeting-time-sel.h
similarity index 100%
rename from calendar/gui/e-meeting-time-sel.h
rename to src/calendar/gui/e-meeting-time-sel.h
diff --git a/calendar/gui/e-meeting-types.h b/src/calendar/gui/e-meeting-types.h
similarity index 100%
rename from calendar/gui/e-meeting-types.h
rename to src/calendar/gui/e-meeting-types.h
diff --git a/calendar/gui/e-meeting-utils.c b/src/calendar/gui/e-meeting-utils.c
similarity index 100%
rename from calendar/gui/e-meeting-utils.c
rename to src/calendar/gui/e-meeting-utils.c
diff --git a/calendar/gui/e-meeting-utils.h b/src/calendar/gui/e-meeting-utils.h
similarity index 100%
rename from calendar/gui/e-meeting-utils.h
rename to src/calendar/gui/e-meeting-utils.h
diff --git a/calendar/gui/e-memo-table.c b/src/calendar/gui/e-memo-table.c
similarity index 100%
rename from calendar/gui/e-memo-table.c
rename to src/calendar/gui/e-memo-table.c
diff --git a/calendar/gui/e-memo-table.etspec b/src/calendar/gui/e-memo-table.etspec
similarity index 100%
rename from calendar/gui/e-memo-table.etspec
rename to src/calendar/gui/e-memo-table.etspec
diff --git a/calendar/gui/e-memo-table.h b/src/calendar/gui/e-memo-table.h
similarity index 100%
rename from calendar/gui/e-memo-table.h
rename to src/calendar/gui/e-memo-table.h
diff --git a/calendar/gui/e-month-view.c b/src/calendar/gui/e-month-view.c
similarity index 100%
rename from calendar/gui/e-month-view.c
rename to src/calendar/gui/e-month-view.c
diff --git a/calendar/gui/e-month-view.h b/src/calendar/gui/e-month-view.h
similarity index 100%
rename from calendar/gui/e-month-view.h
rename to src/calendar/gui/e-month-view.h
diff --git a/calendar/gui/e-select-names-editable.c b/src/calendar/gui/e-select-names-editable.c
similarity index 100%
rename from calendar/gui/e-select-names-editable.c
rename to src/calendar/gui/e-select-names-editable.c
diff --git a/calendar/gui/e-select-names-editable.h b/src/calendar/gui/e-select-names-editable.h
similarity index 100%
rename from calendar/gui/e-select-names-editable.h
rename to src/calendar/gui/e-select-names-editable.h
diff --git a/calendar/gui/e-select-names-renderer.c b/src/calendar/gui/e-select-names-renderer.c
similarity index 100%
rename from calendar/gui/e-select-names-renderer.c
rename to src/calendar/gui/e-select-names-renderer.c
diff --git a/calendar/gui/e-select-names-renderer.h b/src/calendar/gui/e-select-names-renderer.h
similarity index 100%
rename from calendar/gui/e-select-names-renderer.h
rename to src/calendar/gui/e-select-names-renderer.h
diff --git a/calendar/gui/e-send-options-utils.c b/src/calendar/gui/e-send-options-utils.c
similarity index 100%
rename from calendar/gui/e-send-options-utils.c
rename to src/calendar/gui/e-send-options-utils.c
diff --git a/calendar/gui/e-send-options-utils.h b/src/calendar/gui/e-send-options-utils.h
similarity index 100%
rename from calendar/gui/e-send-options-utils.h
rename to src/calendar/gui/e-send-options-utils.h
diff --git a/calendar/gui/e-task-table.c b/src/calendar/gui/e-task-table.c
similarity index 100%
rename from calendar/gui/e-task-table.c
rename to src/calendar/gui/e-task-table.c
diff --git a/calendar/gui/e-task-table.etspec b/src/calendar/gui/e-task-table.etspec
similarity index 100%
rename from calendar/gui/e-task-table.etspec
rename to src/calendar/gui/e-task-table.etspec
diff --git a/calendar/gui/e-task-table.h b/src/calendar/gui/e-task-table.h
similarity index 100%
rename from calendar/gui/e-task-table.h
rename to src/calendar/gui/e-task-table.h
diff --git a/calendar/gui/e-timezone-entry.c b/src/calendar/gui/e-timezone-entry.c
similarity index 100%
rename from calendar/gui/e-timezone-entry.c
rename to src/calendar/gui/e-timezone-entry.c
diff --git a/calendar/gui/e-timezone-entry.h b/src/calendar/gui/e-timezone-entry.h
similarity index 100%
rename from calendar/gui/e-timezone-entry.h
rename to src/calendar/gui/e-timezone-entry.h
diff --git a/calendar/gui/e-week-view-event-item.c b/src/calendar/gui/e-week-view-event-item.c
similarity index 100%
rename from calendar/gui/e-week-view-event-item.c
rename to src/calendar/gui/e-week-view-event-item.c
diff --git a/calendar/gui/e-week-view-event-item.h b/src/calendar/gui/e-week-view-event-item.h
similarity index 100%
rename from calendar/gui/e-week-view-event-item.h
rename to src/calendar/gui/e-week-view-event-item.h
diff --git a/calendar/gui/e-week-view-layout.c b/src/calendar/gui/e-week-view-layout.c
similarity index 100%
rename from calendar/gui/e-week-view-layout.c
rename to src/calendar/gui/e-week-view-layout.c
diff --git a/calendar/gui/e-week-view-layout.h b/src/calendar/gui/e-week-view-layout.h
similarity index 100%
rename from calendar/gui/e-week-view-layout.h
rename to src/calendar/gui/e-week-view-layout.h
diff --git a/calendar/gui/e-week-view-main-item.c b/src/calendar/gui/e-week-view-main-item.c
similarity index 100%
rename from calendar/gui/e-week-view-main-item.c
rename to src/calendar/gui/e-week-view-main-item.c
diff --git a/calendar/gui/e-week-view-main-item.h b/src/calendar/gui/e-week-view-main-item.h
similarity index 100%
rename from calendar/gui/e-week-view-main-item.h
rename to src/calendar/gui/e-week-view-main-item.h
diff --git a/calendar/gui/e-week-view-titles-item.c b/src/calendar/gui/e-week-view-titles-item.c
similarity index 100%
rename from calendar/gui/e-week-view-titles-item.c
rename to src/calendar/gui/e-week-view-titles-item.c
diff --git a/calendar/gui/e-week-view-titles-item.h b/src/calendar/gui/e-week-view-titles-item.h
similarity index 100%
rename from calendar/gui/e-week-view-titles-item.h
rename to src/calendar/gui/e-week-view-titles-item.h
diff --git a/src/calendar/gui/e-week-view.c b/src/calendar/gui/e-week-view.c
new file mode 100644
index 0000000..c97f744
--- /dev/null
+++ b/src/calendar/gui/e-week-view.c
@@ -0,0 +1,5193 @@
+/*
+ * 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.
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ * Authors:
+ * Damon Chaplin <damon ximian com>
+ * Rodrigo Moya <rodrigo ximian com>
+ *
+ * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
+ *
+ */
+
+/*
+ * EWeekView - displays the Week & Month views of the calendar.
+ */
+
+#include "evolution-config.h"
+
+#include "e-week-view.h"
+
+#include <math.h>
+#include <gdk/gdkkeysyms.h>
+#include <glib/gi18n.h>
+#include <libgnomecanvas/libgnomecanvas.h>
+
+#include "calendar-config.h"
+#include "comp-util.h"
+#include "e-cal-dialogs.h"
+#include "e-cal-model-calendar.h"
+#include "e-cal-ops.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 "print.h"
+#include "ea-week-view.h"
+
+/* Images */
+#include "data/xpm/jump.xpm"
+
+#define E_WEEK_VIEW_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_WEEK_VIEW, EWeekViewPrivate))
+
+#define E_WEEK_VIEW_SMALL_FONT_PTSIZE 7
+
+#define E_WEEK_VIEW_JUMP_BUTTON_WIDTH 16
+#define E_WEEK_VIEW_JUMP_BUTTON_HEIGHT 8
+
+#define E_WEEK_VIEW_JUMP_BUTTON_X_PAD 3
+#define E_WEEK_VIEW_JUMP_BUTTON_Y_PAD 3
+
+#define E_WEEK_VIEW_JUMP_BUTTON_NO_FOCUS -1
+
+/* The timeout before we do a layout, so we don't do a layout for each event
+ * we get from the server. */
+#define E_WEEK_VIEW_LAYOUT_TIMEOUT 100
+
+struct _EWeekViewPrivate {
+ /* The first day shown in the view. */
+ GDate first_day_shown;
+
+ /* If we are displaying multiple weeks in rows. If this is
+ * FALSE only one week is shown, with a different layout. */
+ gboolean multi_week_view;
+
+ /* How many weeks we are showing. This is only relevant if
+ * multi_week_view is TRUE. */
+ gint weeks_shown;
+
+ /* If Sat & Sun are compressed. Only applicable in month view,
+ * since they are always compressed into 1 cell in week view. */
+ gboolean compress_weekend;
+
+ /* Whether we show event end times. */
+ gboolean show_event_end_times;
+
+ /* Whether to update the base date when the time range changes. */
+ gboolean update_base_date;
+
+ /* The first day of the week we display. This will usually be
+ * week_start_day, but if the Sat & Sun are compressed and the
+ * week starts on Sunday then we have to use Saturday. */
+ GDateWeekday display_start_day;
+
+ gulong notify_week_start_day_id;
+
+ gboolean show_icons_month_view;
+};
+
+typedef struct {
+ EWeekView *week_view;
+ ECalModelComponent *comp_data;
+} AddEventData;
+
+static void e_week_view_set_colors (EWeekView *week_view);
+static void e_week_view_recalc_cell_sizes (EWeekView *week_view);
+static gboolean e_week_view_get_next_tab_event (EWeekView *week_view,
+ GtkDirectionType direction,
+ gint current_event_num,
+ gint current_span_num,
+ gint *next_event_num,
+ gint *next_span_num);
+static void e_week_view_update_query (EWeekView *week_view);
+
+static gboolean e_week_view_on_button_press (GtkWidget *widget,
+ GdkEvent *button_event,
+ EWeekView *week_view);
+static gboolean e_week_view_on_button_release (GtkWidget *widget,
+ GdkEvent *button_event,
+ EWeekView *week_view);
+static gboolean e_week_view_on_scroll (GtkWidget *widget,
+ GdkEventScroll *scroll,
+ EWeekView *week_view);
+static gboolean e_week_view_on_motion (GtkWidget *widget,
+ GdkEventMotion *event,
+ EWeekView *week_view);
+static gint e_week_view_convert_position_to_day (EWeekView *week_view,
+ gint x,
+ gint y);
+static void e_week_view_update_selection (EWeekView *week_view,
+ gint day);
+
+static void e_week_view_free_events (EWeekView *week_view);
+static void e_week_view_add_event (ECalClient *client,
+ ECalComponent *comp,
+ time_t start,
+ time_t end,
+ gboolean prepend,
+ gpointer data);
+static void e_week_view_check_layout (EWeekView *week_view);
+static void e_week_view_ensure_events_sorted (EWeekView *week_view);
+static void e_week_view_reshape_events (EWeekView *week_view);
+static void e_week_view_reshape_event_span (EWeekView *week_view,
+ gint event_num,
+ gint span_num);
+static void e_week_view_recalc_day_starts (EWeekView *week_view,
+ time_t lower);
+static void e_week_view_on_editing_started (EWeekView *week_view,
+ GnomeCanvasItem *item);
+static void e_week_view_on_editing_stopped (EWeekView *week_view,
+ GnomeCanvasItem *item);
+static gboolean e_week_view_find_event_from_uid (EWeekView *week_view,
+ ECalClient *client,
+ const gchar *uid,
+ const gchar *rid,
+ gint *event_num_return);
+typedef gboolean (* EWeekViewForeachEventCallback) (EWeekView *week_view,
+ gint event_num,
+ gpointer data);
+static void e_week_view_foreach_event_with_uid (EWeekView *week_view,
+ const gchar *uid,
+ EWeekViewForeachEventCallback callback,
+ gpointer data);
+static gboolean e_week_view_on_text_item_event (GnomeCanvasItem *item,
+ GdkEvent *event,
+ EWeekView *week_view);
+static gboolean e_week_view_event_move (ECalendarView *cal_view, ECalViewMoveDirection direction);
+static gint e_week_view_get_day_offset_of_event (EWeekView *week_view, time_t event_time);
+static void e_week_view_change_event_time (EWeekView *week_view, time_t start_dt, time_t end_dt, gboolean
is_all_day);
+static gboolean e_week_view_on_jump_button_event (GnomeCanvasItem *item,
+ GdkEvent *event,
+ EWeekView *week_view);
+static gboolean e_week_view_do_key_press (GtkWidget *widget,
+ GdkEventKey *event);
+static gint e_week_view_get_adjust_days_for_move_up (EWeekView *week_view, gint
+current_day);
+static gint e_week_view_get_adjust_days_for_move_down (EWeekView *week_view,gint current_day);
+static gint e_week_view_get_adjust_days_for_move_left (EWeekView *week_view,gint current_day);
+static gint e_week_view_get_adjust_days_for_move_right (EWeekView *week_view,gint current_day);
+
+static gboolean e_week_view_remove_event_cb (EWeekView *week_view,
+ gint event_num,
+ gpointer data);
+static gboolean e_week_view_recalc_display_start_day (EWeekView *week_view);
+
+static void e_week_view_queue_layout (EWeekView *week_view);
+static void e_week_view_cancel_layout (EWeekView *week_view);
+static gboolean e_week_view_layout_timeout_cb (gpointer data);
+
+G_DEFINE_TYPE (EWeekView, e_week_view, E_TYPE_CALENDAR_VIEW)
+
+enum {
+ PROP_0,
+ PROP_COMPRESS_WEEKEND,
+ PROP_SHOW_EVENT_END_TIMES,
+ PROP_SHOW_ICONS_MONTH_VIEW,
+ PROP_IS_EDITING
+};
+
+static gint map_left[] = {0, 1, 2, 0, 1, 2, 2};
+static gint map_right[] = {3, 4, 5, 3, 4, 5, 6};
+
+static void
+week_view_process_component (EWeekView *week_view,
+ ECalModelComponent *comp_data)
+{
+ ECalComponent *comp = NULL;
+ AddEventData add_event_data;
+ /* rid is never used in this function? */
+ const gchar *uid;
+ gchar *rid = NULL;
+
+ /* If we don't have a valid date set yet, just return. */
+ if (!g_date_valid (&week_view->priv->first_day_shown))
+ return;
+
+ comp = e_cal_component_new ();
+ if (!e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (comp_data->icalcomp))) {
+ g_object_unref (comp);
+
+ g_message (G_STRLOC ": Could not set icalcomponent on ECalComponent");
+ return;
+ }
+
+ e_cal_component_get_uid (comp, &uid);
+ if (e_cal_component_is_instance (comp))
+ rid = e_cal_component_get_recurid_as_string (comp);
+ else
+ rid = NULL;
+
+ /* Add the object */
+ add_event_data.week_view = week_view;
+ add_event_data.comp_data = comp_data;
+ e_week_view_add_event (comp_data->client, comp, comp_data->instance_start, comp_data->instance_end,
FALSE, &add_event_data);
+
+ g_object_unref (comp);
+ g_free (rid);
+}
+
+static void
+week_view_update_row (EWeekView *week_view,
+ gint row)
+{
+ ECalModelComponent *comp_data;
+ ECalModel *model;
+ gint event_num;
+ const gchar *uid;
+ gchar *rid = NULL;
+
+ model = e_calendar_view_get_model (E_CALENDAR_VIEW (week_view));
+ comp_data = e_cal_model_get_component_at (model, row);
+ g_return_if_fail (comp_data != NULL);
+
+ uid = icalcomponent_get_uid (comp_data->icalcomp);
+ if (e_cal_util_component_is_instance (comp_data->icalcomp)) {
+ icalproperty *prop;
+
+ prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_RECURRENCEID_PROPERTY);
+ if (prop)
+ rid = icaltime_as_ical_string_r (icalcomponent_get_recurrenceid
(comp_data->icalcomp));
+ }
+
+ if (e_week_view_find_event_from_uid (week_view, comp_data->client, uid, rid, &event_num))
+ e_week_view_remove_event_cb (week_view, event_num, NULL);
+
+ g_free (rid);
+
+ week_view_process_component (week_view, comp_data);
+
+ gtk_widget_queue_draw (week_view->main_canvas);
+ e_week_view_queue_layout (week_view);
+}
+
+static void
+week_view_model_cell_changed_cb (EWeekView *week_view,
+ gint col,
+ gint row)
+{
+ if (!E_CALENDAR_VIEW (week_view)->in_focus) {
+ e_week_view_free_events (week_view);
+ week_view->requires_update = TRUE;
+ return;
+ }
+
+ week_view_update_row (week_view, row);
+}
+
+static void
+week_view_model_comps_deleted_cb (EWeekView *week_view,
+ gpointer data)
+{
+ GSList *l, *list = data;
+
+ /* FIXME Stop editing? */
+ if (!E_CALENDAR_VIEW (week_view)->in_focus) {
+ e_week_view_free_events (week_view);
+ week_view->requires_update = TRUE;
+ return;
+ }
+
+ for (l = list; l != NULL; l = g_slist_next (l)) {
+ gint event_num;
+ const gchar *uid;
+ gchar *rid = NULL;
+ ECalModelComponent *comp_data = l->data;
+
+ uid = icalcomponent_get_uid (comp_data->icalcomp);
+ if (e_cal_util_component_is_instance (comp_data->icalcomp)) {
+ icalproperty *prop;
+
+ prop = icalcomponent_get_first_property (comp_data->icalcomp,
ICAL_RECURRENCEID_PROPERTY);
+ if (prop)
+ rid = icaltime_as_ical_string_r (icalcomponent_get_recurrenceid
(comp_data->icalcomp));
+ }
+
+ if (e_week_view_find_event_from_uid (week_view, comp_data->client, uid, rid, &event_num))
+ e_week_view_remove_event_cb (week_view, event_num, NULL);
+ g_free (rid);
+ }
+
+ gtk_widget_queue_draw (week_view->main_canvas);
+ e_week_view_queue_layout (week_view);
+}
+
+static void
+week_view_model_row_changed_cb (EWeekView *week_view,
+ gint row)
+{
+ if (!E_CALENDAR_VIEW (week_view)->in_focus) {
+ e_week_view_free_events (week_view);
+ week_view->requires_update = TRUE;
+ return;
+ }
+
+ week_view_update_row (week_view, row);
+}
+
+static void
+week_view_model_rows_inserted_cb (EWeekView *week_view,
+ gint row,
+ gint count)
+{
+ ECalModel *model;
+ gint i;
+
+ if (!E_CALENDAR_VIEW (week_view)->in_focus) {
+ e_week_view_free_events (week_view);
+ week_view->requires_update = TRUE;
+ return;
+ }
+
+ model = e_calendar_view_get_model (E_CALENDAR_VIEW (week_view));
+
+ for (i = 0; i < count; i++) {
+ ECalModelComponent *comp_data;
+
+ comp_data = e_cal_model_get_component_at (model, row + i);
+ if (comp_data == NULL) {
+ g_warning ("comp_data is NULL\n");
+ continue;
+ }
+ week_view_process_component (week_view, comp_data);
+ }
+
+ gtk_widget_queue_draw (week_view->main_canvas);
+ e_week_view_queue_layout (week_view);
+}
+
+static void
+e_week_view_precalc_visible_time_range (ECalendarView *cal_view,
+ time_t in_start_time,
+ time_t in_end_time,
+ time_t *out_start_time,
+ time_t *out_end_time)
+{
+ EWeekView *week_view;
+ GDate date, base_date;
+ GDateWeekday weekday;
+ GDateWeekday display_start_day;
+ guint day_offset, week_start_offset;
+ gint num_days;
+ icaltimezone *zone;
+
+ g_return_if_fail (E_IS_WEEK_VIEW (cal_view));
+ g_return_if_fail (out_start_time != NULL);
+ g_return_if_fail (out_end_time != NULL);
+
+ week_view = E_WEEK_VIEW (cal_view);
+ zone = e_calendar_view_get_timezone (cal_view);
+
+ time_to_gdate_with_zone (&date, in_start_time, e_calendar_view_get_timezone (E_CALENDAR_VIEW
(week_view)));
+
+ weekday = g_date_get_weekday (&date);
+ display_start_day = e_week_view_get_display_start_day (week_view);
+
+ /* Convert it to an offset from the start of the display. */
+ week_start_offset = e_weekday_get_days_between (display_start_day, weekday);
+
+ /* Set the day_offset to the result, so we move back to the
+ * start of the week. */
+ day_offset = week_start_offset;
+
+ /* Calculate the base date, i.e. the first day shown when the
+ * scrollbar adjustment value is 0. */
+ base_date = date;
+ g_date_subtract_days (&base_date, day_offset);
+
+ num_days = e_week_view_get_weeks_shown (week_view) * 7;
+
+ /* See if we need to update the first day shown. */
+ if (!g_date_valid (&week_view->priv->first_day_shown)
+ || g_date_compare (&week_view->priv->first_day_shown, &base_date)) {
+ GDate end_date, in_end_date;
+ gint day;
+
+ end_date = date;
+ g_date_add_days (&end_date, num_days);
+ g_date_subtract_days (&end_date, day_offset);
+
+ time_to_gdate_with_zone (&in_end_date, in_end_time, e_calendar_view_get_timezone
(E_CALENDAR_VIEW (week_view)));
+
+ while (g_date_days_between (&end_date, &in_end_date) >= 6) {
+ g_date_add_days (&end_date, 7);
+ num_days += 7;
+ }
+
+ in_start_time = time_add_day_with_zone (in_start_time, -((gint) day_offset), zone);
+ in_start_time = time_day_begin_with_zone (in_start_time, zone);
+
+ *out_start_time = in_start_time;
+ *out_end_time = in_start_time;
+
+ for (day = 1; day <= num_days; day++) {
+ *out_end_time = time_add_day_with_zone (*out_end_time, 1, zone);
+ }
+ } else {
+ *out_start_time = week_view->day_starts[0];
+ *out_end_time = week_view->day_starts[num_days];
+ }
+}
+
+static void
+week_view_time_range_changed_cb (EWeekView *week_view,
+ time_t start_time,
+ time_t end_time,
+ ECalModel *model)
+{
+ GDate date, base_date;
+ GDateWeekday weekday;
+ GDateWeekday display_start_day;
+ guint day_offset, week_start_offset;
+ gint num_days;
+ gboolean update_adjustment_value = FALSE;
+
+ g_return_if_fail (E_IS_WEEK_VIEW (week_view));
+
+ time_to_gdate_with_zone (&date, start_time, e_calendar_view_get_timezone (E_CALENDAR_VIEW
(week_view)));
+
+ weekday = g_date_get_weekday (&date);
+ display_start_day = e_week_view_get_display_start_day (week_view);
+
+ /* Convert it to an offset from the start of the display. */
+ week_start_offset = e_weekday_get_days_between (
+ display_start_day, weekday);
+
+ /* Set the day_offset to the result, so we move back to the
+ * start of the week. */
+ day_offset = week_start_offset;
+
+ /* Calculate the base date, i.e. the first day shown when the
+ * scrollbar adjustment value is 0. */
+ base_date = date;
+ g_date_subtract_days (&base_date, day_offset);
+
+ /* See if we need to update the base date. */
+ if (!g_date_valid (&week_view->base_date)
+ || e_week_view_get_update_base_date (week_view)) {
+ week_view->base_date = base_date;
+ update_adjustment_value = TRUE;
+ }
+
+ /* See if we need to update the first day shown. */
+ if (!g_date_valid (&week_view->priv->first_day_shown)
+ || g_date_compare (&week_view->priv->first_day_shown, &base_date)) {
+ week_view->priv->first_day_shown = base_date;
+ start_time = time_add_day_with_zone (
+ start_time, -((gint) day_offset),
+ e_calendar_view_get_timezone (E_CALENDAR_VIEW (week_view)));
+ start_time = time_day_begin_with_zone (
+ start_time,
+ e_calendar_view_get_timezone (E_CALENDAR_VIEW (week_view)));
+ e_week_view_recalc_day_starts (week_view, start_time);
+ }
+
+ /* Reset the adjustment value to 0 if the base address has changed.
+ * Note that we do this after updating first_day_shown so that our
+ * signal handler will not try to reload the events. */
+ if (update_adjustment_value) {
+ GtkRange *range;
+ GtkAdjustment *adjustment;
+
+ range = GTK_RANGE (week_view->vscrollbar);
+ adjustment = gtk_range_get_adjustment (range);
+ gtk_adjustment_set_value (adjustment, 0);
+ }
+
+ if (!E_CALENDAR_VIEW (week_view)->in_focus) {
+ e_week_view_free_events (week_view);
+ week_view->requires_update = TRUE;
+ return;
+ }
+
+ gtk_widget_queue_draw (week_view->main_canvas);
+
+ num_days = e_week_view_get_weeks_shown (week_view) * 7;
+
+ /* FIXME Preserve selection if possible */
+ if (week_view->selection_start_day == -1 ||
+ num_days <= week_view->selection_start_day)
+ e_calendar_view_set_selected_time_range (
+ E_CALENDAR_VIEW (week_view), start_time, start_time);
+}
+
+static void
+timezone_changed_cb (ECalModel *cal_model,
+ icaltimezone *old_zone,
+ icaltimezone *new_zone,
+ gpointer user_data)
+{
+ ECalendarView *cal_view = (ECalendarView *) user_data;
+ GDate *first_day_shown;
+ struct icaltimetype tt = icaltime_null_time ();
+ time_t lower;
+ EWeekView *week_view = (EWeekView *) cal_view;
+
+ g_return_if_fail (E_IS_WEEK_VIEW (week_view));
+
+ first_day_shown = &week_view->priv->first_day_shown;
+
+ if (!cal_view->in_focus) {
+ e_week_view_free_events (week_view);
+ week_view->requires_update = TRUE;
+ return;
+ }
+
+ /* If we don't have a valid date set yet, just return. */
+ if (!g_date_valid (first_day_shown))
+ return;
+
+ /* Recalculate the new start of the first week. We just use exactly
+ * the same time, but with the new timezone. */
+ tt.year = g_date_get_year (first_day_shown);
+ tt.month = g_date_get_month (first_day_shown);
+ tt.day = g_date_get_day (first_day_shown);
+
+ lower = icaltime_as_timet_with_zone (tt, new_zone);
+
+ e_week_view_recalc_day_starts (week_view, lower);
+ e_week_view_update_query (week_view);
+}
+
+static void
+week_view_notify_week_start_day_cb (EWeekView *week_view)
+{
+ GDate *first_day_shown;
+
+ first_day_shown = &week_view->priv->first_day_shown;
+
+ e_week_view_recalc_display_start_day (week_view);
+
+ /* Recalculate the days shown and reload if necessary. */
+ if (g_date_valid (first_day_shown))
+ e_week_view_set_first_day_shown (week_view, first_day_shown);
+
+ gtk_widget_queue_draw (week_view->titles_canvas);
+ gtk_widget_queue_draw (week_view->main_canvas);
+}
+
+static void
+month_scroll_by_week_changed_cb (GSettings *settings,
+ const gchar *key,
+ gpointer user_data)
+{
+ EWeekView *week_view = user_data;
+
+ g_return_if_fail (week_view != NULL);
+ g_return_if_fail (E_IS_WEEK_VIEW (week_view));
+
+ if (e_week_view_get_multi_week_view (week_view) &&
+ week_view->month_scroll_by_week != calendar_config_get_month_scroll_by_week ()) {
+ week_view->priv->multi_week_view = FALSE;
+ e_week_view_set_multi_week_view (week_view, TRUE);
+ }
+}
+
+/* FIXME: This is also needed in e-day-view-time-item.c. We should probably use
+ * pango's approximation function, but it needs a language tag. Find out how to
+ * get one of those properly. */
+static gint
+get_digit_width (PangoLayout *layout)
+{
+ gint digit;
+ gint max_digit_width = 1;
+
+ for (digit = '0'; digit <= '9'; digit++) {
+ gchar digit_char;
+ gint digit_width;
+
+ digit_char = digit;
+
+ pango_layout_set_text (layout, &digit_char, 1);
+ pango_layout_get_pixel_size (layout, &digit_width, NULL);
+
+ max_digit_width = MAX (max_digit_width, digit_width);
+ }
+
+ return max_digit_width;
+}
+
+static gint
+get_string_width (PangoLayout *layout,
+ const gchar *string)
+{
+ gint width;
+
+ pango_layout_set_text (layout, string, -1);
+ pango_layout_get_pixel_size (layout, &width, NULL);
+ return width;
+}
+
+typedef struct {
+ EWeekView *week_view;
+ time_t dtstart, dtend;
+ gchar *initial_text;
+ gboolean paste_clipboard;
+} NewEventInRangeData;
+
+static void
+new_event_in_rage_data_free (gpointer ptr)
+{
+ NewEventInRangeData *ned = ptr;
+
+ if (ned) {
+ g_clear_object (&ned->week_view);
+ g_free (ned->initial_text);
+ g_free (ned);
+ }
+}
+
+static void
+week_view_new_event_in_selected_range_cb (ECalModel *model,
+ ECalClient *client,
+ icalcomponent *default_component,
+ gpointer user_data)
+{
+ NewEventInRangeData *ned = user_data;
+ ECalComponent *comp = NULL;
+ gint event_num;
+ ECalComponentDateTime date;
+ struct icaltimetype itt;
+ const gchar *uid;
+ AddEventData add_event_data;
+ EWeekViewEvent *wvevent;
+ EWeekViewEventSpan *span;
+ icaltimezone *zone;
+
+ /* Check if the client is read only */
+ if (e_client_is_readonly (E_CLIENT (client)))
+ goto exit;
+
+ /* Add a new event covering the selected range. */
+ comp = e_cal_component_new_from_icalcomponent (icalcomponent_new_clone (default_component));
+ g_return_if_fail (comp != NULL);
+
+ uid = icalcomponent_get_uid (default_component);
+
+ date.value = &itt;
+ date.tzid = NULL;
+
+ zone = e_cal_model_get_timezone (model);
+
+ /* We use DATE values now, so we don't need the timezone. */
+ /*date.tzid = icaltimezone_get_tzid (e_calendar_view_get_timezone (E_CALENDAR_VIEW (week_view)));*/
+
+ *date.value = icaltime_from_timet_with_zone (ned->dtstart, TRUE, zone);
+ e_cal_component_set_dtstart (comp, &date);
+
+ *date.value = icaltime_from_timet_with_zone (ned->dtend, TRUE, zone);
+ e_cal_component_set_dtend (comp, &date);
+
+ /* Editor default in week/month view */
+ e_cal_component_set_transparency (comp, E_CAL_COMPONENT_TRANSP_TRANSPARENT);
+
+ /* We add the event locally and start editing it. We don't send it
+ * to the server until the user finishes editing it. */
+ add_event_data.week_view = ned->week_view;
+ add_event_data.comp_data = NULL;
+ e_week_view_add_event (client, comp, ned->dtstart, ned->dtend, TRUE, &add_event_data);
+ e_week_view_check_layout (ned->week_view);
+ gtk_widget_queue_draw (ned->week_view->main_canvas);
+
+ if (!e_week_view_find_event_from_uid (ned->week_view, client, uid, NULL, &event_num)) {
+ g_warning ("Couldn't find event to start editing.\n");
+ goto exit;
+ }
+
+ if (!is_array_index_in_bounds (ned->week_view->events, event_num))
+ goto exit;
+
+ wvevent = &g_array_index (ned->week_view->events, EWeekViewEvent, event_num);
+
+ if (!is_array_index_in_bounds (ned->week_view->spans, wvevent->spans_index + 0))
+ goto exit;
+
+ span = &g_array_index (ned->week_view->spans, EWeekViewEventSpan, wvevent->spans_index + 0);
+
+ /* If the event can't be fit on the screen, don't try to edit it. */
+ if (!span->text_item) {
+ e_week_view_foreach_event_with_uid (ned->week_view, uid, e_week_view_remove_event_cb, NULL);
+ goto exit;
+ }
+
+ e_week_view_start_editing_event (ned->week_view, event_num, 0, ned->initial_text);
+
+ if (ned->paste_clipboard) {
+ wvevent = &g_array_index (ned->week_view->events, EWeekViewEvent,
ned->week_view->editing_event_num);
+
+ if (!is_array_index_in_bounds (ned->week_view->spans, wvevent->spans_index +
ned->week_view->editing_span_num))
+ return;
+
+ span = &g_array_index (ned->week_view->spans, EWeekViewEventSpan, wvevent->spans_index +
ned->week_view->editing_span_num);
+
+ if (span->text_item &&
+ E_IS_TEXT (span->text_item) &&
+ E_TEXT (span->text_item)->editing) {
+ e_text_paste_clipboard (E_TEXT (span->text_item));
+ }
+ }
+
+ exit:
+ g_clear_object (&comp);
+}
+
+static void
+e_week_view_add_new_event_in_selected_range (EWeekView *week_view,
+ const gchar *initial_text,
+ gboolean paste_clipboard)
+{
+ NewEventInRangeData *ned;
+ ECalModel *model;
+ const gchar *source_uid;
+
+ ned = g_new0 (NewEventInRangeData, 1);
+ ned->week_view = g_object_ref (week_view);
+ ned->initial_text = g_strdup (initial_text);
+ ned->dtstart = week_view->day_starts[week_view->selection_start_day];
+ ned->dtend = week_view->day_starts[week_view->selection_end_day + 1];
+ ned->paste_clipboard = paste_clipboard;
+
+ model = e_calendar_view_get_model (E_CALENDAR_VIEW (week_view));
+ source_uid = e_cal_model_get_default_source_uid (model);
+
+ e_cal_ops_get_default_component (model, source_uid, TRUE,
+ week_view_new_event_in_selected_range_cb, ned, new_event_in_rage_data_free);
+}
+
+static void
+week_view_set_property (GObject *object,
+ guint property_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ switch (property_id) {
+ case PROP_COMPRESS_WEEKEND:
+ e_week_view_set_compress_weekend (
+ E_WEEK_VIEW (object),
+ g_value_get_boolean (value));
+ return;
+
+ case PROP_SHOW_EVENT_END_TIMES:
+ e_week_view_set_show_event_end_times (
+ E_WEEK_VIEW (object),
+ g_value_get_boolean (value));
+ return;
+
+ case PROP_SHOW_ICONS_MONTH_VIEW:
+ e_week_view_set_show_icons_month_view (
+ E_WEEK_VIEW (object),
+ g_value_get_boolean (value));
+ return;
+ }
+
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+}
+
+static void
+week_view_get_property (GObject *object,
+ guint property_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ switch (property_id) {
+ case PROP_COMPRESS_WEEKEND:
+ g_value_set_boolean (
+ value,
+ e_week_view_get_compress_weekend (
+ E_WEEK_VIEW (object)));
+ return;
+
+ case PROP_SHOW_EVENT_END_TIMES:
+ g_value_set_boolean (
+ value,
+ e_week_view_get_show_event_end_times (
+ E_WEEK_VIEW (object)));
+ return;
+
+ case PROP_SHOW_ICONS_MONTH_VIEW:
+ g_value_set_boolean (
+ value,
+ e_week_view_get_show_icons_month_view (
+ E_WEEK_VIEW (object)));
+ return;
+
+ case PROP_IS_EDITING:
+ g_value_set_boolean (value, e_week_view_is_editing (E_WEEK_VIEW (object)));
+ return;
+ }
+
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+}
+
+static void
+week_view_dispose (GObject *object)
+{
+ EWeekView *week_view;
+ ECalModel *model;
+
+ week_view = E_WEEK_VIEW (object);
+ model = e_calendar_view_get_model (E_CALENDAR_VIEW (object));
+
+ e_week_view_cancel_layout (week_view);
+
+ if (model) {
+ g_signal_handlers_disconnect_by_data (model, object);
+ e_signal_disconnect_notify_handler (model, &week_view->priv->notify_week_start_day_id);
+ }
+
+ if (week_view->events) {
+ e_week_view_free_events (week_view);
+ g_array_free (week_view->events, TRUE);
+ week_view->events = NULL;
+ }
+
+ if (week_view->small_font_desc) {
+ pango_font_description_free (week_view->small_font_desc);
+ week_view->small_font_desc = NULL;
+ }
+
+ if (week_view->normal_cursor) {
+ g_object_unref (week_view->normal_cursor);
+ week_view->normal_cursor = NULL;
+ }
+ if (week_view->move_cursor) {
+ g_object_unref (week_view->move_cursor);
+ week_view->move_cursor = NULL;
+ }
+ if (week_view->resize_width_cursor) {
+ g_object_unref (week_view->resize_width_cursor);
+ week_view->resize_width_cursor = NULL;
+ }
+
+ calendar_config_remove_notification (
+ month_scroll_by_week_changed_cb, week_view);
+
+ /* Chain up to parent's dispose() method. */
+ G_OBJECT_CLASS (e_week_view_parent_class)->dispose (object);
+}
+
+static void
+week_view_constructed (GObject *object)
+{
+ EWeekView *week_view;
+ ECalModel *model;
+ ECalendarView *calendar_view;
+ PangoContext *pango_context;
+
+ /* Chain up to parent's constructed() method. */
+ G_OBJECT_CLASS (e_week_view_parent_class)->constructed (object);
+
+ week_view = E_WEEK_VIEW (object);
+ calendar_view = E_CALENDAR_VIEW (object);
+ model = e_calendar_view_get_model (calendar_view);
+
+ pango_context = gtk_widget_get_pango_context (GTK_WIDGET (week_view));
+ g_warn_if_fail (pango_context != NULL);
+ week_view->small_font_desc = pango_font_description_copy (pango_context_get_font_description
(pango_context));
+ pango_font_description_set_size (
+ week_view->small_font_desc,
+ E_WEEK_VIEW_SMALL_FONT_PTSIZE * PANGO_SCALE);
+
+ e_week_view_recalc_display_start_day (E_WEEK_VIEW (object));
+
+ week_view->priv->notify_week_start_day_id = e_signal_connect_notify_swapped (
+ model, "notify::week-start-day",
+ G_CALLBACK (week_view_notify_week_start_day_cb), object);
+
+ g_signal_connect_swapped (
+ model, "comps-deleted",
+ G_CALLBACK (week_view_model_comps_deleted_cb), object);
+
+ g_signal_connect_swapped (
+ model, "model-cell-changed",
+ G_CALLBACK (week_view_model_cell_changed_cb), object);
+
+ g_signal_connect_swapped (
+ model, "model-row-changed",
+ G_CALLBACK (week_view_model_row_changed_cb), object);
+
+ g_signal_connect_swapped (
+ model, "model-rows-inserted",
+ G_CALLBACK (week_view_model_rows_inserted_cb), object);
+
+ g_signal_connect_swapped (
+ model, "time-range-changed",
+ G_CALLBACK (week_view_time_range_changed_cb), object);
+}
+
+static GdkColor
+e_week_view_get_text_color (EWeekView *week_view,
+ EWeekViewEvent *event)
+{
+ GdkColor color;
+ GdkRGBA bg_rgba;
+
+ if (is_comp_data_valid (event) &&
+ e_cal_model_get_rgba_for_component (e_calendar_view_get_model (E_CALENDAR_VIEW (week_view)),
event->comp_data, &bg_rgba)) {
+ } else {
+ gdouble cc = 65535.0;
+
+ bg_rgba.red = week_view->colors[E_WEEK_VIEW_COLOR_EVENT_BACKGROUND].red / cc;
+ bg_rgba.green = week_view->colors[E_WEEK_VIEW_COLOR_EVENT_BACKGROUND].green / cc;
+ bg_rgba.blue = week_view->colors[E_WEEK_VIEW_COLOR_EVENT_BACKGROUND].blue / cc;
+ bg_rgba.alpha = 1.0;
+
+ }
+
+ color.pixel = 0;
+
+ if ((bg_rgba.red > 0.7) || (bg_rgba.green > 0.7) || (bg_rgba.blue > 0.7)) {
+ color.red = 0.0;
+ color.green = 0.0;
+ color.blue = 0.0;
+ } else {
+ color.red = 65535.0f;
+ color.green = 65535.0f;
+ color.blue = 65535.0f;
+ }
+
+ return color;
+}
+
+static void
+week_view_update_style_settings (EWeekView *week_view)
+{
+ gint day, day_width, max_day_width, max_abbr_day_width;
+ gint month, month_width, max_month_width, max_abbr_month_width;
+ gint span_num;
+ const gchar *name;
+ PangoFontDescription *font_desc;
+ PangoContext *pango_context;
+ PangoFontMetrics *font_metrics;
+ PangoLayout *layout;
+ EWeekViewEventSpan *span;
+
+ e_week_view_set_colors (week_view);
+ e_week_view_check_layout (week_view);
+
+ if (week_view->spans) {
+ for (span_num = 0; span_num < week_view->spans->len; span_num++) {
+ span = &g_array_index (week_view->spans, EWeekViewEventSpan, span_num);
+ if (span->text_item && span->background_item) {
+ gint event_num = GPOINTER_TO_INT (g_object_get_data (G_OBJECT
(span->background_item), "event-num"));
+ EWeekViewEvent *event = NULL;
+
+ if (is_array_index_in_bounds (week_view->events, event_num))
+ event = &g_array_index (week_view->events, EWeekViewEvent, event_num);
+
+ if (event) {
+ GdkColor text_color;
+
+ text_color = e_week_view_get_text_color (week_view, event);
+
+ gnome_canvas_item_set (
+ span->text_item,
+ "fill_color_gdk", &text_color,
+ NULL);
+ }
+ }
+ }
+ }
+
+ /* Set up Pango prerequisites */
+ pango_context = gtk_widget_get_pango_context (GTK_WIDGET (week_view));
+ font_desc = pango_font_description_copy (pango_context_get_font_description (pango_context));
+ font_metrics = pango_context_get_metrics (
+ pango_context, font_desc,
+ pango_context_get_language (pango_context));
+ layout = pango_layout_new (pango_context);
+
+ /* Recalculate the height of each row based on the font size. */
+ week_view->row_height = PANGO_PIXELS (pango_font_metrics_get_ascent (font_metrics)) +
+ PANGO_PIXELS (pango_font_metrics_get_descent (font_metrics)) +
+ E_WEEK_VIEW_EVENT_BORDER_HEIGHT * 2 + E_WEEK_VIEW_EVENT_TEXT_Y_PAD * 2;
+ week_view->row_height = MAX (week_view->row_height, E_WEEK_VIEW_ICON_HEIGHT + E_WEEK_VIEW_ICON_Y_PAD
+ E_WEEK_VIEW_EVENT_BORDER_HEIGHT * 2);
+
+ /* Check that the small font is smaller than the default font.
+ * If it isn't, we won't use it. */
+ if (week_view->small_font_desc) {
+ if (PANGO_PIXELS (pango_font_metrics_get_ascent (font_metrics)) +
+ PANGO_PIXELS (pango_font_metrics_get_descent (font_metrics))
+ <= E_WEEK_VIEW_SMALL_FONT_PTSIZE)
+ week_view->use_small_font = FALSE;
+ }
+
+ /* Set the height of the top canvas. */
+ gtk_widget_set_size_request (
+ week_view->titles_canvas, -1,
+ PANGO_PIXELS (pango_font_metrics_get_ascent (font_metrics)) +
+ PANGO_PIXELS (pango_font_metrics_get_descent (font_metrics)) + 5);
+
+ /* Save the sizes of various strings in the font, so we can quickly
+ * decide which date formats to use. */
+
+ max_day_width = 0;
+ max_abbr_day_width = 0;
+ for (day = 0; day < 7; day++) {
+ name = e_get_weekday_name (day + 1, FALSE);
+ day_width = get_string_width (layout, name);
+ week_view->day_widths[day] = day_width;
+ max_day_width = MAX (max_day_width, day_width);
+
+ name = e_get_weekday_name (day + 1, TRUE);
+ day_width = get_string_width (layout, name);
+ week_view->abbr_day_widths[day] = day_width;
+ max_abbr_day_width = MAX (max_abbr_day_width, day_width);
+ }
+
+ max_month_width = 0;
+ max_abbr_month_width = 0;
+ for (month = 0; month < 12; month++) {
+ name = e_get_month_name (month + 1, FALSE);
+ month_width = get_string_width (layout, name);
+ week_view->month_widths[month] = month_width;
+ max_month_width = MAX (max_month_width, month_width);
+
+ name = e_get_month_name (month + 1, TRUE);
+ month_width = get_string_width (layout, name);
+ week_view->abbr_month_widths[month] = month_width;
+ max_abbr_month_width = MAX (max_abbr_month_width, month_width);
+ }
+
+ week_view->space_width = get_string_width (layout, " ");
+ week_view->colon_width = get_string_width (layout, ":");
+ week_view->slash_width = get_string_width (layout, "/");
+ week_view->digit_width = get_digit_width (layout);
+ if (week_view->small_font_desc) {
+ pango_layout_set_font_description (layout, week_view->small_font_desc);
+ week_view->small_digit_width = get_digit_width (layout);
+ pango_layout_set_font_description (layout, font_desc);
+ }
+ week_view->max_day_width = max_day_width;
+ week_view->max_abbr_day_width = max_abbr_day_width;
+ week_view->max_month_width = max_month_width;
+ week_view->max_abbr_month_width = max_abbr_month_width;
+
+ week_view->am_string_width = get_string_width (
+ layout,
+ week_view->am_string);
+ week_view->pm_string_width = get_string_width (
+ layout,
+ week_view->pm_string);
+
+ g_object_unref (layout);
+ pango_font_metrics_unref (font_metrics);
+ pango_font_description_free (font_desc);
+}
+
+static void
+week_view_realize (GtkWidget *widget)
+{
+ EWeekView *week_view;
+
+ if (GTK_WIDGET_CLASS (e_week_view_parent_class)->realize)
+ (*GTK_WIDGET_CLASS (e_week_view_parent_class)->realize)(widget);
+
+ week_view = E_WEEK_VIEW (widget);
+
+ week_view_update_style_settings (week_view);
+
+ /* Create the pixmaps. */
+ week_view->reminder_icon =
+ e_icon_factory_get_icon ("stock_bell", GTK_ICON_SIZE_MENU);
+ week_view->recurrence_icon =
+ e_icon_factory_get_icon ("view-refresh", GTK_ICON_SIZE_MENU);
+ week_view->timezone_icon =
+ e_icon_factory_get_icon ("stock_timezone", GTK_ICON_SIZE_MENU);
+ week_view->attach_icon =
+ e_icon_factory_get_icon ("mail-attachment", GTK_ICON_SIZE_MENU);
+ week_view->meeting_icon =
+ e_icon_factory_get_icon ("stock_people", GTK_ICON_SIZE_MENU);
+}
+
+static void
+week_view_unrealize (GtkWidget *widget)
+{
+ EWeekView *week_view;
+
+ week_view = E_WEEK_VIEW (widget);
+
+ g_object_unref (week_view->reminder_icon);
+ week_view->reminder_icon = NULL;
+ g_object_unref (week_view->recurrence_icon);
+ week_view->recurrence_icon = NULL;
+ g_object_unref (week_view->timezone_icon);
+ week_view->timezone_icon = NULL;
+ g_object_unref (week_view->attach_icon);
+ week_view->attach_icon = NULL;
+ g_object_unref (week_view->meeting_icon);
+ week_view->meeting_icon = NULL;
+
+ if (GTK_WIDGET_CLASS (e_week_view_parent_class)->unrealize)
+ (*GTK_WIDGET_CLASS (e_week_view_parent_class)->unrealize)(widget);
+}
+
+static void
+week_view_style_updated (GtkWidget *widget)
+{
+ if (GTK_WIDGET_CLASS (e_week_view_parent_class)->style_updated)
+ (*GTK_WIDGET_CLASS (e_week_view_parent_class)->style_updated) (widget);
+
+ week_view_update_style_settings (E_WEEK_VIEW (widget));
+}
+
+static void
+week_view_size_allocate (GtkWidget *widget,
+ GtkAllocation *allocation)
+{
+ EWeekView *week_view;
+ GtkAllocation canvas_allocation;
+ gdouble old_x2, old_y2, new_x2, new_y2;
+
+ week_view = E_WEEK_VIEW (widget);
+
+ (*GTK_WIDGET_CLASS (e_week_view_parent_class)->size_allocate) (widget, allocation);
+
+ e_week_view_recalc_cell_sizes (week_view);
+
+ /* Set the scroll region of the top canvas to its allocated size. */
+ gnome_canvas_get_scroll_region (
+ GNOME_CANVAS (week_view->titles_canvas),
+ NULL, NULL, &old_x2, &old_y2);
+ gtk_widget_get_allocation (
+ week_view->titles_canvas, &canvas_allocation);
+ new_x2 = canvas_allocation.width - 1;
+ new_y2 = canvas_allocation.height - 1;
+ if (old_x2 != new_x2 || old_y2 != new_y2)
+ gnome_canvas_set_scroll_region (
+ GNOME_CANVAS (week_view->titles_canvas),
+ 0, 0, new_x2, new_y2);
+
+ /* Set the scroll region of the main canvas to its allocated width,
+ * but with the height depending on the number of rows needed. */
+ gnome_canvas_get_scroll_region (
+ GNOME_CANVAS (week_view->main_canvas),
+ NULL, NULL, &old_x2, &old_y2);
+ gtk_widget_get_allocation (
+ week_view->main_canvas, &canvas_allocation);
+ new_x2 = canvas_allocation.width - 1;
+ new_y2 = canvas_allocation.height - 1;
+ if (old_x2 != new_x2 || old_y2 != new_y2)
+ gnome_canvas_set_scroll_region (
+ GNOME_CANVAS (week_view->main_canvas),
+ 0, 0, new_x2, new_y2);
+
+ /* Flag that we need to reshape the events. */
+ if (old_x2 != new_x2 || old_y2 != new_y2) {
+ week_view->events_need_reshape = TRUE;
+ e_week_view_check_layout (week_view);
+ }
+}
+
+static gint
+week_view_focus_in (GtkWidget *widget,
+ GdkEventFocus *event)
+{
+ EWeekView *week_view;
+
+ g_return_val_if_fail (widget != NULL, FALSE);
+ g_return_val_if_fail (E_IS_WEEK_VIEW (widget), FALSE);
+ g_return_val_if_fail (event != NULL, FALSE);
+
+ week_view = E_WEEK_VIEW (widget);
+
+ /* XXX Can't access flags directly anymore, but is it really needed?
+ * If so, could we call gtk_widget_send_focus_change() instead? */
+#if 0
+ GTK_WIDGET_SET_FLAGS (widget, GTK_HAS_FOCUS);
+#endif
+
+ if (E_CALENDAR_VIEW (week_view)->in_focus && week_view->requires_update) {
+ time_t my_start = 0, my_end = 0, model_start = 0, model_end = 0;
+
+ week_view->requires_update = FALSE;
+
+ e_cal_model_get_time_range (e_calendar_view_get_model (E_CALENDAR_VIEW (week_view)),
&model_start, &model_end);
+
+ if (e_calendar_view_get_visible_time_range (E_CALENDAR_VIEW (week_view), &my_start, &my_end)
&&
+ model_start == my_start && model_end == my_end) {
+ /* update only when the same time range is set in a view and in a model;
+ * otherwise time range change invokes also query update */
+ e_week_view_update_query (week_view);
+ }
+ }
+
+ gtk_widget_queue_draw (week_view->main_canvas);
+
+ return FALSE;
+}
+
+static gint
+week_view_focus_out (GtkWidget *widget,
+ GdkEventFocus *event)
+{
+ EWeekView *week_view;
+
+ g_return_val_if_fail (widget != NULL, FALSE);
+ g_return_val_if_fail (E_IS_WEEK_VIEW (widget), FALSE);
+ g_return_val_if_fail (event != NULL, FALSE);
+
+ week_view = E_WEEK_VIEW (widget);
+
+ /* XXX Can't access flags directly anymore, but is it really needed?
+ * If so, could we call gtk_widget_send_focus_change() instead? */
+#if 0
+ GTK_WIDGET_UNSET_FLAGS (widget, GTK_HAS_FOCUS);
+#endif
+
+ gtk_widget_queue_draw (week_view->main_canvas);
+
+ return FALSE;
+}
+
+static gboolean
+week_view_key_press (GtkWidget *widget,
+ GdkEventKey *event)
+{
+ gboolean handled = FALSE;
+ handled = e_week_view_do_key_press (widget, event);
+
+ /* if not handled, try key bindings */
+ if (!handled)
+ handled = GTK_WIDGET_CLASS (e_week_view_parent_class)->key_press_event (widget, event);
+ return handled;
+}
+
+static gboolean
+week_view_focus (GtkWidget *widget,
+ GtkDirectionType direction)
+{
+ EWeekView *week_view;
+ gint new_event_num;
+ gint new_span_num;
+ gint event_loop;
+ gboolean editable = FALSE;
+ static gint last_focus_event_num = -1, last_focus_span_num = -1;
+
+ g_return_val_if_fail (widget != NULL, FALSE);
+ g_return_val_if_fail (E_IS_WEEK_VIEW (widget), FALSE);
+
+ week_view = E_WEEK_VIEW (widget);
+
+ e_week_view_check_layout (week_view);
+
+ if (week_view->focused_jump_button == E_WEEK_VIEW_JUMP_BUTTON_NO_FOCUS) {
+ last_focus_event_num = week_view->editing_event_num;
+ last_focus_span_num = week_view->editing_span_num;
+ }
+
+ /* if there is not event, just grab week_view */
+ if (week_view->events->len == 0) {
+ gtk_widget_grab_focus (widget);
+ return TRUE;
+ }
+
+ for (event_loop = 0; event_loop < week_view->events->len;
+ ++event_loop) {
+ if (!e_week_view_get_next_tab_event (week_view, direction,
+ last_focus_event_num,
+ last_focus_span_num,
+ &new_event_num,
+ &new_span_num))
+ return FALSE;
+
+ if (new_event_num == -1) {
+ /* focus should go to week_view widget
+ */
+ gtk_widget_grab_focus (widget);
+ return TRUE;
+ }
+
+ editable = e_week_view_start_editing_event (
+ week_view,
+ new_event_num,
+ new_span_num,
+ NULL);
+ last_focus_event_num = new_event_num;
+ last_focus_span_num = new_span_num;
+
+ if (editable)
+ break;
+ else {
+ /* check if we should go to the jump button */
+
+ EWeekViewEvent *event;
+ EWeekViewEventSpan *span;
+ gint current_day;
+
+ if (!is_array_index_in_bounds (week_view->events, new_event_num))
+ break;
+
+ event = &g_array_index (week_view->events,
+ EWeekViewEvent,
+ new_event_num);
+
+ if (!is_array_index_in_bounds (week_view->spans, event->spans_index + new_span_num))
+ break;
+
+ span = &g_array_index (week_view->spans,
+ EWeekViewEventSpan,
+ event->spans_index + new_span_num);
+ current_day = span->start_day;
+
+ if ((week_view->focused_jump_button != current_day) &&
+ e_week_view_is_jump_button_visible (week_view, current_day)) {
+
+ /* focus go to the jump button */
+ e_week_view_stop_editing_event (week_view);
+ gnome_canvas_item_grab_focus (week_view->jump_buttons[current_day]);
+ return TRUE;
+ }
+ }
+ }
+ return editable;
+}
+
+static gboolean
+week_view_popup_menu (GtkWidget *widget)
+{
+ EWeekView *week_view = E_WEEK_VIEW (widget);
+
+ e_week_view_show_popup_menu (
+ week_view, NULL,
+ week_view->editing_event_num);
+
+ return TRUE;
+}
+
+static GList *
+week_view_get_selected_events (ECalendarView *cal_view)
+{
+ EWeekViewEvent *event = NULL;
+ GList *list = NULL;
+ EWeekView *week_view = (EWeekView *) cal_view;
+
+ g_return_val_if_fail (E_IS_WEEK_VIEW (week_view), NULL);
+
+ if (week_view->editing_event_num != -1) {
+ if (!is_array_index_in_bounds (week_view->events, week_view->editing_event_num)) {
+ week_view->editing_event_num = -1;
+ g_object_notify (G_OBJECT (week_view), "is-editing");
+ return NULL;
+ }
+
+ event = &g_array_index (week_view->events, EWeekViewEvent,
+ week_view->editing_event_num);
+ } else if (week_view->popup_event_num != -1) {
+ if (!is_array_index_in_bounds (week_view->events, week_view->popup_event_num))
+ return NULL;
+
+ event = &g_array_index (week_view->events, EWeekViewEvent,
+ week_view->popup_event_num);
+ }
+
+ if (event)
+ list = g_list_prepend (list, event);
+
+ return list;
+}
+
+static gboolean
+week_view_get_selected_time_range (ECalendarView *cal_view,
+ time_t *start_time,
+ time_t *end_time)
+{
+ gint start_day, end_day;
+ EWeekView *week_view = E_WEEK_VIEW (cal_view);
+
+ start_day = week_view->selection_start_day;
+ end_day = week_view->selection_end_day;
+
+ if (start_day == -1) {
+ start_day = 0;
+ end_day = 0;
+ }
+
+ if (start_time)
+ *start_time = week_view->day_starts[start_day];
+
+ if (end_time)
+ *end_time = week_view->day_starts[end_day + 1];
+
+ return TRUE;
+}
+
+/* This sets the selected time range. The EWeekView will show the corresponding
+ * month and the days between start_time and end_time will be selected.
+ * To select a single day, use the same value for start_time & end_time. */
+static void
+week_view_set_selected_time_range (ECalendarView *cal_view,
+ time_t start_time,
+ time_t end_time)
+{
+ GDate date, end_date;
+ gint num_days;
+ EWeekView *week_view = E_WEEK_VIEW (cal_view);
+
+ g_return_if_fail (E_IS_WEEK_VIEW (week_view));
+
+ if (!g_date_valid (&week_view->base_date)) {
+ /* This view has not been initialized/shown yet, thus skip this. */
+ return;
+ }
+
+ time_to_gdate_with_zone (&date, start_time, e_calendar_view_get_timezone (E_CALENDAR_VIEW
(week_view)));
+
+ /* Set the selection to the given days. */
+ week_view->selection_start_day = g_date_get_julian (&date)
+ - g_date_get_julian (&week_view->base_date);
+ if (end_time == start_time
+ || end_time <= time_add_day_with_zone (start_time, 1,
+ e_calendar_view_get_timezone (E_CALENDAR_VIEW
(week_view))))
+ week_view->selection_end_day = week_view->selection_start_day;
+ else {
+ time_to_gdate_with_zone (&end_date, end_time - 60, e_calendar_view_get_timezone
(E_CALENDAR_VIEW (week_view)));
+ week_view->selection_end_day = g_date_get_julian (&end_date)
+ - g_date_get_julian (&week_view->base_date);
+ }
+
+ /* Make sure the selection is valid. */
+ num_days = (e_week_view_get_weeks_shown (week_view) * 7) - 1;
+ week_view->selection_start_day = CLAMP (
+ week_view->selection_start_day, 0, num_days);
+ week_view->selection_end_day = CLAMP (
+ week_view->selection_end_day,
+ week_view->selection_start_day,
+ num_days);
+
+ gtk_widget_queue_draw (week_view->main_canvas);
+}
+
+static gboolean
+week_view_get_visible_time_range (ECalendarView *cal_view,
+ time_t *start_time,
+ time_t *end_time)
+{
+ gint num_days;
+ EWeekView *week_view = E_WEEK_VIEW (cal_view);
+
+ /* If we don't have a valid date set yet, return FALSE. */
+ if (!g_date_valid (&week_view->priv->first_day_shown))
+ return FALSE;
+
+ num_days = e_week_view_get_weeks_shown (week_view) * 7;
+
+ *start_time = week_view->day_starts[0];
+ *end_time = week_view->day_starts[num_days];
+
+ return TRUE;
+}
+
+static void
+week_view_paste_text (ECalendarView *cal_view)
+{
+ EWeekViewEvent *event;
+ EWeekViewEventSpan *span;
+ EWeekView *week_view;
+
+ g_return_if_fail (E_IS_WEEK_VIEW (cal_view));
+
+ week_view = E_WEEK_VIEW (cal_view);
+
+ if (week_view->editing_event_num == -1) {
+ e_week_view_add_new_event_in_selected_range (week_view, NULL, TRUE);
+ return;
+ }
+
+ if (!is_array_index_in_bounds (week_view->events, week_view->editing_event_num))
+ return;
+
+ event = &g_array_index (week_view->events, EWeekViewEvent,
+ week_view->editing_event_num);
+
+ if (!is_array_index_in_bounds (week_view->spans, event->spans_index + week_view->editing_span_num))
+ return;
+
+ span = &g_array_index (week_view->spans, EWeekViewEventSpan,
+ event->spans_index + week_view->editing_span_num);
+
+ if (span->text_item &&
+ E_IS_TEXT (span->text_item) &&
+ E_TEXT (span->text_item)->editing) {
+ e_text_paste_clipboard (E_TEXT (span->text_item));
+ }
+}
+
+static void
+week_view_cursor_key_up (EWeekView *week_view)
+{
+ if (week_view->selection_start_day == -1)
+ return;
+
+ week_view->selection_start_day--;
+
+ if (week_view->selection_start_day < 0) {
+ e_week_view_scroll_a_step (week_view, E_CAL_VIEW_MOVE_UP);
+ week_view->selection_start_day = 6;
+ }
+
+ week_view->selection_end_day = week_view->selection_start_day;
+ g_signal_emit_by_name (week_view, "selected_time_changed");
+ gtk_widget_queue_draw (week_view->main_canvas);
+}
+
+static void
+week_view_cursor_key_down (EWeekView *week_view)
+{
+ if (week_view->selection_start_day == -1)
+ return;
+
+ week_view->selection_start_day++;
+
+ if (week_view->selection_start_day > 6) {
+ e_week_view_scroll_a_step (week_view, E_CAL_VIEW_MOVE_DOWN);
+ week_view->selection_start_day = 0;
+ }
+
+ week_view->selection_end_day = week_view->selection_start_day;
+ g_signal_emit_by_name (week_view, "selected_time_changed");
+ gtk_widget_queue_draw (week_view->main_canvas);
+}
+
+static void
+week_view_cursor_key_left (EWeekView *week_view)
+{
+ if (week_view->selection_start_day == -1)
+ return;
+
+ week_view->selection_start_day = map_left[week_view->selection_start_day];
+ week_view->selection_end_day = week_view->selection_start_day;
+ g_signal_emit_by_name (week_view, "selected_time_changed");
+ gtk_widget_queue_draw (week_view->main_canvas);
+}
+
+static void
+week_view_cursor_key_right (EWeekView *week_view)
+{
+ if (week_view->selection_start_day == -1)
+ return;
+
+ week_view->selection_start_day = map_right[week_view->selection_start_day];
+ week_view->selection_end_day = week_view->selection_start_day;
+ g_signal_emit_by_name (week_view, "selected_time_changed");
+ gtk_widget_queue_draw (week_view->main_canvas);
+}
+
+static void
+e_week_view_class_init (EWeekViewClass *class)
+{
+ GObjectClass *object_class;
+ GtkWidgetClass *widget_class;
+ ECalendarViewClass *view_class;
+
+ g_type_class_add_private (class, sizeof (EWeekViewPrivate));
+
+ object_class = G_OBJECT_CLASS (class);
+ object_class->set_property = week_view_set_property;
+ object_class->get_property = week_view_get_property;
+ object_class->dispose = week_view_dispose;
+ object_class->constructed = week_view_constructed;
+
+ widget_class = GTK_WIDGET_CLASS (class);
+ widget_class->realize = week_view_realize;
+ widget_class->unrealize = week_view_unrealize;
+ widget_class->style_updated = week_view_style_updated;
+ widget_class->size_allocate = week_view_size_allocate;
+ widget_class->focus_in_event = week_view_focus_in;
+ widget_class->focus_out_event = week_view_focus_out;
+ widget_class->key_press_event = week_view_key_press;
+ widget_class->focus = week_view_focus;
+ widget_class->popup_menu = week_view_popup_menu;
+
+ view_class = E_CALENDAR_VIEW_CLASS (class);
+ view_class->get_selected_events = week_view_get_selected_events;
+ view_class->get_selected_time_range = week_view_get_selected_time_range;
+ view_class->set_selected_time_range = week_view_set_selected_time_range;
+ view_class->get_visible_time_range = week_view_get_visible_time_range;
+ view_class->precalc_visible_time_range = e_week_view_precalc_visible_time_range;
+ view_class->paste_text = week_view_paste_text;
+
+ class->cursor_key_up = week_view_cursor_key_up;
+ class->cursor_key_down = week_view_cursor_key_down;
+ class->cursor_key_left = week_view_cursor_key_left;
+ class->cursor_key_right = week_view_cursor_key_right;
+
+ /* XXX This property really belongs in EMonthView,
+ * but too much drawing code is tied to it. */
+ g_object_class_install_property (
+ object_class,
+ PROP_COMPRESS_WEEKEND,
+ g_param_spec_boolean (
+ "compress-weekend",
+ "Compress Weekend",
+ NULL,
+ TRUE,
+ G_PARAM_READWRITE |
+ G_PARAM_STATIC_STRINGS));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_SHOW_EVENT_END_TIMES,
+ g_param_spec_boolean (
+ "show-event-end-times",
+ "Show Event End Times",
+ NULL,
+ TRUE,
+ G_PARAM_READWRITE |
+ G_PARAM_STATIC_STRINGS));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_SHOW_ICONS_MONTH_VIEW,
+ g_param_spec_boolean (
+ "show-icons-month-view",
+ "Show Icons Month View",
+ NULL,
+ FALSE,
+ G_PARAM_READWRITE |
+ G_PARAM_STATIC_STRINGS));
+
+ g_object_class_override_property (
+ object_class,
+ PROP_IS_EDITING,
+ "is-editing");
+
+ /* init the accessibility support for e_week_view */
+ gtk_widget_class_set_accessible_type (widget_class, EA_TYPE_WEEK_VIEW);
+}
+
+static void
+e_week_view_init (EWeekView *week_view)
+{
+ GnomeCanvasGroup *canvas_group;
+ GtkAdjustment *adjustment;
+ GdkPixbuf *pixbuf;
+ gint i;
+
+ week_view->priv = E_WEEK_VIEW_GET_PRIVATE (week_view);
+ week_view->priv->weeks_shown = 6;
+ week_view->priv->compress_weekend = TRUE;
+ week_view->priv->show_event_end_times = TRUE;
+ week_view->priv->update_base_date = TRUE;
+ week_view->priv->display_start_day = G_DATE_MONDAY;
+
+ gtk_widget_set_can_focus (GTK_WIDGET (week_view), TRUE);
+
+ week_view->event_destroyed = FALSE;
+ week_view->events = g_array_new (
+ FALSE, FALSE,
+ sizeof (EWeekViewEvent));
+ week_view->events_sorted = TRUE;
+ week_view->events_need_layout = FALSE;
+ week_view->events_need_reshape = FALSE;
+
+ week_view->layout_timeout_id = 0;
+
+ week_view->spans = NULL;
+
+ week_view->month_scroll_by_week = FALSE;
+ week_view->scroll_by_week_notif_id = 0;
+ week_view->rows = 6;
+ week_view->columns = 2;
+
+ g_date_clear (&week_view->base_date, 1);
+ g_date_clear (&week_view->priv->first_day_shown, 1);
+
+ week_view->row_height = 10;
+ week_view->rows_per_cell = 1;
+
+ week_view->selection_start_day = -1;
+ week_view->selection_drag_pos = E_WEEK_VIEW_DRAG_NONE;
+
+ week_view->pressed_event_num = -1;
+ week_view->editing_event_num = -1;
+
+ week_view->last_edited_comp_string = NULL;
+
+ /* Create the small font in constructed. */
+ week_view->use_small_font = TRUE;
+ week_view->small_font_desc = NULL;
+
+ /* String to use in 12-hour time format for times in the morning. */
+ week_view->am_string = _("am");
+
+ /* String to use in 12-hour time format for times in the afternoon. */
+ week_view->pm_string = _("pm");
+
+ week_view->bc_event_time = 0;
+ week_view->before_click_dtstart = 0;
+ week_view->before_click_dtend = 0;
+
+ gtk_widget_set_margin_top (GTK_WIDGET (week_view), 1);
+
+ /*
+ * Titles Canvas. Note that we don't show it is only shown in the
+ * Month view.
+ */
+ week_view->titles_canvas = e_canvas_new ();
+ gtk_grid_attach (GTK_GRID (week_view), week_view->titles_canvas, 1, 0, 1, 1);
+ g_object_set (G_OBJECT (week_view->titles_canvas),
+ "hexpand", TRUE,
+ "vexpand", FALSE,
+ "halign", GTK_ALIGN_FILL,
+ "valign", GTK_ALIGN_FILL,
+ NULL);
+
+ canvas_group = GNOME_CANVAS_GROUP (GNOME_CANVAS (week_view->titles_canvas)->root);
+
+ week_view->titles_canvas_item =
+ gnome_canvas_item_new (
+ canvas_group,
+ e_week_view_titles_item_get_type (),
+ "EWeekViewTitlesItem::week_view", week_view,
+ NULL);
+
+ /*
+ * Main Canvas
+ */
+ week_view->main_canvas = e_canvas_new ();
+ gtk_grid_attach (GTK_GRID (week_view), week_view->main_canvas, 1, 1, 1, 1);
+ g_object_set (G_OBJECT (week_view->main_canvas),
+ "hexpand", TRUE,
+ "vexpand", TRUE,
+ "halign", GTK_ALIGN_FILL,
+ "valign", GTK_ALIGN_FILL,
+ NULL);
+ gtk_widget_show (week_view->main_canvas);
+
+ canvas_group = GNOME_CANVAS_GROUP (GNOME_CANVAS (week_view->main_canvas)->root);
+
+ week_view->main_canvas_item =
+ gnome_canvas_item_new (
+ canvas_group,
+ e_week_view_main_item_get_type (),
+ "EWeekViewMainItem::week_view", week_view,
+ NULL);
+
+ g_signal_connect_after (
+ week_view->main_canvas, "button_press_event",
+ G_CALLBACK (e_week_view_on_button_press), week_view);
+ g_signal_connect (
+ week_view->main_canvas, "button_release_event",
+ G_CALLBACK (e_week_view_on_button_release), week_view);
+ g_signal_connect (
+ week_view->main_canvas, "scroll_event",
+ G_CALLBACK (e_week_view_on_scroll), week_view);
+ g_signal_connect (
+ week_view->main_canvas, "motion_notify_event",
+ G_CALLBACK (e_week_view_on_motion), week_view);
+
+ /* Create the buttons to jump to each days. */
+ pixbuf = gdk_pixbuf_new_from_xpm_data ((const gchar **) jump_xpm);
+
+ for (i = 0; i < E_WEEK_VIEW_MAX_WEEKS * 7; i++) {
+ week_view->jump_buttons[i] = gnome_canvas_item_new
+ (canvas_group,
+ gnome_canvas_pixbuf_get_type (),
+ "GnomeCanvasPixbuf::pixbuf", pixbuf,
+ NULL);
+
+ g_signal_connect (
+ week_view->jump_buttons[i], "event",
+ G_CALLBACK (e_week_view_on_jump_button_event), week_view);
+ }
+ week_view->focused_jump_button = E_WEEK_VIEW_JUMP_BUTTON_NO_FOCUS;
+
+ g_object_unref (pixbuf);
+
+ /*
+ * Scrollbar.
+ */
+ adjustment = GTK_ADJUSTMENT (gtk_adjustment_new (0, -52, 52, 1, 1, 1));
+
+ week_view->vscrollbar = gtk_scrollbar_new (
+ GTK_ORIENTATION_VERTICAL, adjustment);
+ gtk_grid_attach (GTK_GRID (week_view), week_view->vscrollbar, 2, 1, 1, 1);
+ g_object_set (G_OBJECT (week_view->vscrollbar),
+ "hexpand", FALSE,
+ "vexpand", TRUE,
+ "halign", GTK_ALIGN_START,
+ "valign", GTK_ALIGN_FILL,
+ NULL);
+ gtk_widget_show (week_view->vscrollbar);
+
+ /* Create the cursors. */
+ week_view->normal_cursor = gdk_cursor_new (GDK_LEFT_PTR);
+ week_view->move_cursor = gdk_cursor_new (GDK_FLEUR);
+ week_view->resize_width_cursor = gdk_cursor_new (GDK_SB_H_DOUBLE_ARROW);
+ week_view->last_cursor_set = NULL;
+
+ week_view->requires_update = FALSE;
+}
+
+/**
+ * e_week_view_new:
+ * @Returns: a new #EWeekView.
+ *
+ * Creates a new #EWeekView.
+ **/
+ECalendarView *
+e_week_view_new (ECalModel *model)
+{
+ ECalendarView *view;
+ g_return_val_if_fail (E_IS_CAL_MODEL (model), NULL);
+
+ view = g_object_new (E_TYPE_WEEK_VIEW, "model", model, NULL);
+
+ g_signal_connect (
+ model, "timezone_changed",
+ G_CALLBACK (timezone_changed_cb), view);
+
+ return view;
+}
+
+static GdkColor
+color_inc (GdkColor c,
+ gint amount)
+{
+ #define dec(x) \
+ if (x + amount >= 0 \
+ && x + amount <= 0xFFFF) \
+ x += amount; \
+ else if (amount <= 0) \
+ x = 0; \
+ else \
+ x = 0xFFFF;
+
+ dec (c.red);
+ dec (c.green);
+ dec (c.blue);
+
+ #undef dec
+
+ return c;
+}
+
+static void
+e_week_view_set_colors (EWeekView *week_view)
+{
+ GtkWidget *widget = GTK_WIDGET (week_view);
+ GdkRGBA base_bg, bg_bg, text_fg, selected_bg, selected_fg, unfocused_selected_bg, dark_bg, light_bg;
+
+ e_utils_get_theme_color (widget, "theme_base_color", E_UTILS_DEFAULT_THEME_BASE_COLOR, &base_bg);
+ e_utils_get_theme_color (widget, "theme_bg_color", E_UTILS_DEFAULT_THEME_BG_COLOR, &bg_bg);
+ e_utils_get_theme_color (widget, "theme_text_color,theme_fg_color", E_UTILS_DEFAULT_THEME_TEXT_COLOR,
&text_fg);
+ e_utils_get_theme_color (widget, "theme_selected_bg_color", E_UTILS_DEFAULT_THEME_SELECTED_BG_COLOR,
&selected_bg);
+ e_utils_get_theme_color (widget, "theme_selected_fg_color", E_UTILS_DEFAULT_THEME_SELECTED_FG_COLOR,
&selected_fg);
+ e_utils_get_theme_color (widget, "theme_unfocused_selected_bg_color,theme_selected_bg_color",
E_UTILS_DEFAULT_THEME_UNFOCUSED_SELECTED_BG_COLOR, &unfocused_selected_bg);
+
+ e_utils_shade_color (&bg_bg, &dark_bg, E_UTILS_DARKNESS_MULT);
+ e_utils_shade_color (&bg_bg, &light_bg, E_UTILS_LIGHTNESS_MULT);
+
+ e_rgba_to_color (&bg_bg, &week_view->colors[E_WEEK_VIEW_COLOR_EVEN_MONTHS]);
+ e_rgba_to_color (&base_bg, &week_view->colors[E_WEEK_VIEW_COLOR_ODD_MONTHS]);
+ e_rgba_to_color (&base_bg, &week_view->colors[E_WEEK_VIEW_COLOR_EVENT_BACKGROUND]);
+ e_rgba_to_color (&dark_bg, &week_view->colors[E_WEEK_VIEW_COLOR_EVENT_BORDER]);
+ e_rgba_to_color (&text_fg, &week_view->colors[E_WEEK_VIEW_COLOR_EVENT_TEXT]);
+ e_rgba_to_color (&dark_bg, &week_view->colors[E_WEEK_VIEW_COLOR_GRID]);
+ e_rgba_to_color (&selected_bg, &week_view->colors[E_WEEK_VIEW_COLOR_SELECTED]);
+ e_rgba_to_color (&unfocused_selected_bg, &week_view->colors[E_WEEK_VIEW_COLOR_SELECTED_UNFOCUSSED]);
+ e_rgba_to_color (&text_fg, &week_view->colors[E_WEEK_VIEW_COLOR_DATES]);
+ e_rgba_to_color (&selected_fg, &week_view->colors[E_WEEK_VIEW_COLOR_DATES_SELECTED]);
+ e_rgba_to_color (&selected_bg, &week_view->colors[E_WEEK_VIEW_COLOR_TODAY]);
+
+ week_view->colors[E_WEEK_VIEW_COLOR_TODAY_BACKGROUND] = get_today_background
(week_view->colors[E_WEEK_VIEW_COLOR_EVENT_BACKGROUND]);
+ week_view->colors[E_WEEK_VIEW_COLOR_MONTH_NONWORKING_DAY] = color_inc
(week_view->colors[E_WEEK_VIEW_COLOR_EVEN_MONTHS], -0x0A0A);
+}
+
+static void
+e_week_view_recalc_cell_sizes (EWeekView *week_view)
+{
+ gfloat canvas_width, canvas_height, offset;
+ gint row, col;
+ GtkAllocation allocation;
+ GtkWidget *widget;
+ gint width, height, time_width;
+ PangoContext *pango_context;
+ PangoFontMetrics *font_metrics;
+
+ if (e_week_view_get_multi_week_view (week_view)) {
+ week_view->rows =
+ e_week_view_get_weeks_shown (week_view) * 2;
+ week_view->columns =
+ e_week_view_get_compress_weekend (week_view) ? 6 : 7;
+ } else {
+ week_view->rows = 6;
+ week_view->columns = 2;
+ }
+
+ gtk_widget_get_allocation (week_view->main_canvas, &allocation);
+
+ /* Calculate the column sizes, using floating point so that pixels
+ * get divided evenly. Note that we use one more element than the
+ * number of columns, to make it easy to get the column widths.
+ * We also add one to the width so that the right border of the last
+ * column is off the edge of the displayed area. */
+ canvas_width = allocation.width + 1;
+ canvas_width /= week_view->columns;
+ offset = 0;
+ for (col = 0; col <= week_view->columns; col++) {
+ week_view->col_offsets[col] = floor (offset + 0.5);
+ offset += canvas_width;
+ }
+
+ /* Calculate the cell widths based on the offsets. */
+ for (col = 0; col < week_view->columns; col++) {
+ week_view->col_widths[col] = week_view->col_offsets[col + 1]
+ - week_view->col_offsets[col];
+ }
+
+ /* Now do the same for the row heights. */
+ canvas_height = allocation.height + 1;
+ canvas_height /= week_view->rows;
+ offset = 0;
+ for (row = 0; row <= week_view->rows; row++) {
+ week_view->row_offsets[row] = floor (offset + 0.5);
+ offset += canvas_height;
+ }
+
+ /* Calculate the cell heights based on the offsets. */
+ for (row = 0; row < week_view->rows; row++) {
+ week_view->row_heights[row] = week_view->row_offsets[row + 1]
+ - week_view->row_offsets[row];
+ }
+
+ widget = GTK_WIDGET (week_view);
+
+ pango_context = gtk_widget_get_pango_context (widget);
+ if (!pango_context)
+ return;
+
+ font_metrics = pango_context_get_metrics (
+ pango_context, NULL,
+ pango_context_get_language (pango_context));
+
+ /* Calculate the number of rows of events in each cell, for the large
+ * cells and the compressed weekend cells. */
+ if (e_week_view_get_multi_week_view (week_view)) {
+ week_view->events_y_offset = E_WEEK_VIEW_DATE_T_PAD
+ + PANGO_PIXELS (pango_font_metrics_get_ascent (font_metrics))
+ + PANGO_PIXELS (pango_font_metrics_get_descent (font_metrics))
+ + E_WEEK_VIEW_DATE_B_PAD;
+ } else {
+ week_view->events_y_offset = E_WEEK_VIEW_DATE_T_PAD
+ + PANGO_PIXELS (pango_font_metrics_get_ascent (font_metrics))
+ + PANGO_PIXELS (pango_font_metrics_get_descent (font_metrics))
+ + E_WEEK_VIEW_DATE_LINE_T_PAD + 1
+ + E_WEEK_VIEW_DATE_LINE_B_PAD;
+ }
+
+ height = week_view->row_heights[0];
+ week_view->rows_per_cell =
+ (height * 2 - week_view->events_y_offset) /
+ (week_view->row_height + E_WEEK_VIEW_EVENT_Y_SPACING);
+ week_view->rows_per_cell = MIN (
+ week_view->rows_per_cell,
+ E_WEEK_VIEW_MAX_ROWS_PER_CELL);
+
+ week_view->rows_per_compressed_cell =
+ (height - week_view->events_y_offset) /
+ (week_view->row_height + E_WEEK_VIEW_EVENT_Y_SPACING);
+ week_view->rows_per_compressed_cell = MIN (
+ week_view->rows_per_compressed_cell,
+ E_WEEK_VIEW_MAX_ROWS_PER_CELL);
+
+ /* Determine which time format to use, based on the width of the cells.
+ * We only allow the time to take up about half of the width. */
+ width = week_view->col_widths[0];
+
+ time_width = e_week_view_get_time_string_width (week_view);
+
+ week_view->time_format = E_WEEK_VIEW_TIME_NONE;
+ if (week_view->use_small_font && week_view->small_font_desc) {
+ if (e_week_view_get_show_event_end_times (week_view) &&
+ width / 2 > time_width * 2 + E_WEEK_VIEW_EVENT_TIME_SPACING)
+ week_view->time_format = E_WEEK_VIEW_TIME_BOTH_SMALL_MIN;
+ else if (width / 2 > time_width)
+ week_view->time_format = E_WEEK_VIEW_TIME_START_SMALL_MIN;
+ } else {
+ if (e_week_view_get_show_event_end_times (week_view) &&
+ width / 2 > time_width * 2 + E_WEEK_VIEW_EVENT_TIME_SPACING)
+ week_view->time_format = E_WEEK_VIEW_TIME_BOTH;
+ else if (width / 2 > time_width)
+ week_view->time_format = E_WEEK_VIEW_TIME_START;
+ }
+
+ pango_font_metrics_unref (font_metrics);
+}
+
+/**
+ * e_week_view_get_next_tab_event
+ * @week_view: the week_view widget operate on
+ * @direction: GTK_DIR_TAB_BACKWARD or GTK_DIR_TAB_FORWARD.
+ * @current_event_num and @current_span_num: current status.
+ * @next_event_num: the event number focus should go next.
+ * -1 indicates focus should go to week_view widget.
+ * @next_span_num: always return 0.
+ **/
+static gboolean
+e_week_view_get_next_tab_event (EWeekView *week_view,
+ GtkDirectionType direction,
+ gint current_event_num,
+ gint current_span_num,
+ gint *next_event_num,
+ gint *next_span_num)
+{
+ gint event_num;
+
+ g_return_val_if_fail (week_view != NULL, FALSE);
+ g_return_val_if_fail (next_event_num != NULL, FALSE);
+ g_return_val_if_fail (next_span_num != NULL, FALSE);
+
+ if (week_view->events->len <= 0)
+ return FALSE;
+
+ /* we only tab through events not spans */
+ *next_span_num = 0;
+
+ switch (direction) {
+ case GTK_DIR_TAB_BACKWARD:
+ event_num = current_event_num - 1;
+ break;
+ case GTK_DIR_TAB_FORWARD:
+ event_num = current_event_num + 1;
+ break;
+ default:
+ return FALSE;
+ }
+
+ if (event_num == -1)
+ /* backward, out of event range, go to week view widget
+ */
+ *next_event_num = -1;
+ else if (event_num < -1)
+ /* backward from week_view, go to the last event
+ */
+ *next_event_num = week_view->events->len - 1;
+ else if (event_num >= week_view->events->len)
+ /* forward, out of event range, go to week view widget
+ */
+ *next_event_num = -1;
+ else
+ *next_event_num = event_num;
+ return TRUE;
+}
+
+/* Restarts a query for the week view */
+static void
+e_week_view_update_query (EWeekView *week_view)
+{
+ gint rows, r;
+
+ if (!E_CALENDAR_VIEW (week_view)->in_focus) {
+ e_week_view_free_events (week_view);
+ week_view->requires_update = TRUE;
+ return;
+ }
+
+ gtk_widget_queue_draw (week_view->main_canvas);
+ e_week_view_free_events (week_view);
+ e_week_view_queue_layout (week_view);
+
+ rows = e_table_model_row_count (E_TABLE_MODEL (e_calendar_view_get_model (E_CALENDAR_VIEW
(week_view))));
+ for (r = 0; r < rows; r++) {
+ ECalModelComponent *comp_data;
+
+ comp_data = e_cal_model_get_component_at (e_calendar_view_get_model (E_CALENDAR_VIEW
(week_view)), r);
+ if (comp_data == NULL) {
+ g_warning ("comp_data is NULL\n");
+ continue;
+ }
+ week_view_process_component (week_view, comp_data);
+ }
+}
+
+void
+e_week_view_set_selected_time_range_visible (EWeekView *week_view,
+ time_t start_time,
+ time_t end_time)
+{
+ GDate *first_day_shown;
+ GDate date, end_date;
+ gint num_days;
+
+ g_return_if_fail (E_IS_WEEK_VIEW (week_view));
+
+ first_day_shown = &week_view->priv->first_day_shown;
+
+ time_to_gdate_with_zone (&date, start_time, e_calendar_view_get_timezone (E_CALENDAR_VIEW
(week_view)));
+
+ /* Set the selection to the given days. */
+ week_view->selection_start_day =
+ g_date_get_julian (&date) -
+ g_date_get_julian (first_day_shown);
+ if (end_time == start_time
+ || end_time <= time_add_day_with_zone (start_time, 1,
+ e_calendar_view_get_timezone (E_CALENDAR_VIEW
(week_view))))
+ week_view->selection_end_day = week_view->selection_start_day;
+ else {
+ time_to_gdate_with_zone (&end_date, end_time - 60, e_calendar_view_get_timezone
(E_CALENDAR_VIEW (week_view)));
+ week_view->selection_end_day =
+ g_date_get_julian (&end_date) -
+ g_date_get_julian (first_day_shown);
+ }
+
+ /* Make sure the selection is valid. */
+ num_days = (e_week_view_get_weeks_shown (week_view) * 7) - 1;
+ week_view->selection_start_day = CLAMP (
+ week_view->selection_start_day, 0, num_days);
+ week_view->selection_end_day = CLAMP (
+ week_view->selection_end_day,
+ week_view->selection_start_day,
+ num_days);
+
+ gtk_widget_queue_draw (week_view->main_canvas);
+}
+
+/* Note that the returned date may be invalid if no date has been set yet. */
+void
+e_week_view_get_first_day_shown (EWeekView *week_view,
+ GDate *date)
+{
+ *date = week_view->priv->first_day_shown;
+}
+
+/* This sets the first day shown in the view. It will be rounded down to the
+ * nearest week. */
+void
+e_week_view_set_first_day_shown (EWeekView *week_view,
+ GDate *date)
+{
+ GDate base_date;
+ GDateWeekday weekday;
+ GDateWeekday display_start_day;
+ guint day_offset;
+ gint num_days;
+ gboolean update_adjustment_value = FALSE;
+ guint32 old_selection_start_julian = 0, old_selection_end_julian = 0;
+ struct icaltimetype start_tt = icaltime_null_time ();
+ time_t start_time;
+
+ g_return_if_fail (E_IS_WEEK_VIEW (week_view));
+
+ /* Calculate the old selection range. */
+ if (week_view->selection_start_day != -1) {
+ old_selection_start_julian =
+ g_date_get_julian (&week_view->base_date)
+ + week_view->selection_start_day;
+ old_selection_end_julian =
+ g_date_get_julian (&week_view->base_date)
+ + week_view->selection_end_day;
+ }
+
+ weekday = g_date_get_weekday (date);
+ display_start_day = e_week_view_get_display_start_day (week_view);
+
+ /* Convert it to an offset from the start of the display. */
+ day_offset = e_weekday_get_days_between (display_start_day, weekday);
+
+ /* Calculate the base date, i.e. the first day shown when the
+ * scrollbar adjustment value is 0. */
+ base_date = *date;
+ g_date_subtract_days (&base_date, day_offset);
+
+ /* See if we need to update the base date. */
+ if (!g_date_valid (&week_view->base_date)
+ || g_date_compare (&week_view->base_date, &base_date)) {
+ week_view->base_date = base_date;
+ update_adjustment_value = TRUE;
+ }
+
+ /* See if we need to update the first day shown. */
+ if (!g_date_valid (&week_view->priv->first_day_shown)
+ || g_date_compare (&week_view->priv->first_day_shown, &base_date)) {
+ week_view->priv->first_day_shown = base_date;
+
+ start_tt.year = g_date_get_year (&base_date);
+ start_tt.month = g_date_get_month (&base_date);
+ start_tt.day = g_date_get_day (&base_date);
+
+ start_time = icaltime_as_timet_with_zone (
+ start_tt,
+ e_calendar_view_get_timezone (E_CALENDAR_VIEW (week_view)));
+
+ e_week_view_recalc_day_starts (week_view, start_time);
+ e_week_view_update_query (week_view);
+ }
+
+ /* Try to keep the previous selection, but if it is no longer shown
+ * just select the first day. */
+ if (week_view->selection_start_day != -1) {
+ week_view->selection_start_day = old_selection_start_julian
+ - g_date_get_julian (&base_date);
+ week_view->selection_end_day = old_selection_end_julian
+ - g_date_get_julian (&base_date);
+
+ /* Make sure the selection is valid. */
+ num_days = (e_week_view_get_weeks_shown (week_view) * 7) - 1;
+ week_view->selection_start_day = CLAMP (
+ week_view->selection_start_day, 0, num_days);
+ week_view->selection_end_day = CLAMP (
+ week_view->selection_end_day,
+ week_view->selection_start_day,
+ num_days);
+ }
+
+ /* Reset the adjustment value to 0 if the base address has changed.
+ * Note that we do this after updating first_day_shown so that our
+ * signal handler will not try to reload the events. */
+ if (update_adjustment_value) {
+ GtkRange *range;
+ GtkAdjustment *adjustment;
+
+ range = GTK_RANGE (week_view->vscrollbar);
+ adjustment = gtk_range_get_adjustment (range);
+ gtk_adjustment_set_value (adjustment, 0);
+ }
+
+ e_week_view_update_query (week_view);
+ gtk_widget_queue_draw (week_view->main_canvas);
+}
+
+GDateWeekday
+e_week_view_get_display_start_day (EWeekView *week_view)
+{
+ g_return_val_if_fail (E_IS_WEEK_VIEW (week_view), G_DATE_BAD_WEEKDAY);
+
+ return week_view->priv->display_start_day;
+}
+
+/* Recalculates the time_t corresponding to the start of each day. */
+static void
+e_week_view_recalc_day_starts (EWeekView *week_view,
+ time_t lower)
+{
+ gint num_days, day;
+ time_t tmp_time;
+
+ num_days = E_WEEK_VIEW_MAX_WEEKS * 7;
+
+ tmp_time = lower;
+ week_view->day_starts[0] = tmp_time;
+ for (day = 1; day <= num_days; day++) {
+ tmp_time = time_add_day_with_zone (
+ tmp_time, 1,
+ e_calendar_view_get_timezone (E_CALENDAR_VIEW (week_view)));
+ week_view->day_starts[day] = tmp_time;
+ }
+}
+
+gboolean
+e_week_view_get_multi_week_view (EWeekView *week_view)
+{
+ g_return_val_if_fail (E_IS_WEEK_VIEW (week_view), FALSE);
+
+ return week_view->priv->multi_week_view;
+}
+
+void
+e_week_view_set_multi_week_view (EWeekView *week_view,
+ gboolean multi_week_view)
+{
+ GtkRange *range;
+ GtkAdjustment *adjustment;
+ gint page_increment, page_size;
+
+ g_return_if_fail (E_IS_WEEK_VIEW (week_view));
+
+ if (multi_week_view == week_view->priv->multi_week_view)
+ return;
+
+ week_view->priv->multi_week_view = multi_week_view;
+
+ if (multi_week_view) {
+ gtk_widget_show (week_view->titles_canvas);
+ week_view->month_scroll_by_week = calendar_config_get_month_scroll_by_week ();
+
+ calendar_config_add_notification_month_scroll_by_week (
+ month_scroll_by_week_changed_cb, week_view);
+
+ if (week_view->month_scroll_by_week) {
+ page_increment = 1;
+ page_size = 1;
+ } else {
+ page_increment = 4;
+ page_size = 5;
+ }
+ } else {
+ gtk_widget_hide (week_view->titles_canvas);
+ page_increment = page_size = 1;
+
+ if (week_view->scroll_by_week_notif_id) {
+ calendar_config_remove_notification (
+ month_scroll_by_week_changed_cb, week_view);
+ week_view->scroll_by_week_notif_id = 0;
+ }
+ }
+
+ range = GTK_RANGE (week_view->vscrollbar);
+ adjustment = gtk_range_get_adjustment (range);
+ gtk_adjustment_set_page_increment (adjustment, page_increment);
+ gtk_adjustment_set_page_size (adjustment, page_size);
+
+ e_week_view_recalc_display_start_day (week_view);
+ e_week_view_recalc_cell_sizes (week_view);
+
+ if (g_date_valid (&week_view->priv->first_day_shown))
+ e_week_view_set_first_day_shown (
+ week_view,
+ &week_view->priv->first_day_shown);
+}
+
+gboolean
+e_week_view_get_update_base_date (EWeekView *week_view)
+{
+ g_return_val_if_fail (E_IS_WEEK_VIEW (week_view), FALSE);
+
+ return week_view->priv->update_base_date;
+}
+
+void
+e_week_view_set_update_base_date (EWeekView *week_view,
+ gboolean update_base_date)
+{
+ g_return_if_fail (E_IS_WEEK_VIEW (week_view));
+
+ week_view->priv->update_base_date = update_base_date;
+}
+
+gint
+e_week_view_get_weeks_shown (EWeekView *week_view)
+{
+ g_return_val_if_fail (E_IS_WEEK_VIEW (week_view), 1);
+
+ /* Give a sensible answer for single-week view. */
+ if (!e_week_view_get_multi_week_view (week_view))
+ return 1;
+
+ return week_view->priv->weeks_shown;
+}
+
+void
+e_week_view_set_weeks_shown (EWeekView *week_view,
+ gint weeks_shown)
+{
+ GtkRange *range;
+ GtkAdjustment *adjustment;
+ gint page_increment, page_size;
+
+ g_return_if_fail (E_IS_WEEK_VIEW (week_view));
+
+ weeks_shown = MIN (weeks_shown, E_WEEK_VIEW_MAX_WEEKS);
+
+ if (weeks_shown == week_view->priv->weeks_shown)
+ return;
+
+ week_view->priv->weeks_shown = weeks_shown;
+
+ if (e_week_view_get_multi_week_view (week_view)) {
+ if (week_view->month_scroll_by_week) {
+ page_increment = 1;
+ page_size = 1;
+ } else {
+ page_increment = 4;
+ page_size = 5;
+ }
+
+ range = GTK_RANGE (week_view->vscrollbar);
+ adjustment = gtk_range_get_adjustment (range);
+ gtk_adjustment_set_page_increment (adjustment, page_increment);
+ gtk_adjustment_set_page_size (adjustment, page_size);
+
+ e_week_view_recalc_cell_sizes (week_view);
+
+ if (g_date_valid (&week_view->priv->first_day_shown))
+ e_week_view_set_first_day_shown (
+ week_view,
+ &week_view->priv->first_day_shown);
+
+ e_week_view_update_query (week_view);
+ }
+}
+
+gboolean
+e_week_view_get_compress_weekend (EWeekView *week_view)
+{
+ g_return_val_if_fail (E_IS_WEEK_VIEW (week_view), FALSE);
+
+ return week_view->priv->compress_weekend;
+}
+
+void
+e_week_view_set_compress_weekend (EWeekView *week_view,
+ gboolean compress_weekend)
+{
+ gboolean need_reload = FALSE;
+
+ g_return_if_fail (E_IS_WEEK_VIEW (week_view));
+
+ if (compress_weekend == week_view->priv->compress_weekend)
+ return;
+
+ week_view->priv->compress_weekend = compress_weekend;
+
+ /* The option only affects the month view. */
+ if (!e_week_view_get_multi_week_view (week_view))
+ return;
+
+ e_week_view_recalc_cell_sizes (week_view);
+
+ need_reload = e_week_view_recalc_display_start_day (week_view);
+
+ /* If the display_start_day has changed we need to recalculate the
+ * date range shown and reload all events, otherwise we only need to
+ * do a reshape. */
+ if (need_reload) {
+ /* Recalculate the days shown and reload if necessary. */
+ if (g_date_valid (&week_view->priv->first_day_shown))
+ e_week_view_set_first_day_shown (
+ week_view,
+ &week_view->priv->first_day_shown);
+ } else {
+ week_view->events_need_reshape = TRUE;
+ e_week_view_check_layout (week_view);
+ }
+
+ gtk_widget_queue_draw (week_view->titles_canvas);
+ gtk_widget_queue_draw (week_view->main_canvas);
+
+ g_object_notify (G_OBJECT (week_view), "compress-weekend");
+}
+
+/* Whether we display event end times. */
+gboolean
+e_week_view_get_show_event_end_times (EWeekView *week_view)
+{
+ g_return_val_if_fail (E_IS_WEEK_VIEW (week_view), TRUE);
+
+ return week_view->priv->show_event_end_times;
+}
+
+void
+e_week_view_set_show_event_end_times (EWeekView *week_view,
+ gboolean show_event_end_times)
+{
+ g_return_if_fail (E_IS_WEEK_VIEW (week_view));
+
+ if (show_event_end_times == week_view->priv->show_event_end_times)
+ return;
+
+ week_view->priv->show_event_end_times = show_event_end_times;
+ e_week_view_recalc_cell_sizes (week_view);
+ week_view->events_need_reshape = TRUE;
+ e_week_view_check_layout (week_view);
+
+ gtk_widget_queue_draw (week_view->titles_canvas);
+ gtk_widget_queue_draw (week_view->main_canvas);
+
+ g_object_notify (G_OBJECT (week_view), "show-event-end-times");
+}
+
+gboolean
+e_week_view_get_show_icons_month_view (EWeekView *week_view)
+{
+ g_return_val_if_fail (E_IS_WEEK_VIEW (week_view), TRUE);
+
+ return week_view->priv->show_icons_month_view;
+}
+
+void
+e_week_view_set_show_icons_month_view (EWeekView *week_view,
+ gboolean show_icons_month_view)
+{
+ g_return_if_fail (E_IS_WEEK_VIEW (week_view));
+
+ if (show_icons_month_view == week_view->priv->show_icons_month_view)
+ return;
+
+ week_view->priv->show_icons_month_view = show_icons_month_view;
+
+ if (e_week_view_get_multi_week_view (week_view)) {
+ e_week_view_recalc_cell_sizes (week_view);
+ week_view->events_need_reshape = TRUE;
+ e_week_view_check_layout (week_view);
+
+ gtk_widget_queue_draw (week_view->titles_canvas);
+ gtk_widget_queue_draw (week_view->main_canvas);
+ }
+
+ g_object_notify (G_OBJECT (week_view), "show-icons-month-view");
+}
+
+static gboolean
+e_week_view_recalc_display_start_day (EWeekView *week_view)
+{
+ ECalModel *model;
+ GDateWeekday week_start_day;
+ GDateWeekday display_start_day;
+ gboolean changed;
+
+ model = e_calendar_view_get_model (E_CALENDAR_VIEW (week_view));
+ week_start_day = e_cal_model_get_week_start_day (model);
+
+ /* The display start day defaults to week_start_day, but we have
+ * to use Saturday if the weekend is compressed and week_start_day
+ * is Sunday. */
+ display_start_day = week_start_day;
+
+ if (display_start_day == G_DATE_SUNDAY) {
+ if (!e_week_view_get_multi_week_view (week_view))
+ display_start_day = G_DATE_SATURDAY;
+
+ if (e_week_view_get_compress_weekend (week_view))
+ display_start_day = G_DATE_SATURDAY;
+ }
+
+ changed = (display_start_day != week_view->priv->display_start_day);
+
+ week_view->priv->display_start_day = display_start_day;
+
+ return changed;
+}
+
+/* Checks if the users participation status is NEEDS-ACTION and shows the summary as bold text */
+static void
+set_style_from_attendee (EWeekViewEvent *event,
+ EWeekViewEventSpan *span,
+ ESourceRegistry *registry)
+{
+ ECalComponent *comp;
+ GSList *attendees = NULL, *l;
+ gchar *address;
+ ECalComponentAttendee *at = NULL;
+
+ if (!is_comp_data_valid (event))
+ return;
+
+ comp = e_cal_component_new ();
+ e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp));
+ address = itip_get_comp_attendee (
+ registry, comp, event->comp_data->client);
+ e_cal_component_get_attendee_list (comp, &attendees);
+ for (l = attendees; l; l = l->next) {
+ ECalComponentAttendee *attendee = l->data;
+
+ if ((g_str_equal (itip_strip_mailto (attendee->value), address))
+ || (attendee->sentby && g_str_equal (itip_strip_mailto (attendee->sentby), address))) {
+ at = attendee;
+ break;
+ }
+ }
+
+ /* The attendee has not yet accepted the meeting, display the summary as bolded.
+ * If the attendee is not present, it might have come through a mailing list.
+ * In that case, we never show the meeting as bold even if it is unaccepted. */
+ if (at && at->status == ICAL_PARTSTAT_NEEDSACTION)
+ gnome_canvas_item_set (span->text_item, "bold", TRUE, NULL);
+ else if (at && at->status == ICAL_PARTSTAT_DECLINED)
+ gnome_canvas_item_set (span->text_item, "strikeout", TRUE, NULL);
+ else if (at && at->status == ICAL_PARTSTAT_TENTATIVE)
+ gnome_canvas_item_set (span->text_item, "italic", TRUE, NULL);
+ else if (at && at->status == ICAL_PARTSTAT_DELEGATED)
+ gnome_canvas_item_set (span->text_item, "italic", TRUE, "strikeout", TRUE, NULL);
+
+ e_cal_component_free_attendee_list (attendees);
+ g_free (address);
+ g_object_unref (comp);
+}
+
+/* This calls a given function for each event instance that matches the given
+ * uid. Note that it is safe for the callback to remove the event (since we
+ * step backwards through the arrays). */
+static void
+e_week_view_foreach_event_with_uid (EWeekView *week_view,
+ const gchar *uid,
+ EWeekViewForeachEventCallback callback,
+ gpointer data)
+{
+ EWeekViewEvent *event;
+ gint event_num;
+
+ for (event_num = week_view->events->len - 1;
+ event_num >= 0;
+ event_num--) {
+ const gchar *u;
+
+ event = &g_array_index (week_view->events, EWeekViewEvent,
+ event_num);
+
+ if (!is_comp_data_valid (event))
+ continue;
+
+ u = icalcomponent_get_uid (event->comp_data->icalcomp);
+ if (u && !strcmp (uid, u)) {
+ if (!(*callback) (week_view, event_num, data))
+ return;
+ }
+ }
+}
+
+static gboolean
+e_week_view_remove_event_cb (EWeekView *week_view,
+ gint event_num,
+ gpointer data)
+{
+ EWeekViewEvent *event;
+ EWeekViewEventSpan *span;
+ gint span_num;
+
+ if (!is_array_index_in_bounds (week_view->events, event_num))
+ return TRUE;
+
+ event = &g_array_index (week_view->events, EWeekViewEvent, event_num);
+ if (!event)
+ return TRUE;
+
+ /* If we were editing this event, set editing_event_num to -1 so
+ * on_editing_stopped doesn't try to update the event. */
+ if (week_view->editing_event_num == event_num) {
+ week_view->editing_event_num = -1;
+ g_object_notify (G_OBJECT (week_view), "is-editing");
+ }
+
+ if (week_view->popup_event_num == event_num)
+ week_view->popup_event_num = -1;
+
+ if (is_comp_data_valid (event))
+ g_object_unref (event->comp_data);
+ event->comp_data = NULL;
+
+ if (week_view->spans) {
+ /* We leave the span elements in the array, but set the canvas item
+ * pointers to NULL. */
+ for (span_num = 0; span_num < event->num_spans; span_num++) {
+ if (!is_array_index_in_bounds (week_view->spans, event->spans_index + span_num))
+ break;
+
+ span = &g_array_index (week_view->spans, EWeekViewEventSpan,
+ event->spans_index + span_num);
+
+ if (span->text_item) {
+ g_object_run_dispose (G_OBJECT (span->text_item));
+ span->text_item = NULL;
+ }
+ if (span->background_item) {
+ g_object_run_dispose (G_OBJECT (span->background_item));
+ span->background_item = NULL;
+ }
+ }
+
+ /* Update event_num numbers for already created spans with event_num higher than our
event_num */
+ for (span_num = 0; span_num < week_view->spans->len; span_num++) {
+ span = &g_array_index (week_view->spans, EWeekViewEventSpan, span_num);
+
+ if (span && span->background_item && E_IS_WEEK_VIEW_EVENT_ITEM
(span->background_item)) {
+ EWeekViewEventItem *wveitem = E_WEEK_VIEW_EVENT_ITEM (span->background_item);
+ gint wveitem_event_num;
+
+ wveitem_event_num =
+ e_week_view_event_item_get_event_num (wveitem);
+
+ if (wveitem_event_num > event_num)
+ e_week_view_event_item_set_event_num (
+ wveitem, wveitem_event_num - 1);
+ }
+ }
+ }
+
+ g_array_remove_index (week_view->events, event_num);
+
+ week_view->events_need_layout = TRUE;
+
+ return TRUE;
+}
+
+void
+e_week_view_get_day_position (EWeekView *week_view,
+ gint day,
+ gint *day_x,
+ gint *day_y,
+ gint *day_w,
+ gint *day_h)
+{
+ gint cell_x, cell_y, cell_h;
+
+ e_week_view_layout_get_day_position (
+ day,
+ e_week_view_get_multi_week_view (week_view),
+ e_week_view_get_weeks_shown (week_view),
+ e_week_view_get_display_start_day (week_view),
+ e_week_view_get_compress_weekend (week_view),
+ &cell_x, &cell_y, &cell_h);
+
+ *day_x = week_view->col_offsets[cell_x];
+ *day_y = week_view->row_offsets[cell_y];
+
+ *day_w = week_view->col_widths[cell_x];
+ *day_h = week_view->row_heights[cell_y];
+
+ while (cell_h > 1) {
+ *day_h += week_view->row_heights[cell_y + 1];
+ cell_h--;
+ cell_y++;
+ }
+}
+
+/* Returns the bounding box for a span of an event. Usually this can easily
+ * be determined by the start & end days and row of the span, which are set in
+ * e_week_view_layout_event (). Though we need a special case for the weekends
+ * when they are compressed, since the span may not fit.
+ * The bounding box includes the entire width of the days in the view (but
+ * not the vertical line down the right of the last day), though the displayed
+ * event doesn't normally extend to the edges of the day.
+ * It returns FALSE if the span isn't visible. */
+gboolean
+e_week_view_get_span_position (EWeekView *week_view,
+ gint event_num,
+ gint span_num,
+ gint *span_x,
+ gint *span_y,
+ gint *span_w)
+{
+ EWeekViewEvent *event;
+ EWeekViewEventSpan *span;
+ gint num_days;
+ gint start_x, start_y, start_w, start_h;
+ gint end_x, end_y, end_w, end_h;
+
+ g_return_val_if_fail (E_IS_WEEK_VIEW (week_view), FALSE);
+ g_return_val_if_fail (event_num < week_view->events->len, FALSE);
+
+ event = &g_array_index (week_view->events, EWeekViewEvent, event_num);
+
+ g_return_val_if_fail (span_num < event->num_spans, FALSE);
+
+ if (!is_array_index_in_bounds (week_view->spans, event->spans_index + span_num))
+ return FALSE;
+
+ span = &g_array_index (week_view->spans, EWeekViewEventSpan,
+ event->spans_index + span_num);
+
+ if (!e_week_view_layout_get_span_position (
+ event, span,
+ week_view->rows_per_cell,
+ week_view->rows_per_compressed_cell,
+ e_week_view_get_display_start_day (week_view),
+ e_week_view_get_multi_week_view (week_view),
+ e_week_view_get_compress_weekend (week_view),
+ &num_days)) {
+ return FALSE;
+ }
+
+ e_week_view_get_day_position (
+ week_view, span->start_day,
+ &start_x, &start_y, &start_w, &start_h);
+ *span_y = start_y + week_view->events_y_offset
+ + span->row * (week_view->row_height
+ + E_WEEK_VIEW_EVENT_Y_SPACING);
+ if (num_days == 1) {
+ *span_x = start_x;
+ *span_w = start_w - 1;
+ } else {
+ e_week_view_get_day_position (
+ week_view,
+ span->start_day + num_days - 1,
+ &end_x, &end_y, &end_w, &end_h);
+ *span_x = start_x;
+ *span_w = end_x + end_w - start_x - 1;
+ }
+
+ return TRUE;
+}
+
+static gboolean
+ewv_pass_gdkevent_to_etext (EWeekView *week_view,
+ GdkEvent *gevent)
+{
+ g_return_val_if_fail (week_view != NULL, FALSE);
+ g_return_val_if_fail (gevent != NULL, FALSE);
+
+ if (week_view->editing_event_num != -1 && week_view->editing_span_num != -1) {
+ EWeekViewEvent *event;
+ EWeekViewEventSpan *span;
+
+ if (!is_array_index_in_bounds (week_view->events, week_view->editing_event_num))
+ return FALSE;
+
+ event = &g_array_index (week_view->events, EWeekViewEvent, week_view->editing_event_num);
+
+ if (!is_array_index_in_bounds (week_view->spans, event->spans_index +
week_view->editing_span_num))
+ return FALSE;
+
+ span = &g_array_index (week_view->spans, EWeekViewEventSpan, event->spans_index +
week_view->editing_span_num);
+
+ if (span->text_item && E_IS_TEXT (span->text_item)) {
+ GNOME_CANVAS_ITEM_GET_CLASS (span->text_item)->event (span->text_item, gevent);
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+}
+
+static gboolean
+e_week_view_on_button_press (GtkWidget *widget,
+ GdkEvent *button_event,
+ EWeekView *week_view)
+{
+ guint event_button = 0;
+ gdouble event_x_win = 0;
+ gdouble event_y_win = 0;
+ gint x, y, day;
+
+ gdk_event_get_button (button_event, &event_button);
+ gdk_event_get_coords (button_event, &event_x_win, &event_y_win);
+
+ /* Convert the mouse position to a week & day. */
+ x = (gint) event_x_win;
+ y = (gint) event_y_win;
+ day = e_week_view_convert_position_to_day (week_view, x, y);
+ if (day == -1)
+ return FALSE;
+
+ if (ewv_pass_gdkevent_to_etext (week_view, button_event))
+ return TRUE;
+
+ /* If an event is pressed just return. */
+ if (week_view->pressed_event_num != -1)
+ return FALSE;
+
+ if (event_button == 1 && button_event->type == GDK_2BUTTON_PRESS) {
+ time_t dtstart, dtend;
+
+ e_calendar_view_get_selected_time_range ((ECalendarView *) week_view, &dtstart, &dtend);
+ if (dtstart < week_view->before_click_dtend && dtend > week_view->before_click_dtstart) {
+ e_calendar_view_set_selected_time_range (
+ E_CALENDAR_VIEW (week_view),
+ week_view->before_click_dtstart,
+ week_view->before_click_dtend);
+ }
+ e_calendar_view_new_appointment_full (E_CALENDAR_VIEW (week_view), FALSE,
calendar_config_get_prefer_meeting (), FALSE);
+ return TRUE;
+ }
+
+ if (event_button == 1) {
+ GdkGrabStatus grab_status;
+ GdkWindow *window;
+ GdkDevice *event_device;
+ guint32 event_time;
+
+ /* Start the selection drag. */
+ if (!gtk_widget_has_focus (GTK_WIDGET (week_view)) && !gtk_widget_has_focus (GTK_WIDGET
(week_view->main_canvas)))
+ gtk_widget_grab_focus (GTK_WIDGET (week_view));
+
+ window = gtk_layout_get_bin_window (GTK_LAYOUT (widget));
+
+ event_device = gdk_event_get_device (button_event);
+ event_time = gdk_event_get_time (button_event);
+
+ grab_status = gdk_device_grab (
+ event_device,
+ window,
+ GDK_OWNERSHIP_NONE,
+ FALSE,
+ GDK_POINTER_MOTION_MASK |
+ GDK_BUTTON_RELEASE_MASK,
+ NULL,
+ event_time);
+
+ if (grab_status == GDK_GRAB_SUCCESS) {
+ if (event_time - week_view->bc_event_time > 250)
+ e_calendar_view_get_selected_time_range (
+ E_CALENDAR_VIEW (week_view),
+ &week_view->before_click_dtstart,
+ &week_view->before_click_dtend);
+ week_view->bc_event_time = event_time;
+ week_view->selection_start_day = day;
+ week_view->selection_end_day = day;
+ week_view->selection_drag_pos = E_WEEK_VIEW_DRAG_END;
+ g_signal_emit_by_name (week_view, "selected_time_changed");
+
+ /* FIXME: Optimise? */
+ gtk_widget_queue_draw (week_view->main_canvas);
+ }
+ } else if (event_button == 3) {
+ if (!gtk_widget_has_focus (GTK_WIDGET (week_view)))
+ gtk_widget_grab_focus (GTK_WIDGET (week_view));
+
+ if (day < week_view->selection_start_day || day > week_view->selection_end_day) {
+ week_view->selection_start_day = day;
+ week_view->selection_end_day = day;
+ week_view->selection_drag_pos = E_WEEK_VIEW_DRAG_NONE;
+
+ /* FIXME: Optimise? */
+ gtk_widget_queue_draw (week_view->main_canvas);
+ }
+
+ e_week_view_show_popup_menu (week_view, button_event, -1);
+ }
+
+ return TRUE;
+}
+
+static gboolean
+e_week_view_on_button_release (GtkWidget *widget,
+ GdkEvent *button_event,
+ EWeekView *week_view)
+{
+ GdkDevice *event_device;
+ guint32 event_time;
+
+ event_device = gdk_event_get_device (button_event);
+ event_time = gdk_event_get_time (button_event);
+
+ if (week_view->selection_drag_pos != E_WEEK_VIEW_DRAG_NONE) {
+ week_view->selection_drag_pos = E_WEEK_VIEW_DRAG_NONE;
+ gdk_device_ungrab (event_device, event_time);
+ } else {
+ ewv_pass_gdkevent_to_etext (week_view, button_event);
+ }
+
+ return FALSE;
+}
+
+static gboolean
+e_week_view_on_scroll (GtkWidget *widget,
+ GdkEventScroll *scroll,
+ EWeekView *week_view)
+{
+ GtkRange *range;
+ GtkAdjustment *adjustment;
+ gdouble page_increment;
+ gdouble new_value;
+ gdouble page_size;
+ gdouble lower;
+ gdouble upper;
+ gdouble value;
+ GtkWidget *tool_window = g_object_get_data (G_OBJECT (week_view), "tooltip-window");
+ guint timeout;
+
+ timeout = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (week_view), "tooltip-timeout"));
+ if (timeout) {
+ g_source_remove (timeout);
+ g_object_set_data (G_OBJECT (week_view), "tooltip-timeout", NULL);
+ }
+
+ if (tool_window) {
+ gtk_widget_destroy (tool_window);
+ g_object_set_data (G_OBJECT (week_view), "tooltip-window", NULL);
+ }
+
+ range = GTK_RANGE (week_view->vscrollbar);
+ adjustment = gtk_range_get_adjustment (range);
+
+ page_increment = gtk_adjustment_get_page_increment (adjustment);
+ page_size = gtk_adjustment_get_page_size (adjustment);
+ lower = gtk_adjustment_get_lower (adjustment);
+ upper = gtk_adjustment_get_upper (adjustment);
+ value = gtk_adjustment_get_value (adjustment);
+
+ switch (scroll->direction) {
+ case GDK_SCROLL_UP:
+ new_value = value - page_increment;
+ break;
+ case GDK_SCROLL_DOWN:
+ new_value = value + page_increment;
+ break;
+ case GDK_SCROLL_SMOOTH:
+ if (scroll->delta_y < -0.001 || scroll->delta_y > 0.001) {
+ new_value = value + scroll->delta_y * page_increment;
+ break;
+ }
+ return FALSE;
+ default:
+ return FALSE;
+ }
+
+ new_value = CLAMP (new_value, lower, upper - page_size);
+ gtk_adjustment_set_value (adjustment, new_value);
+
+ return TRUE;
+}
+
+static gboolean
+e_week_view_on_motion (GtkWidget *widget,
+ GdkEventMotion *mevent,
+ EWeekView *week_view)
+{
+ gint x, y, day;
+
+ /* Convert the mouse position to a week & day. */
+ x = mevent->x;
+ y = mevent->y;
+ day = e_week_view_convert_position_to_day (week_view, x, y);
+ if (day == -1)
+ return FALSE;
+
+ if (week_view->selection_drag_pos != E_WEEK_VIEW_DRAG_NONE) {
+ e_week_view_update_selection (week_view, day);
+ return TRUE;
+ }
+
+ ewv_pass_gdkevent_to_etext (week_view, (GdkEvent *) mevent);
+
+ return FALSE;
+}
+
+/* Converts a position in the canvas window to a day offset from the first
+ * day displayed. Returns -1 if the position is outside the grid. */
+static gint
+e_week_view_convert_position_to_day (EWeekView *week_view,
+ gint x,
+ gint y)
+{
+ GDateWeekday display_start_day;
+ gint col, row, grid_x = -1, grid_y = -1, week, day;
+ gint weekend_col;
+
+ display_start_day = e_week_view_get_display_start_day (week_view);
+
+ /* First we convert it to a grid position. */
+ for (col = 0; col <= week_view->columns; col++) {
+ if (x < week_view->col_offsets[col]) {
+ grid_x = col - 1;
+ break;
+ }
+ }
+
+ for (row = 0; row <= week_view->rows; row++) {
+ if (y < week_view->row_offsets[row]) {
+ grid_y = row - 1;
+ break;
+ }
+ }
+
+ /* If the mouse is outside the grid return FALSE. */
+ if (grid_x == -1 || grid_y == -1)
+ return -1;
+
+ /* Now convert the grid position to a week and day. */
+ if (e_week_view_get_multi_week_view (week_view)) {
+ week = grid_y / 2;
+ day = grid_x;
+
+ if (e_week_view_get_compress_weekend (week_view)) {
+ weekend_col = e_weekday_get_days_between (
+ display_start_day, G_DATE_SATURDAY);
+ if (grid_x > weekend_col
+ || (grid_x == weekend_col && grid_y % 2 == 1))
+ day++;
+ }
+ } else {
+ week = 0;
+
+ for (day = 0; day < 7; day++) {
+ gint day_x = 0, day_y = 0, rows = 0;
+ e_week_view_layout_get_day_position (
+ day, FALSE, 1,
+ e_week_view_get_display_start_day (week_view),
+ e_week_view_get_compress_weekend (week_view),
+ &day_x, &day_y, &rows);
+
+ if (grid_x == day_x && grid_y >= day_y && grid_y < day_y + rows)
+ break;
+ }
+
+ if (day == 7)
+ return -1;
+ }
+
+ return week * 7 + day;
+}
+
+static void
+e_week_view_update_selection (EWeekView *week_view,
+ gint day)
+{
+ gint tmp_day;
+ gboolean need_redraw = FALSE;
+
+ if (week_view->selection_drag_pos == E_WEEK_VIEW_DRAG_START) {
+ if (day != week_view->selection_start_day) {
+ need_redraw = TRUE;
+ week_view->selection_start_day = day;
+ }
+ } else {
+ if (day != week_view->selection_end_day) {
+ need_redraw = TRUE;
+ week_view->selection_end_day = day;
+ }
+ }
+
+ /* Switch the drag position if necessary. */
+ if (week_view->selection_start_day > week_view->selection_end_day) {
+ tmp_day = week_view->selection_start_day;
+ week_view->selection_start_day = week_view->selection_end_day;
+ week_view->selection_end_day = tmp_day;
+ if (week_view->selection_drag_pos == E_WEEK_VIEW_DRAG_START)
+ week_view->selection_drag_pos = E_WEEK_VIEW_DRAG_END;
+ else
+ week_view->selection_drag_pos = E_WEEK_VIEW_DRAG_START;
+ }
+
+ /* FIXME: Optimise? */
+ if (need_redraw) {
+ gtk_widget_queue_draw (week_view->main_canvas);
+ }
+}
+
+static void
+e_week_view_free_events (EWeekView *week_view)
+{
+ EWeekViewEvent *event;
+ EWeekViewEventSpan *span;
+ gint event_num, span_num, num_days, day;
+ gboolean did_editing = week_view->editing_event_num != -1;
+ guint timeout;
+
+ /* Reset all our indices. */
+ week_view->pressed_event_num = -1;
+ week_view->pressed_span_num = -1;
+ week_view->editing_event_num = -1;
+ week_view->editing_span_num = -1;
+ week_view->popup_event_num = -1;
+
+ for (event_num = 0; event_num < week_view->events->len; event_num++) {
+ event = &g_array_index (week_view->events, EWeekViewEvent,
+ event_num);
+
+ if (is_comp_data_valid (event))
+ g_object_unref (event->comp_data);
+ }
+
+ g_array_set_size (week_view->events, 0);
+
+ /* Destroy all the old canvas items. */
+ if (week_view->spans) {
+ for (span_num = 0; span_num < week_view->spans->len;
+ span_num++) {
+ span = &g_array_index (week_view->spans,
+ EWeekViewEventSpan, span_num);
+ if (span->background_item)
+ g_object_run_dispose (G_OBJECT (span->background_item));
+ if (span->text_item)
+ g_object_run_dispose (G_OBJECT (span->text_item));
+ }
+ g_array_free (week_view->spans, TRUE);
+ week_view->spans = NULL;
+ }
+
+ /* Clear the number of rows used per day. */
+ num_days = e_week_view_get_weeks_shown (week_view) * 7;
+ for (day = 0; day <= num_days; day++) {
+ week_view->rows_per_day[day] = 0;
+ }
+
+ /* Hide all the jump buttons. */
+ for (day = 0; day < E_WEEK_VIEW_MAX_WEEKS * 7; day++) {
+ gnome_canvas_item_hide (week_view->jump_buttons[day]);
+ }
+
+ if (did_editing)
+ g_object_notify (G_OBJECT (week_view), "is-editing");
+
+ timeout = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (week_view), "tooltip-timeout"));
+ if (timeout) {
+ g_source_remove (timeout);
+ g_object_set_data (G_OBJECT (week_view), "tooltip-timeout", NULL);
+ }
+}
+
+/* This adds one event to the view, adding it to the appropriate array. */
+static void
+e_week_view_add_event (ECalClient *client,
+ ECalComponent *comp,
+ time_t start,
+ time_t end,
+ gboolean prepend,
+ gpointer data)
+
+{
+ AddEventData *add_event_data;
+ EWeekViewEvent event;
+ gint num_days;
+ struct icaltimetype start_tt, end_tt;
+
+ add_event_data = data;
+
+ /* Check that the event times are valid. */
+ num_days = e_week_view_get_weeks_shown (add_event_data->week_view) * 7;
+
+ g_return_if_fail (start <= end);
+ g_return_if_fail (start < add_event_data->week_view->day_starts[num_days]);
+
+ if (end != start || end < add_event_data->week_view->day_starts[0])
+ g_return_if_fail (end > add_event_data->week_view->day_starts[0]);
+
+ start_tt = icaltime_from_timet_with_zone (
+ start, FALSE,
+ e_calendar_view_get_timezone (E_CALENDAR_VIEW (add_event_data->week_view)));
+ end_tt = icaltime_from_timet_with_zone (
+ end, FALSE,
+ e_calendar_view_get_timezone (E_CALENDAR_VIEW (add_event_data->week_view)));
+
+ if (add_event_data->comp_data) {
+ event.comp_data = g_object_ref (add_event_data->comp_data);
+ } else {
+ event.comp_data = g_object_new (E_TYPE_CAL_MODEL_COMPONENT, NULL);
+ event.comp_data->is_new_component = TRUE;
+ event.comp_data->client = g_object_ref (client);
+ e_cal_component_abort_sequence (comp);
+ event.comp_data->icalcomp = icalcomponent_new_clone (e_cal_component_get_icalcomponent
(comp));
+ }
+ event.start = start;
+ event.end = end;
+ event.tooltip = NULL;
+ event.timeout = -1;
+ event.color = NULL;
+ event.spans_index = 0;
+ event.num_spans = 0;
+ event.comp_data->instance_start = start;
+ event.comp_data->instance_end = end;
+
+ event.start_minute = start_tt.hour * 60 + start_tt.minute;
+ event.end_minute = end_tt.hour * 60 + end_tt.minute;
+ if (event.end_minute == 0 && start != end)
+ event.end_minute = 24 * 60;
+
+ event.different_timezone = FALSE;
+ if (!cal_comp_util_compare_event_timezones (
+ comp,
+ event.comp_data->client,
+ e_calendar_view_get_timezone (E_CALENDAR_VIEW (add_event_data->week_view))))
+ event.different_timezone = TRUE;
+
+ if (prepend)
+ g_array_prepend_val (add_event_data->week_view->events, event);
+ else
+ g_array_append_val (add_event_data->week_view->events, event);
+ add_event_data->week_view->events_sorted = FALSE;
+ add_event_data->week_view->events_need_layout = TRUE;
+}
+
+/* This lays out the events, or reshapes them, as necessary. */
+static void
+e_week_view_check_layout (EWeekView *week_view)
+{
+ /* Don't bother if we aren't visible. */
+ if (!E_CALENDAR_VIEW (week_view)->in_focus) {
+ e_week_view_free_events (week_view);
+ week_view->requires_update = TRUE;
+ return;
+ }
+
+ /* Make sure the events are sorted (by start and size). */
+ e_week_view_ensure_events_sorted (week_view);
+
+ if (week_view->events_need_layout)
+ week_view->spans = e_week_view_layout_events (
+ week_view->events,
+ week_view->spans,
+ e_week_view_get_multi_week_view (week_view),
+ e_week_view_get_weeks_shown (week_view),
+ e_week_view_get_compress_weekend (week_view),
+ e_week_view_get_display_start_day (week_view),
+ week_view->day_starts,
+ week_view->rows_per_day);
+
+ if (week_view->events_need_layout || week_view->events_need_reshape)
+ e_week_view_reshape_events (week_view);
+
+ week_view->events_need_layout = FALSE;
+ week_view->events_need_reshape = FALSE;
+}
+
+static void
+e_week_view_ensure_events_sorted (EWeekView *week_view)
+{
+ if (!week_view->events_sorted) {
+ qsort (
+ week_view->events->data,
+ week_view->events->len,
+ sizeof (EWeekViewEvent),
+ e_week_view_event_sort_func);
+ week_view->events_sorted = TRUE;
+ }
+}
+
+gint
+e_week_view_event_sort_func (gconstpointer arg1,
+ gconstpointer arg2)
+{
+ EWeekViewEvent *event1, *event2;
+
+ event1 = (EWeekViewEvent *) arg1;
+ event2 = (EWeekViewEvent *) arg2;
+
+ if (event1->start < event2->start)
+ return -1;
+ if (event1->start > event2->start)
+ return 1;
+
+ if (event1->end > event2->end)
+ return -1;
+ if (event1->end < event2->end)
+ return 1;
+
+ return 0;
+}
+
+static void
+e_week_view_reshape_events (EWeekView *week_view)
+{
+ EWeekViewEvent *event;
+ GDateWeekday display_start_day;
+ gint event_num, span_num;
+ gint num_days, day, day_x, day_y, day_w, day_h, max_rows;
+ gboolean is_weekend;
+
+ for (event_num = 0; event_num < week_view->events->len; event_num++) {
+ event = &g_array_index (week_view->events, EWeekViewEvent,
+ event_num);
+ if (!is_comp_data_valid (event))
+ continue;
+
+ for (span_num = 0; span_num < event->num_spans; span_num++) {
+ gchar *current_comp_string;
+
+ e_week_view_reshape_event_span (
+ week_view, event_num, span_num);
+ if (week_view->last_edited_comp_string == NULL)
+ continue;
+ current_comp_string = icalcomponent_as_ical_string_r (event->comp_data->icalcomp);
+ if (strncmp (current_comp_string, week_view->last_edited_comp_string,50) == 0) {
+ EWeekViewEventSpan *span;
+
+ if (!is_array_index_in_bounds (week_view->spans, event->spans_index +
span_num)) {
+ g_free (current_comp_string);
+ continue;
+ }
+
+ span = &g_array_index (week_view->spans, EWeekViewEventSpan,
event->spans_index + span_num);
+ e_canvas_item_grab_focus (span->text_item, TRUE);
+ g_free (week_view->last_edited_comp_string);
+ week_view->last_edited_comp_string = NULL;
+ }
+ g_free (current_comp_string);
+ }
+ }
+
+ /* Reshape the jump buttons and show/hide them as appropriate. */
+ num_days = e_week_view_get_weeks_shown (week_view) * 7;
+ display_start_day = e_week_view_get_display_start_day (week_view);
+ for (day = 0; day < num_days; day++) {
+ switch (e_weekday_add_days (display_start_day, day)) {
+ case G_DATE_SATURDAY:
+ case G_DATE_SUNDAY:
+ is_weekend = TRUE;
+ break;
+ default:
+ is_weekend = FALSE;
+ break;
+ }
+
+ if (!is_weekend || (
+ e_week_view_get_multi_week_view (week_view)
+ && !e_week_view_get_compress_weekend (week_view)))
+ max_rows = week_view->rows_per_cell;
+ else
+ max_rows = week_view->rows_per_compressed_cell;
+
+ /* Determine whether the jump button should be shown. */
+ if (week_view->rows_per_day[day] <= max_rows) {
+ gnome_canvas_item_hide (week_view->jump_buttons[day]);
+ } else {
+ cairo_matrix_t matrix;
+
+ e_week_view_get_day_position (
+ week_view, day,
+ &day_x, &day_y,
+ &day_w, &day_h);
+
+ cairo_matrix_init_translate (
+ &matrix,
+ day_x + day_w - E_WEEK_VIEW_JUMP_BUTTON_X_PAD - E_WEEK_VIEW_JUMP_BUTTON_WIDTH,
+ day_y + day_h - E_WEEK_VIEW_JUMP_BUTTON_Y_PAD -
E_WEEK_VIEW_JUMP_BUTTON_HEIGHT);
+ gnome_canvas_item_set_matrix (week_view->jump_buttons[day], &matrix);
+
+ gnome_canvas_item_show (week_view->jump_buttons[day]);
+ gnome_canvas_item_raise_to_top (week_view->jump_buttons[day]);
+ }
+ }
+
+ for (day = num_days; day < E_WEEK_VIEW_MAX_WEEKS * 7; day++) {
+ gnome_canvas_item_hide (week_view->jump_buttons[day]);
+ }
+}
+
+static EWeekViewEvent *
+tooltip_get_view_event (EWeekView *week_view,
+ gint day,
+ gint event_num)
+{
+ EWeekViewEvent *pevent;
+
+ if (!is_array_index_in_bounds (week_view->events, event_num))
+ return NULL;
+
+ pevent = &g_array_index (week_view->events, EWeekViewEvent, event_num);
+
+ return pevent;
+}
+
+static void
+tooltip_destroy (EWeekView *week_view,
+ GnomeCanvasItem *item)
+{
+ gint event_num;
+ EWeekViewEvent *pevent;
+ guint timeout;
+
+ e_week_view_check_layout (week_view);
+
+ event_num = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (item), "event-num"));
+
+ timeout = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (week_view), "tooltip-timeout"));
+ if (timeout) {
+ g_source_remove (timeout);
+ g_object_set_data (G_OBJECT (week_view), "tooltip-timeout", NULL);
+ }
+
+ pevent = tooltip_get_view_event (week_view, -1, event_num);
+ if (pevent) {
+ if (pevent->tooltip && g_object_get_data (G_OBJECT (week_view), "tooltip-window")) {
+ gtk_widget_destroy (pevent->tooltip);
+ pevent->tooltip = NULL;
+ }
+
+ g_object_set_data (G_OBJECT (week_view), "tooltip-window", NULL);
+ }
+}
+
+static gboolean
+e_week_view_handle_tooltip_timeout (gpointer user_data)
+{
+ ECalendarViewEventData *data = user_data;
+
+ g_return_val_if_fail (data != NULL, FALSE);
+
+ return e_calendar_view_get_tooltips (data);
+}
+
+static void
+e_week_view_destroy_tooltip_timeout_data (gpointer ptr)
+{
+ ECalendarViewEventData *data = ptr;
+
+ if (data) {
+ g_object_set_data ((GObject *) data->cal_view, "tooltip-timeout", NULL);
+ g_object_unref (data->cal_view);
+ g_free (data);
+ }
+}
+
+static gboolean
+tooltip_event_cb (GnomeCanvasItem *item,
+ GdkEvent *event,
+ EWeekView *view)
+{
+ gint event_num;
+ EWeekViewEvent *pevent;
+
+ e_week_view_check_layout (view);
+
+ event_num = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (item), "event-num"));
+ pevent = tooltip_get_view_event (view, -1, event_num);
+
+ switch (event->type) {
+ case GDK_ENTER_NOTIFY:
+ if (view->editing_event_num == -1) {
+ ECalendarViewEventData *data;
+
+ g_return_val_if_fail (pevent != NULL, FALSE);
+ data = g_malloc (sizeof (ECalendarViewEventData));
+
+ pevent->x = ((GdkEventCrossing *) event)->x_root;
+ pevent->y = ((GdkEventCrossing *) event)->y_root;
+ pevent->tooltip = NULL;
+
+ data->cal_view = g_object_ref (view);
+ data->day = -1;
+ data->event_num = event_num;
+ data->get_view_event = (ECalendarViewEvent * (*)(ECalendarView *, int, gint))
tooltip_get_view_event;
+ pevent->timeout = e_named_timeout_add_full (
+ G_PRIORITY_DEFAULT, 500,
+ e_week_view_handle_tooltip_timeout,
+ data, e_week_view_destroy_tooltip_timeout_data);
+ g_object_set_data ((GObject *) view, "tooltip-timeout", GUINT_TO_POINTER
(pevent->timeout));
+
+ return TRUE;
+ } else {
+ return FALSE;
+ }
+ case GDK_MOTION_NOTIFY:
+ g_return_val_if_fail (pevent != NULL, FALSE);
+
+ pevent->x = ((GdkEventMotion *) event)->x_root;
+ pevent->y = ((GdkEventMotion *) event)->y_root;
+ pevent->tooltip = (GtkWidget *) g_object_get_data (G_OBJECT (view), "tooltip-window");
+
+ if (pevent->tooltip) {
+ e_calendar_view_move_tip (pevent->tooltip, pevent->x + 16, pevent->y + 16);
+ }
+
+ return TRUE;
+ case GDK_LEAVE_NOTIFY:
+ case GDK_KEY_PRESS:
+ case GDK_BUTTON_PRESS:
+ tooltip_destroy (view, item);
+ default:
+ return FALSE;
+ }
+}
+
+static const gchar *
+get_comp_summary (ECalClient *client,
+ icalcomponent *icalcomp,
+ gboolean *free_text)
+{
+ const gchar *my_summary, *location;
+ const gchar *summary;
+ gboolean my_free_text = FALSE;
+
+ g_return_val_if_fail (icalcomp != NULL && free_text != NULL, NULL);
+
+ my_summary = e_calendar_view_get_icalcomponent_summary (client, icalcomp, &my_free_text);
+
+ location = icalcomponent_get_location (icalcomp);
+ if (location && *location) {
+ *free_text = TRUE;
+ summary = g_strdup_printf ("%s (%s)", my_summary, location);
+
+ if (my_free_text)
+ g_free ((gchar *) my_summary);
+ } else {
+ *free_text = my_free_text;
+ summary = my_summary;
+ }
+
+ return summary;
+}
+
+static void
+e_week_view_reshape_event_span (EWeekView *week_view,
+ gint event_num,
+ gint span_num)
+{
+ ECalendarView *cal_view;
+ ECalModel *model;
+ ESourceRegistry *registry;
+ EWeekViewEvent *event;
+ EWeekViewEventSpan *span;
+ gint span_x, span_y, span_w, num_icons, icons_width, time_width;
+ gint min_text_x, max_text_w, width;
+ gboolean show_icons = TRUE, use_max_width = FALSE;
+ gboolean one_day_event;
+ ECalComponent *comp;
+ gdouble text_x, text_y, text_w, text_h;
+ gchar *text, *end_of_line;
+ gint line_len, text_width;
+ PangoContext *pango_context;
+ PangoFontMetrics *font_metrics;
+ PangoLayout *layout;
+
+ cal_view = E_CALENDAR_VIEW (week_view);
+ model = e_calendar_view_get_model (cal_view);
+
+ registry = e_cal_model_get_registry (model);
+
+ if (!is_array_index_in_bounds (week_view->events, event_num))
+ return;
+
+ event = &g_array_index (week_view->events, EWeekViewEvent, event_num);
+
+ if (!is_comp_data_valid (event))
+ return;
+
+ if (!is_array_index_in_bounds (week_view->spans, event->spans_index + span_num))
+ return;
+
+ span = &g_array_index (week_view->spans, EWeekViewEventSpan,
+ event->spans_index + span_num);
+ comp = e_cal_component_new ();
+ e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp));
+
+ one_day_event = e_week_view_is_one_day_event (week_view, event_num);
+
+ /* If the span will not be visible destroy the canvas items and
+ * return. */
+ if (!e_week_view_get_span_position (week_view, event_num, span_num,
+ &span_x, &span_y, &span_w)) {
+ if (span->background_item)
+ g_object_run_dispose (G_OBJECT (span->background_item));
+ if (span->text_item)
+ g_object_run_dispose (G_OBJECT (span->text_item));
+ span->background_item = NULL;
+ span->text_item = NULL;
+
+ g_object_unref (comp);
+ return;
+ }
+
+ /* Set up Pango prerequisites */
+ pango_context = gtk_widget_get_pango_context (GTK_WIDGET (week_view));
+ font_metrics = pango_context_get_metrics (
+ pango_context, NULL,
+ pango_context_get_language (pango_context));
+ layout = pango_layout_new (pango_context);
+
+ /* If we are editing a long event we don't show the icons and the EText
+ * item uses the maximum width available. */
+ if (!one_day_event && week_view->editing_event_num == event_num
+ && week_view->editing_span_num == span_num) {
+ show_icons = FALSE;
+ use_max_width = TRUE;
+ } else if (e_week_view_get_multi_week_view (week_view)) {
+ show_icons = e_week_view_get_show_icons_month_view (week_view);
+ }
+
+ /* Calculate how many icons we need to show. */
+ num_icons = 0;
+ if (show_icons) {
+ if (e_cal_component_has_alarms (comp))
+ num_icons++;
+ if (e_cal_component_has_recurrences (comp) || e_cal_component_is_instance (comp))
+ num_icons++;
+ if (e_cal_component_has_attachments (comp))
+ num_icons++;
+ if (e_cal_component_has_attendees (comp))
+ num_icons++;
+ if (event->different_timezone)
+ num_icons++;
+ num_icons += cal_comp_util_get_n_icons (comp, NULL);
+ }
+
+ /* Create the background canvas item if necessary. */
+ if (!span->background_item) {
+ span->background_item =
+ gnome_canvas_item_new (
+ GNOME_CANVAS_GROUP (GNOME_CANVAS (week_view->main_canvas)->root),
+ e_week_view_event_item_get_type (),
+ NULL);
+ }
+
+ g_object_set_data ((GObject *) span->background_item, "event-num", GINT_TO_POINTER (event_num));
+ g_signal_connect (
+ span->background_item, "event",
+ G_CALLBACK (tooltip_event_cb), week_view);
+
+ gnome_canvas_item_set (
+ span->background_item,
+ "event_num", event_num,
+ "span_num", span_num,
+ NULL);
+
+ /* Create the text item if necessary. */
+ if (!span->text_item) {
+ const gchar *summary;
+ GdkColor color;
+ gboolean free_text = FALSE;
+
+ color = e_week_view_get_text_color (week_view, event);
+ summary = get_comp_summary (event->comp_data->client, event->comp_data->icalcomp, &free_text);
+
+ span->text_item =
+ gnome_canvas_item_new (
+ GNOME_CANVAS_GROUP (GNOME_CANVAS (week_view->main_canvas)->root),
+ e_text_get_type (),
+ "clip", TRUE,
+ "max_lines", 1,
+ "editable", TRUE,
+ "text", summary ? summary : "",
+ "use_ellipsis", TRUE,
+ "fill_color_gdk", &color,
+ "im_context", E_CANVAS (week_view->main_canvas)->im_context,
+ NULL);
+
+ if (free_text)
+ g_free ((gchar *) summary);
+
+ if (e_cal_util_component_has_attendee (event->comp_data->icalcomp))
+ set_style_from_attendee (event, span, registry);
+
+ g_signal_connect (
+ span->text_item, "event",
+ G_CALLBACK (e_week_view_on_text_item_event), week_view);
+ g_signal_emit_by_name (
+ G_OBJECT (week_view),
+ "event_added", event);
+
+ }
+
+ g_object_set_data (G_OBJECT (span->text_item), "event-num", GINT_TO_POINTER (event_num));
+
+ /* Calculate the position of the text item.
+ * For events < 1 day it starts after the times & icons and ends at the
+ * right edge of the span.
+ * For events >= 1 day we need to determine whether times are shown at
+ * the start and end of the span, then try to center the text item with
+ * the icons in the middle, but making sure we don't go over the times.
+ */
+
+ /* Calculate the space necessary to display a time, e.g. "13:00". */
+ time_width = e_week_view_get_time_string_width (week_view);
+
+ /* Calculate the space needed for the icons. */
+ icons_width = (E_WEEK_VIEW_ICON_WIDTH + E_WEEK_VIEW_ICON_X_PAD)
+ * num_icons - E_WEEK_VIEW_ICON_X_PAD + E_WEEK_VIEW_ICON_R_PAD;
+
+ /* The y position and height are the same for both event types. */
+ text_y = span_y + E_WEEK_VIEW_EVENT_BORDER_HEIGHT
+ + E_WEEK_VIEW_EVENT_TEXT_Y_PAD;
+
+ text_h =
+ PANGO_PIXELS (pango_font_metrics_get_ascent (font_metrics)) +
+ PANGO_PIXELS (pango_font_metrics_get_descent (font_metrics));
+
+ if (one_day_event) {
+ /* Note that 1-day events don't have a border. Although we
+ * still use the border height to position the events
+ * vertically so they still line up neatly (see above),
+ * we don't use the border width or edge padding at all. */
+ text_x = span_x + E_WEEK_VIEW_EVENT_L_PAD;
+
+ switch (week_view->time_format) {
+ case E_WEEK_VIEW_TIME_BOTH_SMALL_MIN:
+ case E_WEEK_VIEW_TIME_BOTH:
+ /* These have 2 time strings with a small space between
+ * them and some space before the EText item. */
+ text_x += time_width * 2
+ + E_WEEK_VIEW_EVENT_TIME_SPACING
+ + E_WEEK_VIEW_EVENT_TIME_X_PAD;
+ break;
+ case E_WEEK_VIEW_TIME_START_SMALL_MIN:
+ case E_WEEK_VIEW_TIME_START:
+ /* These have just 1 time string with some space
+ * before the EText item. */
+ text_x += time_width + E_WEEK_VIEW_EVENT_TIME_X_PAD;
+ break;
+ case E_WEEK_VIEW_TIME_NONE:
+ break;
+ }
+
+ /* The icons_width includes space on the right of the icons. */
+ text_x += icons_width;
+
+ /* The width of the EText item extends right to the edge of the
+ * event, just inside the border. */
+ text_w = span_x + span_w - E_WEEK_VIEW_EVENT_R_PAD - text_x;
+
+ } else {
+ if (use_max_width) {
+ /* When we are editing the event we use all the
+ * available width. */
+ text_x = span_x + E_WEEK_VIEW_EVENT_L_PAD
+ + E_WEEK_VIEW_EVENT_BORDER_WIDTH
+ + E_WEEK_VIEW_EVENT_EDGE_X_PAD;
+ text_w = span_x + span_w - E_WEEK_VIEW_EVENT_R_PAD
+ - E_WEEK_VIEW_EVENT_BORDER_WIDTH
+ - E_WEEK_VIEW_EVENT_EDGE_X_PAD - text_x;
+ } else {
+ text = NULL;
+ /* Get the width of the text of the event. This is a
+ * bit of a hack. It would be better if EText could
+ * tell us this. */
+ g_object_get (span->text_item, "text", &text, NULL);
+ text_width = 0;
+ if (text) {
+ /* It should only have one line of text in it.
+ * I'm not sure we need this any more. */
+ end_of_line = strchr (text, '\n');
+ if (end_of_line)
+ line_len = end_of_line - text;
+ else
+ line_len = strlen (text);
+
+ pango_layout_set_text (layout, text, line_len);
+ pango_layout_get_pixel_size (layout, &text_width, NULL);
+ g_free (text);
+ }
+
+ /* Add on the width of the icons and find the default
+ * position, which centers the icons + text. */
+ width = text_width + icons_width;
+ text_x = span_x + (span_w - width) / 2;
+
+ /* Now calculate the left-most valid position, and make
+ * sure we don't go to the left of that. */
+ min_text_x = span_x + E_WEEK_VIEW_EVENT_L_PAD
+ + E_WEEK_VIEW_EVENT_BORDER_WIDTH
+ + E_WEEK_VIEW_EVENT_EDGE_X_PAD;
+ /* See if we will want to display the start time, and
+ * if so take that into account. */
+ if (event->start > week_view->day_starts[span->start_day])
+ min_text_x += time_width
+ + E_WEEK_VIEW_EVENT_TIME_X_PAD;
+
+ /* Now make sure we don't go to the left of the minimum
+ * position. */
+ text_x = MAX (text_x, min_text_x);
+
+ /* Now calculate the largest valid width, using the
+ * calculated x position, and make sure we don't
+ * exceed that. */
+ max_text_w = span_x + span_w - E_WEEK_VIEW_EVENT_R_PAD
+ - E_WEEK_VIEW_EVENT_BORDER_WIDTH
+ - E_WEEK_VIEW_EVENT_EDGE_X_PAD - text_x;
+ if (event->end < week_view->day_starts[span->start_day
+ + span->num_days])
+ max_text_w -= time_width
+ + E_WEEK_VIEW_EVENT_TIME_X_PAD;
+
+ text_w = MIN (width, max_text_w);
+
+ /* Now take out the space for the icons. */
+ text_x += icons_width;
+ text_w -= icons_width;
+ }
+ }
+
+ /* Make sure we don't try to use a negative width. */
+ text_w = MAX (text_w, 0);
+
+ gnome_canvas_item_set (
+ span->text_item,
+ "clip_width", (gdouble) text_w,
+ "clip_height", (gdouble) text_h,
+ NULL);
+ e_canvas_item_move_absolute (span->text_item, text_x, text_y);
+ gnome_canvas_item_request_update (span->background_item);
+
+ g_object_unref (comp);
+ g_object_unref (layout);
+ pango_font_metrics_unref (font_metrics);
+}
+
+gboolean
+e_week_view_start_editing_event (EWeekView *week_view,
+ gint event_num,
+ gint span_num,
+ gchar *initial_text)
+{
+ EWeekViewEvent *event;
+ EWeekViewEventSpan *span;
+ ETextEventProcessor *event_processor = NULL;
+ ETextEventProcessorCommand command;
+ ECalModelComponent *comp_data;
+
+ /* If we are already editing the event, just return. */
+ if (event_num == week_view->editing_event_num
+ && span_num == week_view->editing_span_num)
+ return TRUE;
+
+ if (!is_array_index_in_bounds (week_view->events, event_num))
+ return FALSE;
+
+ event = &g_array_index (week_view->events, EWeekViewEvent, event_num);
+
+ if (!is_comp_data_valid (event))
+ return FALSE;
+
+ if (!is_array_index_in_bounds (week_view->spans, event->spans_index + span_num))
+ return FALSE;
+
+ span = &g_array_index (week_view->spans, EWeekViewEventSpan,
+ event->spans_index + span_num);
+
+ if (e_client_is_readonly (E_CLIENT (event->comp_data->client)))
+ return FALSE;
+
+ /* If the event is not shown, don't try to edit it. */
+ if (!span->text_item)
+ return FALSE;
+
+ if (week_view->editing_event_num >= 0) {
+ EWeekViewEvent *editing;
+
+ if (!is_array_index_in_bounds (week_view->events, week_view->editing_event_num))
+ return FALSE;
+
+ editing = &g_array_index (week_view->events, EWeekViewEvent, week_view->editing_event_num);
+
+ /* do not change to other part of same component - the event is spread into more days */
+ if (editing && editing->comp_data == event->comp_data)
+ return FALSE;
+ }
+
+ gnome_canvas_item_set (
+ span->text_item,
+ "text", initial_text ? initial_text : icalcomponent_get_summary (event->comp_data->icalcomp),
+ NULL);
+
+ /* Save the comp_data value because we use that as our invariant */
+ comp_data = event->comp_data;
+
+ e_canvas_item_grab_focus (span->text_item, TRUE);
+
+ /* If the above focus caused things to redraw, then find the
+ * the event and the span again */
+ if (event_num < week_view->events->len)
+ event = &g_array_index (week_view->events, EWeekViewEvent, event_num);
+
+ if (event_num >= week_view->events->len || event->comp_data != comp_data) {
+ /* When got in because of other comp_data, then be sure we go through all events */
+ event_num = week_view->events->len;
+
+ /* Unfocussing can cause a removal but not a new
+ * addition so just run backwards through the
+ * events */
+ for (event_num--; event_num >= 0; event_num--) {
+ event = &g_array_index (week_view->events, EWeekViewEvent, event_num);
+ if (event->comp_data == comp_data)
+ break;
+ }
+ g_return_val_if_fail (event_num >= 0, FALSE);
+ }
+
+ if (!is_array_index_in_bounds (week_view->spans, event->spans_index + span_num))
+ return FALSE;
+
+ span = &g_array_index (week_view->spans, EWeekViewEventSpan, event->spans_index + span_num);
+
+ /* Try to move the cursor to the end of the text. */
+ g_object_get (span->text_item, "event_processor", &event_processor, NULL);
+ if (event_processor) {
+ command.action = E_TEP_MOVE;
+ command.position = E_TEP_END_OF_BUFFER;
+ g_signal_emit_by_name (
+ event_processor,
+ "command", &command);
+ }
+ return TRUE;
+}
+
+/* This stops any current edit. */
+void
+e_week_view_stop_editing_event (EWeekView *week_view)
+{
+ GtkWidget *toplevel;
+
+ /* Check we are editing an event. */
+ if (week_view->editing_event_num == -1)
+ return;
+
+ /* Set focus to the toplevel so the item loses focus. */
+ toplevel = gtk_widget_get_toplevel (GTK_WIDGET (week_view));
+ if (toplevel && GTK_IS_WINDOW (toplevel))
+ gtk_window_set_focus (GTK_WINDOW (toplevel), NULL);
+}
+
+/* Cancels the current edition by resetting the appointment's text to its original value */
+static void
+cancel_editing (EWeekView *week_view)
+{
+ gint event_num, span_num;
+ EWeekViewEvent *event;
+ EWeekViewEventSpan *span;
+ const gchar *summary;
+
+ event_num = week_view->editing_event_num;
+ span_num = week_view->editing_span_num;
+
+ g_return_if_fail (event_num != -1);
+
+ if (!is_array_index_in_bounds (week_view->events, event_num))
+ return;
+
+ event = &g_array_index (week_view->events, EWeekViewEvent, event_num);
+
+ if (!is_comp_data_valid (event))
+ return;
+
+ if (!is_array_index_in_bounds (week_view->spans, event->spans_index + span_num))
+ return;
+
+ span = &g_array_index (week_view->spans, EWeekViewEventSpan, event->spans_index + span_num);
+
+ /* Reset the text to what was in the component */
+
+ summary = icalcomponent_get_summary (event->comp_data->icalcomp);
+ g_object_set (span->text_item, "text", summary ? summary : "", NULL);
+
+ /* Stop editing */
+ e_week_view_stop_editing_event (week_view);
+}
+
+static gboolean
+e_week_view_on_text_item_event (GnomeCanvasItem *item,
+ GdkEvent *gdk_event,
+ EWeekView *week_view)
+{
+ EWeekViewEvent *event;
+ gint event_num, span_num;
+ gint nevent;
+ EWeekViewEvent *pevent;
+ guint event_button = 0;
+ guint event_keyval = 0;
+ gdouble event_x_root = 0;
+ gdouble event_y_root = 0;
+
+ e_week_view_check_layout (week_view);
+
+ nevent = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (item), "event-num"));
+ pevent = tooltip_get_view_event (week_view, -1, nevent);
+
+ switch (gdk_event->type) {
+ case GDK_KEY_PRESS:
+ tooltip_destroy (week_view, item);
+ gdk_event_get_keyval (gdk_event, &event_keyval);
+
+ if (!E_TEXT (item)->preedit_len && event_keyval == GDK_KEY_Return) {
+ /* We set the keyboard focus to the EDayView, so the
+ * EText item loses it and stops the edit. */
+ gtk_widget_grab_focus (GTK_WIDGET (week_view));
+
+ /* Stop the signal last or we will also stop any
+ * other events getting to the EText item. */
+ g_signal_stop_emission_by_name (item, "event");
+ return TRUE;
+ } else if (event_keyval == GDK_KEY_Escape) {
+ cancel_editing (week_view);
+ g_signal_stop_emission_by_name (item, "event");
+ /* focus should go to week view when stop editing */
+ gtk_widget_grab_focus (GTK_WIDGET (week_view));
+ return TRUE;
+ }
+ break;
+ case GDK_2BUTTON_PRESS:
+ if (!e_week_view_find_event_from_item (week_view, item,
+ &event_num, &span_num))
+ return FALSE;
+
+ if (!is_array_index_in_bounds (week_view->events, event_num))
+ return FALSE;
+
+ event = &g_array_index (week_view->events, EWeekViewEvent,
+ event_num);
+
+ if (!is_comp_data_valid (event))
+ return FALSE;
+
+ /* if we started to editing new item on the canvas, then do not open editing dialog until
it's saved,
+ * because the save of the event recalculates event numbers and you can edit different one */
+ if (event->comp_data->is_new_component)
+ return TRUE;
+
+ e_calendar_view_edit_appointment (
+ E_CALENDAR_VIEW (week_view),
+ event->comp_data->client,
+ event->comp_data->icalcomp, EDIT_EVENT_AUTODETECT);
+
+ g_signal_stop_emission_by_name (item, "event");
+ return TRUE;
+ case GDK_BUTTON_PRESS:
+ tooltip_destroy (week_view, item);
+ if (!e_week_view_find_event_from_item (week_view, item,
+ &event_num, &span_num))
+ return FALSE;
+
+ gdk_event_get_button (gdk_event, &event_button);
+ if (event_button == 3) {
+ EWeekViewEvent *e;
+
+ if (E_TEXT (item)->editing) {
+ e_week_view_stop_editing_event (week_view);
+ gtk_widget_grab_focus (GTK_WIDGET (week_view));
+ return FALSE;
+ }
+
+ if (!is_array_index_in_bounds (week_view->events, event_num))
+ return FALSE;
+
+ e = &g_array_index (week_view->events, EWeekViewEvent, event_num);
+
+ if (!gtk_widget_has_focus (GTK_WIDGET (week_view)))
+ gtk_widget_grab_focus (GTK_WIDGET (week_view));
+
+ e_week_view_set_selected_time_range_visible (week_view, e->start, e->end);
+
+ e_week_view_show_popup_menu (
+ week_view, gdk_event, event_num);
+
+ g_signal_stop_emission_by_name (
+ item->canvas, "button_press_event");
+ return TRUE;
+ }
+
+ if (event_button != 3) {
+ week_view->pressed_event_num = event_num;
+ week_view->pressed_span_num = span_num;
+ }
+
+ /* Only let the EText handle the event while editing. */
+ if (!E_TEXT (item)->editing) {
+ gdouble event_x_win = 0;
+ gdouble event_y_win = 0;
+
+ g_signal_stop_emission_by_name (item, "event");
+
+ gdk_event_get_coords (
+ gdk_event, &event_x_win, &event_y_win);
+
+ week_view->drag_event_x = (gint) event_x_win;
+ week_view->drag_event_y = (gint) event_y_win;
+
+ /* FIXME: Remember the day offset from the start of
+ * the event, for DnD. */
+
+ return TRUE;
+ }
+ break;
+ case GDK_BUTTON_RELEASE:
+ if (!E_TEXT (item)->editing) {
+ /* This shouldn't ever happen. */
+ if (!e_week_view_find_event_from_item (week_view,
+ item,
+ &event_num,
+ &span_num))
+ return FALSE;
+
+ if (week_view->pressed_event_num != -1
+ && week_view->pressed_event_num == event_num
+ && week_view->pressed_span_num == span_num) {
+ e_week_view_start_editing_event (
+ week_view,
+ event_num,
+ span_num,
+ NULL);
+ week_view->pressed_event_num = -1;
+ }
+
+ /* Stop the signal last or we will also stop any
+ * other events getting to the EText item. */
+ g_signal_stop_emission_by_name (item, "event");
+ return TRUE;
+ }
+ week_view->pressed_event_num = -1;
+ break;
+ case GDK_ENTER_NOTIFY:
+ {
+ ECalendarViewEventData *data;
+ gint nspan;
+
+ if (week_view->editing_event_num != -1
+ || !e_week_view_find_event_from_item (week_view, item, &nevent, &nspan))
+ return FALSE;
+
+ g_object_set_data ((GObject *) item, "event-num", GINT_TO_POINTER (nevent));
+
+ pevent = tooltip_get_view_event (week_view, -1, nevent);
+ g_return_val_if_fail (pevent != NULL, FALSE);
+
+ data = g_malloc (sizeof (ECalendarViewEventData));
+
+ gdk_event_get_root_coords (
+ gdk_event, &event_x_root, &event_y_root);
+
+ pevent->x = (gint) event_x_root;
+ pevent->y = (gint) event_y_root;
+ pevent->tooltip = NULL;
+
+ data->cal_view = g_object_ref (week_view);
+ data->day = -1;
+ data->event_num = nevent;
+ data->get_view_event = (ECalendarViewEvent * (*)(ECalendarView *, int, gint))
tooltip_get_view_event;
+ pevent->timeout = e_named_timeout_add_full (
+ G_PRIORITY_DEFAULT, 500,
+ e_week_view_handle_tooltip_timeout,
+ data, e_week_view_destroy_tooltip_timeout_data);
+ g_object_set_data ((GObject *) week_view, "tooltip-timeout", GUINT_TO_POINTER
(pevent->timeout));
+
+ return TRUE;
+ }
+ case GDK_LEAVE_NOTIFY:
+ tooltip_destroy (week_view, item);
+
+ return FALSE;
+ case GDK_MOTION_NOTIFY:
+ g_return_val_if_fail (pevent != NULL, FALSE);
+
+ gdk_event_get_root_coords (
+ gdk_event, &event_x_root, &event_y_root);
+
+ pevent->x = (gint) event_x_root;
+ pevent->y = (gint) event_y_root;
+ pevent->tooltip = (GtkWidget *) g_object_get_data (G_OBJECT (week_view), "tooltip-window");
+
+ if (pevent->tooltip) {
+ e_calendar_view_move_tip (pevent->tooltip, pevent->x + 16, pevent->y + 16);
+ }
+ return TRUE;
+ case GDK_FOCUS_CHANGE:
+ if (gdk_event->focus_change.in) {
+ e_week_view_on_editing_started (week_view, item);
+ } else {
+ e_week_view_on_editing_stopped (week_view, item);
+ }
+
+ return FALSE;
+ default:
+ break;
+ }
+
+ return FALSE;
+}
+
+static gboolean
+e_week_view_event_move (ECalendarView *cal_view,
+ ECalViewMoveDirection direction)
+{
+ EWeekViewEvent *event;
+ gint event_num, adjust_days, current_start_day, current_end_day;
+ time_t start_dt, end_dt;
+ struct icaltimetype start_time,end_time;
+ EWeekView *week_view = E_WEEK_VIEW (cal_view);
+ gboolean is_all_day = FALSE;
+
+ event_num = week_view->editing_event_num;
+ adjust_days = 0;
+
+ /* If no item is being edited, just return. */
+ if (event_num == -1)
+ return FALSE;
+
+ if (!is_array_index_in_bounds (week_view->events, event_num))
+ return FALSE;
+
+ event = &g_array_index (week_view->events, EWeekViewEvent, event_num);
+
+ if (!is_comp_data_valid (event))
+ return FALSE;
+
+ end_dt = event->end;
+ start_time = icalcomponent_get_dtstart (event->comp_data->icalcomp);
+ end_time = icalcomponent_get_dtend (event->comp_data->icalcomp);
+
+ if (start_time.is_date && end_time.is_date)
+ is_all_day = TRUE;
+
+ current_end_day = e_week_view_get_day_offset_of_event (week_view,end_dt);
+
+ switch (direction) {
+ case E_CAL_VIEW_MOVE_UP:
+ adjust_days = e_week_view_get_adjust_days_for_move_up (week_view,current_end_day);
+ break;
+ case E_CAL_VIEW_MOVE_DOWN:
+ adjust_days = e_week_view_get_adjust_days_for_move_down (week_view,current_end_day);
+ break;
+ case E_CAL_VIEW_MOVE_LEFT:
+ adjust_days = e_week_view_get_adjust_days_for_move_left (week_view,current_end_day);
+ break;
+ case E_CAL_VIEW_MOVE_RIGHT:
+ adjust_days = e_week_view_get_adjust_days_for_move_right (week_view,current_end_day);
+ break;
+ default:
+ break;
+ }
+
+ icaltime_adjust (&start_time ,adjust_days,0,0,0);
+ icaltime_adjust (&end_time ,adjust_days,0,0,0);
+ start_dt = icaltime_as_timet_with_zone (
+ start_time,
+ e_calendar_view_get_timezone (E_CALENDAR_VIEW (week_view)));
+ end_dt = icaltime_as_timet_with_zone (
+ end_time,
+ e_calendar_view_get_timezone (E_CALENDAR_VIEW (week_view)));
+
+ current_start_day = e_week_view_get_day_offset_of_event (week_view,start_dt);
+ current_end_day = e_week_view_get_day_offset_of_event (week_view,end_dt);
+ if (is_all_day)
+ current_end_day--;
+
+ if (current_start_day < 0)
+ return TRUE;
+
+ if (current_end_day >= e_week_view_get_weeks_shown (week_view) * 7)
+ return TRUE;
+
+ e_week_view_change_event_time (week_view, start_dt, end_dt, is_all_day);
+
+ return TRUE;
+}
+
+static gint
+e_week_view_get_day_offset_of_event (EWeekView *week_view,
+ time_t event_time)
+{
+ time_t first_day = week_view->day_starts[0];
+
+ if (event_time - first_day < 0)
+ return -1;
+ else
+ return (event_time - first_day) / (24 * 60 * 60);
+}
+
+void
+e_week_view_scroll_a_step (EWeekView *week_view,
+ ECalViewMoveDirection direction)
+{
+ GtkAdjustment *adjustment;
+ GtkRange *range;
+ gdouble step_increment;
+ gdouble page_size;
+ gdouble new_value;
+ gdouble lower;
+ gdouble upper;
+ gdouble value;
+
+ range = GTK_RANGE (week_view->vscrollbar);
+ adjustment = gtk_range_get_adjustment (range);
+
+ step_increment = gtk_adjustment_get_step_increment (adjustment);
+ page_size = gtk_adjustment_get_page_size (adjustment);
+ lower = gtk_adjustment_get_lower (adjustment);
+ upper = gtk_adjustment_get_upper (adjustment);
+ value = gtk_adjustment_get_value (adjustment);
+
+ switch (direction) {
+ case E_CAL_VIEW_MOVE_UP:
+ new_value = value - step_increment;
+ break;
+ case E_CAL_VIEW_MOVE_DOWN:
+ new_value = value + step_increment;
+ break;
+ case E_CAL_VIEW_MOVE_PAGE_UP:
+ new_value = value - page_size;
+ break;
+ case E_CAL_VIEW_MOVE_PAGE_DOWN:
+ new_value = value + page_size;
+ break;
+ default:
+ return;
+ }
+
+ new_value = CLAMP (new_value, lower, upper - page_size);
+ gtk_adjustment_set_value (adjustment, new_value);
+}
+
+static void
+e_week_view_change_event_time (EWeekView *week_view,
+ time_t start_dt,
+ time_t end_dt,
+ gboolean is_all_day)
+{
+ EWeekViewEvent *event;
+ gint event_num;
+ ECalComponent *comp;
+ ECalComponentDateTime date;
+ struct icaltimetype itt;
+ ECalClient *client;
+ ECalObjModType mod = E_CAL_OBJ_MOD_ALL;
+
+ event_num = week_view->editing_event_num;
+
+ /* If no item is being edited, just return. */
+ if (event_num == -1)
+ return;
+
+ if (!is_array_index_in_bounds (week_view->events, event_num))
+ return;
+
+ event = &g_array_index (week_view->events, EWeekViewEvent, event_num);
+
+ if (!is_comp_data_valid (event))
+ return;
+
+ client = event->comp_data->client;
+
+ /* We use a temporary shallow copy of the ico since we don't want to
+ * change the original ico here. Otherwise we would not detect that
+ * the event's time had changed in the "update_event" callback. */
+ comp = e_cal_component_new ();
+ e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp));
+ date.value = &itt;
+ /* FIXME: Should probably keep the timezone of the original start
+ * and end times. */
+ date.tzid = icaltimezone_get_tzid (e_calendar_view_get_timezone (E_CALENDAR_VIEW (week_view)));
+
+ *date.value = icaltime_from_timet_with_zone (start_dt, is_all_day,
+ e_calendar_view_get_timezone (E_CALENDAR_VIEW
(week_view)));
+ cal_comp_set_dtstart_with_oldzone (client, comp, &date);
+ *date.value = icaltime_from_timet_with_zone (end_dt, is_all_day,
+ e_calendar_view_get_timezone (E_CALENDAR_VIEW
(week_view)));
+ cal_comp_set_dtend_with_oldzone (client, comp, &date);
+
+ e_cal_component_commit_sequence (comp);
+
+ if (week_view->last_edited_comp_string != NULL) {
+ g_free (week_view->last_edited_comp_string);
+ week_view->last_edited_comp_string = NULL;
+ }
+
+ week_view->last_edited_comp_string = e_cal_component_get_as_string (comp);
+
+ if (e_cal_component_has_recurrences (comp)) {
+ if (!e_cal_dialogs_recur_component (client, comp, &mod, NULL, FALSE)) {
+ gtk_widget_queue_draw (week_view->main_canvas);
+ goto out;
+ }
+
+ if (mod == E_CAL_OBJ_MOD_THIS) {
+ e_cal_component_set_rdate_list (comp, NULL);
+ e_cal_component_set_rrule_list (comp, NULL);
+ e_cal_component_set_exdate_list (comp, NULL);
+ e_cal_component_set_exrule_list (comp, NULL);
+ }
+ } else if (e_cal_component_is_instance (comp))
+ mod = E_CAL_OBJ_MOD_THIS;
+
+ e_cal_component_commit_sequence (comp);
+
+ e_cal_ops_modify_component (e_calendar_view_get_model (E_CALENDAR_VIEW (week_view)),
+ client, e_cal_component_get_icalcomponent (comp),
+ mod, E_CAL_OPS_SEND_FLAG_ASK | E_CAL_OPS_SEND_FLAG_IS_NEW_COMPONENT);
+
+out:
+ g_object_unref (comp);
+}
+
+static void
+e_week_view_on_editing_started (EWeekView *week_view,
+ GnomeCanvasItem *item)
+{
+ gint event_num = -1, span_num = -1;
+
+ if (!e_week_view_find_event_from_item (week_view, item,
+ &event_num, &span_num))
+ return;
+
+ week_view->editing_event_num = event_num;
+ week_view->editing_span_num = span_num;
+
+ /* We need to reshape long events so the whole width is used while
+ * editing. */
+ if (!e_week_view_is_one_day_event (week_view, event_num)) {
+ e_week_view_reshape_event_span (
+ week_view, event_num, span_num);
+ }
+
+ if (event_num != -1) {
+ EWeekViewEvent *event;
+ EWeekViewEventSpan *span;
+
+ if (is_array_index_in_bounds (week_view->events, event_num)) {
+ event = &g_array_index (week_view->events, EWeekViewEvent, event_num);
+
+ if (is_comp_data_valid (event) &&
+ is_array_index_in_bounds (week_view->spans, event->spans_index + span_num)) {
+ span = &g_array_index (week_view->spans, EWeekViewEventSpan,
+ event->spans_index + span_num);
+
+ gnome_canvas_item_set (
+ span->text_item,
+ "text", icalcomponent_get_summary (event->comp_data->icalcomp),
+ NULL);
+ }
+ }
+ }
+
+ g_signal_emit_by_name (week_view, "selection_changed");
+
+ g_object_notify (G_OBJECT (week_view), "is-editing");
+}
+
+static void
+e_week_view_on_editing_stopped (EWeekView *week_view,
+ GnomeCanvasItem *item)
+{
+ gint event_num, span_num;
+ EWeekViewEvent *event;
+ EWeekViewEventSpan *span;
+ gchar *text = NULL;
+ ECalComponent *comp;
+ ECalComponentText summary;
+ ECalClient *client;
+ const gchar *uid;
+ gboolean on_server;
+
+ /* Note: the item we are passed here isn't reliable, so we just stop
+ * the edit of whatever item was being edited. We also receive this
+ * event twice for some reason. */
+ event_num = week_view->editing_event_num;
+ span_num = week_view->editing_span_num;
+
+ /* If no item is being edited, just return. */
+ if (event_num == -1)
+ return;
+
+ if (!is_array_index_in_bounds (week_view->events, event_num))
+ return;
+
+ event = &g_array_index (week_view->events, EWeekViewEvent, event_num);
+
+ if (!is_comp_data_valid (event))
+ return;
+
+ if (!is_array_index_in_bounds (week_view->spans, event->spans_index + span_num))
+ return;
+
+ span = &g_array_index (week_view->spans, EWeekViewEventSpan,
+ event->spans_index + span_num);
+
+ /* Reset the edit fields. */
+ week_view->editing_event_num = -1;
+
+ /* Check that the event is still valid. */
+ uid = icalcomponent_get_uid (event->comp_data->icalcomp);
+ if (!uid) {
+ g_object_notify (G_OBJECT (week_view), "is-editing");
+ return;
+ }
+
+ text = NULL;
+ g_object_set (span->text_item, "handle_popup", FALSE, NULL);
+ g_object_get (span->text_item, "text", &text, NULL);
+
+ comp = e_cal_component_new ();
+ e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp));
+
+ client = event->comp_data->client;
+ on_server = !event->comp_data->is_new_component;
+
+ if (string_is_empty (text) && !on_server) {
+ e_cal_component_get_uid (comp, &uid);
+ g_signal_handlers_disconnect_by_func (item, e_week_view_on_text_item_event, week_view);
+ e_week_view_foreach_event_with_uid (week_view, uid,
+ e_week_view_remove_event_cb, NULL);
+ week_view->event_destroyed = TRUE;
+ gtk_widget_queue_draw (week_view->main_canvas);
+ e_week_view_check_layout (week_view);
+ goto out;
+ }
+
+ /* Only update the summary if necessary. */
+ e_cal_component_get_summary (comp, &summary);
+ if (summary.value && !strcmp (text, summary.value)) {
+ gboolean free_text = FALSE;
+ const gchar *summary;
+
+ summary = get_comp_summary (event->comp_data->client, event->comp_data->icalcomp, &free_text);
+ g_object_set (span->text_item, "text", summary ? summary : "", NULL);
+
+ if (free_text)
+ g_free ((gchar *) summary);
+
+ if (!e_week_view_is_one_day_event (week_view, event_num))
+ e_week_view_reshape_event_span (week_view, event_num, span_num);
+ } else if (summary.value || !string_is_empty (text)) {
+ icalcomponent *icalcomp = e_cal_component_get_icalcomponent (comp);
+
+ summary.value = text;
+ summary.altrep = NULL;
+ e_cal_component_set_summary (comp, &summary);
+ e_cal_component_commit_sequence (comp);
+
+ if (!on_server) {
+ e_cal_ops_create_component (e_calendar_view_get_model (E_CALENDAR_VIEW (week_view)),
client, icalcomp,
+ e_calendar_view_component_created_cb, g_object_ref (week_view),
g_object_unref);
+
+ /* we remove the object since we either got the update from the server or failed */
+ e_week_view_remove_event_cb (week_view, event_num, NULL);
+ } else {
+ ECalObjModType mod = E_CAL_OBJ_MOD_ALL;
+
+ if (e_cal_component_has_recurrences (comp)) {
+ if (!e_cal_dialogs_recur_component (client, comp, &mod, NULL, FALSE)) {
+ goto out;
+ }
+
+ if (mod == E_CAL_OBJ_MOD_THIS) {
+ ECalComponentDateTime dt;
+ struct icaltimetype tt;
+ gchar *tzid;
+
+ e_cal_component_get_dtstart (comp, &dt);
+ if (dt.value->zone) {
+ tt = icaltime_from_timet_with_zone (
+ event->comp_data->instance_start,
+ dt.value->is_date,
+ dt.value->zone);
+ } else {
+ tt = icaltime_from_timet_with_zone (
+ event->comp_data->instance_start,
+ dt.value->is_date,
+ e_calendar_view_get_timezone (E_CALENDAR_VIEW
(week_view)));
+ }
+ tzid = g_strdup (dt.tzid);
+ e_cal_component_free_datetime (&dt);
+ dt.value = &tt;
+ dt.tzid = tzid;
+ e_cal_component_set_dtstart (comp, &dt);
+ g_free (tzid);
+
+ e_cal_component_get_dtend (comp, &dt);
+ if (dt.value->zone) {
+ tt = icaltime_from_timet_with_zone (
+ event->comp_data->instance_end,
+ dt.value->is_date,
+ dt.value->zone);
+ } else {
+ tt = icaltime_from_timet_with_zone (
+ event->comp_data->instance_end,
+ dt.value->is_date,
+ e_calendar_view_get_timezone (E_CALENDAR_VIEW
(week_view)));
+ }
+ tzid = g_strdup (dt.tzid);
+ e_cal_component_free_datetime (&dt);
+ dt.value = &tt;
+ dt.tzid = tzid;
+ e_cal_component_set_dtend (comp, &dt);
+ g_free (tzid);
+
+ e_cal_component_set_rdate_list (comp, NULL);
+ e_cal_component_set_rrule_list (comp, NULL);
+ e_cal_component_set_exdate_list (comp, NULL);
+ e_cal_component_set_exrule_list (comp, NULL);
+ }
+ } else if (e_cal_component_is_instance (comp))
+ mod = E_CAL_OBJ_MOD_THIS;
+
+ e_cal_component_commit_sequence (comp);
+ e_cal_ops_modify_component (e_calendar_view_get_model (E_CALENDAR_VIEW (week_view)),
+ client, e_cal_component_get_icalcomponent (comp), mod,
E_CAL_OPS_SEND_FLAG_ASK);
+ }
+ }
+
+ out:
+
+ g_free (text);
+ g_object_unref (comp);
+
+ g_signal_emit_by_name (week_view, "selection_changed");
+
+ g_object_notify (G_OBJECT (week_view), "is-editing");
+}
+
+gboolean
+e_week_view_find_event_from_item (EWeekView *week_view,
+ GnomeCanvasItem *item,
+ gint *event_num_return,
+ gint *span_num_return)
+{
+ EWeekViewEvent *event;
+ EWeekViewEventSpan *span;
+ gint event_num, span_num, num_events;
+
+ num_events = week_view->events->len;
+ for (event_num = 0; event_num < num_events; event_num++) {
+ event = &g_array_index (week_view->events, EWeekViewEvent,
+ event_num);
+ for (span_num = 0; span_num < event->num_spans; span_num++) {
+ if (!is_array_index_in_bounds (week_view->spans, event->spans_index + span_num))
+ continue;
+
+ span = &g_array_index (week_view->spans,
+ EWeekViewEventSpan,
+ event->spans_index + span_num);
+ if (span->text_item == item) {
+ *event_num_return = event_num;
+ *span_num_return = span_num;
+ return TRUE;
+ }
+ }
+ }
+
+ return FALSE;
+}
+
+/* Finds the index of the event with the given uid.
+ * Returns TRUE if an event with the uid was found.
+ * Note that for recurring events there may be several EWeekViewEvents, one
+ * for each instance, all with the same iCalObject and uid. So only use this
+ * function if you know the event doesn't recur or you are just checking to
+ * see if any events with the uid exist. */
+static gboolean
+e_week_view_find_event_from_uid (EWeekView *week_view,
+ ECalClient *client,
+ const gchar *uid,
+ const gchar *rid,
+ gint *event_num_return)
+{
+ EWeekViewEvent *event;
+ gint event_num, num_events;
+
+ *event_num_return = -1;
+ if (!uid)
+ return FALSE;
+
+ num_events = week_view->events->len;
+ for (event_num = 0; event_num < num_events; event_num++) {
+ const gchar *u;
+ gchar *r = NULL;
+
+ event = &g_array_index (week_view->events, EWeekViewEvent,
+ event_num);
+
+ if (!is_comp_data_valid (event))
+ continue;
+
+ if (event->comp_data->client != client)
+ continue;
+
+ u = icalcomponent_get_uid (event->comp_data->icalcomp);
+ if (u && !strcmp (uid, u)) {
+ if (rid && *rid) {
+ r = icaltime_as_ical_string_r (icalcomponent_get_recurrenceid
(event->comp_data->icalcomp));
+ if (!r || !*r)
+ continue;
+ if (strcmp (rid, r) != 0) {
+ g_free (r);
+ continue;
+ }
+ g_free (r);
+ }
+
+ *event_num_return = event_num;
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+}
+
+gboolean
+e_week_view_is_one_day_event (EWeekView *week_view,
+ gint event_num)
+{
+ EWeekViewEvent *event;
+ EWeekViewEventSpan *span;
+
+ if (!is_array_index_in_bounds (week_view->events, event_num))
+ return FALSE;
+
+ event = &g_array_index (week_view->events, EWeekViewEvent, event_num);
+ if (event->num_spans != 1)
+ return FALSE;
+
+ if (!is_array_index_in_bounds (week_view->spans, event->spans_index))
+ return FALSE;
+
+ span = &g_array_index (week_view->spans, EWeekViewEventSpan,
+ event->spans_index);
+
+ if (event->start == week_view->day_starts[span->start_day]
+ && event->end == week_view->day_starts[span->start_day + 1])
+ return FALSE;
+
+ if (span->num_days == 1
+ && event->start >= week_view->day_starts[span->start_day]
+ && event->end <= week_view->day_starts[span->start_day + 1])
+ return TRUE;
+
+ return FALSE;
+}
+
+static void
+e_week_view_cursor_key_up (EWeekView *week_view)
+{
+ EWeekViewClass *week_view_class;
+
+ week_view_class = E_WEEK_VIEW_GET_CLASS (week_view);
+ g_return_if_fail (week_view_class->cursor_key_up != NULL);
+
+ week_view_class->cursor_key_up (week_view);
+}
+
+static void
+e_week_view_cursor_key_down (EWeekView *week_view)
+{
+ EWeekViewClass *week_view_class;
+
+ week_view_class = E_WEEK_VIEW_GET_CLASS (week_view);
+ g_return_if_fail (week_view_class->cursor_key_down != NULL);
+
+ week_view_class->cursor_key_down (week_view);
+}
+
+static void
+e_week_view_cursor_key_left (EWeekView *week_view)
+{
+ EWeekViewClass *week_view_class;
+
+ week_view_class = E_WEEK_VIEW_GET_CLASS (week_view);
+ g_return_if_fail (week_view_class->cursor_key_left != NULL);
+
+ week_view_class->cursor_key_left (week_view);
+}
+
+static void
+e_week_view_cursor_key_right (EWeekView *week_view)
+{
+ EWeekViewClass *week_view_class;
+
+ week_view_class = E_WEEK_VIEW_GET_CLASS (week_view);
+ g_return_if_fail (week_view_class->cursor_key_right != NULL);
+
+ week_view_class->cursor_key_right (week_view);
+}
+
+static gboolean
+e_week_view_do_key_press (GtkWidget *widget,
+ GdkEventKey *event)
+{
+ EWeekView *week_view;
+ gchar *initial_text;
+ guint keyval;
+ gboolean stop_emission;
+
+ g_return_val_if_fail (widget != NULL, FALSE);
+ g_return_val_if_fail (E_IS_WEEK_VIEW (widget), FALSE);
+ g_return_val_if_fail (event != NULL, FALSE);
+
+ week_view = E_WEEK_VIEW (widget);
+ keyval = event->keyval;
+
+ /* The Escape key aborts a resize operation. */
+#if 0
+ if (week_view->resize_drag_pos != E_CALENDAR_VIEW_POS_NONE) {
+ if (event->keyval == GDK_KEY_Escape) {
+ e_week_view_abort_resize (week_view, event->time);
+ }
+ return FALSE;
+ }
+#endif
+
+ /* Handle the cursor keys for moving the selection */
+ stop_emission = FALSE;
+ if (!(event->state & GDK_SHIFT_MASK)
+ && !(event->state & GDK_MOD1_MASK)) {
+ stop_emission = TRUE;
+ switch (keyval) {
+ case GDK_KEY_Page_Up:
+ if (!e_week_view_get_multi_week_view (week_view))
+ e_week_view_scroll_a_step (week_view, E_CAL_VIEW_MOVE_UP);
+ else
+ e_week_view_scroll_a_step (week_view, E_CAL_VIEW_MOVE_PAGE_UP);
+ break;
+ case GDK_KEY_Page_Down:
+ if (!e_week_view_get_multi_week_view (week_view))
+ e_week_view_scroll_a_step (week_view, E_CAL_VIEW_MOVE_DOWN);
+ else
+ e_week_view_scroll_a_step (week_view, E_CAL_VIEW_MOVE_PAGE_DOWN);
+ break;
+ case GDK_KEY_Up:
+ e_week_view_cursor_key_up (week_view);
+ break;
+ case GDK_KEY_Down:
+ e_week_view_cursor_key_down (week_view);
+ break;
+ case GDK_KEY_Left:
+ e_week_view_cursor_key_left (week_view);
+ break;
+ case GDK_KEY_Right:
+ e_week_view_cursor_key_right (week_view);
+ break;
+ default:
+ stop_emission = FALSE;
+ break;
+ }
+ }
+ if (stop_emission)
+ return TRUE;
+
+ /*Navigation through days with arrow keys*/
+ if (((event->state & GDK_SHIFT_MASK) != GDK_SHIFT_MASK)
+ &&((event->state & GDK_CONTROL_MASK) != GDK_CONTROL_MASK)
+ &&((event->state & GDK_MOD1_MASK) == GDK_MOD1_MASK)) {
+ if (keyval == GDK_KEY_Up || keyval == GDK_KEY_KP_Up)
+ return e_week_view_event_move ((ECalendarView *) week_view, E_CAL_VIEW_MOVE_UP);
+ else if (keyval == GDK_KEY_Down || keyval == GDK_KEY_KP_Down)
+ return e_week_view_event_move ((ECalendarView *) week_view, E_CAL_VIEW_MOVE_DOWN);
+ else if (keyval == GDK_KEY_Left || keyval == GDK_KEY_KP_Left)
+ return e_week_view_event_move ((ECalendarView *) week_view, E_CAL_VIEW_MOVE_LEFT);
+ else if (keyval == GDK_KEY_Right || keyval == GDK_KEY_KP_Right)
+ return e_week_view_event_move ((ECalendarView *) week_view, E_CAL_VIEW_MOVE_RIGHT);
+ }
+
+ if (week_view->selection_start_day == -1)
+ return FALSE;
+
+ /* We only want to start an edit with a return key or a simple
+ * character. */
+ if (event->keyval == GDK_KEY_Return) {
+ initial_text = NULL;
+ } else if (((event->keyval >= 0x20) && (event->keyval <= 0xFF)
+ && (event->state & (GDK_CONTROL_MASK | GDK_MOD1_MASK)))
+ || (event->length == 0)
+ || (event->keyval == GDK_KEY_Tab)) {
+ return FALSE;
+ } else
+ initial_text = e_utf8_from_gtk_event_key (widget, event->keyval, event->string);
+
+ e_week_view_add_new_event_in_selected_range (week_view, initial_text, FALSE);
+
+ if (initial_text)
+ g_free (initial_text);
+
+ return TRUE;
+}
+
+static gint
+e_week_view_get_adjust_days_for_move_up (EWeekView *week_view,
+ gint current_day)
+{
+ return e_week_view_get_multi_week_view (week_view) ? -7 : 0;
+}
+
+static gint
+e_week_view_get_adjust_days_for_move_down (EWeekView *week_view,
+ gint current_day)
+{
+ return e_week_view_get_multi_week_view (week_view) ? 7 : 0;
+}
+
+static gint
+e_week_view_get_adjust_days_for_move_left (EWeekView *week_view,
+ gint current_day)
+{
+ return -1;
+}
+
+static gint
+e_week_view_get_adjust_days_for_move_right (EWeekView *week_view,
+ gint current_day)
+{
+ return 1;
+}
+
+void
+e_week_view_show_popup_menu (EWeekView *week_view,
+ GdkEvent *button_event,
+ gint event_num)
+{
+ guint timeout;
+
+ timeout = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (week_view), "tooltip-timeout"));
+ if (timeout) {
+ g_source_remove (timeout);
+ g_object_set_data (G_OBJECT (week_view), "tooltip-timeout", NULL);
+ }
+
+ week_view->popup_event_num = event_num;
+
+ e_calendar_view_popup_event (E_CALENDAR_VIEW (week_view), button_event);
+}
+
+void
+e_week_view_jump_to_button_item (EWeekView *week_view,
+ GnomeCanvasItem *item)
+{
+ gint day;
+
+ for (day = 0; day < E_WEEK_VIEW_MAX_WEEKS * 7; ++day) {
+ if (item == week_view->jump_buttons[day]) {
+ e_calendar_view_move_view_range (E_CALENDAR_VIEW (week_view),
E_CALENDAR_VIEW_MOVE_TO_EXACT_DAY, week_view->day_starts[day]);
+ return;
+ }
+ }
+}
+
+static gboolean
+e_week_view_on_jump_button_event (GnomeCanvasItem *item,
+ GdkEvent *event,
+ EWeekView *week_view)
+{
+ gint day;
+
+ if (event->type == GDK_BUTTON_PRESS) {
+ e_week_view_jump_to_button_item (week_view, item);
+ return TRUE;
+ }
+ else if (event->type == GDK_KEY_PRESS) {
+ /* return, if Tab, Control or Alt is pressed */
+ if ((event->key.keyval == GDK_KEY_Tab) ||
+ (event->key.state & (GDK_CONTROL_MASK | GDK_MOD1_MASK)))
+ return FALSE;
+ /* with a return key or a simple character (from 0x20 to 0xff),
+ * jump to the day
+ */
+ if ((event->key.keyval == GDK_KEY_Return) ||
+ ((event->key.keyval >= 0x20) &&
+ (event->key.keyval <= 0xFF))) {
+ e_week_view_jump_to_button_item (week_view, item);
+ return TRUE;
+ }
+ }
+ else if (event->type == GDK_FOCUS_CHANGE) {
+ GdkEventFocus *focus_event = (GdkEventFocus *) event;
+ GdkPixbuf *pixbuf = NULL;
+
+ for (day = 0; day < E_WEEK_VIEW_MAX_WEEKS * 7; day++) {
+ if (item == week_view->jump_buttons[day])
+ break;
+ }
+
+ if (day >= E_WEEK_VIEW_MAX_WEEKS * 7) {
+ g_warn_if_reached ();
+ return FALSE;
+ }
+
+ if (focus_event->in) {
+ week_view->focused_jump_button = day;
+ pixbuf = gdk_pixbuf_new_from_xpm_data ((const gchar **) jump_xpm_focused);
+ gnome_canvas_item_set (
+ week_view->jump_buttons[day],
+ "GnomeCanvasPixbuf::pixbuf",
+ pixbuf, NULL);
+ }
+ else {
+ week_view->focused_jump_button = E_WEEK_VIEW_JUMP_BUTTON_NO_FOCUS;
+ pixbuf = gdk_pixbuf_new_from_xpm_data ((const gchar **) jump_xpm);
+ gnome_canvas_item_set (
+ week_view->jump_buttons[day],
+ "GnomeCanvasPixbuf::pixbuf",
+ pixbuf, NULL);
+ }
+ if (pixbuf)
+ g_object_unref (pixbuf);
+ }
+
+ return FALSE;
+}
+
+/* Converts an hour from 0-23 to the preferred time format, and returns the
+ * suffix to add and the width of it in the normal font. */
+void
+e_week_view_convert_time_to_display (EWeekView *week_view,
+ gint hour,
+ gint *display_hour,
+ const gchar **suffix,
+ gint *suffix_width)
+{
+ ECalModel *model;
+
+ model = e_calendar_view_get_model (E_CALENDAR_VIEW (week_view));
+
+ /* Calculate the actual hour number to display. For 12-hour
+ * format we convert 0-23 to 12-11am/12-11pm. */
+ *display_hour = hour;
+ if (e_cal_model_get_use_24_hour_format (model)) {
+ *suffix = "";
+ *suffix_width = 0;
+ } else {
+ if (hour < 12) {
+ *suffix = week_view->am_string;
+ *suffix_width = week_view->am_string_width;
+ } else {
+ *display_hour -= 12;
+ *suffix = week_view->pm_string;
+ *suffix_width = week_view->pm_string_width;
+ }
+
+ /* 12-hour uses 12:00 rather than 0:00. */
+ if (*display_hour == 0)
+ *display_hour = 12;
+ }
+}
+
+gint
+e_week_view_get_time_string_width (EWeekView *week_view)
+{
+ ECalModel *model;
+ gint time_width;
+
+ model = e_calendar_view_get_model (E_CALENDAR_VIEW (week_view));
+
+ if (week_view->use_small_font && week_view->small_font_desc)
+ time_width = week_view->digit_width * 2
+ + week_view->small_digit_width * 2;
+ else
+ time_width = week_view->digit_width * 4
+ + week_view->colon_width;
+
+ if (!e_cal_model_get_use_24_hour_format (model))
+ time_width += MAX (week_view->am_string_width,
+ week_view->pm_string_width);
+
+ return time_width;
+}
+
+/* Queues a layout, unless one is already queued. */
+static void
+e_week_view_queue_layout (EWeekView *week_view)
+{
+ if (week_view->layout_timeout_id == 0) {
+ week_view->layout_timeout_id = e_named_timeout_add (
+ E_WEEK_VIEW_LAYOUT_TIMEOUT,
+ e_week_view_layout_timeout_cb, week_view);
+ }
+}
+
+/* Removes any queued layout. */
+static void
+e_week_view_cancel_layout (EWeekView *week_view)
+{
+ if (week_view->layout_timeout_id != 0) {
+ g_source_remove (week_view->layout_timeout_id);
+ week_view->layout_timeout_id = 0;
+ }
+}
+
+static gboolean
+e_week_view_layout_timeout_cb (gpointer data)
+{
+ EWeekView *week_view = E_WEEK_VIEW (data);
+
+ gtk_widget_queue_draw (week_view->main_canvas);
+ e_week_view_check_layout (week_view);
+
+ week_view->layout_timeout_id = 0;
+ return FALSE;
+}
+
+/* Returns the number of selected events (0 or 1 at present). */
+gint
+e_week_view_get_num_events_selected (EWeekView *week_view)
+{
+ g_return_val_if_fail (E_IS_WEEK_VIEW (week_view), 0);
+
+ return (week_view->editing_event_num != -1) ? 1 : 0;
+}
+
+gboolean
+e_week_view_is_jump_button_visible (EWeekView *week_view,
+ gint day)
+{
+ g_return_val_if_fail (E_IS_WEEK_VIEW (week_view), FALSE);
+
+ if ((day >= 0) && (day < E_WEEK_VIEW_MAX_WEEKS * 7))
+ return week_view->jump_buttons[day]->flags & GNOME_CANVAS_ITEM_VISIBLE;
+ return FALSE;
+}
+
+gboolean
+e_week_view_is_editing (EWeekView *week_view)
+{
+ g_return_val_if_fail (E_IS_WEEK_VIEW (week_view), FALSE);
+
+ return week_view->editing_event_num != -1;
+}
diff --git a/calendar/gui/e-week-view.h b/src/calendar/gui/e-week-view.h
similarity index 100%
rename from calendar/gui/e-week-view.h
rename to src/calendar/gui/e-week-view.h
diff --git a/calendar/gui/e-weekday-chooser.c b/src/calendar/gui/e-weekday-chooser.c
similarity index 100%
rename from calendar/gui/e-weekday-chooser.c
rename to src/calendar/gui/e-weekday-chooser.c
diff --git a/calendar/gui/e-weekday-chooser.h b/src/calendar/gui/e-weekday-chooser.h
similarity index 100%
rename from calendar/gui/e-weekday-chooser.h
rename to src/calendar/gui/e-weekday-chooser.h
diff --git a/calendar/gui/ea-cal-view-event.c b/src/calendar/gui/ea-cal-view-event.c
similarity index 100%
rename from calendar/gui/ea-cal-view-event.c
rename to src/calendar/gui/ea-cal-view-event.c
diff --git a/calendar/gui/ea-cal-view-event.h b/src/calendar/gui/ea-cal-view-event.h
similarity index 100%
rename from calendar/gui/ea-cal-view-event.h
rename to src/calendar/gui/ea-cal-view-event.h
diff --git a/calendar/gui/ea-cal-view.c b/src/calendar/gui/ea-cal-view.c
similarity index 100%
rename from calendar/gui/ea-cal-view.c
rename to src/calendar/gui/ea-cal-view.c
diff --git a/calendar/gui/ea-cal-view.h b/src/calendar/gui/ea-cal-view.h
similarity index 100%
rename from calendar/gui/ea-cal-view.h
rename to src/calendar/gui/ea-cal-view.h
diff --git a/calendar/gui/ea-calendar-helpers.c b/src/calendar/gui/ea-calendar-helpers.c
similarity index 100%
rename from calendar/gui/ea-calendar-helpers.c
rename to src/calendar/gui/ea-calendar-helpers.c
diff --git a/calendar/gui/ea-calendar-helpers.h b/src/calendar/gui/ea-calendar-helpers.h
similarity index 100%
rename from calendar/gui/ea-calendar-helpers.h
rename to src/calendar/gui/ea-calendar-helpers.h
diff --git a/calendar/gui/ea-calendar.c b/src/calendar/gui/ea-calendar.c
similarity index 100%
rename from calendar/gui/ea-calendar.c
rename to src/calendar/gui/ea-calendar.c
diff --git a/calendar/gui/ea-calendar.h b/src/calendar/gui/ea-calendar.h
similarity index 100%
rename from calendar/gui/ea-calendar.h
rename to src/calendar/gui/ea-calendar.h
diff --git a/calendar/gui/ea-day-view-cell.c b/src/calendar/gui/ea-day-view-cell.c
similarity index 100%
rename from calendar/gui/ea-day-view-cell.c
rename to src/calendar/gui/ea-day-view-cell.c
diff --git a/calendar/gui/ea-day-view-cell.h b/src/calendar/gui/ea-day-view-cell.h
similarity index 100%
rename from calendar/gui/ea-day-view-cell.h
rename to src/calendar/gui/ea-day-view-cell.h
diff --git a/calendar/gui/ea-day-view-main-item.c b/src/calendar/gui/ea-day-view-main-item.c
similarity index 100%
rename from calendar/gui/ea-day-view-main-item.c
rename to src/calendar/gui/ea-day-view-main-item.c
diff --git a/calendar/gui/ea-day-view-main-item.h b/src/calendar/gui/ea-day-view-main-item.h
similarity index 100%
rename from calendar/gui/ea-day-view-main-item.h
rename to src/calendar/gui/ea-day-view-main-item.h
diff --git a/calendar/gui/ea-day-view.c b/src/calendar/gui/ea-day-view.c
similarity index 100%
rename from calendar/gui/ea-day-view.c
rename to src/calendar/gui/ea-day-view.c
diff --git a/calendar/gui/ea-day-view.h b/src/calendar/gui/ea-day-view.h
similarity index 100%
rename from calendar/gui/ea-day-view.h
rename to src/calendar/gui/ea-day-view.h
diff --git a/calendar/gui/ea-jump-button.c b/src/calendar/gui/ea-jump-button.c
similarity index 100%
rename from calendar/gui/ea-jump-button.c
rename to src/calendar/gui/ea-jump-button.c
diff --git a/calendar/gui/ea-jump-button.h b/src/calendar/gui/ea-jump-button.h
similarity index 100%
rename from calendar/gui/ea-jump-button.h
rename to src/calendar/gui/ea-jump-button.h
diff --git a/calendar/gui/ea-week-view-cell.c b/src/calendar/gui/ea-week-view-cell.c
similarity index 100%
rename from calendar/gui/ea-week-view-cell.c
rename to src/calendar/gui/ea-week-view-cell.c
diff --git a/calendar/gui/ea-week-view-cell.h b/src/calendar/gui/ea-week-view-cell.h
similarity index 100%
rename from calendar/gui/ea-week-view-cell.h
rename to src/calendar/gui/ea-week-view-cell.h
diff --git a/calendar/gui/ea-week-view-main-item.c b/src/calendar/gui/ea-week-view-main-item.c
similarity index 100%
rename from calendar/gui/ea-week-view-main-item.c
rename to src/calendar/gui/ea-week-view-main-item.c
diff --git a/calendar/gui/ea-week-view-main-item.h b/src/calendar/gui/ea-week-view-main-item.h
similarity index 100%
rename from calendar/gui/ea-week-view-main-item.h
rename to src/calendar/gui/ea-week-view-main-item.h
diff --git a/calendar/gui/ea-week-view.c b/src/calendar/gui/ea-week-view.c
similarity index 100%
rename from calendar/gui/ea-week-view.c
rename to src/calendar/gui/ea-week-view.c
diff --git a/calendar/gui/ea-week-view.h b/src/calendar/gui/ea-week-view.h
similarity index 100%
rename from calendar/gui/ea-week-view.h
rename to src/calendar/gui/ea-week-view.h
diff --git a/calendar/gui/itip-utils.c b/src/calendar/gui/itip-utils.c
similarity index 100%
rename from calendar/gui/itip-utils.c
rename to src/calendar/gui/itip-utils.c
diff --git a/calendar/gui/itip-utils.h b/src/calendar/gui/itip-utils.h
similarity index 100%
rename from calendar/gui/itip-utils.h
rename to src/calendar/gui/itip-utils.h
diff --git a/calendar/gui/memotypes.xml.in b/src/calendar/gui/memotypes.xml.in
similarity index 100%
rename from calendar/gui/memotypes.xml.in
rename to src/calendar/gui/memotypes.xml.in
diff --git a/calendar/gui/misc.c b/src/calendar/gui/misc.c
similarity index 100%
rename from calendar/gui/misc.c
rename to src/calendar/gui/misc.c
diff --git a/calendar/gui/misc.h b/src/calendar/gui/misc.h
similarity index 100%
rename from calendar/gui/misc.h
rename to src/calendar/gui/misc.h
diff --git a/src/calendar/gui/print.c b/src/calendar/gui/print.c
new file mode 100644
index 0000000..ba2bddd
--- /dev/null
+++ b/src/calendar/gui/print.c
@@ -0,0 +1,3860 @@
+/*
+ * Evolution calendar - Print support
+ *
+ * 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.
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ * Authors:
+ * Michael Zucchi <notzed ximian com>
+ * Federico Mena-Quintero <federico ximian com>
+ * Damon Chaplin <damon ximian com>
+ *
+ * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
+ *
+ */
+
+#include "evolution-config.h"
+
+#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-cal-model.h"
+#include "e-day-view.h"
+#include "e-day-view-layout.h"
+#include "e-week-view.h"
+#include "e-week-view-layout.h"
+#include "e-task-table.h"
+
+#include "data/xpm/jump.xpm"
+
+typedef struct PrintCompItem PrintCompItem;
+typedef struct PrintCalItem PrintCalItem;
+
+struct PrintCompItem {
+ ECalClient *client;
+ ECalComponent *comp;
+ icaltimezone *zone;
+ gboolean use_24_hour_format;
+};
+
+struct PrintCalItem {
+ ECalendarView *cal_view;
+ ETable *tasks_table;
+ EPrintView print_view_type;
+ time_t start;
+};
+
+static gdouble
+evo_calendar_print_renderer_get_width (GtkPrintContext *context,
+ PangoFontDescription *font,
+ const gchar *text)
+{
+ PangoLayout *layout;
+ gint layout_width, layout_height;
+
+ layout = gtk_print_context_create_pango_layout (context);
+
+ pango_layout_set_font_description (layout, font);
+ pango_layout_set_text (layout, text, -1);
+ pango_layout_set_indent (layout, 0);
+ pango_layout_get_size (layout, &layout_width, &layout_height);
+
+ g_object_unref (layout);
+
+ return pango_units_to_double (layout_width);
+}
+
+static gdouble
+evo_calendar_print_renderer_get_height (GtkPrintContext *context,
+ PangoFontDescription *font,
+ const gchar *text)
+{
+ PangoLayout *layout;
+ gint layout_width, layout_height;
+
+ layout = gtk_print_context_create_pango_layout (context);
+
+ pango_layout_set_font_description (layout, font);
+ pango_layout_set_text (layout, text, -1);
+ pango_layout_set_indent (layout, 0);
+ pango_layout_get_size (layout, &layout_width, &layout_height);
+
+ g_object_unref (layout);
+
+ return pango_units_to_double (layout_height);
+}
+
+static gdouble
+get_font_size (PangoFontDescription *font)
+{
+ g_return_val_if_fail (font, 0.0);
+
+ return pango_units_to_double (pango_font_description_get_size (font));
+}
+
+static gint
+get_day_view_time_divisions (void)
+{
+ GSettings *settings;
+ gint time_divisions;
+
+ settings = e_util_ref_settings ("org.gnome.evolution.calendar");
+
+ time_divisions = g_settings_get_int (settings, "time-divisions");
+ if (time_divisions < 5 || time_divisions > 30)
+ time_divisions = 30;
+
+ g_object_unref (settings);
+
+ return time_divisions;
+}
+
+/*
+ * Note that most dimensions are in points (1/72 of an inch) since that is
+ * what gnome-print uses.
+ */
+
+/* GtkHTML prints using a fixed margin. It has code to get the margins from
+ * gnome-print keys, but it's commented out. The corresponding code here
+ * doesn't seem to work either (getting zero margins), so we adopt
+ * gtkhtml's cheat. */
+
+#define TEMP_MARGIN .05
+
+/* The fonts to use */
+#define FONT_FAMILY "Sans"
+
+/* The font size to use for normal text. */
+#define DAY_NORMAL_FONT_SIZE 12
+#define WEEK_NORMAL_FONT_SIZE 12
+#define MONTH_NORMAL_FONT_SIZE 8
+#define WEEK_EVENT_FONT_SIZE 9
+#define WEEK_SMALL_FONT_SIZE 8
+
+/* The height of the header bar across the top of the Day, Week & Month views,
+ * which contains the dates shown and the 2 small calendar months. */
+#define HEADER_HEIGHT 80
+
+/* The width of the small calendar months, the space from the right edge of
+ * the header rectangle, and the space between the months. */
+#define MIN_SMALL_MONTH_WIDTH 120
+#define SMALL_MONTH_PAD 5
+#define SMALL_MONTH_SPACING 20
+
+/* The minimum number of rows we leave space for for the long events in the
+ * day view. */
+#define DAY_VIEW_MIN_ROWS_IN_TOP_DISPLAY 2
+
+/* The row height for long events in the day view. */
+#define DAY_VIEW_ROW_HEIGHT 14
+
+#define CALC_DAY_VIEW_ROWS(divis) ((60 / divis) * 24)
+
+/* The width of the column with all the times in it. */
+#define DAY_VIEW_TIME_COLUMN_WIDTH 36
+
+/* The space on the right of each event. */
+#define DAY_VIEW_EVENT_X_PAD 8
+
+/* Allowance for small errors in floating point comparisons. */
+#define EPSILON 0.01
+
+/* The weird month of September 1752, where 3 Sep through 13 Sep were
+ * eliminated due to the Gregorian reformation. */
+static const gint sept_1752[42] = {
+ 0, 0, 1, 2, 14, 15, 16,
+ 17, 18, 19, 20, 21, 22, 23,
+ 24, 25, 26, 27, 28, 29, 30,
+ 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0
+};
+#define SEPT_1752_START 2 /* Start day within month */
+#define SEPT_1752_END 20 /* End day within month */
+
+struct pdinfo
+{
+ gint days_shown;
+ time_t day_starts[E_DAY_VIEW_MAX_DAYS + 1];
+
+ GArray *long_events;
+ GArray *events[E_DAY_VIEW_MAX_DAYS];
+
+ gint start_hour;
+ gint end_hour;
+ gint start_minute_offset;
+ gint end_minute_offset;
+ gint rows;
+ gint mins_per_row;
+ guint8 cols_per_row[CALC_DAY_VIEW_ROWS (1)];
+ gboolean use_24_hour_format;
+ icaltimezone *zone;
+};
+
+struct psinfo {
+ gint days_shown;
+ time_t day_starts[E_WEEK_VIEW_MAX_WEEKS * 7 + 1];
+
+ GArray *events;
+
+ gint rows_per_cell;
+ gint rows_per_compressed_cell;
+ GDateWeekday display_start_weekday;
+ gboolean multi_week_view;
+ gint weeks_shown;
+ gint month;
+ gboolean compress_weekend;
+ gboolean use_24_hour_format;
+ gdouble row_height;
+ gdouble header_row_height;
+ icaltimezone *zone;
+};
+
+/* Convenience function to help the transition to timezone functions.
+ * It converts a time_t to a struct tm. */
+static void
+convert_timet_to_struct_tm (time_t time,
+ icaltimezone *zone,
+ struct tm *tm)
+{
+ struct icaltimetype tt;
+
+ /* Convert it to an icaltimetype. */
+ tt = icaltime_from_timet_with_zone (time, FALSE, zone);
+
+ /* Fill in the struct tm. */
+ tm->tm_year = tt.year - 1900;
+ tm->tm_mon = tt.month - 1;
+ tm->tm_mday = tt.day;
+ tm->tm_hour = tt.hour;
+ tm->tm_min = tt.minute;
+ tm->tm_sec = tt.second;
+ tm->tm_isdst = tt.is_daylight;
+
+ tm->tm_wday = time_day_of_week (tt.day, tt.month - 1, tt.year);
+}
+
+/* Fills the 42-element days array with the day numbers for the specified
+ * month. Slots outside the bounds of the month are filled with zeros.
+ * The starting and ending indexes of the days are returned in the start
+ * and end arguments. */
+static void
+build_month (ECalModel *model,
+ gint month,
+ gint year,
+ gint *days,
+ gint *start,
+ gint *end)
+{
+ gint i;
+ gint d_month;
+ gint d_week;
+ GDateWeekday weekday;
+ GDateWeekday week_start_day;
+
+ /* Note that months are zero-based, so September is month 8 */
+
+ if ((year == 1752) && (month == 8)) {
+ memcpy (days, sept_1752, 42 * sizeof (gint));
+
+ if (start)
+ *start = SEPT_1752_START;
+
+ if (end)
+ *end = SEPT_1752_END;
+
+ return;
+ }
+
+ for (i = 0; i < 42; i++)
+ days[i] = 0;
+
+ d_month = time_days_in_month (year, month);
+ /* Get the start weekday in the month, 0=Sun to 6=Sat. */
+ d_week = time_day_of_week (1, month, year);
+
+ /* Get the configuration setting specifying which weekday we put on
+ * the left column. */
+ week_start_day = e_cal_model_get_week_start_day (model);
+
+ weekday = e_weekday_from_tm_wday (d_week);
+
+ /* Figure out which square we want to put the 1 in. */
+ weekday = (weekday + 7 - week_start_day) % 7;
+
+ for (i = 0; i < d_month; i++)
+ days[weekday + i] = i + 1;
+
+ if (start)
+ *start = e_weekday_get_days_between (week_start_day, weekday);
+
+ if (end)
+ *end = d_week + d_month - 1;
+}
+
+static PangoFontDescription *
+get_font_for_size (gdouble height,
+ PangoWeight weight)
+{
+ PangoFontDescription *desc;
+ gint size;
+
+ #define MAGIC_SCALE_FACTOR (0.86)
+ size = pango_units_from_double (height * MAGIC_SCALE_FACTOR);
+
+ desc = pango_font_description_new ();
+ pango_font_description_set_size (desc, size);
+ pango_font_description_set_weight (desc, weight);
+ pango_font_description_set_family_static (desc, FONT_FAMILY);
+
+ return desc;
+}
+
+/* Prints a rectangle, with or without a border, filled or outline, and
+ * possibly with triangular arrows at one or both horizontal edges.
+ * width = width of border, -ve means no border.
+ * red,green,blue = bgcolor to fill, -ve means no fill.
+ * left_triangle_width, right_triangle_width = width from edge of rectangle to
+ * point of triangle, or -ve for no triangle. */
+static void
+print_border_with_triangles (GtkPrintContext *pc,
+ gdouble x1,
+ gdouble x2,
+ gdouble y1,
+ gdouble y2,
+ gdouble line_width,
+ GdkRGBA bg_rgba,
+ gdouble left_triangle_width,
+ gdouble right_triangle_width)
+{
+ cairo_t *cr = gtk_print_context_get_cairo_context (pc);
+
+ cairo_save (cr);
+
+ /* Fill in the interior of the rectangle, if desired. */
+ if (bg_rgba.red >= -EPSILON && bg_rgba.green >= -EPSILON && bg_rgba.blue >= -EPSILON) {
+
+ cairo_move_to (cr, x1, y1);
+
+ if (left_triangle_width > 0.0)
+ cairo_line_to (
+ cr, x1 - left_triangle_width,
+ (y1 + y2) / 2);
+
+ cairo_line_to (cr, x1, y2);
+ cairo_line_to (cr, x2, y2);
+
+ if (right_triangle_width > 0.0)
+ cairo_line_to (cr, x2 + right_triangle_width, (y1 + y2) / 2);
+
+ cairo_line_to (cr, x2, y1);
+ cairo_close_path (cr);
+ gdk_cairo_set_source_rgba (cr, &bg_rgba);
+ cairo_fill (cr);
+ cairo_restore (cr);
+ cairo_save (cr);
+ }
+
+ /* Draw the outline, if desired. */
+ if (line_width >= EPSILON) {
+
+ cr = gtk_print_context_get_cairo_context (pc);
+ cairo_move_to (cr, x1, y1);
+
+ if (left_triangle_width > 0.0)
+ cairo_line_to (
+ cr, x1 - left_triangle_width,
+ (y1 + y2) / 2);
+
+ cairo_line_to (cr, x1, y2);
+ cairo_line_to (cr, x2, y2);
+
+ if (right_triangle_width > 0.0)
+ cairo_line_to (
+ cr, x2 + right_triangle_width,
+ (y1 + y2) / 2);
+
+ cairo_line_to (cr, x2, y1);
+ cairo_close_path (cr);
+ cairo_set_source_rgb (cr, 0, 0, 0);
+ cairo_set_line_width (cr, line_width);
+ cairo_stroke (cr);
+ }
+
+ cairo_restore (cr);
+}
+
+/* Prints a rectangle, with or without a border, and filled or outline.
+ * width = width of border, -ve means no border.
+ * fillcolor = shade of fill, -ve means no fill. */
+static void
+print_border_rgb (GtkPrintContext *pc,
+ gdouble x1,
+ gdouble x2,
+ gdouble y1,
+ gdouble y2,
+ gdouble line_width,
+ GdkRGBA bg_rgba)
+{
+ print_border_with_triangles (
+ pc, x1, x2, y1, y2, line_width,
+ bg_rgba, -1.0, -1.0);
+}
+
+static void
+print_border (GtkPrintContext *pc,
+ gdouble x1,
+ gdouble x2,
+ gdouble y1,
+ gdouble y2,
+ gdouble line_width,
+ gdouble fillcolor)
+{
+ GdkRGBA bg_rgba;
+
+ bg_rgba.red = fillcolor;
+ bg_rgba.green = fillcolor;
+ bg_rgba.blue = fillcolor;
+ bg_rgba.alpha = 1.0;
+
+ print_border_rgb (pc, x1, x2, y1, y2, line_width, bg_rgba);
+}
+
+static void
+print_rectangle (GtkPrintContext *context,
+ gdouble x,
+ gdouble y,
+ gdouble width,
+ gdouble height,
+ GdkRGBA bg_rgba)
+{
+ cairo_t *cr = gtk_print_context_get_cairo_context (context);
+
+ cairo_save (cr);
+
+ cairo_rectangle (cr, x, y, width, height);
+ gdk_cairo_set_source_rgba (cr, &bg_rgba);
+ cairo_fill (cr);
+
+ cairo_restore (cr);
+}
+
+/* Recreate the layout by shrinking the text string if we have a line that's
+ * too high.
+ */
+static PangoLayout *
+shrink_text_to_line (PangoLayout *layout,
+ gint layout_width,
+ gint layout_height,
+ GtkPrintContext *context,
+ PangoFontDescription *desc,
+ const gchar *text,
+ PangoAlignment alignment,
+ gdouble x1,
+ gdouble x2,
+ gdouble y1,
+ gdouble y2)
+{
+ gint new_length;
+
+ if (layout_width == 0 || x2 - x1 < EPSILON)
+ return layout; /* Do nothing */
+
+ new_length = (gint) floor (pango_units_from_double (x2 - x1) /
+ (gdouble) layout_width * (gdouble) strlen (text));
+
+ if (new_length < strlen (text)) {
+ g_object_unref (layout); /* Destroy old layout */
+ layout = gtk_print_context_create_pango_layout (context);
+
+ pango_layout_set_font_description (layout, desc);
+ pango_layout_set_alignment (layout, alignment);
+ pango_layout_set_text (layout, text, new_length);
+ }
+
+ return layout;
+}
+
+/* Prints 1 line of aligned text in a box. It is centered vertically, and
+ * the horizontal alignment can be either PANGO_ALIGN_LEFT, PANGO_ALIGN_RIGHT,
+ * or PANGO_ALIGN_CENTER. Text is truncated if too long for cell. */
+static gdouble
+print_text_line (GtkPrintContext *context,
+ PangoFontDescription *desc,
+ const gchar *text,
+ PangoAlignment alignment,
+ gdouble x1,
+ gdouble x2,
+ gdouble y1,
+ gdouble y2,
+ gboolean shrink)
+{
+ PangoLayout *layout;
+ gint layout_width, layout_height;
+ cairo_t *cr;
+
+ cr = gtk_print_context_get_cairo_context (context);
+ layout = gtk_print_context_create_pango_layout (context);
+
+ pango_layout_set_font_description (layout, desc);
+ pango_layout_set_alignment (layout, alignment);
+ pango_layout_set_text (layout, text, -1);
+
+ /* Grab the width before expanding the layout. */
+ pango_layout_get_size (layout, &layout_width, &layout_height);
+
+ if (shrink && layout_width > pango_units_from_double (x2 - x1)) /* Too wide */
+ layout = shrink_text_to_line (
+ layout, layout_width, layout_height,
+ context, desc, text, alignment,
+ x1, x2, y1, y2);
+
+ pango_layout_set_width (layout, pango_units_from_double (x2 - x1));
+
+ cairo_save (cr);
+
+ /* Set a clipping rectangle. */
+ cairo_move_to (cr, x1, y1);
+ cairo_rectangle (cr, x1, y1, x2 - x1, y2 - y1);
+ cairo_clip (cr);
+
+ cairo_new_path (cr);
+ cairo_set_source_rgb (cr, 0, 0, 0);
+
+ cairo_move_to (cr, x1, y1);
+ pango_cairo_show_layout (cr, layout);
+
+ cairo_stroke (cr);
+
+ cairo_restore (cr);
+
+ g_object_unref (layout);
+
+ return pango_units_to_double (layout_width);
+}
+
+/* Prints 1 or more lines of aligned text in a box. It is centered vertically, and
+ * the horizontal alignment can be either PANGO_ALIGN_LEFT, PANGO_ALIGN_RIGHT,
+ * or PANGO_ALIGN_CENTER. */
+static double
+print_text (GtkPrintContext *context,
+ PangoFontDescription *desc,
+ const gchar *text,
+ PangoAlignment alignment,
+ gdouble x1,
+ gdouble x2,
+ gdouble y1,
+ gdouble y2)
+{
+ return print_text_line (
+ context, desc,
+ text, alignment,
+ x1, x2, y1, y2, FALSE);
+}
+
+/* gets/frees the font for you, as a bold font */
+static gdouble
+print_text_size_bold (GtkPrintContext *context,
+ const gchar *text,
+ PangoAlignment alignment,
+ gdouble x1,
+ gdouble x2,
+ gdouble y1,
+ gdouble y2)
+{
+ PangoFontDescription *font;
+ gdouble w;
+
+ font = get_font_for_size (ABS (y2 - y1) * 0.5, PANGO_WEIGHT_BOLD);
+ w = print_text (context, font, text, alignment, x1, x2, y1, y2);
+ pango_font_description_free (font);
+
+ return w;
+}
+
+/* gets/frees the font for you, as a bold font - absolute size parameter */
+static double
+print_text_abs_bold (GtkPrintContext *context,
+ const gchar *text,
+ gdouble font_size,
+ PangoAlignment alignment,
+ gdouble x1,
+ gdouble x2,
+ gdouble y1,
+ gdouble y2)
+{
+ PangoFontDescription *font;
+ gdouble w;
+
+ font = get_font_for_size (font_size, PANGO_WEIGHT_BOLD);
+ w = print_text_line (context, font, text, alignment, x1, x2, y1, y2, TRUE);
+ pango_font_description_free (font);
+
+ return w;
+}
+
+static void
+titled_box (GtkPrintContext *context,
+ const gchar *text,
+ PangoFontDescription *font,
+ PangoAlignment alignment,
+ gdouble *x1,
+ gdouble *y1,
+ gdouble *x2,
+ gdouble *y2,
+ gdouble linewidth)
+{
+ gdouble size;
+
+ size = evo_calendar_print_renderer_get_height (context, font, text);
+ print_border (context, *x1, *x2, *y1, *y1 + size + 2, linewidth, 0.9);
+ print_border (context, *x1, *x2, *y1 + size + 2, *y2, linewidth, -1.0);
+ *x1 += 2;
+ *x2 -= 2;
+ *y2 += 2;
+ print_text (context, font, text, alignment, *x1, *x2, *y1 + 1.0, *y1 + size);
+ *y1 += size + 2;
+}
+
+static gboolean
+get_show_week_numbers (void)
+{
+ GSettings *settings;
+ gboolean show_week_numbers;
+
+ settings = e_util_ref_settings ("org.gnome.evolution.calendar");
+
+ show_week_numbers =
+ g_settings_get_boolean (settings, "show-week-numbers");
+
+ g_object_unref (settings);
+
+ return show_week_numbers;
+}
+
+enum datefmt {
+ DATE_MONTH = 1 << 0,
+ DATE_DAY = 1 << 1,
+ DATE_DAYNAME = 1 << 2,
+ DATE_YEAR = 1 << 3
+};
+
+static const gchar *days[] = {
+ N_("1st"), N_("2nd"), N_("3rd"), N_("4th"), N_("5th"),
+ N_("6th"), N_("7th"), N_("8th"), N_("9th"), N_("10th"),
+ N_("11th"), N_("12th"), N_("13th"), N_("14th"), N_("15th"),
+ N_("16th"), N_("17th"), N_("18th"), N_("19th"), N_("20th"),
+ N_("21st"), N_("22nd"), N_("23rd"), N_("24th"), N_("25th"),
+ N_("26th"), N_("27th"), N_("28th"), N_("29th"), N_("30th"),
+ N_("31st")
+};
+
+/*
+ format the date 'nicely' and consistently for various headers
+*/
+static gchar *
+format_date (struct tm *tm,
+ gint flags,
+ gchar *buffer,
+ gint bufflen)
+{
+ GString *fmt = g_string_new ("");
+
+ if (flags & DATE_DAYNAME) {
+ g_string_append (fmt, "%A");
+ }
+ if (flags & DATE_DAY) {
+ if (flags & DATE_DAYNAME)
+ g_string_append (fmt, " ");
+ g_string_append (fmt, gettext (days[tm->tm_mday - 1]));
+ }
+ if (flags & DATE_MONTH) {
+ if (flags & (DATE_DAY | DATE_DAYNAME))
+ g_string_append (fmt, " ");
+ g_string_append (fmt, "%B");
+ if ((flags & (DATE_DAY | DATE_YEAR)) == (DATE_DAY | DATE_YEAR))
+ g_string_append (fmt, ",");
+ }
+ if (flags & DATE_YEAR) {
+ if (flags & (DATE_DAY | DATE_DAYNAME | DATE_MONTH))
+ g_string_append (fmt, " ");
+ g_string_append (fmt, "%Y");
+ }
+ e_utf8_strftime (buffer, bufflen, fmt->str, tm);
+ buffer[bufflen - 1] = '\0';
+
+ g_string_free (fmt, TRUE);
+
+ return buffer;
+}
+
+static gboolean
+instance_cb (ECalComponent *comp,
+ time_t instance_start,
+ time_t instance_end,
+ gpointer data)
+{
+
+ gboolean *found = ((ECalModelGenerateInstancesData *) data)->cb_data;
+
+ *found = TRUE;
+
+ return FALSE;
+}
+
+const gchar *daynames[] = {
+ /* Translators: These are workday abbreviations,
+ * e.g. Su=Sunday and Th=thursday */
+ /* G_DATE_BAD_WEEKDAY */ "",
+ /* G_DATE_MONDAY */ N_("Mo"),
+ /* G_DATE_TUESDAY */ N_("Tu"),
+ /* G_DATE_WEDNESDAY */ N_("We"),
+ /* G_DATE_THURSDAY */ N_("Th"),
+ /* G_DATE_FRIDAY */ N_("Fr"),
+ /* G_DATE_SATURDAY */ N_("Sa"),
+ /* G_DATE_SUNDAY */ N_("Su")
+};
+
+static gdouble
+calc_small_month_width (GtkPrintContext *context,
+ gdouble for_height)
+{
+
+ PangoFontDescription *font_bold;
+ gdouble res = 0.0;
+ gint ii;
+
+ font_bold = get_font_for_size (for_height / 7.4, PANGO_WEIGHT_BOLD);
+ res = MAX (evo_calendar_print_renderer_get_width (
+ context, font_bold, "23"), res);
+ for (ii = G_DATE_MONDAY; ii < G_N_ELEMENTS (daynames); ii++) {
+ res = MAX (evo_calendar_print_renderer_get_width (
+ context, font_bold, _(daynames[ii])), res);
+ }
+
+ pango_font_description_free (font_bold);
+
+ /* res is max cell width, so multiply it with column
+ * count plus some space between columns. */
+ res = (res + 1.0) * (7 + (get_show_week_numbers () ? 1 : 0)) - 1.0;
+
+ if (res < MIN_SMALL_MONTH_WIDTH)
+ res = MIN_SMALL_MONTH_WIDTH;
+
+ return res;
+}
+
+/*
+ print out the month small, embolden any days with events.
+*/
+static void
+print_month_small (GtkPrintContext *context,
+ ECalModel *model,
+ time_t month,
+ gdouble x1,
+ gdouble y1,
+ gdouble x2,
+ gdouble y2,
+ gint titleflags,
+ time_t greystart,
+ time_t greyend,
+ gint bordertitle)
+{
+ icaltimezone *zone;
+ PangoFontDescription *font, *font_bold, *font_normal;
+ time_t now, next;
+ gint x, y;
+ gint day;
+ gint days[42];
+ GDateWeekday weekday;
+ GDateWeekday week_start_day;
+ gchar buf[100];
+ struct tm tm;
+ gdouble font_size;
+ gdouble header_size, col_width, row_height, text_xpad, w;
+ gdouble cell_top, cell_bottom, cell_left, cell_right, text_right;
+ gboolean week_numbers;
+ cairo_t *cr;
+
+ zone = e_cal_model_get_timezone (model);
+
+ week_numbers = get_show_week_numbers ();
+
+ /* Print the title, e.g. 'June 2001', in the top 16% of the area. */
+ convert_timet_to_struct_tm (month, zone, &tm);
+ format_date (&tm, titleflags, buf, 100);
+
+ header_size = ABS (y2 - y1) * 0.16;
+
+ font = get_font_for_size (header_size, PANGO_WEIGHT_BOLD);
+ if (bordertitle)
+ print_border (context, x1, x2, y1, y1 + header_size, 1.0, 0.9);
+ print_text (
+ context, font, buf, PANGO_ALIGN_CENTER, x1, x2,
+ y1, y1 + header_size);
+ pango_font_description_free (font);
+
+ y1 += header_size;
+ col_width = (x2 - x1) / (7 + (week_numbers ? 1 : 0));
+
+ /* The top row with the day abbreviations gets an extra bit of
+ * vertical space around it. */
+ row_height = ABS (y2 - y1) / 7.4;
+
+ /* First we need to calculate a reasonable font size. We start with a
+ * rough guess of just under the height of each row. */
+ font_size = row_height;
+
+ /* get month days */
+ convert_timet_to_struct_tm (month, zone, &tm);
+ build_month (model, tm.tm_mon, tm.tm_year + 1900, days, NULL, NULL);
+
+ font_normal = get_font_for_size (font_size, PANGO_WEIGHT_NORMAL);
+ font_bold = get_font_for_size (font_size, PANGO_WEIGHT_BOLD);
+
+ /* Get a reasonable estimate of the largest number we will need,
+ * and use it to calculate the offset from the right edge of the
+ * cell that we should put the numbers. */
+ w = evo_calendar_print_renderer_get_width (context, font_bold, "23");
+ text_xpad = (col_width - w) / 2;
+
+ cr = gtk_print_context_get_cairo_context (context);
+ cairo_set_source_rgb (cr, 0, 0, 0);
+
+ /* Print the abbreviated day names across the top in bold. */
+ week_start_day = e_cal_model_get_week_start_day (model);
+ weekday = week_start_day;
+ for (x = 0; x < 7; x++) {
+ print_text (
+ context, font_bold,
+ _(daynames[weekday]), PANGO_ALIGN_RIGHT,
+ x1 + (x + (week_numbers ? 1 : 0)) * col_width,
+ x1 + (x + 1 + (week_numbers ? 1 : 0)) * col_width,
+ y1, y1 + row_height * 1.4);
+ weekday = e_weekday_get_next (weekday);
+ }
+
+ y1 += row_height * 1.4;
+
+ now = time_month_begin_with_zone (month, zone);
+ for (y = 0; y < 6; y++) {
+
+ cell_top = y1 + y * row_height;
+ cell_bottom = cell_top + row_height;
+
+ if (week_numbers) {
+ cell_left = x1;
+ /* We add a 0.05 to make sure the cells meet up with
+ * each other. Otherwise you sometimes get lines
+ * between them which looks bad. Maybe I'm not using
+ * coords in the way gnome-print expects. */
+ cell_right = cell_left + col_width + 0.05;
+ text_right = cell_right - text_xpad;
+
+ /* last week can be empty */
+ for (x = 0; x < 7; x++) {
+ day = days[y * 7 + x];
+ if (day != 0)
+ break;
+ }
+
+ if (day != 0) {
+ time_t week_begin;
+ gint wday;
+
+ wday = e_weekday_to_tm_wday (week_start_day);
+ week_begin = time_week_begin_with_zone (
+ now, wday, zone);
+
+ convert_timet_to_struct_tm (
+ week_begin, zone, &tm);
+
+ /* Month in e_calendar_item_get_week_number
+ * is also zero-based. */
+ sprintf (
+ buf, "%d",
+ e_calendar_item_get_week_number (
+ NULL, tm.tm_mday, tm.tm_mon,
+ tm.tm_year + 1900));
+
+ print_text (
+ context, font_normal,
+ buf, PANGO_ALIGN_RIGHT,
+ cell_left, text_right,
+ cell_top, cell_bottom);
+ }
+ }
+
+ for (x = 0; x < 7; x++) {
+
+ cell_left = x1 + (x + (week_numbers ? 1 : 0)) * col_width;
+ /* We add a 0.05 to make sure the cells meet up with
+ * each other. Otherwise you sometimes get lines
+ * between them which looks bad. Maybe I'm not using
+ * coords in the way gnome-print expects. */
+ cell_right = cell_left + col_width + 0.05;
+ text_right = cell_right - text_xpad;
+
+ day = days[y * 7 + x];
+ if (day != 0) {
+ gboolean found = FALSE;
+ sprintf (buf, "%d", day);
+
+ /* this is a slow messy way to do this ... but easy ... */
+ e_cal_model_generate_instances_sync (
+ model, now,
+ time_day_end_with_zone (now, zone),
+ instance_cb, &found);
+
+ font = found ? font_bold : font_normal;
+
+ next = time_add_day_with_zone (now, 1, zone);
+ if ((now >= greystart && now < greyend)
+ || (greystart >= now && greystart < next)) {
+ print_border (
+ context,
+ cell_left, cell_right,
+ cell_top, cell_bottom,
+ -1.0, 0.75);
+ }
+ print_text (
+ context, font, buf, PANGO_ALIGN_RIGHT,
+ cell_left, text_right,
+ cell_top, cell_bottom);
+
+ now = next;
+ }
+ }
+ }
+ pango_font_description_free (font_normal);
+ pango_font_description_free (font_bold);
+}
+
+/* wraps text into the print context, not taking up more than its allowed space */
+static gdouble
+bound_text (GtkPrintContext *context,
+ PangoFontDescription *font,
+ const gchar *text,
+ gint len,
+ gdouble x1,
+ gdouble y1,
+ gdouble x2,
+ gdouble y2,
+ gboolean can_wrap,
+ gdouble *last_page_start,
+ gint *pages)
+{
+ PangoLayout *layout;
+ gint layout_width, layout_height;
+ cairo_t *cr;
+
+ cr = gtk_print_context_get_cairo_context (context);
+ layout = gtk_print_context_create_pango_layout (context);
+
+ pango_layout_set_font_description (layout, font);
+ pango_layout_set_text (layout, text, len);
+ pango_layout_set_width (layout, pango_units_from_double (x2 - x1));
+
+ if (can_wrap)
+ pango_layout_set_wrap (layout, PANGO_WRAP_WORD_CHAR);
+
+ pango_layout_get_size (layout, &layout_width, &layout_height);
+
+ if (last_page_start &&
+ y1 + pango_units_to_double (layout_height) >
+ y2 + (*last_page_start)) {
+ /* draw this on new page */
+ if (pages)
+ *pages = *pages + 1;
+
+ *last_page_start = *last_page_start + y2;
+ y1 = *last_page_start + 10.0;
+ }
+
+ if (!last_page_start || (y1 >= 0.0 && y1 < y2)) {
+ cairo_save (cr);
+
+ /* Set a clipping rectangle. */
+ cairo_move_to (cr, x1, y1);
+ cairo_rectangle (cr, x1, y1, x2 - x1, y2 - y1);
+ cairo_clip (cr);
+ cairo_new_path (cr);
+
+ cairo_move_to (cr, x1, y1);
+ pango_cairo_show_layout (cr, layout);
+ cairo_stroke (cr);
+
+ cairo_restore (cr);
+ }
+
+ g_object_unref (layout);
+
+ return y1 + pango_units_to_double (layout_height);
+}
+
+/* Draw the borders, lines, and times down the left of the day view. */
+static void
+print_day_background (GtkPrintContext *context,
+ ECalModel *model,
+ time_t whence,
+ struct pdinfo *pdi,
+ gdouble left,
+ gdouble right,
+ gdouble top,
+ gdouble bottom)
+{
+ PangoFontDescription *font_hour, *font_minute;
+ gdouble yinc, y;
+ gdouble width = DAY_VIEW_TIME_COLUMN_WIDTH;
+ gdouble font_size, max_font_size, hour_font_size, minute_font_size;
+ gchar buf[20];
+ const gchar *minute;
+ gboolean use_24_hour;
+ gint i, hour, row;
+ gdouble hour_minute_x, hour_minute_width;
+ cairo_t *cr;
+
+ use_24_hour = e_cal_model_get_use_24_hour_format (model);
+
+ /* Fill the time column in light-gray. */
+ print_border (context, left, left + width, top, bottom, -1.0, 0.9);
+
+ /* Draw the border around the entire view. */
+ cr = gtk_print_context_get_cairo_context (context);
+
+ cairo_set_source_rgb (cr, 0, 0, 0);
+ print_border (context, left, right, top, bottom, 1.0, -1.0);
+
+ /* Draw the vertical line on the right of the time column. */
+ cr = gtk_print_context_get_cairo_context (context);
+ cairo_set_line_width (cr, 0.0);
+ cairo_move_to (cr, left + width, bottom);
+ cairo_line_to (cr, left + width, top);
+ cairo_stroke (cr);
+
+ /* Calculate the row height. */
+ if (top > bottom)
+ yinc = (top - bottom) / (pdi->end_hour - pdi->start_hour);
+ else
+ yinc = (bottom - top) / (pdi->end_hour - pdi->start_hour);
+
+ /* Get the 2 fonts we need. */
+ font_size = yinc * 0.6;
+ max_font_size = width * 0.45;
+ hour_font_size = MIN (font_size, max_font_size);
+ font_hour = get_font_for_size (hour_font_size, PANGO_WEIGHT_BOLD);
+
+ font_size = yinc * 0.33;
+ max_font_size = width * 0.2;
+ minute_font_size = MIN (font_size, max_font_size);
+ font_minute = get_font_for_size (minute_font_size, PANGO_WEIGHT_BOLD);
+ hour_minute_width = evo_calendar_print_renderer_get_width (
+ context, font_minute, use_24_hour ? "00" : _("am"));
+ if (!use_24_hour)
+ hour_minute_width = MAX (
+ hour_minute_width,
+ evo_calendar_print_renderer_get_width (
+ context, font_minute, _("pm")));
+
+ row = 0;
+ hour_minute_x = left + width - hour_minute_width - 3;
+ for (i = pdi->start_hour; i < pdi->end_hour; i++) {
+ y = top + yinc * (row + 1);
+ cr = gtk_print_context_get_cairo_context (context);
+ cairo_set_source_rgb (cr, 0, 0, 0);
+
+ if (use_24_hour) {
+ hour = i;
+ minute = "00";
+ } else {
+ if (i < 12)
+ minute = _("am");
+ else
+ minute = _("pm");
+
+ hour = i % 12;
+ if (hour == 0)
+ hour = 12;
+ }
+
+ /* the hour label/minute */
+ sprintf (buf, "%d", hour);
+ print_text (
+ context, font_hour, buf, PANGO_ALIGN_RIGHT,
+ left, hour_minute_x,
+ y - yinc, y - yinc + hour_font_size);
+ print_text (
+ context, font_minute, minute, PANGO_ALIGN_LEFT,
+ hour_minute_x, left + width - 3,
+ y - yinc, y - yinc + minute_font_size);
+
+ /* Draw the horizontal line between hours, across the entire
+ width of the day view. */
+ cr = gtk_print_context_get_cairo_context (context);
+ cairo_move_to (cr, left, y);
+ cairo_line_to (cr, right, y);
+ cairo_set_line_width (cr, 1);
+ cairo_stroke (cr);
+
+ /* Draw the horizontal line for the 1/2-hours, across the
+ * entire width except for part of the time column. */
+ cairo_move_to (cr, left + width * 0.6, y - yinc / 2);
+ cairo_line_to (cr, right, y - yinc / 2);
+ cairo_set_line_width (cr, 1);
+ cairo_stroke (cr);
+ row++;
+ }
+
+ pango_font_description_free (font_hour);
+ pango_font_description_free (font_minute);
+}
+
+/* This adds one event to the view, adding it to the appropriate array. */
+static gint
+print_day_add_event (ECalModelComponent *comp_data,
+ time_t start,
+ time_t end,
+ icaltimezone *zone,
+ gint days_shown,
+ time_t *day_starts,
+ GArray *long_events,
+ GArray **events)
+
+{
+ EDayViewEvent event;
+ gint day, offset;
+ struct icaltimetype start_tt, end_tt;
+
+#if 0
+ g_print ("Day view lower: %s", ctime (&day_starts[0]));
+ g_print ("Day view upper: %s", ctime (&day_starts[days_shown]));
+ g_print ("Event start: %s", ctime (&start));
+ g_print ("Event end : %s\n", ctime (&end));
+#endif
+
+ /* Check that the event times are valid. */
+ g_return_val_if_fail (start <= end, -1);
+ g_return_val_if_fail (start < day_starts[days_shown], -1);
+ g_return_val_if_fail (end > day_starts[0], -1);
+
+ start_tt = icaltime_from_timet_with_zone (start, FALSE, zone);
+ end_tt = icaltime_from_timet_with_zone (end, FALSE, zone);
+
+ event.comp_data = comp_data;
+ event.start = start;
+ event.end = end;
+ event.canvas_item = NULL;
+
+ /* Calculate the start & end minute, relative to the top of the
+ * display. */
+ /*offset = day_view->first_hour_shown * 60
+ + day_view->first_minute_shown;*/
+ offset = 0;
+ event.start_minute = start_tt.hour * 60 + start_tt.minute - offset;
+ event.end_minute = end_tt.hour * 60 + end_tt.minute - offset;
+
+ event.start_row_or_col = 0;
+ event.num_columns = 0;
+
+ /* Find out which array to add the event to. */
+ for (day = 0; day < days_shown; day++) {
+ if (start >= day_starts[day] && end <= day_starts[day + 1]) {
+
+ /* Special case for when the appointment ends at
+ * midnight, i.e. the start of the next day. */
+ if (end == day_starts[day + 1]) {
+
+ /* If the event last the entire day, then we
+ * skip it here so it gets added to the top
+ * canvas. */
+ if (start == day_starts[day])
+ break;
+
+ event.end_minute = 24 * 60;
+ }
+ g_array_append_val (events[day], event);
+ return day;
+ }
+ }
+
+ /* The event wasn't within one day so it must be a long event,
+ * i.e. shown in the top canvas. */
+ g_array_append_val (long_events, event);
+ return E_DAY_VIEW_LONG_EVENT;
+}
+
+static gboolean
+print_day_details_cb (ECalComponent *comp,
+ time_t istart,
+ time_t iend,
+ gpointer data)
+{
+ ECalModelGenerateInstancesData *mdata = (ECalModelGenerateInstancesData *) data;
+ struct pdinfo *pdi = (struct pdinfo *) mdata->cb_data;
+
+ print_day_add_event (
+ mdata->comp_data, istart, iend,
+ pdi->zone, pdi->days_shown, pdi->day_starts,
+ pdi->long_events, pdi->events);
+
+ return TRUE;
+}
+
+static void
+free_event_array (GArray *array)
+{
+ EDayViewEvent *event;
+ gint event_num;
+
+ for (event_num = 0; event_num < array->len; event_num++) {
+ event = &g_array_index (array, EDayViewEvent, event_num);
+ if (event->canvas_item)
+ g_object_run_dispose (G_OBJECT (event->canvas_item));
+ }
+
+ g_array_set_size (array, 0);
+}
+
+static const gchar *
+get_type_as_string (icalparameter_cutype cutype)
+{
+ const gchar *res;
+
+ switch (cutype) {
+ case ICAL_CUTYPE_NONE: res = NULL; break;
+ case ICAL_CUTYPE_INDIVIDUAL: res = _("Individual"); break;
+ case ICAL_CUTYPE_GROUP: res = _("Group"); break;
+ case ICAL_CUTYPE_RESOURCE: res = _("Resource"); break;
+ case ICAL_CUTYPE_ROOM: res = _("Room"); break;
+ default: res = _("Unknown"); break;
+ }
+
+ return res;
+}
+
+static const gchar *
+get_role_as_string (icalparameter_role role)
+{
+ const gchar *res;
+
+ switch (role) {
+ case ICAL_ROLE_NONE: res = NULL; break;
+ case ICAL_ROLE_CHAIR: res = _("Chair"); break;
+ case ICAL_ROLE_REQPARTICIPANT: res = _("Required Participant"); break;
+ case ICAL_ROLE_OPTPARTICIPANT: res = _("Optional Participant"); break;
+ case ICAL_ROLE_NONPARTICIPANT: res = _("Non-Participant"); break;
+ default: res = _("Unknown"); break;
+ }
+
+ return res;
+}
+
+static gdouble
+print_attendees (GtkPrintContext *context,
+ PangoFontDescription *font,
+ cairo_t *cr,
+ gdouble left,
+ gdouble right,
+ gdouble top,
+ gdouble bottom,
+ ECalComponent *comp,
+ gint page_nr,
+ gint *pages)
+{
+ GSList *attendees = NULL, *l;
+
+ g_return_val_if_fail (context != NULL, top);
+ g_return_val_if_fail (font != NULL, top);
+ g_return_val_if_fail (cr != NULL, top);
+
+ e_cal_component_get_attendee_list (comp, &attendees);
+
+ for (l = attendees; l; l = l->next) {
+ ECalComponentAttendee *attendee = l->data;
+
+ if (attendee && attendee->value && *attendee->value) {
+ GString *text;
+ const gchar *tmp;
+
+ tmp = get_type_as_string (attendee->cutype);
+ text = g_string_new (tmp ? tmp : "");
+
+ if (tmp)
+ g_string_append (text, " ");
+
+ if (attendee->cn && *attendee->cn)
+ g_string_append (text, attendee->cn);
+ else {
+ /* it's usually in form of "mailto:email@domain" */
+ tmp = strchr (attendee->value, ':');
+ g_string_append (text, tmp ? tmp + 1 : attendee->value);
+ }
+
+ tmp = get_role_as_string (attendee->role);
+ if (tmp) {
+ g_string_append (text, " (");
+ g_string_append (text, tmp);
+ g_string_append (text, ")");
+ }
+
+ if (top > bottom) {
+ top = 10.0;
+ cairo_show_page (cr);
+ }
+
+ top = bound_text (
+ context, font, text->str, -1, left + 40.0,
+ top, right, bottom, FALSE, NULL, pages);
+
+ g_string_free (text, TRUE);
+ }
+ }
+
+ e_cal_component_free_attendee_list (attendees);
+
+ return top;
+}
+
+static gchar *
+get_summary_with_location (icalcomponent *icalcomp)
+{
+ const gchar *summary, *location;
+ gchar *text;
+
+ g_return_val_if_fail (icalcomp != NULL, NULL);
+
+ summary = icalcomponent_get_summary (icalcomp);
+ if (summary == NULL)
+ summary = "";
+
+ location = icalcomponent_get_location (icalcomp);
+ if (location && *location) {
+ text = g_strdup_printf ("%s (%s)", summary, location);
+ } else {
+ text = g_strdup (summary);
+ }
+
+ return text;
+}
+
+static void
+print_day_long_event (GtkPrintContext *context,
+ PangoFontDescription *font,
+ gdouble left,
+ gdouble right,
+ gdouble top,
+ gdouble bottom,
+ gdouble row_height,
+ EDayViewEvent *event,
+ struct pdinfo *pdi,
+ ECalModel *model)
+{
+ gdouble x1, x2, y1, y2;
+ gdouble left_triangle_width = -1.0, right_triangle_width = -1.0;
+ gchar *text;
+ gchar buffer[32];
+ struct tm date_tm;
+ GdkRGBA bg_rgba;
+
+ if (!is_comp_data_valid (event))
+ return;
+
+ /* If the event starts before the first day being printed, draw a
+ * triangle. (Note that I am assuming we are just showing 1 day at
+ * the moment.) */
+ if (event->start < pdi->day_starts[0])
+ left_triangle_width = 4;
+
+ /* If the event ends after the last day being printed, draw a
+ * triangle. */
+ if (event->end > pdi->day_starts[1])
+ right_triangle_width = 4;
+
+ x1 = left + 10;
+ x2 = right - 10;
+ y1 = top + event->start_row_or_col * row_height + 1;
+ y2 = y1 + row_height - 1;
+
+ if (!e_cal_model_get_rgba_for_component (model, event->comp_data, &bg_rgba)) {
+ bg_rgba.red = 0.95;
+ bg_rgba.green = 0.95;
+ bg_rgba.blue = 0.95;
+ bg_rgba.alpha = 1.0;
+ }
+
+ print_border_with_triangles (
+ context, x1, x2, y1, y2, 0.5, bg_rgba,
+ left_triangle_width,
+ right_triangle_width);
+
+ /* If the event starts after the first day being printed, we need to
+ * print the start time. */
+ if (event->start > pdi->day_starts[0]) {
+ date_tm.tm_year = 2001;
+ date_tm.tm_mon = 0;
+ date_tm.tm_mday = 1;
+ date_tm.tm_hour = event->start_minute / 60;
+ date_tm.tm_min = event->start_minute % 60;
+ date_tm.tm_sec = 0;
+ date_tm.tm_isdst = -1;
+
+ e_time_format_time (&date_tm, pdi->use_24_hour_format, FALSE,
+ buffer, sizeof (buffer));
+
+ x1 += 4;
+ x1 += print_text (context, font, buffer, PANGO_ALIGN_LEFT, x1, x2, y1, y2);
+ }
+
+ /* If the event ends before the end of the last day being printed,
+ * we need to print the end time. */
+ if (event->end < pdi->day_starts[1]) {
+ date_tm.tm_year = 2001;
+ date_tm.tm_mon = 0;
+ date_tm.tm_mday = 1;
+ date_tm.tm_hour = event->end_minute / 60;
+ date_tm.tm_min = event->end_minute % 60;
+ date_tm.tm_sec = 0;
+ date_tm.tm_isdst = -1;
+
+ e_time_format_time (&date_tm, pdi->use_24_hour_format, FALSE,
+ buffer, sizeof (buffer));
+
+ x2 -= 4;
+ x2 -= print_text (context, font, buffer, PANGO_ALIGN_RIGHT, x1, x2, y1, y2);
+ }
+
+ /* Print the text. */
+ text = get_summary_with_location (event->comp_data->icalcomp);
+
+ x1 += 4;
+ x2 -= 4;
+ print_text_line (context, font, text, PANGO_ALIGN_CENTER, x1, x2, y1, y2, TRUE);
+
+ g_free (text);
+}
+
+static void
+print_day_event (GtkPrintContext *context,
+ PangoFontDescription *font,
+ gdouble left,
+ gdouble right,
+ gdouble top,
+ gdouble bottom,
+ EDayViewEvent *event,
+ struct pdinfo *pdi,
+ ECalModel *model)
+{
+ gdouble x1, x2, y1, y2, col_width, row_height;
+ gint start_offset, end_offset, start_row, end_row;
+ gchar *text, start_buffer[32], end_buffer[32];
+ gboolean display_times = FALSE;
+ struct tm date_tm;
+ GdkRGBA bg_rgba;
+
+ if (!is_comp_data_valid (event))
+ return;
+
+ if ((event->start_minute >= pdi->end_minute_offset)
+ || (event->end_minute <= pdi->start_minute_offset))
+ return;
+
+ start_offset = event->start_minute - pdi->start_minute_offset;
+ end_offset = event->end_minute - pdi->start_minute_offset;
+
+ start_row = start_offset / pdi->mins_per_row;
+ start_row = MAX (0, start_row);
+ end_row = (end_offset - 1) / pdi->mins_per_row;
+ end_row = MIN (pdi->rows - 1, end_row);
+ col_width = (right - left) /
+ pdi->cols_per_row[event->start_minute / pdi->mins_per_row];
+
+ if (start_offset != start_row * pdi->mins_per_row
+ || end_offset != (end_row + 1) * pdi->mins_per_row)
+ display_times = TRUE;
+
+ x1 = left + event->start_row_or_col * col_width;
+ x2 = x1 + event->num_columns * col_width - DAY_VIEW_EVENT_X_PAD;
+
+ row_height = (bottom - top) / pdi->rows;
+ y1 = top + start_row * row_height;
+ y2 = top + (end_row + 1) * row_height;
+#if 0
+ g_print (
+ "Event: %g,%g %g,%g\n row_height: %g start_row: %i top: %g rows: %i\n",
+ x1, y1, x2, y2, row_height, start_row, top, pdi->rows);
+#endif
+
+ if (!e_cal_model_get_rgba_for_component (model, event->comp_data, &bg_rgba)) {
+ bg_rgba.red = 0.95;
+ bg_rgba.green = 0.95;
+ bg_rgba.blue = 0.95;
+ bg_rgba.alpha = 1.0;
+ }
+
+ print_border_rgb (context, x1, x2, y1, y2, 1.0, bg_rgba);
+
+ text = get_summary_with_location (event->comp_data->icalcomp);
+
+ if (display_times) {
+ gchar *t = NULL;
+
+ date_tm.tm_year = 2001;
+ date_tm.tm_mon = 0;
+ date_tm.tm_mday = 1;
+ date_tm.tm_hour = event->start_minute / 60;
+ date_tm.tm_min = event->start_minute % 60;
+ date_tm.tm_sec = 0;
+ date_tm.tm_isdst = -1;
+
+ e_time_format_time (&date_tm, pdi->use_24_hour_format, FALSE,
+ start_buffer, sizeof (start_buffer));
+
+ date_tm.tm_hour = event->end_minute / 60;
+ date_tm.tm_min = event->end_minute % 60;
+
+ e_time_format_time (&date_tm, pdi->use_24_hour_format, FALSE,
+ end_buffer, sizeof (end_buffer));
+
+ t = text;
+ text = g_strdup_printf (
+ "%s - %s %s ",
+ start_buffer, end_buffer, text);
+
+ g_free (t);
+ }
+
+ bound_text (context, font, text, -1, x1 + 2, y1, x2 - 2, y2, FALSE, NULL, NULL);
+
+ g_free (text);
+}
+
+static void
+print_day_details (GtkPrintContext *context,
+ ECalModel *model,
+ time_t whence,
+ gdouble left,
+ gdouble right,
+ gdouble top,
+ gdouble bottom)
+{
+ icaltimezone *zone;
+ EDayViewEvent *event;
+ PangoFontDescription *font;
+ time_t start, end;
+ struct pdinfo pdi = { 0 };
+ gint rows_in_top_display, i, rows_with_30_mins;
+ gdouble font_size, max_font_size;
+ cairo_t *cr;
+ GdkPixbuf *pixbuf = NULL;
+#define LONG_DAY_EVENTS_TOP_SPACING 4
+#define LONG_DAY_EVENTS_BOTTOM_SPACING 2
+
+ zone = e_cal_model_get_timezone (model);
+
+ start = time_day_begin_with_zone (whence, zone);
+ end = time_day_end_with_zone (start, zone);
+
+ pdi.days_shown = 1;
+ pdi.day_starts[0] = start;
+ pdi.day_starts[1] = end;
+ pdi.long_events = g_array_new (FALSE, FALSE, sizeof (EDayViewEvent));
+ pdi.events[0] = g_array_new (FALSE, FALSE, sizeof (EDayViewEvent));
+ pdi.start_hour = e_cal_model_get_work_day_start_hour (model);
+ pdi.end_hour = e_cal_model_get_work_day_end_hour (model);
+ if (e_cal_model_get_work_day_end_minute (model) != 0)
+ pdi.end_hour++;
+ pdi.mins_per_row = get_day_view_time_divisions ();
+ pdi.rows = (pdi.end_hour - pdi.start_hour) * (60 / pdi.mins_per_row);
+ pdi.start_minute_offset = pdi.start_hour * 60;
+ pdi.end_minute_offset = pdi.end_hour * 60;
+ pdi.use_24_hour_format = e_cal_model_get_use_24_hour_format (model);
+ pdi.zone = e_cal_model_get_timezone (model);
+
+ /* Get the events from the server. */
+ e_cal_model_generate_instances_sync (model, start, end, print_day_details_cb, &pdi);
+ qsort (
+ pdi.long_events->data, pdi.long_events->len,
+ sizeof (EDayViewEvent), e_day_view_event_sort_func);
+ qsort (
+ pdi.events[0]->data, pdi.events[0]->len,
+ sizeof (EDayViewEvent), e_day_view_event_sort_func);
+
+ /* Also print events outside of work hours */
+ if (pdi.events[0]->len > 0) {
+ struct icaltimetype tt;
+
+ event = &g_array_index (pdi.events[0], EDayViewEvent, 0);
+ tt = icaltime_from_timet_with_zone (event->start, FALSE, zone);
+ if (tt.hour < pdi.start_hour)
+ pdi.start_hour = tt.hour;
+ pdi.start_minute_offset = pdi.start_hour * 60;
+
+ event = &g_array_index (pdi.events[0], EDayViewEvent, pdi.events[0]->len - 1);
+ tt = icaltime_from_timet_with_zone (event->end, FALSE, zone);
+ if (tt.hour > pdi.end_hour || tt.hour == 0) {
+ pdi.end_hour = tt.hour ? tt.hour : 24;
+ if (tt.minute > 0)
+ pdi.end_hour++;
+ }
+ pdi.end_minute_offset = pdi.end_hour * 60;
+
+ pdi.rows = (pdi.end_hour - pdi.start_hour) * (60 / pdi.mins_per_row);
+ }
+
+ /* Lay them out the long events, across the top of the page. */
+ e_day_view_layout_long_events (
+ pdi.long_events, pdi.days_shown,
+ pdi.day_starts, &rows_in_top_display);
+
+ /*Print the long events. */
+ font = get_font_for_size (12, PANGO_WEIGHT_NORMAL);
+
+ /* We always leave space for DAY_VIEW_MIN_ROWS_IN_TOP_DISPLAY in the
+ * top display, but we may have more rows than that, in which case
+ * the main display area will be compressed. */
+ /* Limit long day event to half the height of the panel */
+ rows_in_top_display = MIN (
+ MAX (rows_in_top_display,
+ DAY_VIEW_MIN_ROWS_IN_TOP_DISPLAY),
+ (bottom - top) * 0.5 / DAY_VIEW_ROW_HEIGHT);
+
+ if (rows_in_top_display > pdi.long_events->len)
+ rows_in_top_display = pdi.long_events->len;
+
+ for (i = 0; i < rows_in_top_display && i < pdi.long_events->len; i++) {
+ event = &g_array_index (pdi.long_events, EDayViewEvent, i);
+ print_day_long_event (
+ context, font, left, right,
+ top + LONG_DAY_EVENTS_TOP_SPACING, bottom,
+ DAY_VIEW_ROW_HEIGHT, event, &pdi, model);
+ }
+
+ if (rows_in_top_display < pdi.long_events->len) {
+ /* too many events */
+ cairo_t *cr = gtk_print_context_get_cairo_context (context);
+ gint x, y;
+
+ if (!pixbuf) {
+ const gchar **xpm = (const gchar **) jump_xpm;
+
+ /* this ugly thing is here only to get rid of compiler warning
+ * about unused 'jump_xpm_focused' */
+ if (pixbuf) {
+ /* coverity[dead_error_line] */
+ xpm = (const gchar **) jump_xpm_focused;
+ }
+
+ pixbuf = gdk_pixbuf_new_from_xpm_data (xpm);
+ }
+
+ /* Right align - 10 comes from print_day_long_event too */
+ x = right - gdk_pixbuf_get_width (pixbuf) * 0.5 - 10;
+ /* Placing '...' over the last all day event entry printed. '-1 -1' comes
+ from print_long_day_event (top / bottom spacing in each cell) */
+ y = top + LONG_DAY_EVENTS_TOP_SPACING
+ + DAY_VIEW_ROW_HEIGHT * (i - 1)
+ + (DAY_VIEW_ROW_HEIGHT - 1 - 1) * 0.5;
+
+ cairo_save (cr);
+ cairo_scale (cr, 0.5, 0.5);
+ gdk_cairo_set_source_pixbuf (cr, pixbuf, x * 2.0, y * 2.0);
+ cairo_paint (cr);
+ cairo_restore (cr);
+ }
+
+ if (!rows_in_top_display)
+ rows_in_top_display++;
+
+ /* Draw the border around the long events. */
+ cr = gtk_print_context_get_cairo_context (context);
+
+ cairo_set_source_rgb (cr, 0, 0, 0);
+ print_border (
+ context, left, right,
+ top, top + rows_in_top_display * DAY_VIEW_ROW_HEIGHT +
+ LONG_DAY_EVENTS_TOP_SPACING + LONG_DAY_EVENTS_BOTTOM_SPACING,
+ 1.0, -1.0);
+
+ /* Adjust the area containing the main display. */
+ top += rows_in_top_display * DAY_VIEW_ROW_HEIGHT
+ + LONG_DAY_EVENTS_TOP_SPACING
+ + LONG_DAY_EVENTS_BOTTOM_SPACING;
+
+ /* Draw the borders, lines, and times down the left. */
+ print_day_background (
+ context, model, whence, &pdi,
+ left, right, top, bottom);
+ /* Now adjust to get rid of the time column. */
+ left += DAY_VIEW_TIME_COLUMN_WIDTH;
+
+ /* lay out the short events, within the day. */
+ e_day_view_layout_day_events (
+ pdi.events[0], CALC_DAY_VIEW_ROWS (pdi.mins_per_row),
+ pdi.mins_per_row, pdi.cols_per_row, -1);
+
+ /* use font like with 30 minutes time division */
+ rows_with_30_mins = (pdi.end_hour - pdi.start_hour) * (60 / 30);
+
+ pango_font_description_free (font);
+
+ /* print the short events. */
+ if (top > bottom)
+ max_font_size = ((top - bottom) / rows_with_30_mins) - 4;
+ else
+ max_font_size = ((bottom - top) / rows_with_30_mins) - 4;
+ font_size = MIN (DAY_NORMAL_FONT_SIZE, max_font_size);
+ font = get_font_for_size (font_size, PANGO_WEIGHT_NORMAL);
+
+ for (i = 0; i < pdi.events[0]->len; i++) {
+ event = &g_array_index (pdi.events[0], EDayViewEvent, i);
+ print_day_event (
+ context, font, left, right, top, bottom,
+ event, &pdi, model);
+ }
+
+ /* Free everything. */
+ if (pixbuf)
+ g_object_unref (pixbuf);
+ free_event_array (pdi.long_events);
+ pango_font_description_free (font);
+ g_array_free (pdi.long_events, TRUE);
+ free_event_array (pdi.events[0]);
+ g_array_free (pdi.events[0], TRUE);
+}
+
+/* Returns TRUE if the event is a one-day event (i.e. not a long event). */
+static gboolean
+print_is_one_day_week_event (EWeekViewEvent *event,
+ EWeekViewEventSpan *span,
+ time_t *day_starts)
+{
+ if (event->start == day_starts[span->start_day]
+ && event->end == day_starts[span->start_day + 1])
+ return FALSE;
+
+ if (span->num_days == 1
+ && event->start >= day_starts[span->start_day]
+ && event->end <= day_starts[span->start_day + 1])
+ return TRUE;
+
+ return FALSE;
+}
+
+static void
+print_week_long_event (GtkPrintContext *context,
+ PangoFontDescription *font,
+ struct psinfo *psi,
+ gdouble x1,
+ gdouble x2,
+ gdouble y1,
+ gdouble row_height,
+ EWeekViewEvent *event,
+ EWeekViewEventSpan *span,
+ gchar *text,
+ GdkRGBA bg_rgba)
+{
+ gdouble left_triangle_width = -1.0, right_triangle_width = -1.0;
+ struct tm date_tm;
+ gchar buffer[32];
+
+ /* If the event starts before the first day of the span, draw a
+ * triangle to indicate it continues. */
+ if (event->start < psi->day_starts[span->start_day])
+ left_triangle_width = 4;
+
+ /* If the event ends after the last day of the span, draw a
+ * triangle. */
+ if (event->end > psi->day_starts[span->start_day + span->num_days])
+ right_triangle_width = 4;
+
+ print_border_with_triangles (
+ context, x1 + 6, x2 - 6, y1, y1 + row_height, 0.0, bg_rgba,
+ left_triangle_width, right_triangle_width);
+
+ x1 += 6;
+ x2 -= 6;
+
+ /* If the event starts after the first day being printed, we need to
+ * print the start time. */
+ if (event->start > psi->day_starts[span->start_day]) {
+ date_tm.tm_year = 2001;
+ date_tm.tm_mon = 0;
+ date_tm.tm_mday = 1;
+ date_tm.tm_hour = event->start_minute / 60;
+ date_tm.tm_min = event->start_minute % 60;
+ date_tm.tm_sec = 0;
+ date_tm.tm_isdst = -1;
+
+ e_time_format_time (&date_tm, psi->use_24_hour_format, FALSE,
+ buffer, sizeof (buffer));
+
+ x1 += 2;
+ x1 += print_text_line (
+ context, font, buffer, PANGO_ALIGN_LEFT,
+ x1, x2 - 2, y1, y1 + row_height, TRUE);
+ }
+
+ /* If the event ends before the end of the last day being printed,
+ * we need to print the end time. */
+ if (event->end < psi->day_starts[span->start_day + span->num_days]) {
+ date_tm.tm_year = 2001;
+ date_tm.tm_mon = 0;
+ date_tm.tm_mday = 1;
+ date_tm.tm_hour = event->end_minute / 60;
+ date_tm.tm_min = event->end_minute % 60;
+ date_tm.tm_sec = 0;
+ date_tm.tm_isdst = -1;
+
+ e_time_format_time (&date_tm, psi->use_24_hour_format, FALSE,
+ buffer, sizeof (buffer));
+
+ x2 -= 2;
+ x2 -= print_text_line (
+ context, font, buffer, PANGO_ALIGN_RIGHT,
+ x1 + 2, x2, y1, y1 + row_height, TRUE);
+ }
+
+ x1 += 2;
+ x2 -= 2;
+ print_text_line (context, font, text, PANGO_ALIGN_CENTER, x1, x2, y1, y1 + row_height, TRUE);
+}
+
+static void
+print_week_day_event (GtkPrintContext *context,
+ PangoFontDescription *font,
+ struct psinfo *psi,
+ gdouble x1,
+ gdouble x2,
+ gdouble y1,
+ gdouble row_height,
+ EWeekViewEvent *event,
+ EWeekViewEventSpan *span,
+ gchar *text,
+ GdkRGBA bg_rgba)
+{
+ struct tm date_tm;
+ gchar buffer[32];
+
+ date_tm.tm_year = 2001;
+ date_tm.tm_mon = 0;
+ date_tm.tm_mday = 1;
+ date_tm.tm_hour = event->start_minute / 60;
+ date_tm.tm_min = event->start_minute % 60;
+ date_tm.tm_sec = 0;
+ date_tm.tm_isdst = -1;
+
+ e_time_format_time (&date_tm, psi->use_24_hour_format, FALSE,
+ buffer, sizeof (buffer));
+ print_rectangle (context, x1 + 1, y1, x2 - x1 - 2, row_height, bg_rgba);
+ x1 += print_text_line (
+ context, font, buffer, PANGO_ALIGN_LEFT,
+ x1 + 2, x2 - 3, y1, y1 + row_height, TRUE) + 4;
+
+ if (psi->weeks_shown <= 2) {
+ date_tm.tm_hour = event->end_minute / 60;
+ date_tm.tm_min = event->end_minute % 60;
+
+ e_time_format_time (&date_tm, psi->use_24_hour_format, FALSE,
+ buffer, sizeof (buffer));
+
+ x1 += print_text_line (
+ context, font, buffer, PANGO_ALIGN_LEFT,
+ x1, x2 - 3, y1, y1 + row_height, TRUE) + 4;
+ }
+
+ print_text_line (
+ context, font, text, PANGO_ALIGN_LEFT,
+ x1, x2 - 3, y1, y1 + row_height, TRUE);
+}
+
+static void
+print_week_event (GtkPrintContext *context,
+ PangoFontDescription *font,
+ struct psinfo *psi,
+ gdouble left,
+ gdouble top,
+ gdouble cell_width,
+ gdouble cell_height,
+ ECalModel *model,
+ EWeekViewEvent *event,
+ GArray *spans)
+{
+ EWeekViewEventSpan *span;
+ gint span_num;
+ gchar *text;
+ gint num_days, start_x, start_y, start_h, end_x, end_y, end_h;
+ gdouble x1, x2, y1;
+ GdkRGBA bg_rgba;
+ GdkPixbuf *pixbuf = NULL;
+
+ if (!is_comp_data_valid (event))
+ return;
+
+ text = get_summary_with_location (event->comp_data->icalcomp);
+
+ for (span_num = 0; span_num < event->num_spans; span_num++) {
+ span = &g_array_index (spans, EWeekViewEventSpan,
+ event->spans_index + span_num);
+
+ if (e_week_view_layout_get_span_position (
+ event, span,
+ psi->rows_per_cell,
+ psi->rows_per_compressed_cell,
+ psi->display_start_weekday,
+ psi->multi_week_view,
+ psi->compress_weekend,
+ &num_days)) {
+
+ e_week_view_layout_get_day_position
+ (span->start_day,
+ psi->multi_week_view,
+ psi->weeks_shown,
+ psi->display_start_weekday,
+ psi->compress_weekend,
+ &start_x, &start_y, &start_h);
+
+ if (num_days == 1) {
+ end_x = start_x;
+ end_y = start_y;
+ end_h = start_h;
+ } else {
+ e_week_view_layout_get_day_position
+ (span->start_day + num_days - 1,
+ psi->multi_week_view,
+ psi->weeks_shown,
+ psi->display_start_weekday,
+ psi->compress_weekend,
+ &end_x, &end_y, &end_h);
+ }
+
+ x1 = left + start_x * cell_width;
+ x2 = left + (end_x + 1) * cell_width;
+ y1 = top + start_y * cell_height
+ + psi->header_row_height
+ + span->row * (psi->row_height + 2);
+
+ if (!e_cal_model_get_rgba_for_component (model, event->comp_data, &bg_rgba)) {
+ bg_rgba.red = 0.9;
+ bg_rgba.green = 0.9;
+ bg_rgba.blue = 0.9;
+ bg_rgba.alpha = 1.0;
+ }
+
+ if (print_is_one_day_week_event (event, span,
+ psi->day_starts)) {
+ print_week_day_event (
+ context, font, psi,
+ x1, x2, y1, psi->row_height,
+ event, span, text, bg_rgba);
+ } else {
+ print_week_long_event (
+ context, font, psi,
+ x1, x2, y1, psi->row_height,
+ event, span, text, bg_rgba);
+ }
+ } else {
+ cairo_t *cr = gtk_print_context_get_cairo_context (context);
+
+ e_week_view_layout_get_day_position (
+ span->start_day,
+ psi->multi_week_view,
+ psi->weeks_shown,
+ psi->display_start_weekday,
+ psi->compress_weekend,
+ &start_x, &start_y, &start_h);
+
+ y1 = top + start_y * cell_height
+ + psi->header_row_height
+ + psi->rows_per_cell * (psi->row_height + 2);
+
+ if (span->row >= psi->rows_per_compressed_cell && psi->compress_weekend) {
+ GDateWeekday end_weekday;
+ gboolean end_on_weekend;
+
+ end_weekday = e_weekday_add_days (
+ psi->display_start_weekday,
+ span->start_day);
+
+ end_on_weekend =
+ (end_weekday == G_DATE_SATURDAY) ||
+ (end_weekday == G_DATE_SUNDAY);
+
+ if (end_on_weekend) {
+ y1 = top + start_y * cell_height
+ + psi->header_row_height
+ + psi->rows_per_compressed_cell * (psi->row_height + 2);
+
+ }
+ }
+
+ if (!pixbuf) {
+ const gchar **xpm = (const gchar **) jump_xpm;
+
+ pixbuf = gdk_pixbuf_new_from_xpm_data (xpm);
+ }
+
+ x1 = left + (start_x + 1) * cell_width - 6 -
+ gdk_pixbuf_get_width (pixbuf) * 0.5;
+
+ cairo_save (cr);
+ cairo_scale (cr, 0.5, 0.5);
+ gdk_cairo_set_source_pixbuf (cr, pixbuf, x1 * 2.0, y1 * 2.0);
+ cairo_paint (cr);
+ cairo_restore (cr);
+ }
+ }
+
+ if (pixbuf)
+ g_object_unref (pixbuf);
+
+ g_free (text);
+}
+
+static void
+print_week_view_background (GtkPrintContext *context,
+ PangoFontDescription *font,
+ struct psinfo *psi,
+ gdouble left,
+ gdouble top,
+ gdouble cell_width,
+ gdouble cell_height)
+{
+ struct tm tm;
+ gint day, day_x, day_y, day_h;
+ gdouble x1, x2, y1, y2, font_size, fillcolor;
+ const gchar *format_string;
+ gchar buffer[128];
+ cairo_t *cr;
+
+ font_size = get_font_size (font);
+
+ for (day = 0; day < psi->days_shown; day++) {
+ e_week_view_layout_get_day_position
+ (day, psi->multi_week_view, psi->weeks_shown,
+ psi->display_start_weekday, psi->compress_weekend,
+ &day_x, &day_y, &day_h);
+
+ x1 = left + day_x * cell_width;
+ x2 = left + (day_x + 1) * cell_width;
+ y1 = top + day_y * cell_height;
+ y2 = y1 + day_h * cell_height;
+
+ convert_timet_to_struct_tm (psi->day_starts[day], psi->zone, &tm);
+
+ /* In the month view we draw a grey background for the end
+ * of the previous month and the start of the following. */
+ fillcolor = -1.0;
+ if (psi->multi_week_view && (tm.tm_mon != psi->month))
+ fillcolor = 0.9;
+
+ print_border (context, x1, x2, y1, y2, 1.0, fillcolor);
+
+ if (psi->multi_week_view) {
+ if (tm.tm_mday == 1)
+ format_string = _("%d %B");
+ else
+ format_string = "%d";
+ } else {
+ cr = gtk_print_context_get_cairo_context (context);
+
+ cairo_move_to (
+ cr, x1 + 0.1 * cell_width,
+ y1 + psi->header_row_height - 4);
+ cairo_line_to (
+ cr, x2,
+ y1 + psi->header_row_height - 4);
+
+ cairo_set_source_rgb (cr, 0, 0, 0);
+ cairo_set_line_width (cr, 0.5);
+ cairo_stroke (cr);
+
+ /* strftime format %A = full weekday name, %d = day of
+ * month, %B = full month name. You can change the
+ * order but don't change the specifiers or add
+ * anything. */
+ format_string = _("%A %d %B");
+
+ }
+
+ e_utf8_strftime (buffer, sizeof (buffer), format_string, &tm);
+
+ print_text_line (
+ context, font, buffer, PANGO_ALIGN_RIGHT,
+ x1, x2 - 4, y1 + 2, y1 + 2 + font_size, TRUE);
+ }
+}
+
+/* This adds one event to the view, adding it to the appropriate array. */
+static gboolean
+print_week_summary_cb (ECalComponent *comp,
+ time_t start,
+ time_t end,
+ gpointer data)
+
+{
+ EWeekViewEvent event;
+ struct icaltimetype start_tt, end_tt;
+ ECalModelGenerateInstancesData *mdata = (ECalModelGenerateInstancesData *) data;
+ struct psinfo *psi = (struct psinfo *) mdata->cb_data;
+
+ /* Check that the event times are valid. */
+
+#if 0
+ g_print (
+ "View start:%li end:%li Event start:%li end:%li\n",
+ psi->day_starts[0], psi->day_starts[psi->days_shown],
+ start, end);
+#endif
+
+ g_return_val_if_fail (start <= end, TRUE);
+ g_return_val_if_fail (start < psi->day_starts[psi->days_shown], TRUE);
+ g_return_val_if_fail (end > psi->day_starts[0], TRUE);
+
+ start_tt = icaltime_from_timet_with_zone (start, FALSE, psi->zone);
+ end_tt = icaltime_from_timet_with_zone (end, FALSE, psi->zone);
+
+ event.comp_data = g_object_ref (mdata->comp_data);
+
+ event.start = start;
+ event.end = end;
+ event.spans_index = 0;
+ event.num_spans = 0;
+
+ event.start_minute = start_tt.hour * 60 + start_tt.minute;
+ event.end_minute = end_tt.hour * 60 + end_tt.minute;
+ if (event.end_minute == 0 && start != end)
+ event.end_minute = 24 * 60;
+
+ g_array_append_val (psi->events, event);
+
+ return TRUE;
+}
+
+static void
+print_week_summary (GtkPrintContext *context,
+ ECalModel *model,
+ time_t whence,
+ gboolean multi_week_view,
+ gint weeks_shown,
+ gint month,
+ gdouble font_size,
+ gdouble font_size_background,
+ gdouble left,
+ gdouble right,
+ gdouble top,
+ gdouble bottom)
+{
+ icaltimezone *zone;
+ EWeekViewEvent *event;
+ struct psinfo psi = { 0 };
+ time_t day_start;
+ gint rows_per_day[E_WEEK_VIEW_MAX_WEEKS * 7], day, event_num;
+ GArray *spans;
+ PangoFontDescription *font, *font_background;
+ gdouble cell_width, cell_height;
+
+ zone = e_cal_model_get_timezone (model);
+
+ psi.days_shown = weeks_shown * 7;
+ psi.events = g_array_new (FALSE, FALSE, sizeof (EWeekViewEvent));
+ psi.multi_week_view = multi_week_view;
+ psi.weeks_shown = weeks_shown;
+ psi.month = month;
+ psi.zone = zone;
+
+ /* Get a few config settings. */
+ if (multi_week_view)
+ psi.compress_weekend = e_cal_model_get_compress_weekend (model);
+ else
+ psi.compress_weekend = TRUE;
+ psi.use_24_hour_format = e_cal_model_get_use_24_hour_format (model);
+
+ psi.display_start_weekday = e_cal_model_get_week_start_day (model);
+
+ /* If weekends are compressed then we can't start on a Sunday. */
+ if (psi.compress_weekend && psi.display_start_weekday == G_DATE_SUNDAY)
+ psi.display_start_weekday = G_DATE_SATURDAY;
+
+ day_start = time_day_begin_with_zone (whence, zone);
+ for (day = 0; day <= psi.days_shown; day++) {
+ psi.day_starts[day] = day_start;
+ day_start = time_add_day_with_zone (day_start, 1, zone);
+ }
+
+ /* Get the events from the server. */
+ e_cal_model_generate_instances_sync (
+ model,
+ psi.day_starts[0], psi.day_starts[psi.days_shown],
+ print_week_summary_cb, &psi);
+ qsort (
+ psi.events->data, psi.events->len,
+ sizeof (EWeekViewEvent), e_week_view_event_sort_func);
+
+ /* Layout the events. */
+ spans = e_week_view_layout_events (
+ psi.events, NULL,
+ psi.multi_week_view,
+ psi.weeks_shown,
+ psi.compress_weekend,
+ psi.display_start_weekday,
+ psi.day_starts, rows_per_day);
+
+ /* Calculate the size of the cells. */
+ if (multi_week_view) {
+ cell_width = (right - left) / (psi.compress_weekend ? 6 : 7);
+ cell_height = (bottom - top) / (weeks_shown * 2);
+ } else {
+ cell_width = (right - left) / 2;
+ cell_height = (bottom - top) / 6;
+ }
+
+ /* Calculate the row height, using the normal font and with room for
+ * space or a rectangle around it. */
+ psi.row_height = font_size * 1.2;
+ psi.header_row_height = font_size * 1.5;
+
+ /* Calculate how many rows we can fit into each type of cell. */
+ psi.rows_per_cell = ((cell_height * 2) - psi.header_row_height)
+ / (psi.row_height + 2);
+ psi.rows_per_compressed_cell = (cell_height - psi.header_row_height)
+ / (psi.row_height + 2);
+
+ /* Draw the grid and the day names/numbers. */
+ font_background = get_font_for_size (font_size_background, PANGO_WEIGHT_NORMAL);
+ print_week_view_background (
+ context, font_background, &psi, left, top,
+ cell_width, cell_height);
+ pango_font_description_free (font_background);
+
+ /* Print the events. */
+ font = get_font_for_size (font_size, PANGO_WEIGHT_NORMAL);
+ for (event_num = 0; event_num < psi.events->len; event_num++) {
+ event = &g_array_index (psi.events, EWeekViewEvent, event_num);
+ print_week_event (
+ context, font, &psi, left, top,
+ cell_width, cell_height, model, event, spans);
+ }
+
+ pango_font_description_free (font);
+
+ /* Free everything. */
+ for (event_num = 0; event_num < psi.events->len; event_num++) {
+ event = &g_array_index (psi.events, EWeekViewEvent, event_num);
+ g_object_unref (event->comp_data);
+ }
+ g_array_free (psi.events, TRUE);
+ g_array_free (spans, TRUE);
+}
+
+static void
+print_month_summary (GtkPrintContext *context,
+ ECalModel *model,
+ ECalendarView *calendar_view,
+ EPrintView print_view_type,
+ time_t whence,
+ gdouble left,
+ gdouble right,
+ gdouble top,
+ gdouble bottom)
+{
+ icaltimezone *zone;
+ time_t date;
+ struct tm tm;
+ struct icaltimetype tt;
+ gchar buffer[100];
+ PangoFontDescription *font;
+ gboolean compress_weekend;
+ gint columns, col, month, weeks;
+ GDateWeekday weekday;
+ gint wday;
+ gdouble font_size, cell_width, x1, x2, y1, y2;
+
+ zone = e_cal_model_get_timezone (model);
+ weekday = e_cal_model_get_week_start_day (model);
+ compress_weekend = e_cal_model_get_compress_weekend (model);
+
+ date = 0;
+ weeks = 6;
+ if (print_view_type == E_PRINT_VIEW_MONTH) {
+ EWeekView *week_view;
+ GDate first_day_shown;
+ gboolean multi_week_view;
+ gint weeks_shown;
+
+ week_view = E_WEEK_VIEW (calendar_view);
+ weeks_shown = e_week_view_get_weeks_shown (week_view);
+ multi_week_view = e_week_view_get_multi_week_view (week_view);
+ e_week_view_get_first_day_shown (week_view, &first_day_shown);
+
+ if (multi_week_view && !(weeks_shown >= 4 &&
+ g_date_valid (&first_day_shown))) {
+ weeks = weeks_shown;
+ date = whence;
+ }
+ }
+
+ /* Remember which month we want. */
+ tt = icaltime_from_timet_with_zone (whence, FALSE, zone);
+ month = tt.month - 1;
+
+ /* Find the start of the month, and then the start of the week on
+ * or before that day. */
+ if (!date)
+ date = time_month_begin_with_zone (whence, zone);
+
+ wday = e_weekday_to_tm_wday (weekday);
+ date = time_week_begin_with_zone (date, wday, zone);
+
+ /* If weekends are compressed then we can't start on a Sunday. */
+ if (compress_weekend && weekday == G_DATE_SUNDAY)
+ date = time_add_day_with_zone (date, -1, zone);
+
+ /* do day names ... */
+
+ /* We are only interested in outputting the weekday here, but we want
+ * to be able to step through the week without worrying about
+ * overflows making strftime choke, so we move near to the start of
+ * the month. */
+ convert_timet_to_struct_tm (date, zone, &tm);
+ tm.tm_mday = (tm.tm_mday % 7) + 7;
+
+ font = get_font_for_size (MONTH_NORMAL_FONT_SIZE, PANGO_WEIGHT_BOLD);
+ font_size = get_font_size (font);
+
+ columns = compress_weekend ? 6 : 7;
+ cell_width = (right - left) / columns;
+ y1 = top;
+ y2 = top + font_size * 1.5;
+
+ for (col = 0; col < columns; col++) {
+ if (tm.tm_wday == 6 && compress_weekend)
+ g_snprintf (
+ buffer, sizeof (buffer), "%s/%s",
+ e_get_weekday_name (G_DATE_SATURDAY, TRUE),
+ e_get_weekday_name (G_DATE_SUNDAY, TRUE));
+ else
+ g_snprintf (
+ buffer, sizeof (buffer), "%s",
+ e_get_weekday_name (
+ tm.tm_wday ? tm.tm_wday : 7, FALSE));
+
+ x1 = left + cell_width * col;
+ x2 = x1 + cell_width;
+
+ print_border (context, x1, x2, y1, y2, 1.0, -1.0);
+ print_text_line (context, font, buffer, PANGO_ALIGN_CENTER, x1, x2, y1, y2, TRUE);
+
+ tm.tm_mday++;
+ tm.tm_wday = (tm.tm_wday + 1) % 7;
+ }
+ pango_font_description_free (font);
+
+ top = y2;
+ print_week_summary (
+ context, model, date, TRUE, weeks, month,
+ MONTH_NORMAL_FONT_SIZE, MONTH_NORMAL_FONT_SIZE,
+ left, right, top, bottom);
+}
+
+static void
+print_todo_details (GtkPrintContext *context,
+ ETable *tasks_table,
+ time_t start,
+ time_t end,
+ gdouble left,
+ gdouble right,
+ gdouble top,
+ gdouble bottom)
+{
+ PangoFontDescription *font_summary;
+ gdouble y, yend, x, xend;
+ struct icaltimetype *tt;
+ ECalModel *model;
+ gint rows, row;
+ cairo_t *cr;
+
+ /* We get the tasks directly from the TaskPad ETable. This means we
+ * get them filtered & sorted for free. */
+ g_return_if_fail (tasks_table != NULL);
+ model = e_task_table_get_model (E_TASK_TABLE (tasks_table));
+
+ font_summary = get_font_for_size (12, PANGO_WEIGHT_NORMAL);
+
+ cr = gtk_print_context_get_cairo_context (context);
+
+ cairo_set_source_rgb (cr, 0, 0, 0);
+ cairo_set_line_width (cr, 0.0);
+ top +=2;
+
+ titled_box (
+ context, _("Tasks"), font_summary, PANGO_ALIGN_CENTER,
+ &left, &top, &right, &bottom, 1.0);
+
+ y = top;
+ yend = bottom - 2;
+
+ rows = e_table_model_row_count (E_TABLE_MODEL (model));
+ for (row = 0; row < rows; row++) {
+ ECalModelComponent *comp_data;
+ ECalComponent *comp;
+ ECalComponentText summary;
+ gint model_row;
+
+ model_row = e_table_view_to_model_row (tasks_table, row);
+ comp_data = e_cal_model_get_component_at (model, model_row);
+ if (!comp_data)
+ continue;
+
+ comp = e_cal_component_new ();
+ e_cal_component_set_icalcomponent (
+ comp, icalcomponent_new_clone (comp_data->icalcomp));
+
+ e_cal_component_get_summary (comp, &summary);
+ if (!summary.value) {
+ g_object_unref (comp);
+ continue;
+ }
+
+ x = left;
+ xend = right - 2;
+ if (y > bottom) {
+ g_object_unref (comp);
+ break;
+ }
+
+ /* Print the box to put the tick in. */
+ print_border (context, x + 2, x + 8, y + 6, y + 15, 0.1, -1.0);
+
+ /* If the task is complete, print a tick in the box. */
+ e_cal_component_get_completed (comp, &tt);
+ if (tt) {
+ e_cal_component_free_icaltimetype (tt);
+
+ cr = gtk_print_context_get_cairo_context (context);
+ cairo_set_source_rgb (cr, 0, 0, 0);
+ cairo_move_to (cr, x + 3, y + 11);
+ cairo_line_to (cr, x + 5, y + 14);
+ cairo_line_to (cr, x + 7, y + 5.5);
+ cairo_set_line_width (cr, 1);
+ cairo_stroke (cr);
+ }
+
+ y = bound_text (
+ context, font_summary, summary.value, -1,
+ x + 14, y + 4, xend, yend, FALSE, NULL, NULL);
+
+ y += get_font_size (font_summary) - 5;
+ cr = gtk_print_context_get_cairo_context (context);
+ cairo_move_to (cr, x, y);
+ cairo_line_to (cr, xend, y);
+ cairo_set_line_width (cr, 1);
+ cairo_stroke (cr);
+
+ g_object_unref (comp);
+ }
+
+ pango_font_description_free (font_summary);
+}
+
+static void
+print_day_view (GtkPrintContext *context,
+ ECalendarView *cal_view,
+ ETable *tasks_table,
+ time_t date)
+{
+ ECalModel *model;
+ GtkPageSetup *setup;
+ icaltimezone *zone;
+ gint i, days = 1;
+ gdouble todo, l, week_numbers_inc, small_month_width;
+ gchar buf[100];
+ gdouble width, height;
+ struct tm tm;
+
+ model = e_calendar_view_get_model (cal_view);
+ zone = e_cal_model_get_timezone (model);
+
+ setup = gtk_print_context_get_page_setup (context);
+
+ width = gtk_page_setup_get_page_width (setup, GTK_UNIT_POINTS);
+ height = gtk_page_setup_get_page_height (setup, GTK_UNIT_POINTS);
+ small_month_width = calc_small_month_width (context, HEADER_HEIGHT);
+ week_numbers_inc = get_show_week_numbers () ? small_month_width / 7.0 : 0;
+
+ for (i = 0; i < days; i++) {
+ todo = width * 0.75;
+
+ /* Print the main view with all the events in. */
+ print_day_details (
+ context, model, date,
+ 0.0, todo - 2.0, HEADER_HEIGHT + 4,
+ height);
+
+ /* Print the TaskPad down the right. */
+ print_todo_details (
+ context, tasks_table, 0, INT_MAX,
+ todo, width, HEADER_HEIGHT + 4,
+ height);
+
+ /* Print the filled border around the header. */
+ print_border (
+ context, 0.0, width,
+ 0.0, HEADER_HEIGHT + 4, 1.0, 0.9);
+
+ /* Print the 2 mini calendar-months. */
+ l = width - SMALL_MONTH_PAD -
+ (small_month_width + week_numbers_inc) * 2 -
+ SMALL_MONTH_SPACING;
+
+ print_month_small (
+ context, model, date,
+ l, 2, l + small_month_width + week_numbers_inc, HEADER_HEIGHT + 2,
+ DATE_MONTH | DATE_YEAR, date, date, FALSE);
+
+ l += SMALL_MONTH_SPACING + small_month_width + week_numbers_inc;
+ print_month_small (
+ context, model,
+ time_add_month_with_zone (date, 1, zone),
+ l, 2, l + small_month_width + week_numbers_inc, HEADER_HEIGHT + 2,
+ DATE_MONTH | DATE_YEAR, 0, 0, FALSE);
+
+ /* Print the date, e.g. '8th May, 2001'. */
+ convert_timet_to_struct_tm (date, zone, &tm);
+ format_date (&tm, DATE_DAY | DATE_MONTH | DATE_YEAR,
+ buf, 100);
+
+ print_text_size_bold (
+ context, buf, PANGO_ALIGN_LEFT,
+ 4, todo, 4,
+ 4 + 24);
+
+ /* Print the day, e.g. 'Tuesday'. */
+ format_date (&tm, DATE_DAYNAME, buf, 100);
+
+ print_text_size_bold (
+ context, buf, PANGO_ALIGN_LEFT,
+ 4, todo,
+ HEADER_HEIGHT + 9,
+ HEADER_HEIGHT + 9 + 18);
+
+ date = time_add_day_with_zone (date, 1, zone);
+ }
+}
+
+static void
+print_work_week_background (GtkPrintContext *context,
+ ECalModel *model,
+ time_t whence,
+ struct pdinfo *pdi,
+ gdouble left,
+ gdouble right,
+ gdouble top,
+ gdouble bottom)
+{
+ PangoFontDescription *font_hour, *font_minute;
+ gdouble yinc, y;
+ gdouble width = DAY_VIEW_TIME_COLUMN_WIDTH;
+ gdouble day_width;
+ gdouble font_size, max_font_size, hour_font_size, minute_font_size;
+ gchar buf[20];
+ const gchar *minute;
+ const gint LONG_EVENT_OFFSET = 6;
+ gboolean use_24_hour;
+ gint i, hour, row;
+ gdouble hour_minute_xl, hour_minute_xr;
+ cairo_t *cr;
+
+ use_24_hour = e_cal_model_get_use_24_hour_format (model);
+
+ /* Fill the left time column in light-gray. */
+ print_border (context, left, left + width, top, bottom, -1.0, 0.9);
+ /* Fill the right time column in light-gray */
+ print_border (context, right - width, right, top, bottom, -1.0, 0.9);
+
+ /* Draw the border around the entire view. */
+ cr = gtk_print_context_get_cairo_context (context);
+
+ cairo_set_source_rgb (cr, 0, 0, 0);
+ print_border (context, left, right, top, bottom, 1.0, -1.0);
+
+ /* Draw the vertical line on the right of the time column. */
+ cr = gtk_print_context_get_cairo_context (context);
+ cairo_set_line_width (cr, 0.0);
+ cairo_move_to (cr, left + width, bottom);
+ cairo_line_to (cr, left + width, top);
+ cairo_stroke (cr);
+
+ cairo_move_to (cr, right - width, bottom);
+ cairo_line_to (cr, right - width, top);
+ cairo_stroke (cr);
+
+ /* Calculate the row height. */
+ if (top > bottom)
+ yinc = (top - bottom) / (pdi->end_hour - pdi->start_hour);
+ else
+ yinc = (bottom - top) / (pdi->end_hour - pdi->start_hour);
+
+ /* Get the 2 fonts we need. */
+ font_size = yinc * 0.6;
+ max_font_size = width * 0.45;
+ hour_font_size = MIN (font_size, max_font_size);
+ font_hour = get_font_for_size (hour_font_size, PANGO_WEIGHT_BOLD);
+
+ font_size = yinc * 0.33;
+ max_font_size = width * 0.2;
+ minute_font_size = MIN (font_size, max_font_size);
+ font_minute = get_font_for_size (minute_font_size, PANGO_WEIGHT_BOLD);
+ hour_minute_xr = evo_calendar_print_renderer_get_width (
+ context, font_minute, use_24_hour ? "00" : _("am"));
+ if (!use_24_hour)
+ hour_minute_xr = MAX (
+ hour_minute_xr,
+ evo_calendar_print_renderer_get_width (
+ context, font_minute, _("pm")));
+
+ row = 0;
+ hour_minute_xl = left + width - hour_minute_xr - 3;
+ hour_minute_xr = right - hour_minute_xr - 3;
+ for (i = pdi->start_hour; i < pdi->end_hour; i++) {
+ y = top + yinc * (row + 1);
+ cr = gtk_print_context_get_cairo_context (context);
+ cairo_set_source_rgb (cr, 0, 0, 0);
+
+ if (use_24_hour) {
+ hour = i;
+ minute = "00";
+ } else {
+ if (i < 12)
+ minute = _("am");
+ else
+ minute = _("pm");
+
+ hour = i % 12;
+ if (hour == 0)
+ hour = 12;
+ }
+
+ /* the hour label/minute */
+ sprintf (buf, "%d", hour);
+ print_text (
+ context, font_hour, buf, PANGO_ALIGN_RIGHT,
+ left, hour_minute_xl,
+ y - yinc, y - yinc + hour_font_size);
+ print_text (
+ context, font_minute, minute, PANGO_ALIGN_LEFT,
+ hour_minute_xl, left + width - 3,
+ y - yinc, y - yinc + minute_font_size);
+
+ /* To the right */
+ print_text (
+ context, font_hour, buf, PANGO_ALIGN_RIGHT,
+ right - width, hour_minute_xr,
+ y - yinc, y - yinc + hour_font_size);
+ print_text (
+ context, font_minute, minute, PANGO_ALIGN_LEFT,
+ hour_minute_xr, right - 3,
+ y - yinc, y - yinc + minute_font_size);
+
+ /* Draw the horizontal line between hours, across the entire
+ width of the day view. */
+ cr = gtk_print_context_get_cairo_context (context);
+ cairo_move_to (cr, left, y);
+ cairo_line_to (cr, right, y);
+ cairo_set_line_width (cr, 1);
+ cairo_stroke (cr);
+
+ /* Draw the horizontal line for the 1/2-hours, across the
+ * entire width except for part of the time column. */
+ cairo_move_to (cr, left + width * 0.6, y - yinc / 2);
+ cairo_line_to (cr, right, y - yinc / 2);
+ cairo_set_line_width (cr, 1);
+ cairo_stroke (cr);
+ row++;
+ }
+
+ /* Draw the vertical lines for the days */
+ day_width = (right - left - 2 *width) / pdi->days_shown;
+ for (i = 0; i < pdi->days_shown - 1; ++i) {
+ cr = gtk_print_context_get_cairo_context (context);
+ cairo_move_to (cr, left + width + day_width * (i + 1), top);
+ cairo_line_to (cr, left + width + day_width * (i + 1), bottom);
+ cairo_set_line_width (cr, 1);
+ cairo_stroke (cr);
+ }
+
+ /* And now the ones from the border to the hours, looks weird otherwise */
+ cr = gtk_print_context_get_cairo_context (context);
+ cairo_move_to (cr, left, HEADER_HEIGHT);
+ cairo_line_to (cr, left, HEADER_HEIGHT + DAY_VIEW_ROW_HEIGHT + LONG_EVENT_OFFSET);
+
+ cairo_move_to (cr, right, HEADER_HEIGHT);
+ cairo_line_to (cr, right, HEADER_HEIGHT + DAY_VIEW_ROW_HEIGHT + LONG_EVENT_OFFSET);
+ cairo_stroke (cr);
+
+ pango_font_description_free (font_hour);
+ pango_font_description_free (font_minute);
+}
+
+static void
+print_work_week_day_details (GtkPrintContext *context,
+ ECalModel *model,
+ time_t whence,
+ gdouble left,
+ gdouble right,
+ gdouble top,
+ gdouble bottom,
+ struct pdinfo *_pdi)
+{
+ icaltimezone *zone;
+ EDayViewEvent *event;
+ PangoFontDescription *font;
+ time_t start, end;
+ struct pdinfo pdi = { 0 };
+ gint rows_in_top_display, i, rows_with_30_mins;
+ gdouble font_size, max_font_size;
+ cairo_t *cr;
+ GdkPixbuf *pixbuf = NULL;
+#define LONG_DAY_EVENTS_TOP_SPACING 4
+#define LONG_DAY_EVENTS_BOTTOM_SPACING 2
+
+ zone = e_cal_model_get_timezone (model);
+
+ start = time_day_begin_with_zone (whence, zone);
+ end = time_day_end_with_zone (start, zone);
+
+ pdi.days_shown = 1;
+ pdi.day_starts[0] = start;
+ pdi.day_starts[1] = end;
+ pdi.long_events = g_array_new (FALSE, FALSE, sizeof (EDayViewEvent));
+ pdi.events[0] = g_array_new (FALSE, FALSE, sizeof (EDayViewEvent));
+ pdi.start_hour = e_cal_model_get_work_day_start_hour (model);
+ pdi.end_hour = e_cal_model_get_work_day_end_hour (model);
+ if (e_cal_model_get_work_day_end_minute (model) != 0)
+ pdi.end_hour++;
+ pdi.mins_per_row = get_day_view_time_divisions ();
+ pdi.rows = (pdi.end_hour - pdi.start_hour) * (60 / pdi.mins_per_row);
+ pdi.start_minute_offset = pdi.start_hour * 60;
+ pdi.end_minute_offset = pdi.end_hour * 60;
+ pdi.use_24_hour_format = e_cal_model_get_use_24_hour_format (model);
+ pdi.zone = e_cal_model_get_timezone (model);
+
+ /* Get the events from the server. */
+ e_cal_model_generate_instances_sync (model, start, end, print_day_details_cb, &pdi);
+ qsort (
+ pdi.long_events->data, pdi.long_events->len,
+ sizeof (EDayViewEvent), e_day_view_event_sort_func);
+ qsort (
+ pdi.events[0]->data, pdi.events[0]->len,
+ sizeof (EDayViewEvent), e_day_view_event_sort_func);
+
+ pdi.start_hour = MIN (pdi.start_hour, _pdi->start_hour);
+ pdi.end_hour = MAX (pdi.end_hour, _pdi->end_hour);
+
+ /* TODO: This should be redundant */
+ /* Also print events outside of work hours */
+ if (pdi.events[0]->len > 0) {
+ struct icaltimetype tt;
+
+ event = &g_array_index (pdi.events[0], EDayViewEvent, 0);
+ tt = icaltime_from_timet_with_zone (event->start, FALSE, zone);
+ if (tt.hour < pdi.start_hour)
+ pdi.start_hour = tt.hour;
+ pdi.start_minute_offset = pdi.start_hour * 60;
+
+ event = &g_array_index (pdi.events[0], EDayViewEvent, pdi.events[0]->len - 1);
+ tt = icaltime_from_timet_with_zone (event->end, FALSE, zone);
+ if (tt.hour > pdi.end_hour || tt.hour == 0) {
+ pdi.end_hour = tt.hour ? tt.hour : 24;
+ if (tt.minute > 0)
+ pdi.end_hour++;
+ }
+ pdi.end_minute_offset = pdi.end_hour * 60;
+
+ pdi.rows = (pdi.end_hour - pdi.start_hour) * (60 / pdi.mins_per_row);
+ }
+
+ /* Lay them out the long events, across the top of the page. */
+ e_day_view_layout_long_events (
+ pdi.long_events, pdi.days_shown,
+ pdi.day_starts, &rows_in_top_display);
+
+ /*Print the long events. */
+ font = get_font_for_size (12, PANGO_WEIGHT_NORMAL);
+
+ /* We always leave space for DAY_VIEW_MIN_ROWS_IN_TOP_DISPLAY in the
+ * top display, but we may have more rows than that, in which case
+ * the main display area will be compressed. */
+ /* Limit long day event to half the height of the panel */
+ rows_in_top_display = MIN (
+ MAX (rows_in_top_display,
+ DAY_VIEW_MIN_ROWS_IN_TOP_DISPLAY),
+ (bottom - top) * 0.5 / DAY_VIEW_ROW_HEIGHT);
+
+ if (rows_in_top_display > pdi.long_events->len)
+ rows_in_top_display = pdi.long_events->len;
+
+ for (i = 0; i < rows_in_top_display && i < pdi.long_events->len; i++) {
+ event = &g_array_index (pdi.long_events, EDayViewEvent, i);
+ print_day_long_event (
+ context, font, left, right,
+ top + LONG_DAY_EVENTS_TOP_SPACING, bottom,
+ DAY_VIEW_ROW_HEIGHT, event, &pdi, model);
+ }
+
+ if (rows_in_top_display < pdi.long_events->len) {
+ /* too many events */
+ cairo_t *cr = gtk_print_context_get_cairo_context (context);
+ gint x, y;
+
+ if (!pixbuf) {
+ const gchar **xpm = (const gchar **) jump_xpm;
+
+ pixbuf = gdk_pixbuf_new_from_xpm_data (xpm);
+ }
+
+ /* Right align - 10 comes from print_day_long_event too */
+ x = right - gdk_pixbuf_get_width (pixbuf) * 0.5 - 10;
+ /* Placing '...' over the last all day event entry printed. '-1 -1' comes
+ from print_long_day_event (top / bottom spacing in each cell) */
+ y = top + LONG_DAY_EVENTS_TOP_SPACING
+ + DAY_VIEW_ROW_HEIGHT * (i - 1)
+ + (DAY_VIEW_ROW_HEIGHT - 1 - 1) * 0.5;
+
+ cairo_save (cr);
+ cairo_scale (cr, 0.5, 0.5);
+ gdk_cairo_set_source_pixbuf (cr, pixbuf, x * 2.0, y * 2.0);
+ cairo_paint (cr);
+ cairo_restore (cr);
+ }
+
+ if (!rows_in_top_display)
+ rows_in_top_display++;
+
+ /* Draw the border around the long events. */
+ cr = gtk_print_context_get_cairo_context (context);
+
+ cairo_set_source_rgb (cr, 0, 0, 0);
+ print_border (
+ context, left, right,
+ top, top + rows_in_top_display * DAY_VIEW_ROW_HEIGHT +
+ LONG_DAY_EVENTS_TOP_SPACING + LONG_DAY_EVENTS_BOTTOM_SPACING,
+ 1.0, -1.0);
+
+ /* Adjust the area containing the main display. */
+ top += rows_in_top_display * DAY_VIEW_ROW_HEIGHT
+ + LONG_DAY_EVENTS_TOP_SPACING
+ + LONG_DAY_EVENTS_BOTTOM_SPACING;
+
+ /* lay out the short events, within the day. */
+ e_day_view_layout_day_events (
+ pdi.events[0], CALC_DAY_VIEW_ROWS (pdi.mins_per_row),
+ pdi.mins_per_row, pdi.cols_per_row, -1);
+
+ /* use font like with 30 minutes time division */
+ rows_with_30_mins = (pdi.end_hour - pdi.start_hour) * (60 / 30);
+
+ pango_font_description_free (font);
+
+ /* print the short events. */
+ if (top > bottom)
+ max_font_size = ((top - bottom) / rows_with_30_mins) - 4;
+ else
+ max_font_size = ((bottom - top) / rows_with_30_mins) - 4;
+ font_size = MIN (DAY_NORMAL_FONT_SIZE, max_font_size);
+ font = get_font_for_size (font_size, PANGO_WEIGHT_NORMAL);
+
+ for (i = 0; i < pdi.events[0]->len; i++) {
+ event = &g_array_index (pdi.events[0], EDayViewEvent, i);
+ print_day_event (
+ context, font, left,
+ right, top, bottom, event, &pdi, model);
+ }
+
+ /* Free everything. */
+ if (pixbuf)
+ g_object_unref (pixbuf);
+ free_event_array (pdi.long_events);
+ pango_font_description_free (font);
+ g_array_free (pdi.long_events, TRUE);
+ free_event_array (pdi.events[0]);
+ g_array_free (pdi.events[0], TRUE);
+}
+
+/* Figure out what the overal hour limits are */
+static gboolean
+print_work_week_view_cb (ECalComponent *comp,
+ time_t istart,
+ time_t iend,
+ gpointer data)
+{
+ ECalModelGenerateInstancesData *mdata = (ECalModelGenerateInstancesData *) data;
+ struct pdinfo *pdi = (struct pdinfo *) mdata->cb_data;
+ struct icaltimetype tt;
+
+ tt = icaltime_from_timet_with_zone (istart, FALSE, pdi->zone);
+ pdi->start_hour = MIN (pdi->start_hour, tt.hour);
+
+ tt = icaltime_from_timet_with_zone (iend, FALSE, pdi->zone);
+ /* If we're past the hour, use the next one */
+ pdi->end_hour = MAX (pdi->end_hour, tt.minute ? tt.hour + 1 : tt.hour);
+
+ return TRUE;
+}
+
+static void
+print_work_week_view (GtkPrintContext *context,
+ ECalendarView *cal_view,
+ time_t date)
+{
+ GtkPageSetup *setup;
+ icaltimezone *zone;
+ time_t when, start, end;
+ gdouble width, height, l;
+ gdouble small_month_width;
+ gdouble weeknum_inc;
+ gint i, days = 5;
+ gchar buf[100];
+ const gint LONG_EVENT_OFFSET = 6;
+ struct pdinfo pdi = { 0 };
+ struct tm tm;
+ gdouble day_width, day_x;
+ ECalModel *model;
+
+ model = e_calendar_view_get_model (cal_view);
+ zone = e_cal_model_get_timezone (model);
+
+ setup = gtk_print_context_get_page_setup (context);
+
+ width = gtk_page_setup_get_page_width (setup, GTK_UNIT_POINTS);
+ height = gtk_page_setup_get_page_height (setup, GTK_UNIT_POINTS);
+
+ small_month_width = calc_small_month_width (context, HEADER_HEIGHT);
+ weeknum_inc = get_show_week_numbers () ? small_month_width / 7.0 : 0;
+
+ /* We always start on a Monday */
+ start = time_week_begin_with_zone (date, 1, zone);
+ end = time_add_day_with_zone (start, days, zone);
+
+ pdi.days_shown = days;
+ pdi.start_hour = e_cal_model_get_work_day_start_hour (model);
+ pdi.end_hour = e_cal_model_get_work_day_end_hour (model);
+ pdi.zone = zone;
+
+ e_cal_model_generate_instances_sync (model, start, end, print_work_week_view_cb, &pdi);
+
+ print_work_week_background (
+ context, model, date, &pdi, 0.0, width,
+ HEADER_HEIGHT + DAY_VIEW_ROW_HEIGHT + LONG_EVENT_OFFSET,
+ height);
+
+ print_border (context, 0.0, width, 0.0, HEADER_HEIGHT, 1.0, 0.9);
+
+ /* Print the 2 mini calendar-months. */
+ l = width - SMALL_MONTH_PAD - (small_month_width + weeknum_inc) * 2 -
+ SMALL_MONTH_SPACING;
+
+ print_month_small (
+ context, model, start,
+ l, 4, l + small_month_width + weeknum_inc, HEADER_HEIGHT + 4,
+ DATE_MONTH | DATE_YEAR, start, end, FALSE);
+
+ l += SMALL_MONTH_SPACING + small_month_width + weeknum_inc;
+ print_month_small (
+ context, model,
+ time_add_month_with_zone (start, 1, zone),
+ l, 4, l + small_month_width + weeknum_inc, HEADER_HEIGHT + 4,
+ DATE_MONTH | DATE_YEAR, 0, 0, FALSE);
+
+ /* Print the start day of the week, e.g. '7th May 2001'. */
+ convert_timet_to_struct_tm (start, zone, &tm);
+ format_date (&tm, DATE_DAY | DATE_MONTH | DATE_YEAR, buf, 100);
+ print_text_size_bold (
+ context, buf, PANGO_ALIGN_LEFT,
+ 3, width,
+ 4, 4 + 24);
+
+ /* Print the end day of the week, e.g. '13th May 2001'. */
+ /* We need to substract one or the wrong day will be printed */
+ convert_timet_to_struct_tm (
+ time_add_day_with_zone (end, -1, zone), zone, &tm);
+ format_date (&tm, DATE_DAY | DATE_MONTH | DATE_YEAR, buf, 100);
+ print_text_size_bold (
+ context, buf, PANGO_ALIGN_LEFT,
+ 3, width,
+ 24 + 3, 24 + 3 + 24);
+
+ /* Now print each days' events */
+ day_width = (width - 2 *DAY_VIEW_TIME_COLUMN_WIDTH) / days;
+ when = start;
+ for (i = 0; i < days; ++i) {
+ day_x = DAY_VIEW_TIME_COLUMN_WIDTH + day_width * i;
+
+ /* Print the day, e.g. 'Tuesday'. */
+ convert_timet_to_struct_tm (when, zone, &tm);
+ format_date (&tm, DATE_DAYNAME, buf, 100);
+
+ print_text_size_bold (
+ context, buf, PANGO_ALIGN_LEFT,
+ day_x + 4, day_x + day_width,
+ HEADER_HEIGHT + 4, HEADER_HEIGHT + 4 + 18);
+
+ print_work_week_day_details (
+ context, model, when,
+ day_x, day_x + day_width,
+ HEADER_HEIGHT, height, &pdi);
+ when = time_add_day_with_zone (when, 1, zone);
+ }
+}
+
+static void
+print_week_view (GtkPrintContext *context,
+ ECalendarView *cal_view,
+ time_t date)
+{
+ GtkPageSetup *setup;
+ ECalModel *model;
+ icaltimezone *zone;
+ gdouble l, week_numbers_inc, small_month_width;
+ gchar buf[100];
+ time_t when;
+ GDateWeekday week_start_day;
+ gint wday;
+ struct tm tm;
+ gdouble width, height;
+
+ setup = gtk_print_context_get_page_setup (context);
+
+ width = gtk_page_setup_get_page_width (setup, GTK_UNIT_POINTS);
+ height = gtk_page_setup_get_page_height (setup, GTK_UNIT_POINTS);
+ small_month_width = calc_small_month_width (context, HEADER_HEIGHT);
+ week_numbers_inc = get_show_week_numbers () ? small_month_width / 7.0 : 0;
+
+ model = e_calendar_view_get_model (cal_view);
+ zone = e_cal_model_get_timezone (model);
+
+ convert_timet_to_struct_tm (date, zone, &tm);
+ week_start_day = e_cal_model_get_week_start_day (model);
+
+ wday = e_weekday_to_tm_wday (week_start_day);
+ when = time_week_begin_with_zone (date, wday, zone);
+
+ /* If the week starts on a Sunday, we have to show the Saturday first,
+ * since the weekend is compressed. */
+ if (week_start_day == G_DATE_SUNDAY) {
+ if (tm.tm_wday == 6)
+ when = time_add_day_with_zone (when, 6, zone);
+ else
+ when = time_add_day_with_zone (when, -1, zone);
+ }
+
+ /* Print the main week view. */
+ print_week_summary (
+ context, model, when, FALSE, 1, 0,
+ WEEK_EVENT_FONT_SIZE, WEEK_SMALL_FONT_SIZE,
+ 0.0, width,
+ HEADER_HEIGHT + 20, height);
+
+ /* Print the border around the main view. */
+ print_border (
+ context, 0.0, width, HEADER_HEIGHT ,
+ height, 1.0, -1.0);
+
+ /* Print the border around the header area. */
+ print_border (
+ context, 0.0, width,
+ 0.0, HEADER_HEIGHT + 2.0 + 20, 1.0, 0.9);
+
+ /* Print the 2 mini calendar-months. */
+ l = width - SMALL_MONTH_PAD - (small_month_width + week_numbers_inc) * 2
+ - SMALL_MONTH_SPACING;
+ print_month_small (
+ context, model, when,
+ l, 4, l + small_month_width + week_numbers_inc, HEADER_HEIGHT + 10,
+ DATE_MONTH | DATE_YEAR, when,
+ time_add_week_with_zone (when, 1, zone), FALSE);
+
+ l += SMALL_MONTH_SPACING + small_month_width + week_numbers_inc;
+ print_month_small (
+ context, model,
+ time_add_month_with_zone (when, 1, zone),
+ l, 4, l + small_month_width + week_numbers_inc, HEADER_HEIGHT + 10,
+ DATE_MONTH | DATE_YEAR, when,
+ time_add_week_with_zone (when, 1, zone), FALSE);
+
+ /* Print the start day of the week, e.g. '7th May 2001'. */
+ convert_timet_to_struct_tm (when, zone, &tm);
+ format_date (&tm, DATE_DAY | DATE_MONTH | DATE_YEAR, buf, 100);
+ print_text_abs_bold (
+ context, buf, WEEK_NORMAL_FONT_SIZE, PANGO_ALIGN_LEFT,
+ 3, width, 4, 4 + 24);
+
+ /* Print the end day of the week, e.g. '13th May 2001'. */
+ when = time_add_day_with_zone (when, 6, zone);
+ convert_timet_to_struct_tm (when, zone, &tm);
+ format_date (&tm, DATE_DAY | DATE_MONTH | DATE_YEAR, buf, 100);
+ print_text_abs_bold (
+ context, buf, WEEK_NORMAL_FONT_SIZE, PANGO_ALIGN_LEFT,
+ 3, width, 24 + 3, 24 + 3 + 24);
+}
+
+static void
+print_month_view (GtkPrintContext *context,
+ ECalendarView *cal_view,
+ EPrintView print_view_type,
+ time_t date)
+{
+ ECalModel *model;
+ GtkPageSetup *setup;
+ icaltimezone *zone;
+ gchar buf[100];
+ gdouble width, height;
+ gdouble l, week_numbers_inc, small_month_width;
+ struct tm tm;
+
+ model = e_calendar_view_get_model (cal_view);
+ zone = e_cal_model_get_timezone (model);
+
+ setup = gtk_print_context_get_page_setup (context);
+
+ width = gtk_page_setup_get_page_width (setup, GTK_UNIT_POINTS);
+ height = gtk_page_setup_get_page_height (setup, GTK_UNIT_POINTS);
+ small_month_width = calc_small_month_width (context, HEADER_HEIGHT);
+ week_numbers_inc = get_show_week_numbers () ? small_month_width / 7.0 : 0;
+
+ /* Print the main month view. */
+ print_month_summary (context, model, cal_view, print_view_type, date, 0.0, width, HEADER_HEIGHT,
height);
+
+ /* Print the border around the header. */
+ print_border (context, 0.0, width, 0.0, HEADER_HEIGHT + 10, 1.0, 0.9);
+
+ l = width - SMALL_MONTH_PAD - small_month_width - week_numbers_inc;
+
+ /* Print the 2 mini calendar-months. */
+ print_month_small (
+ context, model,
+ time_add_month_with_zone (date, 1, zone),
+ l, 4, l + small_month_width + week_numbers_inc, HEADER_HEIGHT + 4,
+ DATE_MONTH | DATE_YEAR, 0, 0, FALSE);
+
+ print_month_small (
+ context, model,
+ time_add_month_with_zone (date, -1, zone),
+ SMALL_MONTH_PAD, 4, SMALL_MONTH_PAD + small_month_width + week_numbers_inc, HEADER_HEIGHT + 4,
+ DATE_MONTH | DATE_YEAR, 0, 0, FALSE);
+
+ /* Print the month, e.g. 'May 2001'. */
+ convert_timet_to_struct_tm (date, zone, &tm);
+ format_date (&tm, DATE_MONTH | DATE_YEAR, buf, 100);
+ print_text_size_bold (
+ context, buf, PANGO_ALIGN_CENTER,
+ 3, width - 3,
+ 3, 3 + 24);
+
+}
+
+static gboolean
+same_date (struct tm tm1,
+ time_t t2,
+ icaltimezone *zone)
+{
+ struct tm tm2;
+
+ convert_timet_to_struct_tm (t2, zone, &tm2);
+
+ return
+ tm1.tm_mday == tm2.tm_mday &&
+ tm1.tm_mon == tm2.tm_mon &&
+ tm1.tm_year == tm2.tm_year;
+}
+
+static void
+write_label_piece (time_t t,
+ time_t *start_cmp,
+ icaltimezone *zone,
+ gboolean use_24_hour_format,
+ gchar *buffer,
+ gint size,
+ gchar *stext,
+ const gchar *etext)
+{
+ struct tm tmp_tm;
+ gint len;
+
+ convert_timet_to_struct_tm (t, zone, &tmp_tm);
+
+ if (stext != NULL)
+ strcat (buffer, stext);
+
+ len = strlen (buffer);
+ if (start_cmp && same_date (tmp_tm, *start_cmp, zone))
+ e_time_format_time (
+ &tmp_tm, use_24_hour_format,
+ FALSE, &buffer[len], size - len);
+ else
+ e_time_format_date_and_time (
+ &tmp_tm, use_24_hour_format, FALSE,
+ FALSE, &buffer[len], size - len);
+ if (etext != NULL)
+ strcat (buffer, etext);
+}
+
+static icaltimezone *
+get_zone_from_tzid (ECalClient *client,
+ const gchar *tzid)
+{
+ icaltimezone *zone;
+
+ /* Note that the timezones may not be on the server, so we try to get
+ * the builtin timezone with the TZID first. */
+ zone = icaltimezone_get_builtin_timezone_from_tzid (tzid);
+ if (!zone && tzid) {
+ GError *error = NULL;
+
+ e_cal_client_get_timezone_sync (
+ client, tzid, &zone, NULL, &error);
+
+ if (error != NULL) {
+ g_warning (
+ "Couldn't get timezone '%s' from server: %s",
+ tzid ? tzid : "", error->message);
+ g_error_free (error);
+ }
+ }
+
+ return zone;
+}
+
+static void
+print_date_label (GtkPrintContext *context,
+ ECalComponent *comp,
+ ECalClient *client,
+ icaltimezone *zone,
+ gboolean use_24_hour_format,
+ gdouble left,
+ gdouble right,
+ gdouble top,
+ gdouble bottom)
+{
+ icaltimezone *start_zone, *end_zone, *due_zone, *completed_zone;
+ ECalComponentDateTime datetime;
+ time_t start = 0, end = 0, complete = 0, due = 0;
+ static gchar buffer[1024];
+
+ e_cal_component_get_dtstart (comp, &datetime);
+ if (datetime.value) {
+ start_zone = get_zone_from_tzid (client, datetime.tzid);
+ if (!start_zone || datetime.value->is_date)
+ start_zone = zone;
+ start = icaltime_as_timet_with_zone (
+ *datetime.value,
+ start_zone);
+ }
+ e_cal_component_free_datetime (&datetime);
+
+ e_cal_component_get_dtend (comp, &datetime);
+ if (datetime.value) {
+ end_zone = get_zone_from_tzid (client, datetime.tzid);
+ if (!end_zone || datetime.value->is_date)
+ end_zone = zone;
+ end = icaltime_as_timet_with_zone (
+ *datetime.value,
+ end_zone);
+ }
+ e_cal_component_free_datetime (&datetime);
+
+ e_cal_component_get_due (comp, &datetime);
+ if (datetime.value) {
+ due_zone = get_zone_from_tzid (client, datetime.tzid);
+ if (!due_zone || datetime.value->is_date)
+ due_zone = zone;
+ due = icaltime_as_timet_with_zone (
+ *datetime.value, due_zone);
+ }
+ e_cal_component_free_datetime (&datetime);
+
+ e_cal_component_get_completed (comp, &datetime.value);
+ if (datetime.value) {
+ completed_zone = icaltimezone_get_utc_timezone ();
+ complete = icaltime_as_timet_with_zone (
+ *datetime.value, completed_zone);
+ e_cal_component_free_icaltimetype (datetime.value);
+ }
+
+ buffer[0] = '\0';
+
+ if (start > 0)
+ write_label_piece (
+ start, NULL, zone, use_24_hour_format,
+ buffer, 1024, NULL, NULL);
+
+ if (end > 0 && start > 0) {
+ write_label_piece (
+ end, &start, zone, use_24_hour_format,
+ /* Translators: This is part of "START to END" text,
+ * where START and END are date/times. */
+ buffer, 1024, _(" to "), NULL);
+ }
+
+ if (complete > 0) {
+ if (start > 0) {
+ write_label_piece (
+ complete, NULL, zone, use_24_hour_format,
+ /* Translators: This is part of "START to END
+ * (Completed COMPLETED)", where COMPLETED is a
+ * completed date/time. */
+ buffer, 1024, _(" (Completed "), ")");
+ } else {
+ write_label_piece (
+ complete, &start, zone, use_24_hour_format,
+ /* Translators: This is part of "Completed COMPLETED",
+ * where COMPLETED is a completed date/time. */
+ buffer, 1024, _("Completed "), NULL);
+ }
+ }
+
+ if (due > 0 && complete == 0) {
+ if (start > 0) {
+ write_label_piece (
+ due, NULL, zone, use_24_hour_format,
+ /* Translators: This is part of "START (Due DUE)",
+ * where START and DUE are dates/times. */
+ buffer, 1024, _(" (Due "), ")");
+ } else {
+ write_label_piece (
+ due, &start, zone, use_24_hour_format,
+ /* Translators: This is part of "Due DUE",
+ * where DUE is a date/time due the event
+ * should be finished. */
+ buffer, 1024, _("Due "), NULL);
+ }
+ }
+
+ print_text_size_bold (
+ context, buffer, PANGO_ALIGN_LEFT,
+ left, right, top, top + 24);
+}
+
+static void
+print_calendar_draw_page (GtkPrintOperation *operation,
+ GtkPrintContext *context,
+ gint page_nr,
+ PrintCalItem *pcali)
+{
+ switch (pcali->print_view_type) {
+ case E_PRINT_VIEW_DAY:
+ print_day_view (context, pcali->cal_view, pcali->tasks_table, pcali->start);
+ break;
+ case E_PRINT_VIEW_WORKWEEK:
+ print_work_week_view (context, pcali->cal_view, pcali->start);
+ break;
+ case E_PRINT_VIEW_WEEK:
+ print_week_view (context, pcali->cal_view, pcali->start);
+ break;
+ case E_PRINT_VIEW_MONTH:
+ print_month_view (context, pcali->cal_view, pcali->print_view_type, pcali->start);
+ break;
+ default:
+ g_return_if_reached ();
+ }
+}
+
+void
+print_calendar (ECalendarView *cal_view,
+ ETable *tasks_table,
+ EPrintView print_view_type,
+ GtkPrintOperationAction action,
+ time_t start)
+{
+ GtkPrintOperation *operation;
+ PrintCalItem pcali;
+
+ g_return_if_fail (cal_view != NULL);
+ g_return_if_fail (E_IS_CALENDAR_VIEW (cal_view));
+
+ if (print_view_type == E_PRINT_VIEW_MONTH) {
+ EWeekView *week_view;
+ GDate date;
+ gboolean multi_week_view;
+ gint weeks_shown;
+
+ week_view = E_WEEK_VIEW (cal_view);
+ weeks_shown = e_week_view_get_weeks_shown (week_view);
+ multi_week_view = e_week_view_get_multi_week_view (week_view);
+ e_week_view_get_first_day_shown (week_view, &date);
+
+ if (multi_week_view &&
+ weeks_shown >= 4 &&
+ g_date_valid (&date)) {
+
+ struct icaltimetype start_tt;
+
+ g_date_add_days (&date, 7);
+
+ start_tt = icaltime_null_time ();
+ start_tt.is_date = TRUE;
+ start_tt.year = g_date_get_year (&date);
+ start_tt.month = g_date_get_month (&date);
+ start_tt.day = g_date_get_day (&date);
+
+ start = icaltime_as_timet (start_tt);
+ } else if (multi_week_view) {
+ start = week_view->day_starts[0];
+ }
+ }
+
+ pcali.cal_view = cal_view;
+ pcali.tasks_table = tasks_table;
+ pcali.print_view_type = print_view_type;
+ pcali.start = start;
+
+ operation = e_print_operation_new ();
+ gtk_print_operation_set_n_pages (operation, 1);
+
+ g_signal_connect (
+ operation, "draw_page",
+ G_CALLBACK (print_calendar_draw_page), &pcali);
+
+ gtk_print_operation_run (operation, action, NULL, NULL);
+
+ g_object_unref (operation);
+}
+
+/* returns number of required pages, when page_nr is -1 */
+static gint
+print_comp_draw_real (GtkPrintOperation *operation,
+ GtkPrintContext *context,
+ gint page_nr,
+ PrintCompItem *pci)
+{
+ GtkPageSetup *setup;
+ PangoFontDescription *font;
+ ECalClient *client;
+ ECalComponent *comp;
+ ECalComponentVType vtype;
+ ECalComponentText text;
+ GSList *desc, *l;
+ GSList *contact_list, *elem;
+
+ const gchar *title, *categories, *location;
+ gchar *categories_string, *location_string, *summary_string;
+ gdouble header_size;
+ cairo_t *cr;
+ gdouble width, height, page_start;
+ gdouble top;
+ gint pages = 1;
+
+ setup = gtk_print_context_get_page_setup (context);
+
+ width = gtk_page_setup_get_page_width (setup, GTK_UNIT_POINTS);
+ height = gtk_page_setup_get_page_height (setup, GTK_UNIT_POINTS);
+
+ top = 0.0;
+
+ /* Either draw only the right page or do not draw
+ * anything when calculating number of pages. */
+ if (page_nr != -1)
+ top = top - ((page_nr) * height);
+ else
+ top = height;
+
+ page_start = top;
+
+ /* PrintCompItem structure contains elements to be used
+ * with the Print Context , obtained in comp_draw_page
+ */
+ client = pci->client;
+ comp = pci->comp;
+
+ vtype = e_cal_component_get_vtype (comp);
+
+ /* We should only be asked to print VEVENTs, VTODOs, or VJOURNALs. */
+ if (vtype == E_CAL_COMPONENT_EVENT)
+ title = _("Appointment");
+ else if (vtype == E_CAL_COMPONENT_TODO)
+ title = _("Task");
+ else if (vtype == E_CAL_COMPONENT_JOURNAL)
+ title = _("Memo");
+ else
+ return pages;
+
+ cr = gtk_print_context_get_cairo_context (context);
+
+ /* Print the title in a box at the top of the page. */
+ font = get_font_for_size (18, PANGO_WEIGHT_BOLD);
+ header_size = 40;
+
+ if (page_nr == 0) {
+ print_border (
+ context, 0.0, width, 0.0, header_size,
+ 1.0, 0.9);
+ print_text (
+ context, font, title, PANGO_ALIGN_CENTER, 0.0, width,
+ 0.1, header_size - 0.1);
+ }
+
+ pango_font_description_free (font);
+
+ top += header_size + 30;
+
+ /* Summary */
+ font = get_font_for_size (18, PANGO_WEIGHT_BOLD);
+ e_cal_component_get_summary (comp, &text);
+ summary_string = g_strdup_printf (_("Summary: %s"), text.value ? text.value : "");
+ top = bound_text (
+ context, font, summary_string, -1, 0.0, top, width,
+ height, FALSE, &page_start, &pages);
+
+ g_free (summary_string);
+
+ /* Location */
+ e_cal_component_get_location (comp, &location);
+ if (location && location[0]) {
+ location_string = g_strdup_printf (
+ _("Location: %s"),
+ location);
+ top = bound_text (
+ context, font, location_string, -1, 0.0,
+ top + 3, width, height, FALSE, &page_start, &pages);
+ g_free (location_string);
+ }
+
+ /* Date information */
+ if (page_nr == 0)
+ print_date_label (
+ context, comp, client,
+ pci->zone, pci->use_24_hour_format,
+ 0.0, width, top + 3, top + 15);
+ top += 20;
+
+ /* Attendees */
+ if ((page_nr == 0) && e_cal_component_has_attendees (comp)) {
+ top = bound_text (
+ context, font, _("Attendees: "), -1, 0.0,
+ top, width, height, FALSE, &page_start, &pages);
+ pango_font_description_free (font);
+ font = get_font_for_size (12, PANGO_WEIGHT_NORMAL);
+ top = print_attendees (
+ context, font, cr, 0.0, width,
+ top, height, comp, page_nr, &pages);
+ top += get_font_size (font) - 6;
+ }
+
+ pango_font_description_free (font);
+
+ font = get_font_for_size (12, PANGO_WEIGHT_NORMAL);
+
+ /* For a VTODO we print the Status, Priority, % Complete and URL. */
+ if (vtype == E_CAL_COMPONENT_TODO) {
+ icalproperty_status status;
+ const gchar *status_string = NULL;
+ gint *percent;
+ gint *priority;
+ const gchar *url;
+
+ /* Status */
+ e_cal_component_get_status (comp, &status);
+ if (status != ICAL_STATUS_NONE) {
+ switch (status) {
+ case ICAL_STATUS_NEEDSACTION:
+ status_string = _("Not Started");
+ break;
+ case ICAL_STATUS_INPROCESS:
+ status_string = _("In Progress");
+ break;
+ case ICAL_STATUS_COMPLETED:
+ status_string = _("Completed");
+ break;
+ case ICAL_STATUS_CANCELLED:
+ status_string = _("Cancelled");
+ break;
+ default:
+ break;
+ }
+
+ if (status_string) {
+ gchar *status_text = g_strdup_printf (
+ _("Status: %s"),
+ status_string);
+ top = bound_text (
+ context, font, status_text, -1,
+ 0.0, top, width, height, FALSE, &page_start, &pages);
+ top += get_font_size (font) - 6;
+ g_free (status_text);
+ }
+ }
+
+ /* Priority */
+ e_cal_component_get_priority (comp, &priority);
+ if (priority && *priority >= 0) {
+ gchar *pri_text;
+
+ pri_text = g_strdup_printf (
+ _("Priority: %s"),
+ e_cal_util_priority_to_string (*priority));
+ top = bound_text (
+ context, font, pri_text, -1,
+ 0.0, top, width, height, FALSE,
+ &page_start, &pages);
+ top += get_font_size (font) - 6;
+ g_free (pri_text);
+ }
+
+ if (priority)
+ e_cal_component_free_priority (priority);
+
+ /* Percent Complete */
+ e_cal_component_get_percent (comp, &percent);
+ if (percent) {
+ gchar *percent_string;
+
+ percent_string = g_strdup_printf (_("Percent Complete: %i"), *percent);
+ e_cal_component_free_percent (percent);
+
+ top = bound_text (
+ context, font, percent_string, -1,
+ 0.0, top, width, height, FALSE, &page_start, &pages);
+ top += get_font_size (font) - 6;
+ }
+
+ /* URL */
+ e_cal_component_get_url (comp, &url);
+ if (url && url[0]) {
+ gchar *url_string;
+
+ url_string = g_strdup_printf (_("URL: %s"), url);
+
+ top = bound_text (
+ context, font, url_string, -1,
+ 0.0, top, width, height, TRUE, &page_start, &pages);
+ top += get_font_size (font) - 6;
+ g_free (url_string);
+ }
+ }
+
+ /* Categories */
+ e_cal_component_get_categories (comp, &categories);
+ if (categories && categories[0]) {
+ categories_string = g_strdup_printf (
+ _("Categories: %s"), categories);
+ top = bound_text (
+ context, font, categories_string, -1,
+ 0.0, top, width, height, TRUE, &page_start, &pages);
+ top += get_font_size (font) - 6;
+ g_free (categories_string);
+ }
+
+ /* Contacts */
+ e_cal_component_get_contact_list (comp, &contact_list);
+ if (contact_list) {
+ GString *contacts = g_string_new (_("Contacts: "));
+ for (elem = contact_list; elem; elem = elem->next) {
+ ECalComponentText *t = elem->data;
+ /* Put a comma between contacts. */
+ if (elem != contact_list)
+ g_string_append (contacts, ", ");
+ g_string_append (contacts, t->value);
+ }
+ e_cal_component_free_text_list (contact_list);
+
+ top = bound_text (
+ context, font, contacts->str, -1,
+ 0.0, top, width, height, TRUE, &page_start, &pages);
+ top += get_font_size (font) - 6;
+ g_string_free (contacts, TRUE);
+ }
+ top += 16;
+
+ /* Description */
+ e_cal_component_get_description_list (comp, &desc);
+ for (l = desc; l != NULL; l = l->next) {
+ ECalComponentText *ptext = l->data;
+ const gchar *line, *next_line;
+
+ for (line = ptext->value; line != NULL; line = next_line) {
+ next_line = strchr (line, '\n');
+
+ top = bound_text (
+ context, font, line,
+ next_line ? next_line - line : -1,
+ 0.0, top + 3, width, height, TRUE,
+ &page_start, &pages);
+
+ if (next_line) {
+ next_line++;
+ if (!*next_line)
+ next_line = NULL;
+ }
+ }
+
+ }
+
+ e_cal_component_free_text_list (desc);
+ pango_font_description_free (font);
+
+ return pages;
+}
+
+static void
+print_comp_draw_page (GtkPrintOperation *operation,
+ GtkPrintContext *context,
+ gint page_nr,
+ PrintCompItem *pci)
+{
+ print_comp_draw_real (operation, context, page_nr, pci);
+}
+
+static void
+print_comp_begin_print (GtkPrintOperation *operation,
+ GtkPrintContext *context,
+ PrintCompItem *pci)
+{
+ gint pages;
+
+ pages = print_comp_draw_real (operation, context, -1, pci);
+
+ gtk_print_operation_set_n_pages (operation, pages);
+}
+
+void
+print_comp (ECalComponent *comp,
+ ECalClient *cal_client,
+ icaltimezone *zone,
+ gboolean use_24_hour_format,
+ GtkPrintOperationAction action)
+{
+ GtkPrintOperation *operation;
+ PrintCompItem pci;
+
+ g_return_if_fail (E_IS_CAL_COMPONENT (comp));
+
+ pci.comp = comp;
+ pci.client = cal_client;
+ pci.zone = zone;
+ pci.use_24_hour_format = use_24_hour_format;
+
+ operation = e_print_operation_new ();
+ gtk_print_operation_set_n_pages (operation, 1);
+
+ g_signal_connect (
+ operation, "begin-print",
+ G_CALLBACK (print_comp_begin_print), &pci);
+
+ g_signal_connect (
+ operation, "draw-page",
+ G_CALLBACK (print_comp_draw_page), &pci);
+
+ gtk_print_operation_run (operation, action, NULL, NULL);
+
+ g_object_unref (operation);
+}
+
+static void
+print_title (GtkPrintContext *context,
+ const gchar *text,
+ gdouble page_width)
+{
+ PangoFontDescription *desc;
+ PangoLayout *layout;
+ cairo_t *cr;
+
+ cr = gtk_print_context_get_cairo_context (context);
+
+ desc = pango_font_description_from_string (FONT_FAMILY " Bold 18");
+
+ layout = gtk_print_context_create_pango_layout (context);
+ pango_layout_set_text (layout, text, -1);
+ pango_layout_set_font_description (layout, desc);
+ pango_layout_set_alignment (layout, PANGO_ALIGN_CENTER);
+ pango_layout_set_width (layout, pango_units_from_double (page_width));
+
+ cairo_save (cr);
+
+ cairo_move_to (cr, 0.0, 0.0);
+ pango_cairo_show_layout (cr, layout);
+ cairo_translate (cr, 0.0, 18);
+ cairo_save (cr);
+ cairo_restore (cr);
+
+ g_object_unref (layout);
+
+ pango_font_description_free (desc);
+}
+
+struct print_opts {
+ EPrintable *printable;
+ const gchar *print_header;
+};
+
+static void
+print_table_draw_page (GtkPrintOperation *operation,
+ GtkPrintContext *context,
+ gint page_nr,
+ struct print_opts *opts)
+{
+ GtkPageSetup *setup;
+ gdouble width;
+
+ setup = gtk_print_context_get_page_setup (context);
+
+ width = gtk_page_setup_get_page_width (setup, GTK_UNIT_POINTS);
+
+ do {
+ /* TODO Allow the user to customize the title. */
+ print_title (context, opts->print_header, width);
+
+ if (e_printable_data_left (opts->printable))
+ e_printable_print_page (
+ opts->printable, context, width, 24, TRUE);
+
+ } while (e_printable_data_left (opts->printable));
+
+ g_free (opts);
+}
+
+void
+print_table (ETable *table,
+ const gchar *dialog_title,
+ const gchar *print_header,
+ GtkPrintOperationAction action)
+{
+ GtkPrintOperation *operation;
+ EPrintable *printable;
+ struct print_opts *opts;
+
+ printable = e_table_get_printable (table);
+ g_object_ref_sink (printable);
+ e_printable_reset (printable);
+
+ operation = e_print_operation_new ();
+ gtk_print_operation_set_n_pages (operation, 1);
+
+ opts = g_malloc (sizeof (struct print_opts));
+ opts->printable = printable;
+ opts->print_header = print_header;
+
+ g_signal_connect (
+ operation, "draw_page",
+ G_CALLBACK (print_table_draw_page), opts);
+
+ gtk_print_operation_run (operation, action, NULL, NULL);
+
+ g_object_unref (operation);
+}
diff --git a/calendar/gui/print.h b/src/calendar/gui/print.h
similarity index 100%
rename from calendar/gui/print.h
rename to src/calendar/gui/print.h
diff --git a/calendar/gui/tag-calendar.c b/src/calendar/gui/tag-calendar.c
similarity index 100%
rename from calendar/gui/tag-calendar.c
rename to src/calendar/gui/tag-calendar.c
diff --git a/calendar/gui/tag-calendar.h b/src/calendar/gui/tag-calendar.h
similarity index 100%
rename from calendar/gui/tag-calendar.h
rename to src/calendar/gui/tag-calendar.h
diff --git a/calendar/gui/tasktypes.xml.in b/src/calendar/gui/tasktypes.xml.in
similarity index 100%
rename from calendar/gui/tasktypes.xml.in
rename to src/calendar/gui/tasktypes.xml.in
diff --git a/src/calendar/importers/CMakeLists.txt b/src/calendar/importers/CMakeLists.txt
new file mode 100644
index 0000000..d0bc817
--- /dev/null
+++ b/src/calendar/importers/CMakeLists.txt
@@ -0,0 +1,48 @@
+set(DEPENDENCIES
+ evolution-shell
+ evolution-util
+)
+
+set(SOURCES
+ evolution-calendar-importer.h
+ icalendar-importer.c
+)
+
+add_library(evolution-calendar-importers SHARED
+ ${SOURCES}
+)
+
+add_dependencies(evolution-calendar-importers
+ ${DEPENDENCIES}
+)
+
+target_compile_definitions(evolution-calendar-importers PRIVATE
+ -DG_LOG_DOMAIN=\"evolution-calendar-importers\"
+ -DEVOLUTION_SOUNDDIR=\"${soundsdir}\"
+)
+
+target_compile_options(evolution-calendar-importers PUBLIC
+ ${EVOLUTION_DATA_SERVER_CFLAGS}
+ ${GNOME_PLATFORM_CFLAGS}
+)
+
+target_include_directories(evolution-calendar-importers PUBLIC
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}/src
+ ${CMAKE_SOURCE_DIR}/src
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}/src/calendar
+ ${CMAKE_SOURCE_DIR}/src/calendar
+ ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+ ${GNOME_PLATFORM_INCLUDE_DIRS}
+)
+
+target_link_libraries(evolution-calendar-importers
+ ${DEPENDENCIES}
+ ${EVOLUTION_DATA_SERVER_LDFLAGS}
+ ${GNOME_PLATFORM_LDFLAGS}
+)
+
+install(TARGETS evolution-calendar-importers
+ DESTINATION ${privsolibdir}
+)
diff --git a/calendar/importers/evolution-calendar-importer.h
b/src/calendar/importers/evolution-calendar-importer.h
similarity index 100%
rename from calendar/importers/evolution-calendar-importer.h
rename to src/calendar/importers/evolution-calendar-importer.h
diff --git a/calendar/importers/icalendar-importer.c b/src/calendar/importers/icalendar-importer.c
similarity index 100%
rename from calendar/importers/icalendar-importer.c
rename to src/calendar/importers/icalendar-importer.c
diff --git a/calendar/zones.h b/src/calendar/zones.h
similarity index 100%
rename from calendar/zones.h
rename to src/calendar/zones.h
diff --git a/src/composer/CMakeLists.txt b/src/composer/CMakeLists.txt
new file mode 100644
index 0000000..c5800fd
--- /dev/null
+++ b/src/composer/CMakeLists.txt
@@ -0,0 +1,86 @@
+add_error_files(composer mail-composer.error)
+
+install(FILES evolution-composer.ui
+ DESTINATION ${uidir}
+)
+
+set(DEPENDENCIES
+ econtacteditor
+ econtactlisteditor
+ email-engine
+ evolution-mail-formatter
+ evolution-shell
+ evolution-util
+)
+
+set(SOURCES
+ e-composer-actions.c
+ e-composer-from-header.c
+ e-composer-header-table.c
+ e-composer-header.c
+ e-composer-name-header.c
+ e-composer-post-header.c
+ e-composer-private.c
+ e-composer-spell-header.c
+ e-composer-text-header.c
+ e-msg-composer.c
+)
+
+set(HEADERS
+ e-composer-actions.h
+ e-composer-common.h
+ e-composer-from-header.h
+ e-composer-header-table.h
+ e-composer-header.h
+ e-composer-name-header.h
+ e-composer-post-header.h
+ e-composer-private.h
+ e-composer-spell-header.h
+ e-composer-text-header.h
+ e-msg-composer.h
+)
+
+add_library(evolution-mail-composer SHARED
+ ${SOURCES}
+ ${HEADERS}
+)
+
+add_dependencies(evolution-mail-composer
+ ${DEPENDENCIES}
+)
+
+target_compile_definitions(evolution-mail-composer PRIVATE
+ -DG_LOG_DOMAIN=\"evolution-mail-composer\"
+ -DEVOLUTION_UIDIR=\"${uidir}\"
+)
+
+target_compile_options(evolution-mail-composer PUBLIC
+ ${CERT_UI_CFLAGS}
+ ${EVOLUTION_DATA_SERVER_CFLAGS}
+ ${GNOME_PLATFORM_CFLAGS}
+)
+
+target_include_directories(evolution-mail-composer PUBLIC
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}/src
+ ${CMAKE_SOURCE_DIR}/src
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${CERT_UI_INCLUDE_DIRS}
+ ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+ ${GNOME_PLATFORM_INCLUDE_DIRS}
+)
+
+target_link_libraries(evolution-mail-composer
+ ${DEPENDENCIES}
+ ${CERT_UI_LDFLAGS}
+ ${EVOLUTION_DATA_SERVER_LDFLAGS}
+ ${GNOME_PLATFORM_LDFLAGS}
+)
+
+install(TARGETS evolution-mail-composer
+ DESTINATION ${privsolibdir}
+)
+
+install(FILES ${HEADERS}
+ DESTINATION ${privincludedir}/composer
+)
diff --git a/composer/e-composer-actions.c b/src/composer/e-composer-actions.c
similarity index 100%
rename from composer/e-composer-actions.c
rename to src/composer/e-composer-actions.c
diff --git a/composer/e-composer-actions.h b/src/composer/e-composer-actions.h
similarity index 100%
rename from composer/e-composer-actions.h
rename to src/composer/e-composer-actions.h
diff --git a/composer/e-composer-common.h b/src/composer/e-composer-common.h
similarity index 100%
rename from composer/e-composer-common.h
rename to src/composer/e-composer-common.h
diff --git a/composer/e-composer-from-header.c b/src/composer/e-composer-from-header.c
similarity index 100%
rename from composer/e-composer-from-header.c
rename to src/composer/e-composer-from-header.c
diff --git a/composer/e-composer-from-header.h b/src/composer/e-composer-from-header.h
similarity index 100%
rename from composer/e-composer-from-header.h
rename to src/composer/e-composer-from-header.h
diff --git a/composer/e-composer-header-table.c b/src/composer/e-composer-header-table.c
similarity index 100%
rename from composer/e-composer-header-table.c
rename to src/composer/e-composer-header-table.c
diff --git a/composer/e-composer-header-table.h b/src/composer/e-composer-header-table.h
similarity index 100%
rename from composer/e-composer-header-table.h
rename to src/composer/e-composer-header-table.h
diff --git a/composer/e-composer-header.c b/src/composer/e-composer-header.c
similarity index 100%
rename from composer/e-composer-header.c
rename to src/composer/e-composer-header.c
diff --git a/composer/e-composer-header.h b/src/composer/e-composer-header.h
similarity index 100%
rename from composer/e-composer-header.h
rename to src/composer/e-composer-header.h
diff --git a/composer/e-composer-name-header.c b/src/composer/e-composer-name-header.c
similarity index 100%
rename from composer/e-composer-name-header.c
rename to src/composer/e-composer-name-header.c
diff --git a/composer/e-composer-name-header.h b/src/composer/e-composer-name-header.h
similarity index 100%
rename from composer/e-composer-name-header.h
rename to src/composer/e-composer-name-header.h
diff --git a/composer/e-composer-post-header.c b/src/composer/e-composer-post-header.c
similarity index 100%
rename from composer/e-composer-post-header.c
rename to src/composer/e-composer-post-header.c
diff --git a/composer/e-composer-post-header.h b/src/composer/e-composer-post-header.h
similarity index 100%
rename from composer/e-composer-post-header.h
rename to src/composer/e-composer-post-header.h
diff --git a/composer/e-composer-private.c b/src/composer/e-composer-private.c
similarity index 100%
rename from composer/e-composer-private.c
rename to src/composer/e-composer-private.c
diff --git a/composer/e-composer-private.h b/src/composer/e-composer-private.h
similarity index 100%
rename from composer/e-composer-private.h
rename to src/composer/e-composer-private.h
diff --git a/composer/e-composer-spell-header.c b/src/composer/e-composer-spell-header.c
similarity index 100%
rename from composer/e-composer-spell-header.c
rename to src/composer/e-composer-spell-header.c
diff --git a/composer/e-composer-spell-header.h b/src/composer/e-composer-spell-header.h
similarity index 100%
rename from composer/e-composer-spell-header.h
rename to src/composer/e-composer-spell-header.h
diff --git a/composer/e-composer-text-header.c b/src/composer/e-composer-text-header.c
similarity index 100%
rename from composer/e-composer-text-header.c
rename to src/composer/e-composer-text-header.c
diff --git a/composer/e-composer-text-header.h b/src/composer/e-composer-text-header.h
similarity index 100%
rename from composer/e-composer-text-header.h
rename to src/composer/e-composer-text-header.h
diff --git a/composer/e-msg-composer.c b/src/composer/e-msg-composer.c
similarity index 100%
rename from composer/e-msg-composer.c
rename to src/composer/e-msg-composer.c
diff --git a/composer/e-msg-composer.h b/src/composer/e-msg-composer.h
similarity index 100%
rename from composer/e-msg-composer.h
rename to src/composer/e-msg-composer.h
diff --git a/composer/evolution-composer.ui b/src/composer/evolution-composer.ui
similarity index 100%
rename from composer/evolution-composer.ui
rename to src/composer/evolution-composer.ui
diff --git a/composer/mail-composer.error.xml b/src/composer/mail-composer.error.xml
similarity index 100%
rename from composer/mail-composer.error.xml
rename to src/composer/mail-composer.error.xml
diff --git a/src/e-util/CMakeLists.txt b/src/e-util/CMakeLists.txt
new file mode 100644
index 0000000..cfb670b
--- /dev/null
+++ b/src/e-util/CMakeLists.txt
@@ -0,0 +1,773 @@
+glib_mkenums(e-util-enumtypes e-util-enums.h E_UTIL_ENUMTYPES_H)
+glib_genmarshal(e-marshal e_marshal e-marshal.list)
+
+add_error_files(e-util
+ e-system.error
+ filter.error
+ widgets.error
+)
+
+set(uifiles
+ e-html-editor-manager.ui
+ e-send-options.ui
+ e-table-config.ui
+ e-timezone-dialog.ui
+ filter.ui
+ gal-view-instance-save-as-dialog.ui
+)
+
+install(FILES ${uifiles}
+ DESTINATION ${uidir}
+)
+
+set(PLATFORM_SOURCES)
+
+if(WIN32)
+ set(PLATFORM_SOURCES
+ e-win32-reloc.c
+ e-win32-defaults.c
+ e-win32-defaults.h
+ )
+endif(WIN32)
+
+# Main libevolution-util
+
+set(DEPENDENCIES
+ gnomecanvas
+)
+
+set(SOURCES
+ 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-dialog.c
+ e-attachment-handler-image.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-int.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-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-cache.c
+ e-client-combo-box.c
+ e-client-selector.c
+ e-color-chooser-widget.c
+ e-color-combo.c
+ e-config.c
+ e-conflict-search-selector.c
+ e-contact-store.c
+ e-content-editor.c
+ e-content-request.c
+ e-data-capture.c
+ e-dateedit.c
+ e-datetime-format.c
+ e-destination-store.c
+ e-dialog-utils.c
+ e-dialog-widgets.c
+ e-emoticon-action.c
+ e-emoticon-chooser-menu.c
+ e-emoticon-chooser.c
+ e-emoticon-tool-button.c
+ e-emoticon.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-editor-actions.c
+ e-html-editor-cell-dialog.c
+ e-html-editor-dialog.c
+ e-html-editor-find-dialog.c
+ e-html-editor-hrule-dialog.c
+ e-html-editor-image-dialog.c
+ e-html-editor-link-dialog.c
+ e-html-editor-page-dialog.c
+ e-html-editor-paragraph-dialog.c
+ e-html-editor-private.h
+ e-html-editor-replace-dialog.c
+ e-html-editor-spell-check-dialog.c
+ e-html-editor-table-dialog.c
+ e-html-editor-text-dialog.c
+ e-html-editor.c
+ e-html-utils.c
+ e-icon-factory.c
+ e-image-chooser.c
+ e-image-chooser-dialog.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-photo-cache.c
+ e-photo-source.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-proxy-combo-box.c
+ e-proxy-editor.c
+ e-proxy-link-selector.c
+ e-proxy-preferences.c
+ e-proxy-selector.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-simple-async-result.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-conflict-search.c
+ e-source-selector-dialog.c
+ e-source-selector.c
+ e-source-util.c
+ e-spell-checker.c
+ e-spell-dictionary.c
+ e-spell-entry.c
+ e-spell-text-view.c
+ e-spinner.c
+ e-stock-request.c
+ e-table-click-to-add.c
+ e-table-col.c
+ e-table-column-selector.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-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.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-model-generator.c
+ e-tree-model.c
+ e-tree-selection-model.c
+ e-tree-table-adapter.c
+ e-tree-view-frame.c
+ e-tree.c
+ e-unicode.c
+ e-url-entry.c
+ e-util-private.h
+ e-web-view-preview.c
+ e-web-view.c
+ e-widget-undo.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-text.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-view-collection.c
+ gal-view-etable.c
+ gal-view-instance-save-as-dialog.c
+ gal-view-instance.c
+ gal-view.c
+ ${PLATFORM_SOURCES}
+ ${CMAKE_CURRENT_BINARY_DIR}/e-marshal.c
+ ${CMAKE_CURRENT_BINARY_DIR}/e-util-enumtypes.c
+)
+
+set(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-dialog.h
+ e-attachment-handler-image.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-int.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-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-cache.h
+ e-client-combo-box.h
+ e-client-selector.h
+ e-color-chooser-widget.h
+ e-color-combo.h
+ e-config.h
+ e-conflict-search-selector.h
+ e-contact-store.h
+ e-content-editor.h
+ e-content-request.h
+ e-data-capture.h
+ e-dateedit.h
+ e-datetime-format.h
+ e-destination-store.h
+ e-dialog-utils.h
+ e-dialog-widgets.h
+ e-emoticon-action.h
+ e-emoticon-chooser-menu.h
+ e-emoticon-chooser.h
+ e-emoticon-tool-button.h
+ e-emoticon.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-editor-actions.h
+ e-html-editor-cell-dialog.h
+ e-html-editor-dialog.h
+ e-html-editor-find-dialog.h
+ e-html-editor-hrule-dialog.h
+ e-html-editor-image-dialog.h
+ e-html-editor-link-dialog.h
+ e-html-editor-page-dialog.h
+ e-html-editor-paragraph-dialog.h
+ e-html-editor-replace-dialog.h
+ e-html-editor-spell-check-dialog.h
+ e-html-editor-table-dialog.h
+ e-html-editor-text-dialog.h
+ e-html-editor.h
+ e-html-utils.h
+ e-icon-factory.h
+ e-image-chooser.h
+ e-image-chooser-dialog.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-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-photo-cache.h
+ e-photo-source.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-proxy-combo-box.h
+ e-proxy-editor.h
+ e-proxy-link-selector.h
+ e-proxy-preferences.h
+ e-proxy-selector.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-simple-async-result.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-conflict-search.h
+ e-source-selector-dialog.h
+ e-source-selector.h
+ e-source-util.h
+ e-spell-checker.h
+ e-spell-dictionary.h
+ e-spell-entry.h
+ e-spell-text-view.h
+ e-spinner.h
+ e-stock-request.h
+ e-table-click-to-add.h
+ e-table-col-dnd.h
+ e-table-col.h
+ e-table-column-selector.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-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.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-model-generator.h
+ e-tree-model.h
+ e-tree-selection-model.h
+ e-tree-table-adapter.h
+ e-tree-view-frame.h
+ e-tree.h
+ e-unicode.h
+ e-url-entry.h
+ e-util-enums.h
+ e-web-view-preview.h
+ e-web-view.h
+ e-widget-undo.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-text.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-view-collection.h
+ gal-view-etable.h
+ gal-view-instance-save-as-dialog.h
+ gal-view-instance.h
+ gal-view.h
+ ${CMAKE_CURRENT_BINARY_DIR}/e-marshal.h
+ ${CMAKE_CURRENT_BINARY_DIR}/e-util-enumtypes.h
+)
+
+add_library(evolution-util SHARED
+ ${SOURCES}
+ ${HEADERS}
+)
+
+add_dependencies(evolution-util
+ ${DEPENDENCIES}
+)
+
+target_compile_definitions(evolution-util PRIVATE
+ -DG_LOG_DOMAIN=\"evolution-util\"
+ -DEVOLUTION_BINDIR=\"${BIN_INSTALL_DIR}\"
+ -DEVOLUTION_DATADIR=\"${SHARE_INSTALL_DIR}\"
+ -DEVOLUTION_ECPSDIR=\"${privdatadir}/ecps\"
+ -DEVOLUTION_ETSPECDIR=\"${etspecdir}\"
+ -DEVOLUTION_GALVIEWSDIR=\"${viewsdir}\"
+ -DEVOLUTION_HELPDIR=\"${evolutionhelpdir}\"
+ -DEVOLUTION_ICONDIR=\"${icondir}\"
+ -DEVOLUTION_IMAGESDIR=\"${imagesdir}\"
+ -DEVOLUTION_LIBDIR=\"${LIB_INSTALL_DIR}\"
+ -DEVOLUTION_LIBEXECDIR=\"${privlibexecdir}\"
+ -DEVOLUTION_LOCALEDIR=\"${LOCALE_INSTALL_DIR}\"
+ -DEVOLUTION_MODULEDIR=\"${moduledir}\"
+ -DEVOLUTION_PLUGINDIR=\"${plugindir}\"
+ -DEVOLUTION_PREFIX=\"${CMAKE_INSTALL_PREFIX}\"
+ -DEVOLUTION_PRIVDATADIR=\"${privdatadir}\"
+ -DEVOLUTION_SOUNDDIR=\"${soundsdir}\"
+ -DEVOLUTION_SYSCONFDIR=\"${SYSCONF_INSTALL_DIR}\"
+ -DEVOLUTION_TOOLSDIR=\"${privlibexecdir}\"
+ -DEVOLUTION_UIDIR=\"${uidir}\"
+ -DEVOLUTION_RULEDIR=\"${privdatadir}\"
+ -DEVOLUTION_WEB_EXTENSIONS_DIR=\"${webextensionsdir}\"
+ -DEVOLUTION_TESTGIOMODULESDIR=\"${CMAKE_CURRENT_BINARY_DIR}\"
+ -DEVOLUTION_TESTTOPSRCDIR=\"${CMAKE_SOURCE_DIR}\"
+ -DLIBEUTIL_COMPILATION
+)
+
+target_compile_options(evolution-util PUBLIC
+ ${AUTOAR_CFLAGS}
+ ${ENCHANT_CFLAGS}
+ ${EVOLUTION_DATA_SERVER_CFLAGS}
+ ${GEO_CFLAGS}
+ ${GNOME_PLATFORM_CFLAGS}
+ ${GTKSPELL_CFLAGS}
+)
+
+target_include_directories(evolution-util PUBLIC
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}/src
+ ${CMAKE_SOURCE_DIR}
+ ${CMAKE_SOURCE_DIR}/src
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${AUTOAR_INCLUDE_DIRS}
+ ${ENCHANT_INCLUDE_DIRS}
+ ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+ ${GEO_INCLUDE_DIRS}
+ ${GNOME_PLATFORM_INCLUDE_DIRS}
+ ${GTKSPELL_INCLUDE_DIRS}
+)
+
+target_link_libraries(evolution-util
+ ${DEPENDENCIES}
+ ${AUTOAR_LDFLAGS}
+ ${ENCHANT_LDFLAGS}
+ ${EVOLUTION_DATA_SERVER_LDFLAGS}
+ ${GEO_LDFLAGS}
+ ${GNOME_PLATFORM_LDFLAGS}
+ ${GTKSPELL_LDFLAGS}
+ ${ICONV_LIBS}
+ ${MATH_LDFLAGS}
+)
+
+install(TARGETS evolution-util
+ DESTINATION ${privsolibdir}
+)
+
+install(FILES ${HEADERS}
+ DESTINATION ${privincludedir}/e-util
+)
+
+# Private gsettings module
+
+# This is not meant to be distributed to end users, unless test-html-editor-units
+# is also distributed, but even then it can work without it
+add_library(evolutiontestsettings MODULE
+ test-keyfile-settings-backend.h
+ test-keyfile-settings-backend.c
+ ${PLATFORM_SOURCES}
+)
+
+target_compile_definitions(evolutiontestsettings PRIVATE
+ -DG_LOG_DOMAIN=\"evolution-test-settings\"
+)
+
+target_compile_options(evolutiontestsettings PUBLIC
+ ${EVOLUTION_DATA_SERVER_CFLAGS}
+)
+
+target_include_directories(evolutiontestsettings PUBLIC
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}/src
+ ${CMAKE_SOURCE_DIR}/src
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+)
+
+target_link_libraries(evolutiontestsettings
+ ${EVOLUTION_DATA_SERVER_LDFLAGS}
+)
+
+# Private test programs
+
+macro(add_private_program _name _sources)
+ set(DEPENDENCIES
+ evolution-util
+ )
+
+ set(SOURCES)
+ foreach(_src ${_sources} ${ARGN})
+ list(APPEND SOURCES ${_src})
+ endforeach(_src)
+
+ add_executable(${_name}
+ ${SOURCES}
+ )
+
+ add_dependencies(${_name}
+ ${DEPENDENCIES}
+ )
+
+ target_compile_definitions(${_name} PRIVATE
+ -DG_LOG_DOMAIN=\"${_name}\"
+ -DEVOLUTION_LOCALEDIR=\"${LOCALE_INSTALL_DIR}\"
+ -DEVOLUTION_MODULEDIR=\"${moduledir}\"
+ -DEVOLUTION_TESTGIOMODULESDIR=\"${CMAKE_CURRENT_BINARY_DIR}\"
+ -DEVOLUTION_TESTTOPSRCDIR=\"${CMAKE_SOURCE_DIR}\"
+ -DLIBEUTIL_COMPILATION
+ )
+
+ target_compile_options(${_name} PUBLIC
+ ${AUTOAR_CFLAGS}
+ ${ENCHANT_CFLAGS}
+ ${EVOLUTION_DATA_SERVER_CFLAGS}
+ ${GEO_CFLAGS}
+ ${GNOME_PLATFORM_CFLAGS}
+ ${GTKSPELL_CFLAGS}
+ )
+
+ target_include_directories(${_name} PUBLIC
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}/src
+ ${CMAKE_SOURCE_DIR}/src
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${AUTOAR_INCLUDE_DIRS}
+ ${ENCHANT_INCLUDE_DIRS}
+ ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+ ${GEO_INCLUDE_DIRS}
+ ${GNOME_PLATFORM_INCLUDE_DIRS}
+ ${GTKSPELL_INCLUDE_DIRS}
+ )
+
+ target_link_libraries(${_name}
+ ${DEPENDENCIES}
+ ${AUTOAR_LDFLAGS}
+ ${ENCHANT_LDFLAGS}
+ ${EVOLUTION_DATA_SERVER_LDFLAGS}
+ ${GEO_LDFLAGS}
+ ${GNOME_PLATFORM_LDFLAGS}
+ ${GTKSPELL_LDFLAGS}
+ ${ICONV_LIBS}
+ ${MATH_LDFLAGS}
+ )
+endmacro(add_private_program)
+
+macro(add_private_programs_simple _name0)
+ foreach(_name ${_name0} ${ARGN})
+ add_private_program(${_name} ${_name}.c)
+ endforeach(_name)
+endmacro(add_private_programs_simple)
+
+add_private_programs_simple(
+ evolution-source-viewer
+ test-calendar
+ test-category-completion
+ test-contact-store
+ test-dateedit
+ test-html-editor
+ test-mail-signatures
+ test-name-selector
+ test-preferences-window
+ test-proxy-preferences
+ test-source-combo-box
+ test-source-config
+ test-source-selector
+ test-tree-view-frame
+)
+
+add_private_program(test-html-editor-units
+ test-html-editor-units.c
+ test-html-editor-units-bugs.h
+ test-html-editor-units-bugs.c
+ test-html-editor-units-utils.h
+ test-html-editor-units-utils.c
+)
+add_dependencies(test-html-editor-units evolutiontestsettings)
diff --git a/e-util/e-action-combo-box.c b/src/e-util/e-action-combo-box.c
similarity index 100%
rename from e-util/e-action-combo-box.c
rename to src/e-util/e-action-combo-box.c
diff --git a/e-util/e-action-combo-box.h b/src/e-util/e-action-combo-box.h
similarity index 100%
rename from e-util/e-action-combo-box.h
rename to src/e-util/e-action-combo-box.h
diff --git a/e-util/e-activity-bar.c b/src/e-util/e-activity-bar.c
similarity index 100%
rename from e-util/e-activity-bar.c
rename to src/e-util/e-activity-bar.c
diff --git a/e-util/e-activity-bar.h b/src/e-util/e-activity-bar.h
similarity index 100%
rename from e-util/e-activity-bar.h
rename to src/e-util/e-activity-bar.h
diff --git a/e-util/e-activity-proxy.c b/src/e-util/e-activity-proxy.c
similarity index 100%
rename from e-util/e-activity-proxy.c
rename to src/e-util/e-activity-proxy.c
diff --git a/e-util/e-activity-proxy.h b/src/e-util/e-activity-proxy.h
similarity index 100%
rename from e-util/e-activity-proxy.h
rename to src/e-util/e-activity-proxy.h
diff --git a/e-util/e-activity.c b/src/e-util/e-activity.c
similarity index 100%
rename from e-util/e-activity.c
rename to src/e-util/e-activity.c
diff --git a/e-util/e-activity.h b/src/e-util/e-activity.h
similarity index 100%
rename from e-util/e-activity.h
rename to src/e-util/e-activity.h
diff --git a/e-util/e-alarm-selector.c b/src/e-util/e-alarm-selector.c
similarity index 100%
rename from e-util/e-alarm-selector.c
rename to src/e-util/e-alarm-selector.c
diff --git a/e-util/e-alarm-selector.h b/src/e-util/e-alarm-selector.h
similarity index 100%
rename from e-util/e-alarm-selector.h
rename to src/e-util/e-alarm-selector.h
diff --git a/e-util/e-alert-bar.c b/src/e-util/e-alert-bar.c
similarity index 100%
rename from e-util/e-alert-bar.c
rename to src/e-util/e-alert-bar.c
diff --git a/e-util/e-alert-bar.h b/src/e-util/e-alert-bar.h
similarity index 100%
rename from e-util/e-alert-bar.h
rename to src/e-util/e-alert-bar.h
diff --git a/e-util/e-alert-dialog.c b/src/e-util/e-alert-dialog.c
similarity index 100%
rename from e-util/e-alert-dialog.c
rename to src/e-util/e-alert-dialog.c
diff --git a/e-util/e-alert-dialog.h b/src/e-util/e-alert-dialog.h
similarity index 100%
rename from e-util/e-alert-dialog.h
rename to src/e-util/e-alert-dialog.h
diff --git a/e-util/e-alert-sink.c b/src/e-util/e-alert-sink.c
similarity index 100%
rename from e-util/e-alert-sink.c
rename to src/e-util/e-alert-sink.c
diff --git a/e-util/e-alert-sink.h b/src/e-util/e-alert-sink.h
similarity index 100%
rename from e-util/e-alert-sink.h
rename to src/e-util/e-alert-sink.h
diff --git a/e-util/e-alert.c b/src/e-util/e-alert.c
similarity index 100%
rename from e-util/e-alert.c
rename to src/e-util/e-alert.c
diff --git a/e-util/e-alert.h b/src/e-util/e-alert.h
similarity index 100%
rename from e-util/e-alert.h
rename to src/e-util/e-alert.h
diff --git a/e-util/e-attachment-bar.c b/src/e-util/e-attachment-bar.c
similarity index 100%
rename from e-util/e-attachment-bar.c
rename to src/e-util/e-attachment-bar.c
diff --git a/e-util/e-attachment-bar.h b/src/e-util/e-attachment-bar.h
similarity index 100%
rename from e-util/e-attachment-bar.h
rename to src/e-util/e-attachment-bar.h
diff --git a/e-util/e-attachment-dialog.c b/src/e-util/e-attachment-dialog.c
similarity index 100%
rename from e-util/e-attachment-dialog.c
rename to src/e-util/e-attachment-dialog.c
diff --git a/e-util/e-attachment-dialog.h b/src/e-util/e-attachment-dialog.h
similarity index 100%
rename from e-util/e-attachment-dialog.h
rename to src/e-util/e-attachment-dialog.h
diff --git a/e-util/e-attachment-handler-image.c b/src/e-util/e-attachment-handler-image.c
similarity index 100%
rename from e-util/e-attachment-handler-image.c
rename to src/e-util/e-attachment-handler-image.c
diff --git a/e-util/e-attachment-handler-image.h b/src/e-util/e-attachment-handler-image.h
similarity index 100%
rename from e-util/e-attachment-handler-image.h
rename to src/e-util/e-attachment-handler-image.h
diff --git a/e-util/e-attachment-handler.c b/src/e-util/e-attachment-handler.c
similarity index 100%
rename from e-util/e-attachment-handler.c
rename to src/e-util/e-attachment-handler.c
diff --git a/e-util/e-attachment-handler.h b/src/e-util/e-attachment-handler.h
similarity index 100%
rename from e-util/e-attachment-handler.h
rename to src/e-util/e-attachment-handler.h
diff --git a/e-util/e-attachment-icon-view.c b/src/e-util/e-attachment-icon-view.c
similarity index 100%
rename from e-util/e-attachment-icon-view.c
rename to src/e-util/e-attachment-icon-view.c
diff --git a/e-util/e-attachment-icon-view.h b/src/e-util/e-attachment-icon-view.h
similarity index 100%
rename from e-util/e-attachment-icon-view.h
rename to src/e-util/e-attachment-icon-view.h
diff --git a/e-util/e-attachment-paned.c b/src/e-util/e-attachment-paned.c
similarity index 100%
rename from e-util/e-attachment-paned.c
rename to src/e-util/e-attachment-paned.c
diff --git a/e-util/e-attachment-paned.h b/src/e-util/e-attachment-paned.h
similarity index 100%
rename from e-util/e-attachment-paned.h
rename to src/e-util/e-attachment-paned.h
diff --git a/e-util/e-attachment-store.c b/src/e-util/e-attachment-store.c
similarity index 100%
rename from e-util/e-attachment-store.c
rename to src/e-util/e-attachment-store.c
diff --git a/e-util/e-attachment-store.h b/src/e-util/e-attachment-store.h
similarity index 100%
rename from e-util/e-attachment-store.h
rename to src/e-util/e-attachment-store.h
diff --git a/e-util/e-attachment-tree-view.c b/src/e-util/e-attachment-tree-view.c
similarity index 100%
rename from e-util/e-attachment-tree-view.c
rename to src/e-util/e-attachment-tree-view.c
diff --git a/e-util/e-attachment-tree-view.h b/src/e-util/e-attachment-tree-view.h
similarity index 100%
rename from e-util/e-attachment-tree-view.h
rename to src/e-util/e-attachment-tree-view.h
diff --git a/e-util/e-attachment-view.c b/src/e-util/e-attachment-view.c
similarity index 100%
rename from e-util/e-attachment-view.c
rename to src/e-util/e-attachment-view.c
diff --git a/e-util/e-attachment-view.h b/src/e-util/e-attachment-view.h
similarity index 100%
rename from e-util/e-attachment-view.h
rename to src/e-util/e-attachment-view.h
diff --git a/e-util/e-attachment.c b/src/e-util/e-attachment.c
similarity index 100%
rename from e-util/e-attachment.c
rename to src/e-util/e-attachment.c
diff --git a/e-util/e-attachment.h b/src/e-util/e-attachment.h
similarity index 100%
rename from e-util/e-attachment.h
rename to src/e-util/e-attachment.h
diff --git a/e-util/e-auth-combo-box.c b/src/e-util/e-auth-combo-box.c
similarity index 100%
rename from e-util/e-auth-combo-box.c
rename to src/e-util/e-auth-combo-box.c
diff --git a/e-util/e-auth-combo-box.h b/src/e-util/e-auth-combo-box.h
similarity index 100%
rename from e-util/e-auth-combo-box.h
rename to src/e-util/e-auth-combo-box.h
diff --git a/e-util/e-autocomplete-selector.c b/src/e-util/e-autocomplete-selector.c
similarity index 100%
rename from e-util/e-autocomplete-selector.c
rename to src/e-util/e-autocomplete-selector.c
diff --git a/e-util/e-autocomplete-selector.h b/src/e-util/e-autocomplete-selector.h
similarity index 100%
rename from e-util/e-autocomplete-selector.h
rename to src/e-util/e-autocomplete-selector.h
diff --git a/e-util/e-bit-array.c b/src/e-util/e-bit-array.c
similarity index 100%
rename from e-util/e-bit-array.c
rename to src/e-util/e-bit-array.c
diff --git a/e-util/e-bit-array.h b/src/e-util/e-bit-array.h
similarity index 100%
rename from e-util/e-bit-array.h
rename to src/e-util/e-bit-array.h
diff --git a/e-util/e-book-source-config.c b/src/e-util/e-book-source-config.c
similarity index 100%
rename from e-util/e-book-source-config.c
rename to src/e-util/e-book-source-config.c
diff --git a/e-util/e-book-source-config.h b/src/e-util/e-book-source-config.h
similarity index 100%
rename from e-util/e-book-source-config.h
rename to src/e-util/e-book-source-config.h
diff --git a/e-util/e-buffer-tagger.c b/src/e-util/e-buffer-tagger.c
similarity index 100%
rename from e-util/e-buffer-tagger.c
rename to src/e-util/e-buffer-tagger.c
diff --git a/e-util/e-buffer-tagger.h b/src/e-util/e-buffer-tagger.h
similarity index 100%
rename from e-util/e-buffer-tagger.h
rename to src/e-util/e-buffer-tagger.h
diff --git a/e-util/e-cal-source-config.c b/src/e-util/e-cal-source-config.c
similarity index 100%
rename from e-util/e-cal-source-config.c
rename to src/e-util/e-cal-source-config.c
diff --git a/e-util/e-cal-source-config.h b/src/e-util/e-cal-source-config.h
similarity index 100%
rename from e-util/e-cal-source-config.h
rename to src/e-util/e-cal-source-config.h
diff --git a/e-util/e-calendar-item.c b/src/e-util/e-calendar-item.c
similarity index 100%
rename from e-util/e-calendar-item.c
rename to src/e-util/e-calendar-item.c
diff --git a/e-util/e-calendar-item.h b/src/e-util/e-calendar-item.h
similarity index 100%
rename from e-util/e-calendar-item.h
rename to src/e-util/e-calendar-item.h
diff --git a/e-util/e-calendar.c b/src/e-util/e-calendar.c
similarity index 100%
rename from e-util/e-calendar.c
rename to src/e-util/e-calendar.c
diff --git a/e-util/e-calendar.h b/src/e-util/e-calendar.h
similarity index 100%
rename from e-util/e-calendar.h
rename to src/e-util/e-calendar.h
diff --git a/e-util/e-canvas-background.c b/src/e-util/e-canvas-background.c
similarity index 100%
rename from e-util/e-canvas-background.c
rename to src/e-util/e-canvas-background.c
diff --git a/e-util/e-canvas-background.h b/src/e-util/e-canvas-background.h
similarity index 100%
rename from e-util/e-canvas-background.h
rename to src/e-util/e-canvas-background.h
diff --git a/e-util/e-canvas-utils.c b/src/e-util/e-canvas-utils.c
similarity index 100%
rename from e-util/e-canvas-utils.c
rename to src/e-util/e-canvas-utils.c
diff --git a/e-util/e-canvas-utils.h b/src/e-util/e-canvas-utils.h
similarity index 100%
rename from e-util/e-canvas-utils.h
rename to src/e-util/e-canvas-utils.h
diff --git a/e-util/e-canvas-vbox.c b/src/e-util/e-canvas-vbox.c
similarity index 100%
rename from e-util/e-canvas-vbox.c
rename to src/e-util/e-canvas-vbox.c
diff --git a/e-util/e-canvas-vbox.h b/src/e-util/e-canvas-vbox.h
similarity index 100%
rename from e-util/e-canvas-vbox.h
rename to src/e-util/e-canvas-vbox.h
diff --git a/e-util/e-canvas.c b/src/e-util/e-canvas.c
similarity index 100%
rename from e-util/e-canvas.c
rename to src/e-util/e-canvas.c
diff --git a/e-util/e-canvas.h b/src/e-util/e-canvas.h
similarity index 100%
rename from e-util/e-canvas.h
rename to src/e-util/e-canvas.h
diff --git a/e-util/e-categories-config.c b/src/e-util/e-categories-config.c
similarity index 100%
rename from e-util/e-categories-config.c
rename to src/e-util/e-categories-config.c
diff --git a/e-util/e-categories-config.h b/src/e-util/e-categories-config.h
similarity index 100%
rename from e-util/e-categories-config.h
rename to src/e-util/e-categories-config.h
diff --git a/e-util/e-categories-dialog.c b/src/e-util/e-categories-dialog.c
similarity index 100%
rename from e-util/e-categories-dialog.c
rename to src/e-util/e-categories-dialog.c
diff --git a/e-util/e-categories-dialog.h b/src/e-util/e-categories-dialog.h
similarity index 100%
rename from e-util/e-categories-dialog.h
rename to src/e-util/e-categories-dialog.h
diff --git a/e-util/e-categories-editor.c b/src/e-util/e-categories-editor.c
similarity index 100%
rename from e-util/e-categories-editor.c
rename to src/e-util/e-categories-editor.c
diff --git a/e-util/e-categories-editor.h b/src/e-util/e-categories-editor.h
similarity index 100%
rename from e-util/e-categories-editor.h
rename to src/e-util/e-categories-editor.h
diff --git a/e-util/e-categories-selector.c b/src/e-util/e-categories-selector.c
similarity index 100%
rename from e-util/e-categories-selector.c
rename to src/e-util/e-categories-selector.c
diff --git a/e-util/e-categories-selector.h b/src/e-util/e-categories-selector.h
similarity index 100%
rename from e-util/e-categories-selector.h
rename to src/e-util/e-categories-selector.h
diff --git a/e-util/e-category-completion.c b/src/e-util/e-category-completion.c
similarity index 100%
rename from e-util/e-category-completion.c
rename to src/e-util/e-category-completion.c
diff --git a/e-util/e-category-completion.h b/src/e-util/e-category-completion.h
similarity index 100%
rename from e-util/e-category-completion.h
rename to src/e-util/e-category-completion.h
diff --git a/e-util/e-category-editor.c b/src/e-util/e-category-editor.c
similarity index 100%
rename from e-util/e-category-editor.c
rename to src/e-util/e-category-editor.c
diff --git a/e-util/e-category-editor.h b/src/e-util/e-category-editor.h
similarity index 100%
rename from e-util/e-category-editor.h
rename to src/e-util/e-category-editor.h
diff --git a/src/e-util/e-cell-checkbox.c b/src/e-util/e-cell-checkbox.c
new file mode 100644
index 0000000..501c0f1
--- /dev/null
+++ b/src/e-util/e-cell-checkbox.c
@@ -0,0 +1,99 @@
+/*
+ *
+ * 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.
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ * Authors:
+ * Miguel de Icaza <miguel ximian com>
+ *
+ * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
+ *
+ */
+
+#include "evolution-config.h"
+
+#include <gdk/gdkkeysyms.h>
+#include <gtk/gtk.h>
+#include <libgnomecanvas/libgnomecanvas.h>
+
+#include "e-table-item.h"
+#include "e-cell-checkbox.h"
+
+#include "data/xpm/check-empty.xpm"
+#include "data/xpm/check-filled.xpm"
+
+G_DEFINE_TYPE (ECellCheckbox, e_cell_checkbox, E_TYPE_CELL_TOGGLE)
+
+static GdkPixbuf *checks[2];
+
+static void
+ecc_print (ECellView *ecell_view,
+ GtkPrintContext *context,
+ gint model_col,
+ gint view_col,
+ gint row,
+ gdouble width,
+ gdouble height)
+{
+ cairo_t *cr = gtk_print_context_get_cairo_context (context);
+ const gint value = GPOINTER_TO_INT (
+ e_table_model_value_at (
+ ecell_view->e_table_model, model_col, row));
+ cairo_save (cr);
+
+ if (value == 1) {
+ cairo_set_line_width (cr, 2);
+ cairo_move_to (cr, 3, 11);
+ cairo_line_to (cr, 7, 14);
+ cairo_line_to (cr, 11, 5);
+ cairo_stroke (cr);
+ }
+
+ cairo_restore (cr);
+}
+
+static void
+e_cell_checkbox_class_init (ECellCheckboxClass *class)
+{
+ ECellClass *ecc = E_CELL_CLASS (class);
+
+ ecc->print = ecc_print;
+ checks[0] = gdk_pixbuf_new_from_xpm_data (check_empty_xpm);
+ checks[1] = gdk_pixbuf_new_from_xpm_data (check_filled_xpm);
+}
+
+static void
+e_cell_checkbox_init (ECellCheckbox *eccb)
+{
+ GPtrArray *pixbufs;
+
+ pixbufs = e_cell_toggle_get_pixbufs (E_CELL_TOGGLE (eccb));
+
+ g_ptr_array_add (pixbufs, g_object_ref (checks[0]));
+ g_ptr_array_add (pixbufs, g_object_ref (checks[1]));
+}
+
+/**
+ * e_cell_checkbox_new:
+ *
+ * Creates a new ECell renderer that can be used to render check
+ * boxes. the data provided from the model is cast to an integer.
+ * zero is used for the off display, and non-zero for checked status.
+ *
+ * Returns: an ECell object that can be used to render checkboxes.
+ */
+ECell *
+e_cell_checkbox_new (void)
+{
+ return g_object_new (E_TYPE_CELL_CHECKBOX, NULL);
+}
diff --git a/e-util/e-cell-checkbox.h b/src/e-util/e-cell-checkbox.h
similarity index 100%
rename from e-util/e-cell-checkbox.h
rename to src/e-util/e-cell-checkbox.h
diff --git a/e-util/e-cell-combo.c b/src/e-util/e-cell-combo.c
similarity index 100%
rename from e-util/e-cell-combo.c
rename to src/e-util/e-cell-combo.c
diff --git a/e-util/e-cell-combo.h b/src/e-util/e-cell-combo.h
similarity index 100%
rename from e-util/e-cell-combo.h
rename to src/e-util/e-cell-combo.h
diff --git a/e-util/e-cell-date-edit.c b/src/e-util/e-cell-date-edit.c
similarity index 100%
rename from e-util/e-cell-date-edit.c
rename to src/e-util/e-cell-date-edit.c
diff --git a/e-util/e-cell-date-edit.h b/src/e-util/e-cell-date-edit.h
similarity index 100%
rename from e-util/e-cell-date-edit.h
rename to src/e-util/e-cell-date-edit.h
diff --git a/e-util/e-cell-date-int.c b/src/e-util/e-cell-date-int.c
similarity index 100%
rename from e-util/e-cell-date-int.c
rename to src/e-util/e-cell-date-int.c
diff --git a/e-util/e-cell-date-int.h b/src/e-util/e-cell-date-int.h
similarity index 100%
rename from e-util/e-cell-date-int.h
rename to src/e-util/e-cell-date-int.h
diff --git a/e-util/e-cell-date.c b/src/e-util/e-cell-date.c
similarity index 100%
rename from e-util/e-cell-date.c
rename to src/e-util/e-cell-date.c
diff --git a/e-util/e-cell-date.h b/src/e-util/e-cell-date.h
similarity index 100%
rename from e-util/e-cell-date.h
rename to src/e-util/e-cell-date.h
diff --git a/e-util/e-cell-hbox.c b/src/e-util/e-cell-hbox.c
similarity index 100%
rename from e-util/e-cell-hbox.c
rename to src/e-util/e-cell-hbox.c
diff --git a/e-util/e-cell-hbox.h b/src/e-util/e-cell-hbox.h
similarity index 100%
rename from e-util/e-cell-hbox.h
rename to src/e-util/e-cell-hbox.h
diff --git a/e-util/e-cell-number.c b/src/e-util/e-cell-number.c
similarity index 100%
rename from e-util/e-cell-number.c
rename to src/e-util/e-cell-number.c
diff --git a/e-util/e-cell-number.h b/src/e-util/e-cell-number.h
similarity index 100%
rename from e-util/e-cell-number.h
rename to src/e-util/e-cell-number.h
diff --git a/e-util/e-cell-percent.c b/src/e-util/e-cell-percent.c
similarity index 100%
rename from e-util/e-cell-percent.c
rename to src/e-util/e-cell-percent.c
diff --git a/e-util/e-cell-percent.h b/src/e-util/e-cell-percent.h
similarity index 100%
rename from e-util/e-cell-percent.h
rename to src/e-util/e-cell-percent.h
diff --git a/e-util/e-cell-pixbuf.c b/src/e-util/e-cell-pixbuf.c
similarity index 100%
rename from e-util/e-cell-pixbuf.c
rename to src/e-util/e-cell-pixbuf.c
diff --git a/e-util/e-cell-pixbuf.h b/src/e-util/e-cell-pixbuf.h
similarity index 100%
rename from e-util/e-cell-pixbuf.h
rename to src/e-util/e-cell-pixbuf.h
diff --git a/e-util/e-cell-popup.c b/src/e-util/e-cell-popup.c
similarity index 100%
rename from e-util/e-cell-popup.c
rename to src/e-util/e-cell-popup.c
diff --git a/e-util/e-cell-popup.h b/src/e-util/e-cell-popup.h
similarity index 100%
rename from e-util/e-cell-popup.h
rename to src/e-util/e-cell-popup.h
diff --git a/e-util/e-cell-size.c b/src/e-util/e-cell-size.c
similarity index 100%
rename from e-util/e-cell-size.c
rename to src/e-util/e-cell-size.c
diff --git a/e-util/e-cell-size.h b/src/e-util/e-cell-size.h
similarity index 100%
rename from e-util/e-cell-size.h
rename to src/e-util/e-cell-size.h
diff --git a/e-util/e-cell-text.c b/src/e-util/e-cell-text.c
similarity index 100%
rename from e-util/e-cell-text.c
rename to src/e-util/e-cell-text.c
diff --git a/e-util/e-cell-text.h b/src/e-util/e-cell-text.h
similarity index 100%
rename from e-util/e-cell-text.h
rename to src/e-util/e-cell-text.h
diff --git a/src/e-util/e-cell-toggle.c b/src/e-util/e-cell-toggle.c
new file mode 100644
index 0000000..eeb1135
--- /dev/null
+++ b/src/e-util/e-cell-toggle.c
@@ -0,0 +1,506 @@
+/*
+ * e-cell-toggle.c - Multi-state image toggle cell object.
+ *
+ * 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.
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ * Authors:
+ * Miguel de Icaza <miguel ximian com>
+ *
+ * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
+ *
+ */
+
+#include "evolution-config.h"
+
+#include <gdk/gdkkeysyms.h>
+#include <gtk/gtk.h>
+#include <libgnomecanvas/libgnomecanvas.h>
+
+#include "data/xpm/empty.xpm"
+
+#include "gal-a11y-e-cell-toggle.h"
+#include "gal-a11y-e-cell-registry.h"
+
+#include "e-cell-toggle.h"
+#include "e-table-item.h"
+
+#define E_CELL_TOGGLE_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_CELL_TOGGLE, ECellTogglePrivate))
+
+struct _ECellTogglePrivate {
+ gchar **icon_names;
+ gchar **icon_descriptions;
+ guint n_icon_names;
+
+ GdkPixbuf *empty;
+ GPtrArray *pixbufs;
+ gint height;
+};
+
+G_DEFINE_TYPE (ECellToggle, e_cell_toggle, E_TYPE_CELL)
+
+typedef struct {
+ ECellView cell_view;
+ GnomeCanvas *canvas;
+} ECellToggleView;
+
+static void
+cell_toggle_load_icons (ECellToggle *cell_toggle)
+{
+ GtkIconTheme *icon_theme;
+ gint width, height;
+ gint max_height = 0;
+ guint ii;
+ GError *error = NULL;
+
+ icon_theme = gtk_icon_theme_get_default ();
+ gtk_icon_size_lookup (GTK_ICON_SIZE_MENU, &width, &height);
+
+ g_ptr_array_set_size (cell_toggle->priv->pixbufs, 0);
+
+ for (ii = 0; ii < cell_toggle->priv->n_icon_names; ii++) {
+ const gchar *icon_name = cell_toggle->priv->icon_names[ii];
+ GdkPixbuf *pixbuf = NULL;
+
+ if (icon_name != NULL)
+ pixbuf = gtk_icon_theme_load_icon (
+ icon_theme, icon_name, height, GTK_ICON_LOOKUP_FORCE_SIZE, &error);
+
+ if (error != NULL) {
+ g_warning ("%s", error->message);
+ g_clear_error (&error);
+ }
+
+ if (pixbuf == NULL)
+ pixbuf = g_object_ref (cell_toggle->priv->empty);
+
+ g_ptr_array_add (cell_toggle->priv->pixbufs, pixbuf);
+ max_height = MAX (max_height, gdk_pixbuf_get_height (pixbuf));
+ }
+
+ cell_toggle->priv->height = max_height;
+}
+
+static void
+cell_toggle_dispose (GObject *object)
+{
+ ECellTogglePrivate *priv;
+
+ priv = E_CELL_TOGGLE_GET_PRIVATE (object);
+
+ if (priv->empty != NULL) {
+ g_object_unref (priv->empty);
+ priv->empty = NULL;
+ }
+
+ /* This unrefs all the elements. */
+ g_ptr_array_set_size (priv->pixbufs, 0);
+
+ /* Chain up to parent's dispose() method. */
+ G_OBJECT_CLASS (e_cell_toggle_parent_class)->dispose (object);
+}
+
+static void
+cell_toggle_finalize (GObject *object)
+{
+ ECellTogglePrivate *priv;
+ guint ii;
+
+ priv = E_CELL_TOGGLE_GET_PRIVATE (object);
+
+ /* The array is not NULL-terminated,
+ * so g_strfreev() will not work. */
+ for (ii = 0; ii < priv->n_icon_names; ii++)
+ g_free (priv->icon_names[ii]);
+ g_free (priv->icon_names);
+
+ if (priv->icon_descriptions) {
+ for (ii = 0; ii < priv->n_icon_names; ii++)
+ g_free (priv->icon_descriptions[ii]);
+ g_free (priv->icon_descriptions);
+ }
+
+ g_ptr_array_free (priv->pixbufs, TRUE);
+
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (e_cell_toggle_parent_class)->finalize (object);
+}
+
+static ECellView *
+cell_toggle_new_view (ECell *ecell,
+ ETableModel *table_model,
+ gpointer e_table_item_view)
+{
+ ECellToggleView *toggle_view = g_new0 (ECellToggleView, 1);
+ ETableItem *eti = E_TABLE_ITEM (e_table_item_view);
+ GnomeCanvas *canvas = GNOME_CANVAS_ITEM (eti)->canvas;
+
+ toggle_view->cell_view.ecell = ecell;
+ toggle_view->cell_view.e_table_model = table_model;
+ toggle_view->cell_view.e_table_item_view = e_table_item_view;
+ toggle_view->cell_view.kill_view_cb = NULL;
+ toggle_view->cell_view.kill_view_cb_data = NULL;
+ toggle_view->canvas = canvas;
+
+ return (ECellView *) toggle_view;
+}
+
+static void
+cell_toggle_kill_view (ECellView *ecell_view)
+{
+ ECellToggleView *toggle_view = (ECellToggleView *) ecell_view;
+
+ if (toggle_view->cell_view.kill_view_cb)
+ toggle_view->cell_view.kill_view_cb (
+ ecell_view, toggle_view->cell_view.kill_view_cb_data);
+
+ if (toggle_view->cell_view.kill_view_cb_data)
+ g_list_free (toggle_view->cell_view.kill_view_cb_data);
+
+ g_free (ecell_view);
+}
+
+static void
+cell_toggle_draw (ECellView *ecell_view,
+ cairo_t *cr,
+ gint model_col,
+ gint view_col,
+ gint row,
+ ECellFlags flags,
+ gint x1,
+ gint y1,
+ gint x2,
+ gint y2)
+{
+ ECellTogglePrivate *priv;
+ GdkPixbuf *image;
+ gint x, y;
+
+ const gint value = GPOINTER_TO_INT (
+ e_table_model_value_at (ecell_view->e_table_model, model_col, row));
+
+ priv = E_CELL_TOGGLE_GET_PRIVATE (ecell_view->ecell);
+
+ if (value < 0 || value >= priv->pixbufs->len)
+ return;
+
+ image = g_ptr_array_index (priv->pixbufs, value);
+
+ if ((x2 - x1) < gdk_pixbuf_get_width (image))
+ x = x1;
+ else
+ x = x1 + ((x2 - x1) - gdk_pixbuf_get_width (image)) / 2;
+
+ if ((y2 - y1) < gdk_pixbuf_get_height (image))
+ y = y1;
+ else
+ y = y1 + ((y2 - y1) - gdk_pixbuf_get_height (image)) / 2;
+
+ cairo_save (cr);
+ gdk_cairo_set_source_pixbuf (cr, image, x, y);
+ cairo_paint_with_alpha (cr, 1);
+ cairo_restore (cr);
+}
+
+static void
+etog_set_value (ECellToggleView *toggle_view,
+ gint model_col,
+ gint view_col,
+ gint row,
+ gint value)
+{
+ ECellTogglePrivate *priv;
+
+ priv = E_CELL_TOGGLE_GET_PRIVATE (toggle_view->cell_view.ecell);
+
+ if (value >= priv->pixbufs->len)
+ value = 0;
+
+ e_table_model_set_value_at (
+ toggle_view->cell_view.e_table_model,
+ model_col, row, GINT_TO_POINTER (value));
+}
+
+static gint
+cell_toggle_event (ECellView *ecell_view,
+ GdkEvent *event,
+ gint model_col,
+ gint view_col,
+ gint row,
+ ECellFlags flags,
+ ECellActions *actions)
+{
+ ECellToggleView *toggle_view = (ECellToggleView *) ecell_view;
+ gpointer _value = e_table_model_value_at (
+ ecell_view->e_table_model, model_col, row);
+ const gint value = GPOINTER_TO_INT (_value);
+
+ switch (event->type) {
+ case GDK_KEY_PRESS:
+ if (event->key.keyval != GDK_KEY_space)
+ return FALSE;
+ /* Fall through */
+ case GDK_BUTTON_PRESS:
+ if (!e_table_model_is_cell_editable (
+ ecell_view->e_table_model, model_col, row))
+ return FALSE;
+
+ etog_set_value (
+ toggle_view, model_col, view_col, row, value + 1);
+
+ return TRUE;
+
+ default:
+ return FALSE;
+ }
+}
+
+static gint
+cell_toggle_height (ECellView *ecell_view,
+ gint model_col,
+ gint view_col,
+ gint row)
+{
+ ECellTogglePrivate *priv;
+
+ priv = E_CELL_TOGGLE_GET_PRIVATE (ecell_view->ecell);
+
+ return priv->height;
+}
+
+static void
+cell_toggle_print (ECellView *ecell_view,
+ GtkPrintContext *context,
+ gint model_col,
+ gint view_col,
+ gint row,
+ gdouble width,
+ gdouble height)
+{
+ ECellTogglePrivate *priv;
+ GdkPixbuf *image;
+ gdouble image_width, image_height;
+ const gint value = GPOINTER_TO_INT (
+ e_table_model_value_at (ecell_view->e_table_model, model_col, row));
+
+ cairo_t *cr;
+
+ priv = E_CELL_TOGGLE_GET_PRIVATE (ecell_view->ecell);
+
+ if (value >= priv->pixbufs->len)
+ return;
+
+ image = g_ptr_array_index (priv->pixbufs, value);
+ if (image) {
+ cr = gtk_print_context_get_cairo_context (context);
+ cairo_save (cr);
+ cairo_translate (cr, 0 , 0);
+ image = gdk_pixbuf_add_alpha (image, TRUE, 255, 255, 255);
+ image_width = (gdouble) gdk_pixbuf_get_width (image);
+ image_height = (gdouble) gdk_pixbuf_get_height (image);
+ cairo_rectangle (
+ cr,
+ image_width / 7,
+ image_height / 3,
+ image_width - image_width / 4,
+ image_width - image_height / 7);
+ cairo_clip (cr);
+ gdk_cairo_set_source_pixbuf (cr, image, 0, image_height / 4);
+ cairo_paint (cr);
+ cairo_restore (cr);
+ }
+}
+
+static gdouble
+cell_toggle_print_height (ECellView *ecell_view,
+ GtkPrintContext *context,
+ gint model_col,
+ gint view_col,
+ gint row,
+ gdouble width)
+{
+ ECellTogglePrivate *priv;
+
+ priv = E_CELL_TOGGLE_GET_PRIVATE (ecell_view->ecell);
+
+ return priv->height;
+}
+
+static gint
+cell_toggle_max_width (ECellView *ecell_view,
+ gint model_col,
+ gint view_col)
+{
+ ECellTogglePrivate *priv;
+ gint max_width = 0;
+ gint number_of_rows;
+ gint row;
+
+ priv = E_CELL_TOGGLE_GET_PRIVATE (ecell_view->ecell);
+
+ number_of_rows = e_table_model_row_count (ecell_view->e_table_model);
+ for (row = 0; row < number_of_rows; row++) {
+ GdkPixbuf *pixbuf;
+ gpointer value;
+
+ value = e_table_model_value_at (
+ ecell_view->e_table_model, model_col, row);
+ pixbuf = g_ptr_array_index (
+ priv->pixbufs, GPOINTER_TO_INT (value));
+
+ max_width = MAX (max_width, gdk_pixbuf_get_width (pixbuf));
+ }
+
+ return max_width;
+}
+
+static void
+e_cell_toggle_class_init (ECellToggleClass *class)
+{
+ GObjectClass *object_class;
+ ECellClass *cell_class;
+
+ g_type_class_add_private (class, sizeof (ECellTogglePrivate));
+
+ object_class = G_OBJECT_CLASS (class);
+ object_class->dispose = cell_toggle_dispose;
+ object_class->finalize = cell_toggle_finalize;
+
+ cell_class = E_CELL_CLASS (class);
+ cell_class->new_view = cell_toggle_new_view;
+ cell_class->kill_view = cell_toggle_kill_view;
+ cell_class->draw = cell_toggle_draw;
+ cell_class->event = cell_toggle_event;
+ cell_class->height = cell_toggle_height;
+ cell_class->print = cell_toggle_print;
+ cell_class->print_height = cell_toggle_print_height;
+ cell_class->max_width = cell_toggle_max_width;
+
+ gal_a11y_e_cell_registry_add_cell_type (
+ NULL, E_TYPE_CELL_TOGGLE, gal_a11y_e_cell_toggle_new);
+}
+
+static void
+e_cell_toggle_init (ECellToggle *cell_toggle)
+{
+ cell_toggle->priv = E_CELL_TOGGLE_GET_PRIVATE (cell_toggle);
+
+ cell_toggle->priv->empty =
+ gdk_pixbuf_new_from_xpm_data (empty_xpm);
+
+ cell_toggle->priv->pixbufs =
+ g_ptr_array_new_with_free_func (g_object_unref);
+}
+
+/**
+ * e_cell_toggle_construct:
+ * @cell_toggle: a fresh ECellToggle object
+ * @icon_names: array of icon names, some of which may be %NULL
+ * @n_icon_names: length of the @icon_names array
+ *
+ * Constructs the @cell_toggle object with the @icon_names and @n_icon_names
+ * arguments.
+ */
+void
+e_cell_toggle_construct (ECellToggle *cell_toggle,
+ const gchar **icon_names,
+ guint n_icon_names)
+{
+ guint ii;
+
+ g_return_if_fail (E_IS_CELL_TOGGLE (cell_toggle));
+ g_return_if_fail (icon_names != NULL);
+ g_return_if_fail (n_icon_names > 0);
+
+ cell_toggle->priv->icon_names = g_new (gchar *, n_icon_names);
+ cell_toggle->priv->n_icon_names = n_icon_names;
+
+ for (ii = 0; ii < n_icon_names; ii++)
+ cell_toggle->priv->icon_names[ii] = g_strdup (icon_names[ii]);
+
+ cell_toggle_load_icons (cell_toggle);
+}
+
+/**
+ * e_cell_toggle_new:
+ * @icon_names: array of icon names, some of which may be %NULL
+ * @n_icon_names: length of the @icon_names array
+ *
+ * Creates a new ECell renderer that can be used to render toggle
+ * buttons with the icons specified in @icon_names. The value returned
+ * by ETableModel::get_value is typecast into an integer and clamped
+ * to the [0..n_icon_names) range. That will select the image rendered.
+ *
+ * %NULL elements in @icon_names will show no icon for the corresponding
+ * integer value.
+ *
+ * Returns: an ECell object that can be used to render multi-state
+ * toggle cells.
+ */
+ECell *
+e_cell_toggle_new (const gchar **icon_names,
+ guint n_icon_names)
+{
+ ECellToggle *cell_toggle;
+
+ g_return_val_if_fail (icon_names != NULL, NULL);
+ g_return_val_if_fail (n_icon_names > 0, NULL);
+
+ cell_toggle = g_object_new (E_TYPE_CELL_TOGGLE, NULL);
+ e_cell_toggle_construct (cell_toggle, icon_names, n_icon_names);
+
+ return (ECell *) cell_toggle;
+}
+
+GPtrArray *
+e_cell_toggle_get_pixbufs (ECellToggle *cell_toggle)
+{
+ g_return_val_if_fail (E_IS_CELL_TOGGLE (cell_toggle), NULL);
+
+ return cell_toggle->priv->pixbufs;
+}
+
+void
+e_cell_toggle_set_icon_descriptions (ECellToggle *cell_toggle,
+ const gchar **descriptions,
+ gint n_descriptions)
+{
+ gint ii;
+ gint n_icon_names;
+
+ g_return_if_fail (E_IS_CELL_TOGGLE (cell_toggle));
+ g_return_if_fail (cell_toggle->priv->icon_descriptions == NULL);
+ g_return_if_fail (n_descriptions == cell_toggle->priv->n_icon_names);
+
+ n_icon_names = cell_toggle->priv->n_icon_names;
+
+ cell_toggle->priv->icon_descriptions = g_new (gchar *, n_icon_names);
+
+ for (ii = 0; ii < n_icon_names; ii++)
+ cell_toggle->priv->icon_descriptions[ii] = g_strdup (descriptions[ii]);
+}
+
+const gchar *
+e_cell_toggle_get_icon_description (ECellToggle *cell_toggle,
+ gint n)
+{
+ if (n < 0 || n >= cell_toggle->priv->n_icon_names)
+ return NULL;
+
+ if (!cell_toggle->priv->icon_descriptions)
+ return NULL;
+
+ return cell_toggle->priv->icon_descriptions[n];
+}
diff --git a/e-util/e-cell-toggle.h b/src/e-util/e-cell-toggle.h
similarity index 100%
rename from e-util/e-cell-toggle.h
rename to src/e-util/e-cell-toggle.h
diff --git a/e-util/e-cell-tree.c b/src/e-util/e-cell-tree.c
similarity index 100%
rename from e-util/e-cell-tree.c
rename to src/e-util/e-cell-tree.c
diff --git a/e-util/e-cell-tree.h b/src/e-util/e-cell-tree.h
similarity index 100%
rename from e-util/e-cell-tree.h
rename to src/e-util/e-cell-tree.h
diff --git a/e-util/e-cell-vbox.c b/src/e-util/e-cell-vbox.c
similarity index 100%
rename from e-util/e-cell-vbox.c
rename to src/e-util/e-cell-vbox.c
diff --git a/e-util/e-cell-vbox.h b/src/e-util/e-cell-vbox.h
similarity index 100%
rename from e-util/e-cell-vbox.h
rename to src/e-util/e-cell-vbox.h
diff --git a/e-util/e-cell.c b/src/e-util/e-cell.c
similarity index 100%
rename from e-util/e-cell.c
rename to src/e-util/e-cell.c
diff --git a/e-util/e-cell.h b/src/e-util/e-cell.h
similarity index 100%
rename from e-util/e-cell.h
rename to src/e-util/e-cell.h
diff --git a/e-util/e-charset-combo-box.c b/src/e-util/e-charset-combo-box.c
similarity index 100%
rename from e-util/e-charset-combo-box.c
rename to src/e-util/e-charset-combo-box.c
diff --git a/e-util/e-charset-combo-box.h b/src/e-util/e-charset-combo-box.h
similarity index 100%
rename from e-util/e-charset-combo-box.h
rename to src/e-util/e-charset-combo-box.h
diff --git a/e-util/e-charset.c b/src/e-util/e-charset.c
similarity index 100%
rename from e-util/e-charset.c
rename to src/e-util/e-charset.c
diff --git a/e-util/e-charset.h b/src/e-util/e-charset.h
similarity index 100%
rename from e-util/e-charset.h
rename to src/e-util/e-charset.h
diff --git a/e-util/e-client-cache.c b/src/e-util/e-client-cache.c
similarity index 100%
rename from e-util/e-client-cache.c
rename to src/e-util/e-client-cache.c
diff --git a/e-util/e-client-cache.h b/src/e-util/e-client-cache.h
similarity index 100%
rename from e-util/e-client-cache.h
rename to src/e-util/e-client-cache.h
diff --git a/e-util/e-client-combo-box.c b/src/e-util/e-client-combo-box.c
similarity index 100%
rename from e-util/e-client-combo-box.c
rename to src/e-util/e-client-combo-box.c
diff --git a/e-util/e-client-combo-box.h b/src/e-util/e-client-combo-box.h
similarity index 100%
rename from e-util/e-client-combo-box.h
rename to src/e-util/e-client-combo-box.h
diff --git a/e-util/e-client-selector.c b/src/e-util/e-client-selector.c
similarity index 100%
rename from e-util/e-client-selector.c
rename to src/e-util/e-client-selector.c
diff --git a/e-util/e-client-selector.h b/src/e-util/e-client-selector.h
similarity index 100%
rename from e-util/e-client-selector.h
rename to src/e-util/e-client-selector.h
diff --git a/e-util/e-color-chooser-widget.c b/src/e-util/e-color-chooser-widget.c
similarity index 100%
rename from e-util/e-color-chooser-widget.c
rename to src/e-util/e-color-chooser-widget.c
diff --git a/e-util/e-color-chooser-widget.h b/src/e-util/e-color-chooser-widget.h
similarity index 100%
rename from e-util/e-color-chooser-widget.h
rename to src/e-util/e-color-chooser-widget.h
diff --git a/e-util/e-color-combo.c b/src/e-util/e-color-combo.c
similarity index 100%
rename from e-util/e-color-combo.c
rename to src/e-util/e-color-combo.c
diff --git a/e-util/e-color-combo.h b/src/e-util/e-color-combo.h
similarity index 100%
rename from e-util/e-color-combo.h
rename to src/e-util/e-color-combo.h
diff --git a/e-util/e-config.c b/src/e-util/e-config.c
similarity index 100%
rename from e-util/e-config.c
rename to src/e-util/e-config.c
diff --git a/e-util/e-config.h b/src/e-util/e-config.h
similarity index 100%
rename from e-util/e-config.h
rename to src/e-util/e-config.h
diff --git a/e-util/e-conflict-search-selector.c b/src/e-util/e-conflict-search-selector.c
similarity index 100%
rename from e-util/e-conflict-search-selector.c
rename to src/e-util/e-conflict-search-selector.c
diff --git a/e-util/e-conflict-search-selector.h b/src/e-util/e-conflict-search-selector.h
similarity index 100%
rename from e-util/e-conflict-search-selector.h
rename to src/e-util/e-conflict-search-selector.h
diff --git a/e-util/e-contact-store.c b/src/e-util/e-contact-store.c
similarity index 100%
rename from e-util/e-contact-store.c
rename to src/e-util/e-contact-store.c
diff --git a/e-util/e-contact-store.h b/src/e-util/e-contact-store.h
similarity index 100%
rename from e-util/e-contact-store.h
rename to src/e-util/e-contact-store.h
diff --git a/e-util/e-content-editor.c b/src/e-util/e-content-editor.c
similarity index 100%
rename from e-util/e-content-editor.c
rename to src/e-util/e-content-editor.c
diff --git a/e-util/e-content-editor.h b/src/e-util/e-content-editor.h
similarity index 100%
rename from e-util/e-content-editor.h
rename to src/e-util/e-content-editor.h
diff --git a/e-util/e-content-request.c b/src/e-util/e-content-request.c
similarity index 100%
rename from e-util/e-content-request.c
rename to src/e-util/e-content-request.c
diff --git a/e-util/e-content-request.h b/src/e-util/e-content-request.h
similarity index 100%
rename from e-util/e-content-request.h
rename to src/e-util/e-content-request.h
diff --git a/e-util/e-data-capture.c b/src/e-util/e-data-capture.c
similarity index 100%
rename from e-util/e-data-capture.c
rename to src/e-util/e-data-capture.c
diff --git a/e-util/e-data-capture.h b/src/e-util/e-data-capture.h
similarity index 100%
rename from e-util/e-data-capture.h
rename to src/e-util/e-data-capture.h
diff --git a/e-util/e-dateedit.c b/src/e-util/e-dateedit.c
similarity index 100%
rename from e-util/e-dateedit.c
rename to src/e-util/e-dateedit.c
diff --git a/e-util/e-dateedit.h b/src/e-util/e-dateedit.h
similarity index 100%
rename from e-util/e-dateedit.h
rename to src/e-util/e-dateedit.h
diff --git a/e-util/e-datetime-format.c b/src/e-util/e-datetime-format.c
similarity index 100%
rename from e-util/e-datetime-format.c
rename to src/e-util/e-datetime-format.c
diff --git a/e-util/e-datetime-format.h b/src/e-util/e-datetime-format.h
similarity index 100%
rename from e-util/e-datetime-format.h
rename to src/e-util/e-datetime-format.h
diff --git a/e-util/e-destination-store.c b/src/e-util/e-destination-store.c
similarity index 100%
rename from e-util/e-destination-store.c
rename to src/e-util/e-destination-store.c
diff --git a/e-util/e-destination-store.h b/src/e-util/e-destination-store.h
similarity index 100%
rename from e-util/e-destination-store.h
rename to src/e-util/e-destination-store.h
diff --git a/e-util/e-dialog-utils.c b/src/e-util/e-dialog-utils.c
similarity index 100%
rename from e-util/e-dialog-utils.c
rename to src/e-util/e-dialog-utils.c
diff --git a/e-util/e-dialog-utils.h b/src/e-util/e-dialog-utils.h
similarity index 100%
rename from e-util/e-dialog-utils.h
rename to src/e-util/e-dialog-utils.h
diff --git a/e-util/e-dialog-widgets.c b/src/e-util/e-dialog-widgets.c
similarity index 100%
rename from e-util/e-dialog-widgets.c
rename to src/e-util/e-dialog-widgets.c
diff --git a/e-util/e-dialog-widgets.h b/src/e-util/e-dialog-widgets.h
similarity index 100%
rename from e-util/e-dialog-widgets.h
rename to src/e-util/e-dialog-widgets.h
diff --git a/e-util/e-emoticon-action.c b/src/e-util/e-emoticon-action.c
similarity index 100%
rename from e-util/e-emoticon-action.c
rename to src/e-util/e-emoticon-action.c
diff --git a/e-util/e-emoticon-action.h b/src/e-util/e-emoticon-action.h
similarity index 100%
rename from e-util/e-emoticon-action.h
rename to src/e-util/e-emoticon-action.h
diff --git a/e-util/e-emoticon-chooser-menu.c b/src/e-util/e-emoticon-chooser-menu.c
similarity index 100%
rename from e-util/e-emoticon-chooser-menu.c
rename to src/e-util/e-emoticon-chooser-menu.c
diff --git a/e-util/e-emoticon-chooser-menu.h b/src/e-util/e-emoticon-chooser-menu.h
similarity index 100%
rename from e-util/e-emoticon-chooser-menu.h
rename to src/e-util/e-emoticon-chooser-menu.h
diff --git a/e-util/e-emoticon-chooser.c b/src/e-util/e-emoticon-chooser.c
similarity index 100%
rename from e-util/e-emoticon-chooser.c
rename to src/e-util/e-emoticon-chooser.c
diff --git a/e-util/e-emoticon-chooser.h b/src/e-util/e-emoticon-chooser.h
similarity index 100%
rename from e-util/e-emoticon-chooser.h
rename to src/e-util/e-emoticon-chooser.h
diff --git a/e-util/e-emoticon-tool-button.c b/src/e-util/e-emoticon-tool-button.c
similarity index 100%
rename from e-util/e-emoticon-tool-button.c
rename to src/e-util/e-emoticon-tool-button.c
diff --git a/e-util/e-emoticon-tool-button.h b/src/e-util/e-emoticon-tool-button.h
similarity index 100%
rename from e-util/e-emoticon-tool-button.h
rename to src/e-util/e-emoticon-tool-button.h
diff --git a/e-util/e-emoticon.c b/src/e-util/e-emoticon.c
similarity index 100%
rename from e-util/e-emoticon.c
rename to src/e-util/e-emoticon.c
diff --git a/e-util/e-emoticon.h b/src/e-util/e-emoticon.h
similarity index 100%
rename from e-util/e-emoticon.h
rename to src/e-util/e-emoticon.h
diff --git a/e-util/e-event.c b/src/e-util/e-event.c
similarity index 100%
rename from e-util/e-event.c
rename to src/e-util/e-event.c
diff --git a/e-util/e-event.h b/src/e-util/e-event.h
similarity index 100%
rename from e-util/e-event.h
rename to src/e-util/e-event.h
diff --git a/e-util/e-file-request.c b/src/e-util/e-file-request.c
similarity index 100%
rename from e-util/e-file-request.c
rename to src/e-util/e-file-request.c
diff --git a/e-util/e-file-request.h b/src/e-util/e-file-request.h
similarity index 100%
rename from e-util/e-file-request.h
rename to src/e-util/e-file-request.h
diff --git a/e-util/e-file-utils.c b/src/e-util/e-file-utils.c
similarity index 100%
rename from e-util/e-file-utils.c
rename to src/e-util/e-file-utils.c
diff --git a/e-util/e-file-utils.h b/src/e-util/e-file-utils.h
similarity index 100%
rename from e-util/e-file-utils.h
rename to src/e-util/e-file-utils.h
diff --git a/e-util/e-filter-code.c b/src/e-util/e-filter-code.c
similarity index 100%
rename from e-util/e-filter-code.c
rename to src/e-util/e-filter-code.c
diff --git a/e-util/e-filter-code.h b/src/e-util/e-filter-code.h
similarity index 100%
rename from e-util/e-filter-code.h
rename to src/e-util/e-filter-code.h
diff --git a/e-util/e-filter-color.c b/src/e-util/e-filter-color.c
similarity index 100%
rename from e-util/e-filter-color.c
rename to src/e-util/e-filter-color.c
diff --git a/e-util/e-filter-color.h b/src/e-util/e-filter-color.h
similarity index 100%
rename from e-util/e-filter-color.h
rename to src/e-util/e-filter-color.h
diff --git a/e-util/e-filter-datespec.c b/src/e-util/e-filter-datespec.c
similarity index 100%
rename from e-util/e-filter-datespec.c
rename to src/e-util/e-filter-datespec.c
diff --git a/e-util/e-filter-datespec.h b/src/e-util/e-filter-datespec.h
similarity index 100%
rename from e-util/e-filter-datespec.h
rename to src/e-util/e-filter-datespec.h
diff --git a/e-util/e-filter-element.c b/src/e-util/e-filter-element.c
similarity index 100%
rename from e-util/e-filter-element.c
rename to src/e-util/e-filter-element.c
diff --git a/e-util/e-filter-element.h b/src/e-util/e-filter-element.h
similarity index 100%
rename from e-util/e-filter-element.h
rename to src/e-util/e-filter-element.h
diff --git a/e-util/e-filter-file.c b/src/e-util/e-filter-file.c
similarity index 100%
rename from e-util/e-filter-file.c
rename to src/e-util/e-filter-file.c
diff --git a/e-util/e-filter-file.h b/src/e-util/e-filter-file.h
similarity index 100%
rename from e-util/e-filter-file.h
rename to src/e-util/e-filter-file.h
diff --git a/e-util/e-filter-input.c b/src/e-util/e-filter-input.c
similarity index 100%
rename from e-util/e-filter-input.c
rename to src/e-util/e-filter-input.c
diff --git a/e-util/e-filter-input.h b/src/e-util/e-filter-input.h
similarity index 100%
rename from e-util/e-filter-input.h
rename to src/e-util/e-filter-input.h
diff --git a/e-util/e-filter-int.c b/src/e-util/e-filter-int.c
similarity index 100%
rename from e-util/e-filter-int.c
rename to src/e-util/e-filter-int.c
diff --git a/e-util/e-filter-int.h b/src/e-util/e-filter-int.h
similarity index 100%
rename from e-util/e-filter-int.h
rename to src/e-util/e-filter-int.h
diff --git a/e-util/e-filter-option.c b/src/e-util/e-filter-option.c
similarity index 100%
rename from e-util/e-filter-option.c
rename to src/e-util/e-filter-option.c
diff --git a/e-util/e-filter-option.h b/src/e-util/e-filter-option.h
similarity index 100%
rename from e-util/e-filter-option.h
rename to src/e-util/e-filter-option.h
diff --git a/e-util/e-filter-part.c b/src/e-util/e-filter-part.c
similarity index 100%
rename from e-util/e-filter-part.c
rename to src/e-util/e-filter-part.c
diff --git a/e-util/e-filter-part.h b/src/e-util/e-filter-part.h
similarity index 100%
rename from e-util/e-filter-part.h
rename to src/e-util/e-filter-part.h
diff --git a/e-util/e-filter-rule.c b/src/e-util/e-filter-rule.c
similarity index 100%
rename from e-util/e-filter-rule.c
rename to src/e-util/e-filter-rule.c
diff --git a/e-util/e-filter-rule.h b/src/e-util/e-filter-rule.h
similarity index 100%
rename from e-util/e-filter-rule.h
rename to src/e-util/e-filter-rule.h
diff --git a/e-util/e-focus-tracker.c b/src/e-util/e-focus-tracker.c
similarity index 100%
rename from e-util/e-focus-tracker.c
rename to src/e-util/e-focus-tracker.c
diff --git a/e-util/e-focus-tracker.h b/src/e-util/e-focus-tracker.h
similarity index 100%
rename from e-util/e-focus-tracker.h
rename to src/e-util/e-focus-tracker.h
diff --git a/e-util/e-html-editor-actions.c b/src/e-util/e-html-editor-actions.c
similarity index 100%
rename from e-util/e-html-editor-actions.c
rename to src/e-util/e-html-editor-actions.c
diff --git a/e-util/e-html-editor-actions.h b/src/e-util/e-html-editor-actions.h
similarity index 100%
rename from e-util/e-html-editor-actions.h
rename to src/e-util/e-html-editor-actions.h
diff --git a/e-util/e-html-editor-cell-dialog.c b/src/e-util/e-html-editor-cell-dialog.c
similarity index 100%
rename from e-util/e-html-editor-cell-dialog.c
rename to src/e-util/e-html-editor-cell-dialog.c
diff --git a/e-util/e-html-editor-cell-dialog.h b/src/e-util/e-html-editor-cell-dialog.h
similarity index 100%
rename from e-util/e-html-editor-cell-dialog.h
rename to src/e-util/e-html-editor-cell-dialog.h
diff --git a/e-util/e-html-editor-dialog.c b/src/e-util/e-html-editor-dialog.c
similarity index 100%
rename from e-util/e-html-editor-dialog.c
rename to src/e-util/e-html-editor-dialog.c
diff --git a/e-util/e-html-editor-dialog.h b/src/e-util/e-html-editor-dialog.h
similarity index 100%
rename from e-util/e-html-editor-dialog.h
rename to src/e-util/e-html-editor-dialog.h
diff --git a/e-util/e-html-editor-find-dialog.c b/src/e-util/e-html-editor-find-dialog.c
similarity index 100%
rename from e-util/e-html-editor-find-dialog.c
rename to src/e-util/e-html-editor-find-dialog.c
diff --git a/e-util/e-html-editor-find-dialog.h b/src/e-util/e-html-editor-find-dialog.h
similarity index 100%
rename from e-util/e-html-editor-find-dialog.h
rename to src/e-util/e-html-editor-find-dialog.h
diff --git a/e-util/e-html-editor-hrule-dialog.c b/src/e-util/e-html-editor-hrule-dialog.c
similarity index 100%
rename from e-util/e-html-editor-hrule-dialog.c
rename to src/e-util/e-html-editor-hrule-dialog.c
diff --git a/e-util/e-html-editor-hrule-dialog.h b/src/e-util/e-html-editor-hrule-dialog.h
similarity index 100%
rename from e-util/e-html-editor-hrule-dialog.h
rename to src/e-util/e-html-editor-hrule-dialog.h
diff --git a/e-util/e-html-editor-image-dialog.c b/src/e-util/e-html-editor-image-dialog.c
similarity index 100%
rename from e-util/e-html-editor-image-dialog.c
rename to src/e-util/e-html-editor-image-dialog.c
diff --git a/e-util/e-html-editor-image-dialog.h b/src/e-util/e-html-editor-image-dialog.h
similarity index 100%
rename from e-util/e-html-editor-image-dialog.h
rename to src/e-util/e-html-editor-image-dialog.h
diff --git a/e-util/e-html-editor-link-dialog.c b/src/e-util/e-html-editor-link-dialog.c
similarity index 100%
rename from e-util/e-html-editor-link-dialog.c
rename to src/e-util/e-html-editor-link-dialog.c
diff --git a/e-util/e-html-editor-link-dialog.h b/src/e-util/e-html-editor-link-dialog.h
similarity index 100%
rename from e-util/e-html-editor-link-dialog.h
rename to src/e-util/e-html-editor-link-dialog.h
diff --git a/e-util/e-html-editor-manager.ui b/src/e-util/e-html-editor-manager.ui
similarity index 100%
rename from e-util/e-html-editor-manager.ui
rename to src/e-util/e-html-editor-manager.ui
diff --git a/e-util/e-html-editor-page-dialog.c b/src/e-util/e-html-editor-page-dialog.c
similarity index 100%
rename from e-util/e-html-editor-page-dialog.c
rename to src/e-util/e-html-editor-page-dialog.c
diff --git a/e-util/e-html-editor-page-dialog.h b/src/e-util/e-html-editor-page-dialog.h
similarity index 100%
rename from e-util/e-html-editor-page-dialog.h
rename to src/e-util/e-html-editor-page-dialog.h
diff --git a/e-util/e-html-editor-paragraph-dialog.c b/src/e-util/e-html-editor-paragraph-dialog.c
similarity index 100%
rename from e-util/e-html-editor-paragraph-dialog.c
rename to src/e-util/e-html-editor-paragraph-dialog.c
diff --git a/e-util/e-html-editor-paragraph-dialog.h b/src/e-util/e-html-editor-paragraph-dialog.h
similarity index 100%
rename from e-util/e-html-editor-paragraph-dialog.h
rename to src/e-util/e-html-editor-paragraph-dialog.h
diff --git a/e-util/e-html-editor-private.h b/src/e-util/e-html-editor-private.h
similarity index 100%
rename from e-util/e-html-editor-private.h
rename to src/e-util/e-html-editor-private.h
diff --git a/e-util/e-html-editor-replace-dialog.c b/src/e-util/e-html-editor-replace-dialog.c
similarity index 100%
rename from e-util/e-html-editor-replace-dialog.c
rename to src/e-util/e-html-editor-replace-dialog.c
diff --git a/e-util/e-html-editor-replace-dialog.h b/src/e-util/e-html-editor-replace-dialog.h
similarity index 100%
rename from e-util/e-html-editor-replace-dialog.h
rename to src/e-util/e-html-editor-replace-dialog.h
diff --git a/e-util/e-html-editor-spell-check-dialog.c b/src/e-util/e-html-editor-spell-check-dialog.c
similarity index 100%
rename from e-util/e-html-editor-spell-check-dialog.c
rename to src/e-util/e-html-editor-spell-check-dialog.c
diff --git a/e-util/e-html-editor-spell-check-dialog.h b/src/e-util/e-html-editor-spell-check-dialog.h
similarity index 100%
rename from e-util/e-html-editor-spell-check-dialog.h
rename to src/e-util/e-html-editor-spell-check-dialog.h
diff --git a/e-util/e-html-editor-table-dialog.c b/src/e-util/e-html-editor-table-dialog.c
similarity index 100%
rename from e-util/e-html-editor-table-dialog.c
rename to src/e-util/e-html-editor-table-dialog.c
diff --git a/e-util/e-html-editor-table-dialog.h b/src/e-util/e-html-editor-table-dialog.h
similarity index 100%
rename from e-util/e-html-editor-table-dialog.h
rename to src/e-util/e-html-editor-table-dialog.h
diff --git a/e-util/e-html-editor-text-dialog.c b/src/e-util/e-html-editor-text-dialog.c
similarity index 100%
rename from e-util/e-html-editor-text-dialog.c
rename to src/e-util/e-html-editor-text-dialog.c
diff --git a/e-util/e-html-editor-text-dialog.h b/src/e-util/e-html-editor-text-dialog.h
similarity index 100%
rename from e-util/e-html-editor-text-dialog.h
rename to src/e-util/e-html-editor-text-dialog.h
diff --git a/e-util/e-html-editor.c b/src/e-util/e-html-editor.c
similarity index 100%
rename from e-util/e-html-editor.c
rename to src/e-util/e-html-editor.c
diff --git a/e-util/e-html-editor.h b/src/e-util/e-html-editor.h
similarity index 100%
rename from e-util/e-html-editor.h
rename to src/e-util/e-html-editor.h
diff --git a/e-util/e-html-utils.c b/src/e-util/e-html-utils.c
similarity index 100%
rename from e-util/e-html-utils.c
rename to src/e-util/e-html-utils.c
diff --git a/e-util/e-html-utils.h b/src/e-util/e-html-utils.h
similarity index 100%
rename from e-util/e-html-utils.h
rename to src/e-util/e-html-utils.h
diff --git a/e-util/e-icon-factory.c b/src/e-util/e-icon-factory.c
similarity index 100%
rename from e-util/e-icon-factory.c
rename to src/e-util/e-icon-factory.c
diff --git a/e-util/e-icon-factory.h b/src/e-util/e-icon-factory.h
similarity index 100%
rename from e-util/e-icon-factory.h
rename to src/e-util/e-icon-factory.h
diff --git a/e-util/e-image-chooser-dialog.c b/src/e-util/e-image-chooser-dialog.c
similarity index 100%
rename from e-util/e-image-chooser-dialog.c
rename to src/e-util/e-image-chooser-dialog.c
diff --git a/e-util/e-image-chooser-dialog.h b/src/e-util/e-image-chooser-dialog.h
similarity index 100%
rename from e-util/e-image-chooser-dialog.h
rename to src/e-util/e-image-chooser-dialog.h
diff --git a/e-util/e-image-chooser.c b/src/e-util/e-image-chooser.c
similarity index 100%
rename from e-util/e-image-chooser.c
rename to src/e-util/e-image-chooser.c
diff --git a/e-util/e-image-chooser.h b/src/e-util/e-image-chooser.h
similarity index 100%
rename from e-util/e-image-chooser.h
rename to src/e-util/e-image-chooser.h
diff --git a/e-util/e-import-assistant.c b/src/e-util/e-import-assistant.c
similarity index 100%
rename from e-util/e-import-assistant.c
rename to src/e-util/e-import-assistant.c
diff --git a/e-util/e-import-assistant.h b/src/e-util/e-import-assistant.h
similarity index 100%
rename from e-util/e-import-assistant.h
rename to src/e-util/e-import-assistant.h
diff --git a/e-util/e-import.c b/src/e-util/e-import.c
similarity index 100%
rename from e-util/e-import.c
rename to src/e-util/e-import.c
diff --git a/e-util/e-import.h b/src/e-util/e-import.h
similarity index 100%
rename from e-util/e-import.h
rename to src/e-util/e-import.h
diff --git a/e-util/e-interval-chooser.c b/src/e-util/e-interval-chooser.c
similarity index 100%
rename from e-util/e-interval-chooser.c
rename to src/e-util/e-interval-chooser.c
diff --git a/e-util/e-interval-chooser.h b/src/e-util/e-interval-chooser.h
similarity index 100%
rename from e-util/e-interval-chooser.h
rename to src/e-util/e-interval-chooser.h
diff --git a/e-util/e-mail-identity-combo-box.c b/src/e-util/e-mail-identity-combo-box.c
similarity index 100%
rename from e-util/e-mail-identity-combo-box.c
rename to src/e-util/e-mail-identity-combo-box.c
diff --git a/e-util/e-mail-identity-combo-box.h b/src/e-util/e-mail-identity-combo-box.h
similarity index 100%
rename from e-util/e-mail-identity-combo-box.h
rename to src/e-util/e-mail-identity-combo-box.h
diff --git a/e-util/e-mail-signature-combo-box.c b/src/e-util/e-mail-signature-combo-box.c
similarity index 100%
rename from e-util/e-mail-signature-combo-box.c
rename to src/e-util/e-mail-signature-combo-box.c
diff --git a/e-util/e-mail-signature-combo-box.h b/src/e-util/e-mail-signature-combo-box.h
similarity index 100%
rename from e-util/e-mail-signature-combo-box.h
rename to src/e-util/e-mail-signature-combo-box.h
diff --git a/e-util/e-mail-signature-editor.c b/src/e-util/e-mail-signature-editor.c
similarity index 100%
rename from e-util/e-mail-signature-editor.c
rename to src/e-util/e-mail-signature-editor.c
diff --git a/e-util/e-mail-signature-editor.h b/src/e-util/e-mail-signature-editor.h
similarity index 100%
rename from e-util/e-mail-signature-editor.h
rename to src/e-util/e-mail-signature-editor.h
diff --git a/e-util/e-mail-signature-manager.c b/src/e-util/e-mail-signature-manager.c
similarity index 100%
rename from e-util/e-mail-signature-manager.c
rename to src/e-util/e-mail-signature-manager.c
diff --git a/e-util/e-mail-signature-manager.h b/src/e-util/e-mail-signature-manager.h
similarity index 100%
rename from e-util/e-mail-signature-manager.h
rename to src/e-util/e-mail-signature-manager.h
diff --git a/e-util/e-mail-signature-preview.c b/src/e-util/e-mail-signature-preview.c
similarity index 100%
rename from e-util/e-mail-signature-preview.c
rename to src/e-util/e-mail-signature-preview.c
diff --git a/e-util/e-mail-signature-preview.h b/src/e-util/e-mail-signature-preview.h
similarity index 100%
rename from e-util/e-mail-signature-preview.h
rename to src/e-util/e-mail-signature-preview.h
diff --git a/e-util/e-mail-signature-script-dialog.c b/src/e-util/e-mail-signature-script-dialog.c
similarity index 100%
rename from e-util/e-mail-signature-script-dialog.c
rename to src/e-util/e-mail-signature-script-dialog.c
diff --git a/e-util/e-mail-signature-script-dialog.h b/src/e-util/e-mail-signature-script-dialog.h
similarity index 100%
rename from e-util/e-mail-signature-script-dialog.h
rename to src/e-util/e-mail-signature-script-dialog.h
diff --git a/e-util/e-mail-signature-tree-view.c b/src/e-util/e-mail-signature-tree-view.c
similarity index 100%
rename from e-util/e-mail-signature-tree-view.c
rename to src/e-util/e-mail-signature-tree-view.c
diff --git a/e-util/e-mail-signature-tree-view.h b/src/e-util/e-mail-signature-tree-view.h
similarity index 100%
rename from e-util/e-mail-signature-tree-view.h
rename to src/e-util/e-mail-signature-tree-view.h
diff --git a/e-util/e-map.c b/src/e-util/e-map.c
similarity index 100%
rename from e-util/e-map.c
rename to src/e-util/e-map.c
diff --git a/e-util/e-map.h b/src/e-util/e-map.h
similarity index 100%
rename from e-util/e-map.h
rename to src/e-util/e-map.h
diff --git a/e-util/e-marshal.list b/src/e-util/e-marshal.list
similarity index 100%
rename from e-util/e-marshal.list
rename to src/e-util/e-marshal.list
diff --git a/e-util/e-menu-tool-action.c b/src/e-util/e-menu-tool-action.c
similarity index 100%
rename from e-util/e-menu-tool-action.c
rename to src/e-util/e-menu-tool-action.c
diff --git a/e-util/e-menu-tool-action.h b/src/e-util/e-menu-tool-action.h
similarity index 100%
rename from e-util/e-menu-tool-action.h
rename to src/e-util/e-menu-tool-action.h
diff --git a/e-util/e-menu-tool-button.c b/src/e-util/e-menu-tool-button.c
similarity index 100%
rename from e-util/e-menu-tool-button.c
rename to src/e-util/e-menu-tool-button.c
diff --git a/e-util/e-menu-tool-button.h b/src/e-util/e-menu-tool-button.h
similarity index 100%
rename from e-util/e-menu-tool-button.h
rename to src/e-util/e-menu-tool-button.h
diff --git a/e-util/e-misc-utils.c b/src/e-util/e-misc-utils.c
similarity index 100%
rename from e-util/e-misc-utils.c
rename to src/e-util/e-misc-utils.c
diff --git a/e-util/e-misc-utils.h b/src/e-util/e-misc-utils.h
similarity index 100%
rename from e-util/e-misc-utils.h
rename to src/e-util/e-misc-utils.h
diff --git a/e-util/e-mktemp.c b/src/e-util/e-mktemp.c
similarity index 100%
rename from e-util/e-mktemp.c
rename to src/e-util/e-mktemp.c
diff --git a/e-util/e-mktemp.h b/src/e-util/e-mktemp.h
similarity index 100%
rename from e-util/e-mktemp.h
rename to src/e-util/e-mktemp.h
diff --git a/e-util/e-name-selector-dialog.c b/src/e-util/e-name-selector-dialog.c
similarity index 100%
rename from e-util/e-name-selector-dialog.c
rename to src/e-util/e-name-selector-dialog.c
diff --git a/e-util/e-name-selector-dialog.h b/src/e-util/e-name-selector-dialog.h
similarity index 100%
rename from e-util/e-name-selector-dialog.h
rename to src/e-util/e-name-selector-dialog.h
diff --git a/e-util/e-name-selector-entry.c b/src/e-util/e-name-selector-entry.c
similarity index 100%
rename from e-util/e-name-selector-entry.c
rename to src/e-util/e-name-selector-entry.c
diff --git a/e-util/e-name-selector-entry.h b/src/e-util/e-name-selector-entry.h
similarity index 100%
rename from e-util/e-name-selector-entry.h
rename to src/e-util/e-name-selector-entry.h
diff --git a/e-util/e-name-selector-list.c b/src/e-util/e-name-selector-list.c
similarity index 100%
rename from e-util/e-name-selector-list.c
rename to src/e-util/e-name-selector-list.c
diff --git a/e-util/e-name-selector-list.h b/src/e-util/e-name-selector-list.h
similarity index 100%
rename from e-util/e-name-selector-list.h
rename to src/e-util/e-name-selector-list.h
diff --git a/e-util/e-name-selector-model.c b/src/e-util/e-name-selector-model.c
similarity index 100%
rename from e-util/e-name-selector-model.c
rename to src/e-util/e-name-selector-model.c
diff --git a/e-util/e-name-selector-model.h b/src/e-util/e-name-selector-model.h
similarity index 100%
rename from e-util/e-name-selector-model.h
rename to src/e-util/e-name-selector-model.h
diff --git a/e-util/e-name-selector.c b/src/e-util/e-name-selector.c
similarity index 100%
rename from e-util/e-name-selector.c
rename to src/e-util/e-name-selector.c
diff --git a/e-util/e-name-selector.h b/src/e-util/e-name-selector.h
similarity index 100%
rename from e-util/e-name-selector.h
rename to src/e-util/e-name-selector.h
diff --git a/e-util/e-online-button.c b/src/e-util/e-online-button.c
similarity index 100%
rename from e-util/e-online-button.c
rename to src/e-util/e-online-button.c
diff --git a/e-util/e-online-button.h b/src/e-util/e-online-button.h
similarity index 100%
rename from e-util/e-online-button.h
rename to src/e-util/e-online-button.h
diff --git a/e-util/e-paned.c b/src/e-util/e-paned.c
similarity index 100%
rename from e-util/e-paned.c
rename to src/e-util/e-paned.c
diff --git a/e-util/e-paned.h b/src/e-util/e-paned.h
similarity index 100%
rename from e-util/e-paned.h
rename to src/e-util/e-paned.h
diff --git a/e-util/e-passwords.c b/src/e-util/e-passwords.c
similarity index 100%
rename from e-util/e-passwords.c
rename to src/e-util/e-passwords.c
diff --git a/e-util/e-passwords.h b/src/e-util/e-passwords.h
similarity index 100%
rename from e-util/e-passwords.h
rename to src/e-util/e-passwords.h
diff --git a/e-util/e-photo-cache.c b/src/e-util/e-photo-cache.c
similarity index 100%
rename from e-util/e-photo-cache.c
rename to src/e-util/e-photo-cache.c
diff --git a/e-util/e-photo-cache.h b/src/e-util/e-photo-cache.h
similarity index 100%
rename from e-util/e-photo-cache.h
rename to src/e-util/e-photo-cache.h
diff --git a/e-util/e-photo-source.c b/src/e-util/e-photo-source.c
similarity index 100%
rename from e-util/e-photo-source.c
rename to src/e-util/e-photo-source.c
diff --git a/e-util/e-photo-source.h b/src/e-util/e-photo-source.h
similarity index 100%
rename from e-util/e-photo-source.h
rename to src/e-util/e-photo-source.h
diff --git a/e-util/e-picture-gallery.c b/src/e-util/e-picture-gallery.c
similarity index 100%
rename from e-util/e-picture-gallery.c
rename to src/e-util/e-picture-gallery.c
diff --git a/e-util/e-picture-gallery.h b/src/e-util/e-picture-gallery.h
similarity index 100%
rename from e-util/e-picture-gallery.h
rename to src/e-util/e-picture-gallery.h
diff --git a/e-util/e-plugin-ui.c b/src/e-util/e-plugin-ui.c
similarity index 100%
rename from e-util/e-plugin-ui.c
rename to src/e-util/e-plugin-ui.c
diff --git a/e-util/e-plugin-ui.h b/src/e-util/e-plugin-ui.h
similarity index 100%
rename from e-util/e-plugin-ui.h
rename to src/e-util/e-plugin-ui.h
diff --git a/e-util/e-plugin.c b/src/e-util/e-plugin.c
similarity index 100%
rename from e-util/e-plugin.c
rename to src/e-util/e-plugin.c
diff --git a/e-util/e-plugin.h b/src/e-util/e-plugin.h
similarity index 100%
rename from e-util/e-plugin.h
rename to src/e-util/e-plugin.h
diff --git a/e-util/e-poolv.c b/src/e-util/e-poolv.c
similarity index 100%
rename from e-util/e-poolv.c
rename to src/e-util/e-poolv.c
diff --git a/e-util/e-poolv.h b/src/e-util/e-poolv.h
similarity index 100%
rename from e-util/e-poolv.h
rename to src/e-util/e-poolv.h
diff --git a/e-util/e-popup-action.c b/src/e-util/e-popup-action.c
similarity index 100%
rename from e-util/e-popup-action.c
rename to src/e-util/e-popup-action.c
diff --git a/e-util/e-popup-action.h b/src/e-util/e-popup-action.h
similarity index 100%
rename from e-util/e-popup-action.h
rename to src/e-util/e-popup-action.h
diff --git a/e-util/e-popup-menu.c b/src/e-util/e-popup-menu.c
similarity index 100%
rename from e-util/e-popup-menu.c
rename to src/e-util/e-popup-menu.c
diff --git a/e-util/e-popup-menu.h b/src/e-util/e-popup-menu.h
similarity index 100%
rename from e-util/e-popup-menu.h
rename to src/e-util/e-popup-menu.h
diff --git a/e-util/e-port-entry.c b/src/e-util/e-port-entry.c
similarity index 100%
rename from e-util/e-port-entry.c
rename to src/e-util/e-port-entry.c
diff --git a/e-util/e-port-entry.h b/src/e-util/e-port-entry.h
similarity index 100%
rename from e-util/e-port-entry.h
rename to src/e-util/e-port-entry.h
diff --git a/e-util/e-preferences-window.c b/src/e-util/e-preferences-window.c
similarity index 100%
rename from e-util/e-preferences-window.c
rename to src/e-util/e-preferences-window.c
diff --git a/e-util/e-preferences-window.h b/src/e-util/e-preferences-window.h
similarity index 100%
rename from e-util/e-preferences-window.h
rename to src/e-util/e-preferences-window.h
diff --git a/e-util/e-preview-pane.c b/src/e-util/e-preview-pane.c
similarity index 100%
rename from e-util/e-preview-pane.c
rename to src/e-util/e-preview-pane.c
diff --git a/e-util/e-preview-pane.h b/src/e-util/e-preview-pane.h
similarity index 100%
rename from e-util/e-preview-pane.h
rename to src/e-util/e-preview-pane.h
diff --git a/e-util/e-print.c b/src/e-util/e-print.c
similarity index 100%
rename from e-util/e-print.c
rename to src/e-util/e-print.c
diff --git a/e-util/e-print.h b/src/e-util/e-print.h
similarity index 100%
rename from e-util/e-print.h
rename to src/e-util/e-print.h
diff --git a/e-util/e-printable.c b/src/e-util/e-printable.c
similarity index 100%
rename from e-util/e-printable.c
rename to src/e-util/e-printable.c
diff --git a/e-util/e-printable.h b/src/e-util/e-printable.h
similarity index 100%
rename from e-util/e-printable.h
rename to src/e-util/e-printable.h
diff --git a/e-util/e-proxy-combo-box.c b/src/e-util/e-proxy-combo-box.c
similarity index 100%
rename from e-util/e-proxy-combo-box.c
rename to src/e-util/e-proxy-combo-box.c
diff --git a/e-util/e-proxy-combo-box.h b/src/e-util/e-proxy-combo-box.h
similarity index 100%
rename from e-util/e-proxy-combo-box.h
rename to src/e-util/e-proxy-combo-box.h
diff --git a/e-util/e-proxy-editor.c b/src/e-util/e-proxy-editor.c
similarity index 100%
rename from e-util/e-proxy-editor.c
rename to src/e-util/e-proxy-editor.c
diff --git a/e-util/e-proxy-editor.h b/src/e-util/e-proxy-editor.h
similarity index 100%
rename from e-util/e-proxy-editor.h
rename to src/e-util/e-proxy-editor.h
diff --git a/e-util/e-proxy-link-selector.c b/src/e-util/e-proxy-link-selector.c
similarity index 100%
rename from e-util/e-proxy-link-selector.c
rename to src/e-util/e-proxy-link-selector.c
diff --git a/e-util/e-proxy-link-selector.h b/src/e-util/e-proxy-link-selector.h
similarity index 100%
rename from e-util/e-proxy-link-selector.h
rename to src/e-util/e-proxy-link-selector.h
diff --git a/e-util/e-proxy-preferences.c b/src/e-util/e-proxy-preferences.c
similarity index 100%
rename from e-util/e-proxy-preferences.c
rename to src/e-util/e-proxy-preferences.c
diff --git a/e-util/e-proxy-preferences.h b/src/e-util/e-proxy-preferences.h
similarity index 100%
rename from e-util/e-proxy-preferences.h
rename to src/e-util/e-proxy-preferences.h
diff --git a/e-util/e-proxy-selector.c b/src/e-util/e-proxy-selector.c
similarity index 100%
rename from e-util/e-proxy-selector.c
rename to src/e-util/e-proxy-selector.c
diff --git a/e-util/e-proxy-selector.h b/src/e-util/e-proxy-selector.h
similarity index 100%
rename from e-util/e-proxy-selector.h
rename to src/e-util/e-proxy-selector.h
diff --git a/e-util/e-reflow-model.c b/src/e-util/e-reflow-model.c
similarity index 100%
rename from e-util/e-reflow-model.c
rename to src/e-util/e-reflow-model.c
diff --git a/e-util/e-reflow-model.h b/src/e-util/e-reflow-model.h
similarity index 100%
rename from e-util/e-reflow-model.h
rename to src/e-util/e-reflow-model.h
diff --git a/e-util/e-reflow.c b/src/e-util/e-reflow.c
similarity index 100%
rename from e-util/e-reflow.c
rename to src/e-util/e-reflow.c
diff --git a/e-util/e-reflow.h b/src/e-util/e-reflow.h
similarity index 100%
rename from e-util/e-reflow.h
rename to src/e-util/e-reflow.h
diff --git a/e-util/e-rule-context.c b/src/e-util/e-rule-context.c
similarity index 100%
rename from e-util/e-rule-context.c
rename to src/e-util/e-rule-context.c
diff --git a/e-util/e-rule-context.h b/src/e-util/e-rule-context.h
similarity index 100%
rename from e-util/e-rule-context.h
rename to src/e-util/e-rule-context.h
diff --git a/e-util/e-rule-editor.c b/src/e-util/e-rule-editor.c
similarity index 100%
rename from e-util/e-rule-editor.c
rename to src/e-util/e-rule-editor.c
diff --git a/e-util/e-rule-editor.h b/src/e-util/e-rule-editor.h
similarity index 100%
rename from e-util/e-rule-editor.h
rename to src/e-util/e-rule-editor.h
diff --git a/e-util/e-search-bar.c b/src/e-util/e-search-bar.c
similarity index 100%
rename from e-util/e-search-bar.c
rename to src/e-util/e-search-bar.c
diff --git a/e-util/e-search-bar.h b/src/e-util/e-search-bar.h
similarity index 100%
rename from e-util/e-search-bar.h
rename to src/e-util/e-search-bar.h
diff --git a/e-util/e-selectable.c b/src/e-util/e-selectable.c
similarity index 100%
rename from e-util/e-selectable.c
rename to src/e-util/e-selectable.c
diff --git a/e-util/e-selectable.h b/src/e-util/e-selectable.h
similarity index 100%
rename from e-util/e-selectable.h
rename to src/e-util/e-selectable.h
diff --git a/e-util/e-selection-model-array.c b/src/e-util/e-selection-model-array.c
similarity index 100%
rename from e-util/e-selection-model-array.c
rename to src/e-util/e-selection-model-array.c
diff --git a/e-util/e-selection-model-array.h b/src/e-util/e-selection-model-array.h
similarity index 100%
rename from e-util/e-selection-model-array.h
rename to src/e-util/e-selection-model-array.h
diff --git a/e-util/e-selection-model-simple.c b/src/e-util/e-selection-model-simple.c
similarity index 100%
rename from e-util/e-selection-model-simple.c
rename to src/e-util/e-selection-model-simple.c
diff --git a/e-util/e-selection-model-simple.h b/src/e-util/e-selection-model-simple.h
similarity index 100%
rename from e-util/e-selection-model-simple.h
rename to src/e-util/e-selection-model-simple.h
diff --git a/e-util/e-selection-model.c b/src/e-util/e-selection-model.c
similarity index 100%
rename from e-util/e-selection-model.c
rename to src/e-util/e-selection-model.c
diff --git a/e-util/e-selection-model.h b/src/e-util/e-selection-model.h
similarity index 100%
rename from e-util/e-selection-model.h
rename to src/e-util/e-selection-model.h
diff --git a/e-util/e-selection.c b/src/e-util/e-selection.c
similarity index 100%
rename from e-util/e-selection.c
rename to src/e-util/e-selection.c
diff --git a/e-util/e-selection.h b/src/e-util/e-selection.h
similarity index 100%
rename from e-util/e-selection.h
rename to src/e-util/e-selection.h
diff --git a/e-util/e-send-options.c b/src/e-util/e-send-options.c
similarity index 100%
rename from e-util/e-send-options.c
rename to src/e-util/e-send-options.c
diff --git a/e-util/e-send-options.h b/src/e-util/e-send-options.h
similarity index 100%
rename from e-util/e-send-options.h
rename to src/e-util/e-send-options.h
diff --git a/e-util/e-send-options.ui b/src/e-util/e-send-options.ui
similarity index 100%
rename from e-util/e-send-options.ui
rename to src/e-util/e-send-options.ui
diff --git a/e-util/e-simple-async-result.c b/src/e-util/e-simple-async-result.c
similarity index 100%
rename from e-util/e-simple-async-result.c
rename to src/e-util/e-simple-async-result.c
diff --git a/e-util/e-simple-async-result.h b/src/e-util/e-simple-async-result.h
similarity index 100%
rename from e-util/e-simple-async-result.h
rename to src/e-util/e-simple-async-result.h
diff --git a/e-util/e-sorter-array.c b/src/e-util/e-sorter-array.c
similarity index 100%
rename from e-util/e-sorter-array.c
rename to src/e-util/e-sorter-array.c
diff --git a/e-util/e-sorter-array.h b/src/e-util/e-sorter-array.h
similarity index 100%
rename from e-util/e-sorter-array.h
rename to src/e-util/e-sorter-array.h
diff --git a/e-util/e-sorter.c b/src/e-util/e-sorter.c
similarity index 100%
rename from e-util/e-sorter.c
rename to src/e-util/e-sorter.c
diff --git a/e-util/e-sorter.h b/src/e-util/e-sorter.h
similarity index 100%
rename from e-util/e-sorter.h
rename to src/e-util/e-sorter.h
diff --git a/e-util/e-source-combo-box.c b/src/e-util/e-source-combo-box.c
similarity index 100%
rename from e-util/e-source-combo-box.c
rename to src/e-util/e-source-combo-box.c
diff --git a/e-util/e-source-combo-box.h b/src/e-util/e-source-combo-box.h
similarity index 100%
rename from e-util/e-source-combo-box.h
rename to src/e-util/e-source-combo-box.h
diff --git a/e-util/e-source-config-backend.c b/src/e-util/e-source-config-backend.c
similarity index 100%
rename from e-util/e-source-config-backend.c
rename to src/e-util/e-source-config-backend.c
diff --git a/e-util/e-source-config-backend.h b/src/e-util/e-source-config-backend.h
similarity index 100%
rename from e-util/e-source-config-backend.h
rename to src/e-util/e-source-config-backend.h
diff --git a/e-util/e-source-config-dialog.c b/src/e-util/e-source-config-dialog.c
similarity index 100%
rename from e-util/e-source-config-dialog.c
rename to src/e-util/e-source-config-dialog.c
diff --git a/e-util/e-source-config-dialog.h b/src/e-util/e-source-config-dialog.h
similarity index 100%
rename from e-util/e-source-config-dialog.h
rename to src/e-util/e-source-config-dialog.h
diff --git a/e-util/e-source-config.c b/src/e-util/e-source-config.c
similarity index 100%
rename from e-util/e-source-config.c
rename to src/e-util/e-source-config.c
diff --git a/e-util/e-source-config.h b/src/e-util/e-source-config.h
similarity index 100%
rename from e-util/e-source-config.h
rename to src/e-util/e-source-config.h
diff --git a/e-util/e-source-conflict-search.c b/src/e-util/e-source-conflict-search.c
similarity index 100%
rename from e-util/e-source-conflict-search.c
rename to src/e-util/e-source-conflict-search.c
diff --git a/e-util/e-source-conflict-search.h b/src/e-util/e-source-conflict-search.h
similarity index 100%
rename from e-util/e-source-conflict-search.h
rename to src/e-util/e-source-conflict-search.h
diff --git a/e-util/e-source-selector-dialog.c b/src/e-util/e-source-selector-dialog.c
similarity index 100%
rename from e-util/e-source-selector-dialog.c
rename to src/e-util/e-source-selector-dialog.c
diff --git a/e-util/e-source-selector-dialog.h b/src/e-util/e-source-selector-dialog.h
similarity index 100%
rename from e-util/e-source-selector-dialog.h
rename to src/e-util/e-source-selector-dialog.h
diff --git a/e-util/e-source-selector.c b/src/e-util/e-source-selector.c
similarity index 100%
rename from e-util/e-source-selector.c
rename to src/e-util/e-source-selector.c
diff --git a/e-util/e-source-selector.h b/src/e-util/e-source-selector.h
similarity index 100%
rename from e-util/e-source-selector.h
rename to src/e-util/e-source-selector.h
diff --git a/e-util/e-source-util.c b/src/e-util/e-source-util.c
similarity index 100%
rename from e-util/e-source-util.c
rename to src/e-util/e-source-util.c
diff --git a/e-util/e-source-util.h b/src/e-util/e-source-util.h
similarity index 100%
rename from e-util/e-source-util.h
rename to src/e-util/e-source-util.h
diff --git a/e-util/e-spell-checker.c b/src/e-util/e-spell-checker.c
similarity index 100%
rename from e-util/e-spell-checker.c
rename to src/e-util/e-spell-checker.c
diff --git a/e-util/e-spell-checker.h b/src/e-util/e-spell-checker.h
similarity index 100%
rename from e-util/e-spell-checker.h
rename to src/e-util/e-spell-checker.h
diff --git a/e-util/e-spell-dictionary.c b/src/e-util/e-spell-dictionary.c
similarity index 100%
rename from e-util/e-spell-dictionary.c
rename to src/e-util/e-spell-dictionary.c
diff --git a/e-util/e-spell-dictionary.h b/src/e-util/e-spell-dictionary.h
similarity index 100%
rename from e-util/e-spell-dictionary.h
rename to src/e-util/e-spell-dictionary.h
diff --git a/e-util/e-spell-entry.c b/src/e-util/e-spell-entry.c
similarity index 100%
rename from e-util/e-spell-entry.c
rename to src/e-util/e-spell-entry.c
diff --git a/e-util/e-spell-entry.h b/src/e-util/e-spell-entry.h
similarity index 100%
rename from e-util/e-spell-entry.h
rename to src/e-util/e-spell-entry.h
diff --git a/e-util/e-spell-text-view.c b/src/e-util/e-spell-text-view.c
similarity index 100%
rename from e-util/e-spell-text-view.c
rename to src/e-util/e-spell-text-view.c
diff --git a/e-util/e-spell-text-view.h b/src/e-util/e-spell-text-view.h
similarity index 100%
rename from e-util/e-spell-text-view.h
rename to src/e-util/e-spell-text-view.h
diff --git a/e-util/e-spinner.c b/src/e-util/e-spinner.c
similarity index 100%
rename from e-util/e-spinner.c
rename to src/e-util/e-spinner.c
diff --git a/e-util/e-spinner.h b/src/e-util/e-spinner.h
similarity index 100%
rename from e-util/e-spinner.h
rename to src/e-util/e-spinner.h
diff --git a/e-util/e-stock-request.c b/src/e-util/e-stock-request.c
similarity index 100%
rename from e-util/e-stock-request.c
rename to src/e-util/e-stock-request.c
diff --git a/e-util/e-stock-request.h b/src/e-util/e-stock-request.h
similarity index 100%
rename from e-util/e-stock-request.h
rename to src/e-util/e-stock-request.h
diff --git a/e-util/e-system.error.xml b/src/e-util/e-system.error.xml
similarity index 100%
rename from e-util/e-system.error.xml
rename to src/e-util/e-system.error.xml
diff --git a/e-util/e-table-click-to-add.c b/src/e-util/e-table-click-to-add.c
similarity index 100%
rename from e-util/e-table-click-to-add.c
rename to src/e-util/e-table-click-to-add.c
diff --git a/e-util/e-table-click-to-add.h b/src/e-util/e-table-click-to-add.h
similarity index 100%
rename from e-util/e-table-click-to-add.h
rename to src/e-util/e-table-click-to-add.h
diff --git a/e-util/e-table-col-dnd.h b/src/e-util/e-table-col-dnd.h
similarity index 100%
rename from e-util/e-table-col-dnd.h
rename to src/e-util/e-table-col-dnd.h
diff --git a/e-util/e-table-col.c b/src/e-util/e-table-col.c
similarity index 100%
rename from e-util/e-table-col.c
rename to src/e-util/e-table-col.c
diff --git a/e-util/e-table-col.h b/src/e-util/e-table-col.h
similarity index 100%
rename from e-util/e-table-col.h
rename to src/e-util/e-table-col.h
diff --git a/e-util/e-table-column-selector.c b/src/e-util/e-table-column-selector.c
similarity index 100%
rename from e-util/e-table-column-selector.c
rename to src/e-util/e-table-column-selector.c
diff --git a/e-util/e-table-column-selector.h b/src/e-util/e-table-column-selector.h
similarity index 100%
rename from e-util/e-table-column-selector.h
rename to src/e-util/e-table-column-selector.h
diff --git a/e-util/e-table-column-specification.c b/src/e-util/e-table-column-specification.c
similarity index 100%
rename from e-util/e-table-column-specification.c
rename to src/e-util/e-table-column-specification.c
diff --git a/e-util/e-table-column-specification.h b/src/e-util/e-table-column-specification.h
similarity index 100%
rename from e-util/e-table-column-specification.h
rename to src/e-util/e-table-column-specification.h
diff --git a/e-util/e-table-config.c b/src/e-util/e-table-config.c
similarity index 100%
rename from e-util/e-table-config.c
rename to src/e-util/e-table-config.c
diff --git a/e-util/e-table-config.h b/src/e-util/e-table-config.h
similarity index 100%
rename from e-util/e-table-config.h
rename to src/e-util/e-table-config.h
diff --git a/e-util/e-table-config.ui b/src/e-util/e-table-config.ui
similarity index 100%
rename from e-util/e-table-config.ui
rename to src/e-util/e-table-config.ui
diff --git a/e-util/e-table-defines.h b/src/e-util/e-table-defines.h
similarity index 100%
rename from e-util/e-table-defines.h
rename to src/e-util/e-table-defines.h
diff --git a/e-util/e-table-extras.c b/src/e-util/e-table-extras.c
similarity index 100%
rename from e-util/e-table-extras.c
rename to src/e-util/e-table-extras.c
diff --git a/e-util/e-table-extras.h b/src/e-util/e-table-extras.h
similarity index 100%
rename from e-util/e-table-extras.h
rename to src/e-util/e-table-extras.h
diff --git a/e-util/e-table-field-chooser-dialog.c b/src/e-util/e-table-field-chooser-dialog.c
similarity index 100%
rename from e-util/e-table-field-chooser-dialog.c
rename to src/e-util/e-table-field-chooser-dialog.c
diff --git a/e-util/e-table-field-chooser-dialog.h b/src/e-util/e-table-field-chooser-dialog.h
similarity index 100%
rename from e-util/e-table-field-chooser-dialog.h
rename to src/e-util/e-table-field-chooser-dialog.h
diff --git a/e-util/e-table-field-chooser-item.c b/src/e-util/e-table-field-chooser-item.c
similarity index 100%
rename from e-util/e-table-field-chooser-item.c
rename to src/e-util/e-table-field-chooser-item.c
diff --git a/e-util/e-table-field-chooser-item.h b/src/e-util/e-table-field-chooser-item.h
similarity index 100%
rename from e-util/e-table-field-chooser-item.h
rename to src/e-util/e-table-field-chooser-item.h
diff --git a/e-util/e-table-field-chooser.c b/src/e-util/e-table-field-chooser.c
similarity index 100%
rename from e-util/e-table-field-chooser.c
rename to src/e-util/e-table-field-chooser.c
diff --git a/e-util/e-table-field-chooser.h b/src/e-util/e-table-field-chooser.h
similarity index 100%
rename from e-util/e-table-field-chooser.h
rename to src/e-util/e-table-field-chooser.h
diff --git a/e-util/e-table-group-container.c b/src/e-util/e-table-group-container.c
similarity index 100%
rename from e-util/e-table-group-container.c
rename to src/e-util/e-table-group-container.c
diff --git a/e-util/e-table-group-container.h b/src/e-util/e-table-group-container.h
similarity index 100%
rename from e-util/e-table-group-container.h
rename to src/e-util/e-table-group-container.h
diff --git a/e-util/e-table-group-leaf.c b/src/e-util/e-table-group-leaf.c
similarity index 100%
rename from e-util/e-table-group-leaf.c
rename to src/e-util/e-table-group-leaf.c
diff --git a/e-util/e-table-group-leaf.h b/src/e-util/e-table-group-leaf.h
similarity index 100%
rename from e-util/e-table-group-leaf.h
rename to src/e-util/e-table-group-leaf.h
diff --git a/e-util/e-table-group.c b/src/e-util/e-table-group.c
similarity index 100%
rename from e-util/e-table-group.c
rename to src/e-util/e-table-group.c
diff --git a/e-util/e-table-group.h b/src/e-util/e-table-group.h
similarity index 100%
rename from e-util/e-table-group.h
rename to src/e-util/e-table-group.h
diff --git a/src/e-util/e-table-header-item.c b/src/e-util/e-table-header-item.c
new file mode 100644
index 0000000..6252121
--- /dev/null
+++ b/src/e-util/e-table-header-item.c
@@ -0,0 +1,2298 @@
+/*
+ * 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.
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ * Authors:
+ * Chris Lahey <clahey ximian com>
+ * Miguel de Icaza <miguel gnu org>
+ *
+ * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
+ *
+ */
+
+#include "evolution-config.h"
+
+#include "e-table-header-item.h"
+
+#include <string.h>
+
+#include <gtk/gtk.h>
+#include <glib/gi18n.h>
+#include <gdk/gdkkeysyms.h>
+#include <gdk-pixbuf/gdk-pixbuf.h>
+
+#include <libgnomecanvas/libgnomecanvas.h>
+
+#include "e-canvas.h"
+#include "e-popup-menu.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-utils.h"
+#include "e-table-header.h"
+#include "e-table.h"
+#include "e-xml-utils.h"
+
+#include "data/xpm/arrow-up.xpm"
+#include "data/xpm/arrow-down.xpm"
+
+enum {
+ BUTTON_PRESSED,
+ LAST_SIGNAL
+};
+
+static guint ethi_signals[LAST_SIGNAL] = { 0, };
+
+#define ARROW_DOWN_HEIGHT 16
+#define ARROW_PTR 7
+
+/* Defines the tolerance for proximity of the column division to the cursor position */
+#define TOLERANCE 4
+
+#define ETHI_RESIZING(x) ((x)->resize_col != -1)
+
+#define ethi_get_type e_table_header_item_get_type
+G_DEFINE_TYPE (ETableHeaderItem, ethi, GNOME_TYPE_CANVAS_ITEM)
+
+#define d(x)
+
+static void ethi_drop_table_header (ETableHeaderItem *ethi);
+
+/*
+ * They display the arrows for the drop location.
+ */
+
+static GtkWidget *arrow_up, *arrow_down;
+
+enum {
+ PROP_0,
+ PROP_TABLE_HEADER,
+ PROP_FULL_HEADER,
+ PROP_DND_CODE,
+ PROP_TABLE_FONT_DESC,
+ PROP_SORT_INFO,
+ PROP_TABLE,
+ PROP_TREE
+};
+
+enum {
+ ET_SCROLL_UP = 1 << 0,
+ ET_SCROLL_DOWN = 1 << 1,
+ ET_SCROLL_LEFT = 1 << 2,
+ ET_SCROLL_RIGHT = 1 << 3
+};
+
+static void scroll_off (ETableHeaderItem *ethi);
+static void scroll_on (ETableHeaderItem *ethi, guint scroll_direction);
+
+static void
+ethi_dispose (GObject *object)
+{
+ ETableHeaderItem *ethi = E_TABLE_HEADER_ITEM (object);
+
+ ethi_drop_table_header (ethi);
+
+ scroll_off (ethi);
+
+ if (ethi->resize_cursor) {
+ g_object_unref (ethi->resize_cursor);
+ ethi->resize_cursor = NULL;
+ }
+
+ if (ethi->dnd_code) {
+ g_free (ethi->dnd_code);
+ ethi->dnd_code = NULL;
+ }
+
+ if (ethi->sort_info) {
+ if (ethi->sort_info_changed_id)
+ g_signal_handler_disconnect (
+ ethi->sort_info, ethi->sort_info_changed_id);
+ if (ethi->group_info_changed_id)
+ g_signal_handler_disconnect (
+ ethi->sort_info, ethi->group_info_changed_id);
+ g_object_unref (ethi->sort_info);
+ ethi->sort_info = NULL;
+ }
+
+ if (ethi->full_header)
+ g_object_unref (ethi->full_header);
+ ethi->full_header = NULL;
+
+ if (ethi->etfcd.widget)
+ g_object_remove_weak_pointer (
+ G_OBJECT (ethi->etfcd.widget), ði->etfcd.pointer);
+
+ if (ethi->config)
+ g_object_unref (ethi->config);
+ ethi->config = NULL;
+
+ /* Chain up to parent's dispose() method. */
+ G_OBJECT_CLASS (ethi_parent_class)->dispose (object);
+}
+
+static gint
+e_table_header_item_get_height (ETableHeaderItem *ethi)
+{
+ ETableHeader *eth;
+ gint numcols, col;
+ gint maxheight;
+
+ g_return_val_if_fail (ethi != NULL, 0);
+ g_return_val_if_fail (E_IS_TABLE_HEADER_ITEM (ethi), 0);
+
+ eth = ethi->eth;
+ numcols = e_table_header_count (eth);
+
+ maxheight = 0;
+
+ for (col = 0; col < numcols; col++) {
+ ETableCol *ecol = e_table_header_get_column (eth, col);
+ gint height;
+
+ height = e_table_header_compute_height (
+ ecol, GTK_WIDGET (GNOME_CANVAS_ITEM (ethi)->canvas));
+
+ if (height > maxheight)
+ maxheight = height;
+ }
+
+ return maxheight;
+}
+
+static void
+ethi_update (GnomeCanvasItem *item,
+ const cairo_matrix_t *i2c,
+ gint flags)
+{
+ ETableHeaderItem *ethi = E_TABLE_HEADER_ITEM (item);
+ gdouble x1, y1, x2, y2;
+
+ if (GNOME_CANVAS_ITEM_CLASS (ethi_parent_class)->update)
+ GNOME_CANVAS_ITEM_CLASS (ethi_parent_class)->update (
+ item, i2c, flags);
+
+ if (ethi->sort_info)
+ ethi->group_indent_width =
+ e_table_sort_info_grouping_get_count (ethi->sort_info)
+ * GROUP_INDENT;
+ else
+ ethi->group_indent_width = 0;
+
+ ethi->width =
+ e_table_header_total_width (ethi->eth) +
+ ethi->group_indent_width;
+
+ x1 = y1 = 0;
+ x2 = ethi->width;
+ y2 = ethi->height;
+
+ gnome_canvas_matrix_transform_rect (i2c, &x1, &y1, &x2, &y2);
+
+ if (item->x1 != x1 ||
+ item->y1 != y1 ||
+ item->x2 != x2 ||
+ item->y2 != y2) {
+ gnome_canvas_request_redraw (
+ item->canvas,
+ item->x1, item->y1,
+ item->x2, item->y2);
+ item->x1 = x1;
+ item->y1 = y1;
+ item->x2 = x2;
+ item->y2 = y2;
+ }
+ gnome_canvas_request_redraw (
+ item->canvas, item->x1, item->y1, item->x2, item->y2);
+}
+
+static void
+ethi_font_set (ETableHeaderItem *ethi,
+ PangoFontDescription *font_desc)
+{
+ if (ethi->font_desc)
+ pango_font_description_free (ethi->font_desc);
+
+ ethi->font_desc = pango_font_description_copy (font_desc);
+
+ ethi->height = e_table_header_item_get_height (ethi);
+ e_canvas_item_request_reflow (GNOME_CANVAS_ITEM (ethi));
+}
+
+static void
+ethi_drop_table_header (ETableHeaderItem *ethi)
+{
+ GObject *header;
+
+ if (!ethi->eth)
+ return;
+
+ header = G_OBJECT (ethi->eth);
+ g_signal_handler_disconnect (header, ethi->structure_change_id);
+ g_signal_handler_disconnect (header, ethi->dimension_change_id);
+
+ g_object_unref (header);
+ ethi->eth = NULL;
+ ethi->width = 0;
+}
+
+static void
+structure_changed (ETableHeader *header,
+ ETableHeaderItem *ethi)
+{
+ gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (ethi));
+}
+
+static void
+dimension_changed (ETableHeader *header,
+ gint col,
+ ETableHeaderItem *ethi)
+{
+ gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (ethi));
+}
+
+static void
+ethi_add_table_header (ETableHeaderItem *ethi,
+ ETableHeader *header)
+{
+ ethi->eth = header;
+ g_object_ref (ethi->eth);
+
+ ethi->height = e_table_header_item_get_height (ethi);
+
+ ethi->structure_change_id = g_signal_connect (
+ header, "structure_change",
+ G_CALLBACK (structure_changed), ethi);
+ ethi->dimension_change_id = g_signal_connect (
+ header, "dimension_change",
+ G_CALLBACK (dimension_changed), ethi);
+ e_canvas_item_request_reflow (GNOME_CANVAS_ITEM (ethi));
+ gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (ethi));
+}
+
+static void
+ethi_sort_info_changed (ETableSortInfo *sort_info,
+ ETableHeaderItem *ethi)
+{
+ gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (ethi));
+}
+
+static void
+ethi_set_property (GObject *object,
+ guint property_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ GnomeCanvasItem *item;
+ ETableHeaderItem *ethi;
+
+ item = GNOME_CANVAS_ITEM (object);
+ ethi = E_TABLE_HEADER_ITEM (object);
+
+ switch (property_id) {
+ case PROP_TABLE_HEADER:
+ ethi_drop_table_header (ethi);
+ ethi_add_table_header (ethi, E_TABLE_HEADER (g_value_get_object (value)));
+ break;
+
+ case PROP_FULL_HEADER:
+ if (ethi->full_header)
+ g_object_unref (ethi->full_header);
+ ethi->full_header = E_TABLE_HEADER (g_value_get_object (value));
+ if (ethi->full_header)
+ g_object_ref (ethi->full_header);
+ break;
+
+ case PROP_DND_CODE:
+ g_free (ethi->dnd_code);
+ ethi->dnd_code = g_strdup (g_value_get_string (value));
+ break;
+
+ case PROP_TABLE_FONT_DESC:
+ ethi_font_set (ethi, g_value_get_boxed (value));
+ break;
+
+ case PROP_SORT_INFO:
+ if (ethi->sort_info) {
+ if (ethi->sort_info_changed_id)
+ g_signal_handler_disconnect (
+ ethi->sort_info,
+ ethi->sort_info_changed_id);
+
+ if (ethi->group_info_changed_id)
+ g_signal_handler_disconnect (
+ ethi->sort_info,
+ ethi->group_info_changed_id);
+ g_object_unref (ethi->sort_info);
+ }
+ ethi->sort_info = g_value_get_object (value);
+ g_object_ref (ethi->sort_info);
+ ethi->sort_info_changed_id =
+ g_signal_connect (
+ ethi->sort_info, "sort_info_changed",
+ G_CALLBACK (ethi_sort_info_changed), ethi);
+ ethi->group_info_changed_id =
+ g_signal_connect (
+ ethi->sort_info, "group_info_changed",
+ G_CALLBACK (ethi_sort_info_changed), ethi);
+ break;
+ case PROP_TABLE:
+ if (g_value_get_object (value))
+ ethi->table = E_TABLE (g_value_get_object (value));
+ else
+ ethi->table = NULL;
+ break;
+ case PROP_TREE:
+ if (g_value_get_object (value))
+ ethi->tree = E_TREE (g_value_get_object (value));
+ else
+ ethi->tree = NULL;
+ break;
+ }
+ gnome_canvas_item_request_update (item);
+}
+
+static void
+ethi_get_property (GObject *object,
+ guint property_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ ETableHeaderItem *ethi;
+
+ ethi = E_TABLE_HEADER_ITEM (object);
+
+ switch (property_id) {
+ case PROP_FULL_HEADER:
+ g_value_set_object (value, ethi->full_header);
+ break;
+ case PROP_DND_CODE:
+ g_value_set_string (value, ethi->dnd_code);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ break;
+ }
+}
+
+static gint
+ethi_find_col_by_x (ETableHeaderItem *ethi,
+ gint x)
+{
+ const gint cols = e_table_header_count (ethi->eth);
+ gint x1 = 0;
+ gint col;
+
+ d (g_print ("%s:%d: x = %d, x1 = %d\n", G_STRFUNC, __LINE__, x, x1));
+
+ x1 += ethi->group_indent_width;
+
+ if (x < x1) {
+ d (g_print ("%s:%d: Returning 0\n", G_STRFUNC, __LINE__));
+ return 0;
+ }
+
+ for (col = 0; col < cols; col++) {
+ ETableCol *ecol = e_table_header_get_column (ethi->eth, col);
+
+ if ((x >= x1) && (x <= x1 + ecol->width)) {
+ d (g_print ("%s:%d: Returning %d\n", G_STRFUNC, __LINE__, col));
+ return col;
+ }
+
+ x1 += ecol->width;
+ }
+ d (g_print ("%s:%d: Returning %d\n", G_STRFUNC, __LINE__, cols - 1));
+ return cols - 1;
+}
+
+static gint
+ethi_find_col_by_x_nearest (ETableHeaderItem *ethi,
+ gint x)
+{
+ const gint cols = e_table_header_count (ethi->eth);
+ gint x1 = 0;
+ gint col;
+
+ x1 += ethi->group_indent_width;
+
+ if (x < x1)
+ return 0;
+
+ for (col = 0; col < cols; col++) {
+ ETableCol *ecol = e_table_header_get_column (ethi->eth, col);
+
+ x1 += (ecol->width / 2);
+
+ if (x <= x1)
+ return col;
+
+ x1 += (ecol->width + 1) / 2;
+ }
+ return col;
+}
+
+static void
+ethi_remove_drop_marker (ETableHeaderItem *ethi)
+{
+ if (ethi->drag_mark == -1)
+ return;
+
+ gtk_widget_hide (arrow_up);
+ gtk_widget_hide (arrow_down);
+
+ ethi->drag_mark = -1;
+}
+
+static GtkWidget *
+make_shaped_window_from_xpm (const gchar **xpm)
+{
+ GdkPixbuf *pixbuf;
+ GtkWidget *win, *pix;
+
+ pixbuf = gdk_pixbuf_new_from_xpm_data (xpm);
+
+ win = gtk_window_new (GTK_WINDOW_POPUP);
+ gtk_window_set_type_hint (GTK_WINDOW (win), GDK_WINDOW_TYPE_HINT_NOTIFICATION);
+ gtk_window_set_resizable (GTK_WINDOW (win), FALSE);
+
+ gtk_widget_set_size_request (win, gdk_pixbuf_get_width (pixbuf), gdk_pixbuf_get_height (pixbuf));
+
+ pix = gtk_image_new_from_pixbuf (pixbuf);
+ gtk_widget_realize (win);
+ gtk_container_add (GTK_CONTAINER (win), pix);
+
+ g_object_unref (pixbuf);
+
+ return win;
+}
+
+static void
+ethi_add_drop_marker (ETableHeaderItem *ethi,
+ gint col,
+ gboolean recreate)
+{
+ GnomeCanvas *canvas;
+ GtkAdjustment *adjustment;
+ GdkWindow *window;
+ GtkWidget *toplevel;
+ gint rx, ry;
+ gint x;
+
+ if (!recreate && ethi->drag_mark == col)
+ return;
+
+ ethi->drag_mark = col;
+
+ x = e_table_header_col_diff (ethi->eth, 0, col);
+ if (col > 0)
+ x += ethi->group_indent_width;
+
+ if (!arrow_up) {
+ arrow_up = make_shaped_window_from_xpm (arrow_up_xpm);
+ arrow_down = make_shaped_window_from_xpm (arrow_down_xpm);
+ }
+
+ canvas = GNOME_CANVAS_ITEM (ethi)->canvas;
+ toplevel = gtk_widget_get_toplevel (GTK_WIDGET (canvas));
+ if (GTK_IS_WINDOW (toplevel)) {
+ gtk_window_set_transient_for (GTK_WINDOW (arrow_up), GTK_WINDOW (toplevel));
+ gtk_window_set_transient_for (GTK_WINDOW (arrow_down), GTK_WINDOW (toplevel));
+ }
+
+ window = gtk_widget_get_window (GTK_WIDGET (canvas));
+ gdk_window_get_origin (window, &rx, &ry);
+
+ adjustment = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (canvas));
+ rx -= gtk_adjustment_get_value (adjustment);
+
+ adjustment = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (canvas));
+ ry -= gtk_adjustment_get_value (adjustment);
+
+ gtk_window_move (
+ GTK_WINDOW (arrow_down),
+ rx + x - ARROW_PTR,
+ ry - ARROW_DOWN_HEIGHT);
+ gtk_widget_show_all (arrow_down);
+
+ gtk_window_move (
+ GTK_WINDOW (arrow_up),
+ rx + x - ARROW_PTR,
+ ry + ethi->height);
+ gtk_widget_show_all (arrow_up);
+}
+
+static void
+ethi_add_destroy_marker (ETableHeaderItem *ethi)
+{
+ gdouble x1;
+
+ if (ethi->remove_item)
+ g_object_run_dispose (G_OBJECT (ethi->remove_item));
+
+ x1 = (gdouble) e_table_header_col_diff (ethi->eth, 0, ethi->drag_col);
+ if (ethi->drag_col > 0)
+ x1 += ethi->group_indent_width;
+
+ ethi->remove_item = gnome_canvas_item_new (
+ GNOME_CANVAS_GROUP (GNOME_CANVAS_ITEM (ethi)->canvas->root),
+ gnome_canvas_rect_get_type (),
+ "x1", x1 + 1,
+ "y1", (gdouble) 1,
+ "x2", (gdouble) x1 + e_table_header_col_diff (
+ ethi->eth, ethi->drag_col, ethi->drag_col + 1) - 2,
+
+ "y2", (gdouble) ethi->height - 2,
+ "fill_color_rgba", 0xFF000080,
+ NULL);
+}
+
+static void
+ethi_remove_destroy_marker (ETableHeaderItem *ethi)
+{
+ if (!ethi->remove_item)
+ return;
+
+ g_object_run_dispose (G_OBJECT (ethi->remove_item));
+ ethi->remove_item = NULL;
+}
+
+static void
+do_drag_motion (ETableHeaderItem *ethi,
+ GdkDragContext *context,
+ gint x,
+ gint y,
+ guint time,
+ gboolean recreate)
+{
+ if ((x >= 0) && (x <= (ethi->width)) &&
+ (y >= 0) && (y <= (ethi->height))) {
+ GdkDragAction suggested_action;
+ gint col;
+ d (g_print ("In header\n"));
+
+ col = ethi_find_col_by_x_nearest (ethi, x);
+ suggested_action = gdk_drag_context_get_suggested_action (context);
+
+ if (ethi->drag_col != -1 && (col == ethi->drag_col ||
+ col == ethi->drag_col + 1)) {
+ if (ethi->drag_col != -1)
+ ethi_remove_destroy_marker (ethi);
+
+ ethi_remove_drop_marker (ethi);
+ gdk_drag_status (context, suggested_action, time);
+ }
+ else if (col != -1) {
+ if (ethi->drag_col != -1)
+ ethi_remove_destroy_marker (ethi);
+
+ ethi_add_drop_marker (ethi, col, recreate);
+ gdk_drag_status (context, suggested_action, time);
+ } else {
+ ethi_remove_drop_marker (ethi);
+ if (ethi->drag_col != -1)
+ ethi_add_destroy_marker (ethi);
+ }
+ } else {
+ ethi_remove_drop_marker (ethi);
+ if (ethi->drag_col != -1)
+ ethi_add_destroy_marker (ethi);
+ }
+}
+
+static gboolean
+scroll_timeout (gpointer data)
+{
+ ETableHeaderItem *ethi = data;
+ gint dx = 0;
+ GtkAdjustment *adjustment;
+ GtkScrollable *scrollable;
+ gdouble hadjustment_value;
+ gdouble vadjustment_value;
+ gdouble page_size;
+ gdouble lower;
+ gdouble upper;
+ gdouble value;
+
+ if (ethi->scroll_direction & ET_SCROLL_RIGHT)
+ dx += 20;
+ if (ethi->scroll_direction & ET_SCROLL_LEFT)
+ dx -= 20;
+
+ scrollable = GTK_SCROLLABLE (GNOME_CANVAS_ITEM (ethi)->canvas);
+
+ adjustment = gtk_scrollable_get_hadjustment (scrollable);
+ hadjustment_value = gtk_adjustment_get_value (adjustment);
+
+ adjustment = gtk_scrollable_get_vadjustment (scrollable);
+ vadjustment_value = gtk_adjustment_get_value (adjustment);
+
+ value = hadjustment_value;
+
+ adjustment = gtk_scrollable_get_hadjustment (scrollable);
+ page_size = gtk_adjustment_get_page_size (adjustment);
+ lower = gtk_adjustment_get_lower (adjustment);
+ upper = gtk_adjustment_get_upper (adjustment);
+
+ gtk_adjustment_set_value (
+ adjustment, CLAMP (
+ hadjustment_value + dx, lower, upper - page_size));
+
+ hadjustment_value = gtk_adjustment_get_value (adjustment);
+
+ if (hadjustment_value != value)
+ do_drag_motion (
+ ethi,
+ ethi->last_drop_context,
+ ethi->last_drop_x + hadjustment_value,
+ ethi->last_drop_y + vadjustment_value,
+ ethi->last_drop_time,
+ TRUE);
+
+ return TRUE;
+}
+
+static void
+scroll_on (ETableHeaderItem *ethi,
+ guint scroll_direction)
+{
+ if (ethi->scroll_idle_id == 0 || scroll_direction != ethi->scroll_direction) {
+ if (ethi->scroll_idle_id != 0)
+ g_source_remove (ethi->scroll_idle_id);
+ ethi->scroll_direction = scroll_direction;
+ ethi->scroll_idle_id = e_named_timeout_add (
+ 100, scroll_timeout, ethi);
+ }
+}
+
+static void
+scroll_off (ETableHeaderItem *ethi)
+{
+ if (ethi->scroll_idle_id) {
+ g_source_remove (ethi->scroll_idle_id);
+ ethi->scroll_idle_id = 0;
+ }
+}
+
+static void
+context_destroyed (gpointer data)
+{
+ ETableHeaderItem *ethi = data;
+
+ ethi->last_drop_x = 0;
+ ethi->last_drop_y = 0;
+ ethi->last_drop_time = 0;
+ ethi->last_drop_context = NULL;
+ scroll_off (ethi);
+
+ g_object_unref (ethi);
+}
+
+static void
+context_connect (ETableHeaderItem *ethi,
+ GdkDragContext *context)
+{
+ if (g_dataset_get_data (context, "e-table-header-item") == NULL)
+ g_dataset_set_data_full (
+ context, "e-table-header-item",
+ g_object_ref (ethi), context_destroyed);
+}
+
+static gboolean
+ethi_drag_motion (GtkWidget *widget,
+ GdkDragContext *context,
+ gint x,
+ gint y,
+ guint time,
+ ETableHeaderItem *ethi)
+{
+ GtkAllocation allocation;
+ GtkAdjustment *adjustment;
+ GList *targets, *link;
+ gdouble hadjustment_value;
+ gdouble vadjustment_value;
+ gchar *headertype;
+ guint direction = 0;
+
+ gdk_drag_status (context, 0, time);
+
+ headertype = g_strdup_printf ("%s-%s", TARGET_ETABLE_COL_TYPE, ethi->dnd_code);
+ targets = gdk_drag_context_list_targets (context);
+ for (link = targets; link; link = g_list_next (link)) {
+ gchar *droptype;
+
+ droptype = gdk_atom_name (GDK_POINTER_TO_ATOM (link->data));
+ if (g_strcmp0 (droptype, headertype) == 0) {
+ g_free (droptype);
+ break;
+ }
+
+ g_free (droptype);
+ }
+
+ if (!link) {
+ g_free (headertype);
+ return FALSE;
+ }
+
+ g_free (headertype);
+
+ gtk_widget_get_allocation (widget, &allocation);
+
+ if (x < 20)
+ direction |= ET_SCROLL_LEFT;
+ if (x > allocation.width - 20)
+ direction |= ET_SCROLL_RIGHT;
+
+ ethi->last_drop_x = x;
+ ethi->last_drop_y = y;
+ ethi->last_drop_time = time;
+ ethi->last_drop_context = context;
+ context_connect (ethi, context);
+
+ adjustment = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (widget));
+ hadjustment_value = gtk_adjustment_get_value (adjustment);
+
+ adjustment = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (widget));
+ vadjustment_value = gtk_adjustment_get_value (adjustment);
+
+ do_drag_motion (
+ ethi, context,
+ x + hadjustment_value,
+ y + vadjustment_value,
+ time, FALSE);
+
+ if (direction != 0)
+ scroll_on (ethi, direction);
+ else
+ scroll_off (ethi);
+
+ return TRUE;
+}
+
+static void
+ethi_drag_end (GtkWidget *canvas,
+ GdkDragContext *context,
+ ETableHeaderItem *ethi)
+{
+ ethi_remove_drop_marker (ethi);
+ ethi_remove_destroy_marker (ethi);
+ ethi->drag_col = -1;
+ scroll_off (ethi);
+}
+
+static void
+ethi_drag_data_received (GtkWidget *canvas,
+ GdkDragContext *drag_context,
+ gint x,
+ gint y,
+ GtkSelectionData *selection_data,
+ guint info,
+ guint time,
+ ETableHeaderItem *ethi)
+{
+ const guchar *data;
+ gint found = FALSE;
+ gint count;
+ gint column;
+ gint drop_col;
+ gint i;
+
+ data = gtk_selection_data_get_data (selection_data);
+
+ if (data != NULL) {
+ count = e_table_header_count (ethi->eth);
+ column = atoi ((gchar *) data);
+ drop_col = ethi->drop_col;
+ ethi->drop_col = -1;
+
+ if (column >= 0) {
+ for (i = 0; i < count; i++) {
+ ETableCol *ecol = e_table_header_get_column (ethi->eth, i);
+ if (ecol->spec->model_col == column) {
+ e_table_header_move (ethi->eth, i, drop_col);
+ found = TRUE;
+ break;
+ }
+ }
+ if (!found) {
+ count = e_table_header_count (ethi->full_header);
+ for (i = 0; i < count; i++) {
+ ETableCol *ecol;
+
+ ecol = e_table_header_get_column (
+ ethi->full_header, i);
+
+ if (ecol->spec->model_col == column) {
+ e_table_header_add_column (
+ ethi->eth, ecol,
+ drop_col);
+ break;
+ }
+ }
+ }
+ }
+ }
+ ethi_remove_drop_marker (ethi);
+ gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (ethi));
+}
+
+static void
+ethi_drag_data_get (GtkWidget *canvas,
+ GdkDragContext *context,
+ GtkSelectionData *selection_data,
+ guint info,
+ guint time,
+ ETableHeaderItem *ethi)
+{
+ if (ethi->drag_col != -1) {
+ ETableCol *ecol = e_table_header_get_column (ethi->eth, ethi->drag_col);
+
+ gchar *string = g_strdup_printf ("%d", ecol->spec->model_col);
+ gtk_selection_data_set (
+ selection_data,
+ GDK_SELECTION_TYPE_STRING,
+ sizeof (string[0]),
+ (guchar *) string,
+ strlen (string));
+ g_free (string);
+ }
+}
+
+static gboolean
+ethi_drag_drop (GtkWidget *canvas,
+ GdkDragContext *context,
+ gint x,
+ gint y,
+ guint time,
+ ETableHeaderItem *ethi)
+{
+ gboolean successful = FALSE;
+
+ if ((x >= 0) && (x <= (ethi->width)) &&
+ (y >= 0) && (y <= (ethi->height))) {
+ gint col;
+
+ col = ethi_find_col_by_x_nearest (ethi, x);
+
+ ethi_add_drop_marker (ethi, col, FALSE);
+
+ ethi->drop_col = col;
+
+ if (col != -1) {
+ gchar *target = g_strdup_printf (
+ "%s-%s", TARGET_ETABLE_COL_TYPE, ethi->dnd_code);
+ d (g_print ("ethi - %s\n", target));
+ gtk_drag_get_data (
+ canvas, context,
+ gdk_atom_intern (target, FALSE),
+ time);
+ g_free (target);
+ }
+ }
+ gtk_drag_finish (context, successful, successful, time);
+ scroll_off (ethi);
+ return successful;
+}
+
+static void
+ethi_drag_leave (GtkWidget *widget,
+ GdkDragContext *context,
+ guint time,
+ ETableHeaderItem *ethi)
+{
+ ethi_remove_drop_marker (ethi);
+ if (ethi->drag_col != -1)
+ ethi_add_destroy_marker (ethi);
+}
+
+static void
+ethi_style_updated_cb (GtkWidget *widget,
+ ETableHeaderItem *ethi)
+{
+ PangoContext *pango_context;
+
+ g_return_if_fail (GTK_IS_WIDGET (widget));
+ g_return_if_fail (E_IS_TABLE_HEADER_ITEM (ethi));
+
+ pango_context = gtk_widget_get_pango_context (widget);
+
+ ethi_font_set (ethi, pango_context_get_font_description (pango_context));
+}
+
+static void
+ethi_realize (GnomeCanvasItem *item)
+{
+ ETableHeaderItem *ethi = E_TABLE_HEADER_ITEM (item);
+ GtkTargetEntry ethi_drop_types[] = {
+ { (gchar *) TARGET_ETABLE_COL_TYPE, 0, TARGET_ETABLE_COL_HEADER },
+ };
+
+ if (GNOME_CANVAS_ITEM_CLASS (ethi_parent_class)-> realize)
+ (*GNOME_CANVAS_ITEM_CLASS (ethi_parent_class)->realize)(item);
+
+ if (!ethi->font_desc) {
+ PangoContext *pango_context;
+
+ pango_context = gtk_widget_get_pango_context (GTK_WIDGET (item->canvas));
+
+ ethi_font_set (ethi, pango_context_get_font_description (pango_context));
+ }
+
+ g_signal_connect (
+ item->canvas, "style-updated",
+ G_CALLBACK (ethi_style_updated_cb), ethi);
+
+ /*
+ * Now, configure DnD
+ */
+ ethi_drop_types[0].target = g_strdup_printf (
+ "%s-%s", ethi_drop_types[0].target, ethi->dnd_code);
+ gtk_drag_dest_set (
+ GTK_WIDGET (item->canvas), 0, ethi_drop_types,
+ G_N_ELEMENTS (ethi_drop_types), GDK_ACTION_MOVE);
+ g_free ((gpointer) ethi_drop_types[0].target);
+
+ /* Drop signals */
+ ethi->drag_motion_id = g_signal_connect (
+ item->canvas, "drag_motion",
+ G_CALLBACK (ethi_drag_motion), ethi);
+ ethi->drag_leave_id = g_signal_connect (
+ item->canvas, "drag_leave",
+ G_CALLBACK (ethi_drag_leave), ethi);
+ ethi->drag_drop_id = g_signal_connect (
+ item->canvas, "drag_drop",
+ G_CALLBACK (ethi_drag_drop), ethi);
+ ethi->drag_data_received_id = g_signal_connect (
+ item->canvas, "drag_data_received",
+ G_CALLBACK (ethi_drag_data_received), ethi);
+
+ /* Drag signals */
+ ethi->drag_end_id = g_signal_connect (
+ item->canvas, "drag_end",
+ G_CALLBACK (ethi_drag_end), ethi);
+ ethi->drag_data_get_id = g_signal_connect (
+ item->canvas, "drag_data_get",
+ G_CALLBACK (ethi_drag_data_get), ethi);
+
+}
+
+static void
+ethi_unrealize (GnomeCanvasItem *item)
+{
+ ETableHeaderItem *ethi = E_TABLE_HEADER_ITEM (item);
+
+ if (ethi->font_desc != NULL) {
+ pango_font_description_free (ethi->font_desc);
+ ethi->font_desc = NULL;
+ }
+
+ g_signal_handlers_disconnect_by_func (item->canvas, G_CALLBACK (ethi_style_updated_cb), ethi);
+
+ g_signal_handler_disconnect (item->canvas, ethi->drag_motion_id);
+ g_signal_handler_disconnect (item->canvas, ethi->drag_leave_id);
+ g_signal_handler_disconnect (item->canvas, ethi->drag_drop_id);
+ g_signal_handler_disconnect (item->canvas, ethi->drag_data_received_id);
+
+ g_signal_handler_disconnect (item->canvas, ethi->drag_end_id);
+ g_signal_handler_disconnect (item->canvas, ethi->drag_data_get_id);
+
+ gtk_drag_dest_unset (GTK_WIDGET (item->canvas));
+
+ if (GNOME_CANVAS_ITEM_CLASS (ethi_parent_class)->unrealize)
+ (*GNOME_CANVAS_ITEM_CLASS (ethi_parent_class)->unrealize)(item);
+}
+
+static void
+ethi_draw (GnomeCanvasItem *item,
+ cairo_t *cr,
+ gint x,
+ gint y,
+ gint width,
+ gint height)
+{
+ ETableHeaderItem *ethi = E_TABLE_HEADER_ITEM (item);
+ GnomeCanvas *canvas = item->canvas;
+ const gint cols = e_table_header_count (ethi->eth);
+ gint x1, x2;
+ gint col;
+ GHashTable *arrows = g_hash_table_new (NULL, NULL);
+ GtkStyleContext *context;
+
+ if (ethi->sort_info) {
+ gint length;
+ gint i;
+
+ length = e_table_sort_info_grouping_get_count (ethi->sort_info);
+ for (i = 0; i < length; i++) {
+ ETableColumnSpecification *spec;
+ GtkSortType sort_type;
+
+ spec = e_table_sort_info_grouping_get_nth (
+ ethi->sort_info, i, &sort_type);
+
+ g_hash_table_insert (
+ arrows,
+ GINT_TO_POINTER (spec->model_col),
+ GINT_TO_POINTER (
+ (sort_type == GTK_SORT_ASCENDING) ?
+ E_TABLE_COL_ARROW_DOWN :
+ E_TABLE_COL_ARROW_UP));
+ }
+
+ length = e_table_sort_info_sorting_get_count (ethi->sort_info);
+ for (i = 0; i < length; i++) {
+ ETableColumnSpecification *spec;
+ GtkSortType sort_type;
+
+ spec = e_table_sort_info_sorting_get_nth (
+ ethi->sort_info, i, &sort_type);
+
+ g_hash_table_insert (
+ arrows,
+ GINT_TO_POINTER (spec->model_col),
+ GINT_TO_POINTER (
+ (sort_type == GTK_SORT_ASCENDING) ?
+ E_TABLE_COL_ARROW_DOWN :
+ E_TABLE_COL_ARROW_UP));
+ }
+ }
+
+ ethi->width = e_table_header_total_width (ethi->eth) + ethi->group_indent_width;
+ x1 = x2 = 0;
+ x2 += ethi->group_indent_width;
+
+ context = gtk_widget_get_style_context (GTK_WIDGET (canvas));
+
+ for (col = 0; col < cols; col++, x1 = x2) {
+ ETableCol *ecol = e_table_header_get_column (ethi->eth, col);
+ gint col_width;
+ GtkRegionFlags flags = 0;
+
+ col_width = ecol->width;
+
+ x2 += col_width;
+
+ if (x1 > (x + width))
+ break;
+
+ if (x2 < x)
+ continue;
+
+ if (x2 <= x1)
+ continue;
+
+ if (((col + 1) % 2) == 0)
+ flags |= GTK_REGION_EVEN;
+ else
+ flags |= GTK_REGION_ODD;
+
+ if (col == 0)
+ flags |= GTK_REGION_FIRST;
+
+ if (col + 1 == cols)
+ flags |= GTK_REGION_LAST;
+
+ gtk_style_context_save (context);
+ gtk_style_context_add_region (
+ context, GTK_STYLE_REGION_COLUMN_HEADER, flags);
+
+ e_table_header_draw_button (
+ cr, ecol, GTK_WIDGET (canvas),
+ x1 - x, -y, width, height,
+ x2 - x1, ethi->height,
+ (ETableColArrow) g_hash_table_lookup (
+ arrows, GINT_TO_POINTER (ecol->spec->model_col)));
+
+ gtk_style_context_restore (context);
+ }
+
+ g_hash_table_destroy (arrows);
+}
+
+static GnomeCanvasItem *
+ethi_point (GnomeCanvasItem *item,
+ gdouble x,
+ gdouble y,
+ gint cx,
+ gint cy)
+{
+ return item;
+}
+
+/*
+ * is_pointer_on_division:
+ *
+ * Returns whether @pos is a column header division; If @the_total is not NULL,
+ * then the actual position is returned here. If @return_ecol is not NULL,
+ * then the ETableCol that actually contains this point is returned here
+ */
+static gboolean
+is_pointer_on_division (ETableHeaderItem *ethi,
+ gint pos,
+ gint *the_total,
+ gint *return_col)
+{
+ const gint cols = e_table_header_count (ethi->eth);
+ gint col, total;
+
+ total = 0;
+ for (col = 0; col < cols; col++) {
+ ETableCol *ecol = e_table_header_get_column (ethi->eth, col);
+
+ if (col == 0)
+ total += ethi->group_indent_width;
+
+ total += ecol->width;
+
+ if ((total - TOLERANCE < pos) && (pos < total + TOLERANCE)) {
+ if (return_col)
+ *return_col = col;
+ if (the_total)
+ *the_total = total;
+
+ return TRUE;
+ }
+ if (return_col)
+ *return_col = col;
+
+ if (total > pos + TOLERANCE)
+ return FALSE;
+ }
+
+ return FALSE;
+}
+
+#define convert(c,sx,sy,x,y) gnome_canvas_w2c (c,sx,sy,x,y)
+
+static void
+set_cursor (ETableHeaderItem *ethi,
+ gint pos)
+{
+ GnomeCanvas *canvas;
+ GdkWindow *window;
+ gboolean resizable = FALSE;
+ gint col;
+
+ canvas = GNOME_CANVAS_ITEM (ethi)->canvas;
+ window = gtk_widget_get_window (GTK_WIDGET (canvas));
+
+ /* We might be invoked before we are realized */
+ if (window == NULL)
+ return;
+
+ if (is_pointer_on_division (ethi, pos, NULL, &col)) {
+ gint last_col = ethi->eth->col_count - 1;
+ ETableCol *ecol = e_table_header_get_column (ethi->eth, col);
+
+ /* Last column is not resizable */
+ if (ecol->spec->resizable && col != last_col) {
+ gint c = col + 1;
+
+ /* Column is not resizable if all columns after it
+ * are also not resizable */
+ for (; c <= last_col; c++) {
+ ETableCol *ecol2;
+
+ ecol2 = e_table_header_get_column (ethi->eth, c);
+ if (ecol2->spec->resizable) {
+ resizable = TRUE;
+ break;
+ }
+ }
+ }
+ }
+
+ if (resizable)
+ gdk_window_set_cursor (window, ethi->resize_cursor);
+ else
+ gdk_window_set_cursor (window, NULL);
+}
+
+static void
+ethi_end_resize (ETableHeaderItem *ethi)
+{
+ ethi->resize_col = -1;
+ ethi->resize_guide = GINT_TO_POINTER (0);
+
+ if (ethi->table)
+ e_table_thaw_state_change (ethi->table);
+ else if (ethi->tree)
+ e_tree_thaw_state_change (ethi->tree);
+
+ gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (ethi));
+}
+
+static gboolean
+ethi_maybe_start_drag (ETableHeaderItem *ethi,
+ GdkEventMotion *event)
+{
+ GnomeCanvasItem *item;
+
+ if (!ethi->maybe_drag)
+ return FALSE;
+
+ if (ethi->eth->col_count < 2) {
+ ethi->maybe_drag = FALSE;
+ return FALSE;
+ }
+
+ item = GNOME_CANVAS_ITEM (ethi);
+
+ return gtk_drag_check_threshold (GTK_WIDGET (item->canvas), ethi->click_x, ethi->click_y, event->x,
event->y);
+}
+
+static void
+ethi_start_drag (ETableHeaderItem *ethi,
+ GdkEvent *event)
+{
+ GtkWidget *widget;
+ GtkTargetList *list;
+ GdkDragContext *context;
+ ETableCol *ecol;
+ gint col_width;
+ cairo_surface_t *s;
+ cairo_t *cr;
+
+ gint group_indent = 0;
+ GHashTable *arrows = g_hash_table_new (NULL, NULL);
+
+ GtkTargetEntry ethi_drag_types[] = {
+ { (gchar *) TARGET_ETABLE_COL_TYPE, 0, TARGET_ETABLE_COL_HEADER },
+ };
+
+ widget = GTK_WIDGET (GNOME_CANVAS_ITEM (ethi)->canvas);
+ ethi->drag_col = ethi_find_col_by_x (ethi, event->motion.x);
+
+ if (ethi->drag_col == -1)
+ return;
+
+ if (ethi->sort_info) {
+ gint length = e_table_sort_info_grouping_get_count (ethi->sort_info);
+ gint i;
+ for (i = 0; i < length; i++) {
+ ETableColumnSpecification *spec;
+ GtkSortType sort_type;
+
+ group_indent++;
+
+ spec = e_table_sort_info_grouping_get_nth (
+ ethi->sort_info, i, &sort_type);
+
+ g_hash_table_insert (
+ arrows,
+ GINT_TO_POINTER (spec->model_col),
+ GINT_TO_POINTER (
+ (sort_type == GTK_SORT_ASCENDING) ?
+ E_TABLE_COL_ARROW_DOWN :
+ E_TABLE_COL_ARROW_UP));
+ }
+ length = e_table_sort_info_sorting_get_count (ethi->sort_info);
+ for (i = 0; i < length; i++) {
+ ETableColumnSpecification *spec;
+ GtkSortType sort_type;
+
+ spec = e_table_sort_info_sorting_get_nth (
+ ethi->sort_info, i, &sort_type);
+
+ g_hash_table_insert (
+ arrows,
+ GINT_TO_POINTER (spec->model_col),
+ GINT_TO_POINTER (
+ (sort_type == GTK_SORT_ASCENDING) ?
+ E_TABLE_COL_ARROW_DOWN :
+ E_TABLE_COL_ARROW_UP));
+ }
+ }
+
+ ethi_drag_types[0].target = g_strdup_printf (
+ "%s-%s", ethi_drag_types[0].target, ethi->dnd_code);
+ list = gtk_target_list_new (
+ ethi_drag_types, G_N_ELEMENTS (ethi_drag_types));
+ context = gtk_drag_begin (widget, list, GDK_ACTION_MOVE, 1, event);
+ g_free ((gpointer) ethi_drag_types[0].target);
+
+ ecol = e_table_header_get_column (ethi->eth, ethi->drag_col);
+ col_width = ecol->width;
+ s = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, col_width, ethi->height);
+ cr = cairo_create (s);
+
+ e_table_header_draw_button (
+ cr, ecol,
+ widget, 0, 0,
+ col_width, ethi->height,
+ col_width, ethi->height,
+ (ETableColArrow) g_hash_table_lookup (
+ arrows, GINT_TO_POINTER (ecol->spec->model_col)));
+ gtk_drag_set_icon_surface (context, s);
+ cairo_surface_destroy (s);
+
+ ethi->maybe_drag = FALSE;
+ g_hash_table_destroy (arrows);
+}
+
+typedef struct {
+ ETableHeaderItem *ethi;
+ gint col;
+} EthiHeaderInfo;
+
+static void
+ethi_popup_sort_ascending (GtkWidget *widget,
+ EthiHeaderInfo *info)
+{
+ ETableColumnSpecification *col_spec = NULL;
+ ETableCol *col;
+ gint length;
+ gint i;
+ gint found = FALSE;
+ ETableHeaderItem *ethi = info->ethi;
+
+ col = e_table_header_get_column (ethi->eth, info->col);
+ if (col->spec->sortable)
+ col_spec = col->spec;
+
+ length = e_table_sort_info_grouping_get_count (ethi->sort_info);
+ for (i = 0; i < length; i++) {
+ ETableColumnSpecification *spec;
+
+ spec = e_table_sort_info_grouping_get_nth (
+ ethi->sort_info, i, NULL);
+
+ if (e_table_column_specification_equal (col_spec, spec)) {
+ e_table_sort_info_grouping_set_nth (
+ ethi->sort_info, i, spec,
+ GTK_SORT_ASCENDING);
+ return;
+ }
+ }
+
+ length = e_table_sort_info_sorting_get_count (ethi->sort_info);
+ for (i = 0; i < length; i++) {
+ ETableColumnSpecification *spec;
+
+ spec = e_table_sort_info_sorting_get_nth (
+ ethi->sort_info, i, NULL);
+
+ if (col_spec == NULL ||
+ e_table_column_specification_equal (col_spec, spec)) {
+ e_table_sort_info_sorting_set_nth (
+ ethi->sort_info, i, spec,
+ GTK_SORT_ASCENDING);
+ found = TRUE;
+ if (col_spec != NULL)
+ return;
+ }
+ }
+
+ if (!found) {
+ length = e_table_sort_info_sorting_get_count (ethi->sort_info);
+ if (length == 0)
+ length++;
+
+ e_table_sort_info_sorting_set_nth (
+ ethi->sort_info, length - 1,
+ col_spec, GTK_SORT_ASCENDING);
+ }
+}
+
+static void
+ethi_popup_sort_descending (GtkWidget *widget,
+ EthiHeaderInfo *info)
+{
+ ETableColumnSpecification *col_spec = NULL;
+ ETableCol *col;
+ gint length;
+ gint i;
+ gint found = FALSE;
+ ETableHeaderItem *ethi = info->ethi;
+
+ col = e_table_header_get_column (ethi->eth, info->col);
+ if (col->spec->sortable)
+ col_spec = col->spec;
+
+ length = e_table_sort_info_grouping_get_count (ethi->sort_info);
+ for (i = 0; i < length; i++) {
+ ETableColumnSpecification *spec;
+ GtkSortType sort_type;
+
+ spec = e_table_sort_info_grouping_get_nth (
+ ethi->sort_info, i, &sort_type);
+
+ if (e_table_column_specification_equal (col_spec, spec)) {
+ e_table_sort_info_grouping_set_nth (
+ ethi->sort_info, i, spec,
+ GTK_SORT_DESCENDING);
+ return;
+ }
+ }
+
+ length = e_table_sort_info_sorting_get_count (ethi->sort_info);
+ for (i = 0; i < length; i++) {
+ ETableColumnSpecification *spec;
+
+ spec = e_table_sort_info_sorting_get_nth (
+ ethi->sort_info, i, NULL);
+
+ if (col_spec == NULL ||
+ e_table_column_specification_equal (col_spec, spec)) {
+ e_table_sort_info_sorting_set_nth (
+ ethi->sort_info, i, spec,
+ GTK_SORT_DESCENDING);
+ found = TRUE;
+ if (col_spec != NULL)
+ break;
+ }
+ }
+
+ if (!found) {
+ length = e_table_sort_info_sorting_get_count (ethi->sort_info);
+ if (length == 0)
+ length++;
+
+ e_table_sort_info_sorting_set_nth (
+ ethi->sort_info, length - 1,
+ col_spec, GTK_SORT_DESCENDING);
+ }
+}
+
+static void
+ethi_popup_unsort (GtkWidget *widget,
+ EthiHeaderInfo *info)
+{
+ ETableHeaderItem *ethi = info->ethi;
+
+ e_table_sort_info_grouping_truncate (ethi->sort_info, 0);
+ e_table_sort_info_sorting_truncate (ethi->sort_info, 0);
+}
+
+static void
+ethi_popup_group_field (GtkWidget *widget,
+ EthiHeaderInfo *info)
+{
+ ETableCol *col;
+
+ col = e_table_header_get_column (info->ethi->eth, info->col);
+
+ e_table_sort_info_grouping_set_nth (
+ info->ethi->sort_info, 0,
+ col->spec, GTK_SORT_ASCENDING);
+ e_table_sort_info_grouping_truncate (info->ethi->sort_info, 1);
+}
+
+static void
+ethi_popup_group_box (GtkWidget *widget,
+ EthiHeaderInfo *info)
+{
+}
+
+static void
+ethi_popup_remove_column (GtkWidget *widget,
+ EthiHeaderInfo *info)
+{
+ e_table_header_remove (info->ethi->eth, info->col);
+}
+
+static void
+ethi_popup_field_chooser (GtkWidget *widget,
+ EthiHeaderInfo *info)
+{
+ GtkWidget *etfcd = info->ethi->etfcd.widget;
+ GtkWidget *toplevel;
+
+ if (etfcd) {
+ gtk_window_present (GTK_WINDOW (etfcd));
+
+ return;
+ }
+
+ info->ethi->etfcd.widget = e_table_field_chooser_dialog_new ();
+ etfcd = info->ethi->etfcd.widget;
+
+ toplevel = gtk_widget_get_toplevel (widget);
+ if (GTK_IS_WINDOW (toplevel))
+ gtk_window_set_transient_for (GTK_WINDOW (etfcd), GTK_WINDOW (toplevel));
+
+ g_object_add_weak_pointer (G_OBJECT (etfcd), &info->ethi->etfcd.pointer);
+
+ g_object_set (
+ info->ethi->etfcd.widget,
+ "full_header", info->ethi->full_header,
+ "header", info->ethi->eth,
+ "dnd_code", info->ethi->dnd_code,
+ NULL);
+
+ gtk_widget_show (etfcd);
+}
+
+static void
+ethi_popup_alignment (GtkWidget *widget,
+ EthiHeaderInfo *info)
+{
+}
+
+static void
+ethi_popup_best_fit (GtkWidget *widget,
+ EthiHeaderInfo *info)
+{
+ ETableHeaderItem *ethi = info->ethi;
+ gint width;
+
+ g_signal_emit_by_name (
+ ethi->eth,
+ "request_width",
+ info->col, &width);
+ /* Add 10 to stop it from "..."ing */
+ e_table_header_set_size (ethi->eth, info->col, width + 10);
+
+ gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (ethi));
+
+}
+
+static void
+ethi_popup_format_columns (GtkWidget *widget,
+ EthiHeaderInfo *info)
+{
+}
+
+static void
+config_destroyed (gpointer data,
+ GObject *where_object_was)
+{
+ ETableHeaderItem *ethi = data;
+ ethi->config = NULL;
+}
+
+static void
+apply_changes (ETableConfig *config,
+ ETableHeaderItem *ethi)
+{
+ ETableState *state;
+
+ state = e_table_state_duplicate (config->state);
+
+ if (ethi->table != NULL)
+ e_table_set_state_object (ethi->table, state);
+ if (ethi->tree != NULL)
+ e_tree_set_state_object (ethi->tree, state);
+
+ g_object_unref (state);
+
+ gtk_dialog_set_response_sensitive (
+ GTK_DIALOG (config->dialog_toplevel),
+ GTK_RESPONSE_APPLY, FALSE);
+}
+
+static void
+ethi_popup_customize_view (GtkWidget *widget,
+ EthiHeaderInfo *info)
+{
+ ETableHeaderItem *ethi = info->ethi;
+ ETableState *state;
+ ETableSpecification *spec;
+
+ if (ethi->config)
+ e_table_config_raise (E_TABLE_CONFIG (ethi->config));
+ else {
+ if (ethi->table) {
+ state = e_table_get_state_object (ethi->table);
+ spec = ethi->table->spec;
+ } else if (ethi->tree) {
+ state = e_tree_get_state_object (ethi->tree);
+ spec = e_tree_get_spec (ethi->tree);
+ } else
+ return;
+
+ ethi->config = e_table_config_new (
+ _("Customize Current View"),
+ spec, state, GTK_WINDOW (gtk_widget_get_toplevel (widget)));
+ g_object_weak_ref (
+ G_OBJECT (ethi->config),
+ config_destroyed, ethi);
+ g_signal_connect (
+ ethi->config, "changed",
+ G_CALLBACK (apply_changes), ethi);
+ }
+}
+
+static void
+free_popup_info (GtkWidget *w,
+ EthiHeaderInfo *info)
+{
+ g_free (info);
+}
+
+/* Bit 1 is always disabled. */
+/* Bit 2 is disabled if not "sortable". */
+/* Bit 4 is disabled if we don't have a pointer to our table object. */
+static EPopupMenu ethi_context_menu[] = {
+ E_POPUP_ITEM (
+ N_("Sort _Ascending"),
+ G_CALLBACK (ethi_popup_sort_ascending), 2),
+ E_POPUP_ITEM (
+ N_("Sort _Descending"),
+ G_CALLBACK (ethi_popup_sort_descending), 2),
+ E_POPUP_ITEM (
+ N_("_Reset sort"), G_CALLBACK (ethi_popup_unsort), 0),
+ E_POPUP_SEPARATOR,
+ E_POPUP_ITEM (
+ N_("Group By This _Field"),
+ G_CALLBACK (ethi_popup_group_field), 16),
+ E_POPUP_ITEM (
+ N_("Group By _Box"),
+ G_CALLBACK (ethi_popup_group_box), 128),
+ E_POPUP_SEPARATOR,
+ E_POPUP_ITEM (
+ N_("Remove This _Column"),
+ G_CALLBACK (ethi_popup_remove_column), 8),
+ E_POPUP_ITEM (
+ N_("Add a C_olumn..."),
+ G_CALLBACK (ethi_popup_field_chooser), 0),
+ E_POPUP_SEPARATOR,
+ E_POPUP_ITEM (
+ N_("A_lignment"),
+ G_CALLBACK (ethi_popup_alignment), 128),
+ E_POPUP_ITEM (
+ N_("B_est Fit"),
+ G_CALLBACK (ethi_popup_best_fit), 2),
+ E_POPUP_ITEM (
+ N_("Format Column_s..."),
+ G_CALLBACK (ethi_popup_format_columns), 128),
+ E_POPUP_SEPARATOR,
+ E_POPUP_ITEM (
+ N_("Custo_mize Current View..."),
+ G_CALLBACK (ethi_popup_customize_view), 4),
+ E_POPUP_TERMINATOR
+};
+
+static void
+sort_by_id (GtkWidget *menu_item,
+ ETableHeaderItem *ethi)
+{
+ ETableCol *ecol;
+ gboolean clearfirst;
+ gint col;
+
+ col = GPOINTER_TO_INT (g_object_get_data (
+ G_OBJECT (menu_item), "col-number"));
+ ecol = e_table_header_get_column (ethi->full_header, col);
+ clearfirst = e_table_sort_info_sorting_get_count (ethi->sort_info) > 1;
+
+ if (!clearfirst && ecol &&
+ e_table_sort_info_sorting_get_count (ethi->sort_info) == 1) {
+ ETableColumnSpecification *spec;
+
+ spec = e_table_sort_info_sorting_get_nth (
+ ethi->sort_info, 0, NULL);
+ clearfirst = ecol->spec->sortable && ecol->spec != spec;
+ }
+
+ if (clearfirst)
+ e_table_sort_info_sorting_truncate (ethi->sort_info, 0);
+
+ ethi_change_sort_state (ethi, ecol, E_TABLE_HEADER_ITEM_SORT_FLAG_NONE);
+}
+
+static void
+popup_custom (GtkWidget *menu_item,
+ EthiHeaderInfo *info)
+{
+ ethi_popup_customize_view (menu_item, info);
+}
+
+static void
+ethi_header_context_menu (ETableHeaderItem *ethi,
+ GdkEvent *button_event)
+{
+ EthiHeaderInfo *info = g_new (EthiHeaderInfo, 1);
+ GtkMenu *popup;
+ gint ncol, sort_count, sort_col;
+ GtkWidget *menu_item, *sub_menu;
+ gboolean ascending = TRUE;
+ gdouble event_x_win = 0;
+ gdouble event_y_win = 0;
+ guint event_button = 0;
+ guint32 event_time;
+
+ d (g_print ("ethi_header_context_menu: \n"));
+
+ gdk_event_get_button (button_event, &event_button);
+ gdk_event_get_coords (button_event, &event_x_win, &event_y_win);
+ event_time = gdk_event_get_time (button_event);
+
+ info->ethi = ethi;
+ info->col = ethi_find_col_by_x (ethi, event_x_win);
+
+ popup = e_popup_menu_create_with_domain (
+ ethi_context_menu,
+ 1 +
+ ((ethi->table || ethi->tree) ? 0 : 4) +
+ ((e_table_header_count (ethi->eth) > 1) ? 0 : 8),
+ ((e_table_sort_info_get_can_group (ethi->sort_info)) ? 0 : 16) +
+ 128, info, GETTEXT_PACKAGE);
+
+ menu_item = gtk_menu_item_new_with_mnemonic (_("_Sort By"));
+ gtk_widget_show (menu_item);
+ sub_menu = gtk_menu_new ();
+ gtk_widget_show (sub_menu);
+ gtk_menu_item_set_submenu (GTK_MENU_ITEM (menu_item), sub_menu);
+ gtk_menu_shell_prepend (GTK_MENU_SHELL (popup), menu_item);
+
+ sort_count = e_table_sort_info_sorting_get_count (ethi->sort_info);
+
+ if (sort_count > 1 || sort_count < 1)
+ sort_col = -1; /* Custom sorting */
+ else {
+ ETableColumnSpecification *spec;
+ GtkSortType sort_type;
+
+ spec = e_table_sort_info_sorting_get_nth (
+ ethi->sort_info, 0, &sort_type);
+
+ sort_col = spec->model_col;
+ ascending = (sort_type == GTK_SORT_ASCENDING);
+ }
+
+ /* Custom */
+ menu_item = gtk_check_menu_item_new_with_mnemonic (_("_Custom"));
+ gtk_widget_show (menu_item);
+ gtk_menu_shell_prepend (GTK_MENU_SHELL (sub_menu), menu_item);
+ if (sort_col == -1)
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menu_item), TRUE);
+ gtk_check_menu_item_set_draw_as_radio (GTK_CHECK_MENU_ITEM (menu_item), TRUE);
+ g_signal_connect (
+ menu_item, "activate",
+ G_CALLBACK (popup_custom), info);
+
+ /* Show a seperator */
+ menu_item = gtk_separator_menu_item_new ();
+ gtk_widget_show (menu_item);
+ gtk_menu_shell_prepend (GTK_MENU_SHELL (sub_menu), menu_item);
+ /* Headers */
+ for (ncol = 0; ncol < ethi->full_header->col_count; ncol++)
+ {
+ gchar *text = NULL;
+
+ if (!ethi->full_header->columns[ncol]->spec->sortable ||
+ ethi->full_header->columns[ncol]->spec->disabled)
+ continue;
+
+ if (ncol == sort_col) {
+ text = g_strdup_printf (
+ "%s (%s)",
+ ethi->full_header->columns[ncol]->text,
+ ascending ? _("Ascending"):_("Descending"));
+ menu_item = gtk_check_menu_item_new_with_label (text);
+ g_free (text);
+ } else
+ menu_item = gtk_check_menu_item_new_with_label (
+ ethi->full_header->columns[ncol]->text);
+
+ gtk_widget_show (menu_item);
+ gtk_menu_shell_prepend (GTK_MENU_SHELL (sub_menu), menu_item);
+
+ if (ncol == sort_col)
+ gtk_check_menu_item_set_active (
+ GTK_CHECK_MENU_ITEM (menu_item), TRUE);
+ gtk_check_menu_item_set_draw_as_radio (
+ GTK_CHECK_MENU_ITEM (menu_item), TRUE);
+ g_object_set_data (
+ G_OBJECT (menu_item), "col-number",
+ GINT_TO_POINTER (ncol));
+ g_signal_connect (
+ menu_item, "activate",
+ G_CALLBACK (sort_by_id), ethi);
+ }
+
+ g_object_ref_sink (popup);
+ g_signal_connect (
+ popup, "selection-done",
+ G_CALLBACK (free_popup_info), info);
+
+ gtk_menu_attach_to_widget (GTK_MENU (popup),
+ GTK_WIDGET (ethi->parent.canvas),
+ NULL);
+ gtk_menu_popup (
+ GTK_MENU (popup),
+ NULL, NULL, NULL, NULL,
+ event_button, event_time);
+}
+
+static void
+ethi_button_pressed (ETableHeaderItem *ethi,
+ GdkEvent *button_event)
+{
+ g_signal_emit (ethi, ethi_signals[BUTTON_PRESSED], 0, button_event);
+}
+
+void
+ethi_change_sort_state (ETableHeaderItem *ethi,
+ ETableCol *col,
+ ETableHeaderItemSortFlag flag)
+{
+ ETableColumnSpecification *col_spec = NULL;
+ gint length;
+ gint i;
+ gboolean found = FALSE;
+
+ if (col == NULL)
+ return;
+
+ if (col->spec->sortable)
+ col_spec = col->spec;
+
+ length = e_table_sort_info_grouping_get_count (ethi->sort_info);
+ for (i = 0; i < length; i++) {
+ ETableColumnSpecification *spec;
+ GtkSortType sort_type;
+
+ spec = e_table_sort_info_grouping_get_nth (
+ ethi->sort_info, i, &sort_type);
+
+ /* Invert the sort type. */
+ if (sort_type == GTK_SORT_ASCENDING)
+ sort_type = GTK_SORT_DESCENDING;
+ else
+ sort_type = GTK_SORT_ASCENDING;
+
+ if (col_spec == NULL ||
+ e_table_column_specification_equal (col_spec, spec)) {
+ e_table_sort_info_grouping_set_nth (
+ ethi->sort_info, i, spec, sort_type);
+ found = TRUE;
+ if (col_spec != NULL)
+ break;
+ }
+ }
+
+ if (!found) {
+ length = e_table_sort_info_sorting_get_count (ethi->sort_info);
+ for (i = 0; i < length; i++) {
+ ETableColumnSpecification *spec;
+ GtkSortType sort_type;
+
+ spec = e_table_sort_info_sorting_get_nth (
+ ethi->sort_info, i, &sort_type);
+
+ if (col_spec == NULL ||
+ e_table_column_specification_equal (col_spec, spec)) {
+ if (sort_type == GTK_SORT_DESCENDING && col_spec != NULL) {
+ /*
+ * This means the user has clicked twice
+ * already, lets kill sorting of this column now.
+ */
+ e_table_sort_info_sorting_remove (
+ ethi->sort_info, i);
+ length--;
+ i--;
+ } else {
+ /* Invert the sort type. */
+ if (sort_type == GTK_SORT_ASCENDING)
+ sort_type = GTK_SORT_DESCENDING;
+ else
+ sort_type = GTK_SORT_ASCENDING;
+
+ e_table_sort_info_sorting_set_nth (
+ ethi->sort_info, i, spec, sort_type);
+ }
+ found = TRUE;
+ if (col_spec != NULL)
+ break;
+ }
+ }
+ }
+
+ if (!found && col_spec != NULL) {
+ if (flag == E_TABLE_HEADER_ITEM_SORT_FLAG_NONE) {
+ e_table_sort_info_sorting_truncate (ethi->sort_info, 0);
+ e_table_sort_info_sorting_set_nth (
+ ethi->sort_info, 0,
+ col_spec, GTK_SORT_ASCENDING);
+ } else {
+ guint index = 0;
+
+ if (flag == E_TABLE_HEADER_ITEM_SORT_FLAG_ADD_AS_LAST)
+ index = e_table_sort_info_sorting_get_count (ethi->sort_info);
+
+ e_table_sort_info_sorting_insert (
+ ethi->sort_info, index,
+ col_spec, GTK_SORT_ASCENDING);
+ }
+ }
+}
+
+/*
+ * Handles the events on the ETableHeaderItem, particularly it handles resizing
+ */
+static gint
+ethi_event (GnomeCanvasItem *item,
+ GdkEvent *event)
+{
+ ETableHeaderItem *ethi = E_TABLE_HEADER_ITEM (item);
+ GnomeCanvas *canvas = item->canvas;
+ GdkWindow *window;
+ const gboolean resizing = ETHI_RESIZING (ethi);
+ gint x, y, start, col;
+ gint was_maybe_drag = 0;
+ GdkModifierType event_state = 0;
+ guint event_button = 0;
+ guint event_keyval = 0;
+ gdouble event_x_win = 0;
+ gdouble event_y_win = 0;
+ guint32 event_time;
+ ETableHeaderItemSortFlag sort_flag = E_TABLE_HEADER_ITEM_SORT_FLAG_NONE;
+
+ /* Don't fetch the device here. GnomeCanvas frequently emits
+ * synthesized events, and calling gdk_event_get_device() on them
+ * will trigger a runtime warning. Fetch the device where needed. */
+ gdk_event_get_button (event, &event_button);
+ gdk_event_get_coords (event, &event_x_win, &event_y_win);
+ gdk_event_get_keyval (event, &event_keyval);
+ gdk_event_get_state (event, &event_state);
+ event_time = gdk_event_get_time (event);
+
+ if ((event_state & GDK_CONTROL_MASK) != 0) {
+ if ((event_state & GDK_SHIFT_MASK) != 0)
+ sort_flag = E_TABLE_HEADER_ITEM_SORT_FLAG_ADD_AS_LAST;
+ else
+ sort_flag = E_TABLE_HEADER_ITEM_SORT_FLAG_ADD_AS_FIRST;
+ }
+
+ switch (event->type) {
+ case GDK_ENTER_NOTIFY:
+ convert (canvas, event_x_win, event_y_win, &x, &y);
+ set_cursor (ethi, x);
+ break;
+
+ case GDK_LEAVE_NOTIFY:
+ window = gtk_widget_get_window (GTK_WIDGET (canvas));
+ gdk_window_set_cursor (window, NULL);
+ break;
+
+ case GDK_MOTION_NOTIFY:
+
+ convert (canvas, event_x_win, event_y_win, &x, &y);
+ if (resizing) {
+ gint new_width;
+
+ if (ethi->resize_guide == NULL) {
+ GdkDevice *event_device;
+
+ /* Quick hack until I actually bind the views */
+ ethi->resize_guide = GINT_TO_POINTER (1);
+
+ event_device = gdk_event_get_device (event);
+
+ gnome_canvas_item_grab (
+ item,
+ GDK_POINTER_MOTION_MASK |
+ GDK_BUTTON_RELEASE_MASK,
+ ethi->resize_cursor,
+ event_device,
+ event_time);
+ }
+
+ new_width = x - ethi->resize_start_pos;
+
+ e_table_header_set_size (ethi->eth, ethi->resize_col, new_width);
+
+ gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (ethi));
+ } else if (ethi_maybe_start_drag (ethi, &event->motion)) {
+ ethi_start_drag (ethi, event);
+ } else
+ set_cursor (ethi, x);
+ break;
+
+ case GDK_BUTTON_PRESS:
+ if (event_button > 3)
+ return FALSE;
+
+ convert (canvas, event_x_win, event_y_win, &x, &y);
+
+ if (is_pointer_on_division (ethi, x, &start, &col) &&
+ event_button == 1) {
+ ETableCol *ecol;
+
+ /*
+ * Record the important bits.
+ *
+ * By setting resize_pos to a non -1 value,
+ * we know that we are being resized (used in the
+ * other event handlers).
+ */
+ ecol = e_table_header_get_column (ethi->eth, col);
+
+ if (!ecol->spec->resizable)
+ break;
+ ethi->resize_col = col;
+ ethi->resize_start_pos = start - ecol->width;
+ ethi->resize_min_width = ecol->min_width;
+
+ if (ethi->table)
+ e_table_freeze_state_change (ethi->table);
+ else if (ethi->tree)
+ e_tree_freeze_state_change (ethi->tree);
+ } else {
+ if (event_button == 1) {
+ ethi->click_x = event_x_win;
+ ethi->click_y = event_y_win;
+ ethi->maybe_drag = TRUE;
+ col = -1;
+ is_pointer_on_division (ethi, x, &start, &col);
+ if (col != -1)
+ ethi->selected_col = col;
+ if (gtk_widget_get_can_focus (GTK_WIDGET (item->canvas)))
+ e_canvas_item_grab_focus (item, TRUE);
+ } else if (event_button == 3) {
+ ethi_header_context_menu (ethi, event);
+ } else
+ ethi_button_pressed (ethi, event);
+ }
+ break;
+
+ case GDK_2BUTTON_PRESS:
+ if (!resizing)
+ break;
+
+ if (event_button != 1)
+ break;
+ else {
+ gint width = 0;
+ g_signal_emit_by_name (
+ ethi->eth,
+ "request_width",
+ (gint) ethi->resize_col, &width);
+ /* Add 10 to stop it from "..."ing */
+ e_table_header_set_size (ethi->eth, ethi->resize_col, width + 10);
+
+ gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (ethi));
+ ethi->maybe_drag = FALSE;
+ }
+ break;
+
+ case GDK_BUTTON_RELEASE: {
+ gboolean needs_ungrab = FALSE;
+
+ was_maybe_drag = ethi->maybe_drag;
+
+ ethi->maybe_drag = FALSE;
+
+ if (ethi->resize_col != -1) {
+ needs_ungrab = (ethi->resize_guide != NULL);
+ ethi_end_resize (ethi);
+ } else if (was_maybe_drag && ethi->sort_info) {
+ ETableCol *ecol;
+
+ col = ethi_find_col_by_x (ethi, event_x_win);
+ ecol = e_table_header_get_column (ethi->eth, col);
+ ethi_change_sort_state (ethi, ecol, sort_flag);
+ }
+
+ if (needs_ungrab)
+ gnome_canvas_item_ungrab (item, event_time);
+
+ break;
+ }
+ case GDK_KEY_PRESS:
+ if ((event_keyval == GDK_KEY_F10) && (event_state & GDK_SHIFT_MASK)) {
+ EthiHeaderInfo *info = g_new (EthiHeaderInfo, 1);
+ ETableCol *ecol;
+ GtkMenu *popup;
+
+ info->ethi = ethi;
+ info->col = ethi->selected_col;
+ ecol = e_table_header_get_column (ethi->eth, info->col);
+
+ popup = e_popup_menu_create_with_domain (
+ ethi_context_menu,
+ 1 +
+ (ecol->spec->sortable ? 0 : 2) +
+ ((ethi->table || ethi->tree) ? 0 : 4) +
+ ((e_table_header_count (ethi->eth) > 1) ? 0 : 8),
+ ((e_table_sort_info_get_can_group (
+ ethi->sort_info)) ? 0 : 16) +
+ 128, info, GETTEXT_PACKAGE);
+ g_object_ref_sink (popup);
+ g_signal_connect (
+ popup, "selection-done",
+ G_CALLBACK (free_popup_info), info);
+ gtk_menu_attach_to_widget (GTK_MENU (popup),
+ GTK_WIDGET (canvas),
+ NULL);
+ gtk_menu_popup (
+ GTK_MENU (popup),
+ NULL, NULL, NULL, NULL,
+ 0, GDK_CURRENT_TIME);
+ } else if (event_keyval == GDK_KEY_space) {
+ ETableCol *ecol;
+
+ ecol = e_table_header_get_column (ethi->eth, ethi->selected_col);
+ ethi_change_sort_state (ethi, ecol, sort_flag);
+ } else if ((event_keyval == GDK_KEY_Right) ||
+ (event_keyval == GDK_KEY_KP_Right)) {
+ ETableCol *ecol;
+
+ if ((ethi->selected_col < 0) ||
+ (ethi->selected_col >= ethi->eth->col_count - 1))
+ ethi->selected_col = 0;
+ else
+ ethi->selected_col++;
+ ecol = e_table_header_get_column (ethi->eth, ethi->selected_col);
+ ethi_change_sort_state (ethi, ecol, sort_flag);
+ } else if ((event_keyval == GDK_KEY_Left) ||
+ (event_keyval == GDK_KEY_KP_Left)) {
+ ETableCol *ecol;
+
+ if ((ethi->selected_col <= 0) ||
+ (ethi->selected_col >= ethi->eth->col_count))
+ ethi->selected_col = ethi->eth->col_count - 1;
+ else
+ ethi->selected_col--;
+ ecol = e_table_header_get_column (ethi->eth, ethi->selected_col);
+ ethi_change_sort_state (ethi, ecol, sort_flag);
+ }
+ break;
+
+ default:
+ return FALSE;
+ }
+ return TRUE;
+}
+
+static void
+ethi_class_init (ETableHeaderItemClass *class)
+{
+ GnomeCanvasItemClass *item_class = GNOME_CANVAS_ITEM_CLASS (class);
+ GObjectClass *object_class = G_OBJECT_CLASS (class);
+
+ object_class->dispose = ethi_dispose;
+ object_class->set_property = ethi_set_property;
+ object_class->get_property = ethi_get_property;
+
+ item_class->update = ethi_update;
+ item_class->realize = ethi_realize;
+ item_class->unrealize = ethi_unrealize;
+ item_class->draw = ethi_draw;
+ item_class->point = ethi_point;
+ item_class->event = ethi_event;
+
+ g_object_class_install_property (
+ object_class,
+ PROP_DND_CODE,
+ g_param_spec_string (
+ "dnd_code",
+ "DnD code",
+ NULL,
+ NULL,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_TABLE_FONT_DESC,
+ g_param_spec_boxed (
+ "font-desc",
+ "Font Description",
+ NULL,
+ PANGO_TYPE_FONT_DESCRIPTION,
+ G_PARAM_WRITABLE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_FULL_HEADER,
+ g_param_spec_object (
+ "full_header",
+ "Full Header",
+ NULL,
+ E_TYPE_TABLE_HEADER,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_TABLE_HEADER,
+ g_param_spec_object (
+ "ETableHeader",
+ "Header",
+ NULL,
+ E_TYPE_TABLE_HEADER,
+ G_PARAM_WRITABLE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_SORT_INFO,
+ g_param_spec_object (
+ "sort_info",
+ "Sort Info",
+ NULL,
+ E_TYPE_TABLE_SORT_INFO,
+ G_PARAM_WRITABLE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_TABLE,
+ g_param_spec_object (
+ "table",
+ "Table",
+ NULL,
+ E_TYPE_TABLE,
+ G_PARAM_WRITABLE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_TREE,
+ g_param_spec_object (
+ "tree",
+ "Tree",
+ NULL,
+ E_TYPE_TREE,
+ G_PARAM_WRITABLE));
+
+ ethi_signals[BUTTON_PRESSED] = g_signal_new (
+ "button_pressed",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETableHeaderItemClass, button_pressed),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__BOXED,
+ G_TYPE_NONE, 1,
+ GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
+}
+
+static void
+ethi_init (ETableHeaderItem *ethi)
+{
+ GnomeCanvasItem *item = GNOME_CANVAS_ITEM (ethi);
+
+ ethi->resize_cursor = gdk_cursor_new (GDK_SB_H_DOUBLE_ARROW);
+
+ ethi->resize_col = -1;
+
+ item->x1 = 0;
+ item->y1 = 0;
+ item->x2 = 0;
+ item->y2 = 0;
+
+ ethi->drag_col = -1;
+ ethi->drag_mark = -1;
+
+ ethi->sort_info = NULL;
+
+ ethi->sort_info_changed_id = 0;
+ ethi->group_info_changed_id = 0;
+
+ ethi->group_indent_width = 0;
+ ethi->table = NULL;
+ ethi->tree = NULL;
+
+ ethi->selected_col = 0;
+}
+
diff --git a/e-util/e-table-header-item.h b/src/e-util/e-table-header-item.h
similarity index 100%
rename from e-util/e-table-header-item.h
rename to src/e-util/e-table-header-item.h
diff --git a/e-util/e-table-header-utils.c b/src/e-util/e-table-header-utils.c
similarity index 100%
rename from e-util/e-table-header-utils.c
rename to src/e-util/e-table-header-utils.c
diff --git a/e-util/e-table-header-utils.h b/src/e-util/e-table-header-utils.h
similarity index 100%
rename from e-util/e-table-header-utils.h
rename to src/e-util/e-table-header-utils.h
diff --git a/e-util/e-table-header.c b/src/e-util/e-table-header.c
similarity index 100%
rename from e-util/e-table-header.c
rename to src/e-util/e-table-header.c
diff --git a/e-util/e-table-header.h b/src/e-util/e-table-header.h
similarity index 100%
rename from e-util/e-table-header.h
rename to src/e-util/e-table-header.h
diff --git a/e-util/e-table-item.c b/src/e-util/e-table-item.c
similarity index 100%
rename from e-util/e-table-item.c
rename to src/e-util/e-table-item.c
diff --git a/e-util/e-table-item.h b/src/e-util/e-table-item.h
similarity index 100%
rename from e-util/e-table-item.h
rename to src/e-util/e-table-item.h
diff --git a/e-util/e-table-model.c b/src/e-util/e-table-model.c
similarity index 100%
rename from e-util/e-table-model.c
rename to src/e-util/e-table-model.c
diff --git a/e-util/e-table-model.h b/src/e-util/e-table-model.h
similarity index 100%
rename from e-util/e-table-model.h
rename to src/e-util/e-table-model.h
diff --git a/e-util/e-table-one.c b/src/e-util/e-table-one.c
similarity index 100%
rename from e-util/e-table-one.c
rename to src/e-util/e-table-one.c
diff --git a/e-util/e-table-one.h b/src/e-util/e-table-one.h
similarity index 100%
rename from e-util/e-table-one.h
rename to src/e-util/e-table-one.h
diff --git a/e-util/e-table-search.c b/src/e-util/e-table-search.c
similarity index 100%
rename from e-util/e-table-search.c
rename to src/e-util/e-table-search.c
diff --git a/e-util/e-table-search.h b/src/e-util/e-table-search.h
similarity index 100%
rename from e-util/e-table-search.h
rename to src/e-util/e-table-search.h
diff --git a/e-util/e-table-selection-model.c b/src/e-util/e-table-selection-model.c
similarity index 100%
rename from e-util/e-table-selection-model.c
rename to src/e-util/e-table-selection-model.c
diff --git a/e-util/e-table-selection-model.h b/src/e-util/e-table-selection-model.h
similarity index 100%
rename from e-util/e-table-selection-model.h
rename to src/e-util/e-table-selection-model.h
diff --git a/e-util/e-table-sort-info.c b/src/e-util/e-table-sort-info.c
similarity index 100%
rename from e-util/e-table-sort-info.c
rename to src/e-util/e-table-sort-info.c
diff --git a/e-util/e-table-sort-info.h b/src/e-util/e-table-sort-info.h
similarity index 100%
rename from e-util/e-table-sort-info.h
rename to src/e-util/e-table-sort-info.h
diff --git a/e-util/e-table-sorted-variable.c b/src/e-util/e-table-sorted-variable.c
similarity index 100%
rename from e-util/e-table-sorted-variable.c
rename to src/e-util/e-table-sorted-variable.c
diff --git a/e-util/e-table-sorted-variable.h b/src/e-util/e-table-sorted-variable.h
similarity index 100%
rename from e-util/e-table-sorted-variable.h
rename to src/e-util/e-table-sorted-variable.h
diff --git a/e-util/e-table-sorted.c b/src/e-util/e-table-sorted.c
similarity index 100%
rename from e-util/e-table-sorted.c
rename to src/e-util/e-table-sorted.c
diff --git a/e-util/e-table-sorted.h b/src/e-util/e-table-sorted.h
similarity index 100%
rename from e-util/e-table-sorted.h
rename to src/e-util/e-table-sorted.h
diff --git a/e-util/e-table-sorter.c b/src/e-util/e-table-sorter.c
similarity index 100%
rename from e-util/e-table-sorter.c
rename to src/e-util/e-table-sorter.c
diff --git a/e-util/e-table-sorter.h b/src/e-util/e-table-sorter.h
similarity index 100%
rename from e-util/e-table-sorter.h
rename to src/e-util/e-table-sorter.h
diff --git a/e-util/e-table-sorting-utils.c b/src/e-util/e-table-sorting-utils.c
similarity index 100%
rename from e-util/e-table-sorting-utils.c
rename to src/e-util/e-table-sorting-utils.c
diff --git a/e-util/e-table-sorting-utils.h b/src/e-util/e-table-sorting-utils.h
similarity index 100%
rename from e-util/e-table-sorting-utils.h
rename to src/e-util/e-table-sorting-utils.h
diff --git a/e-util/e-table-specification.c b/src/e-util/e-table-specification.c
similarity index 100%
rename from e-util/e-table-specification.c
rename to src/e-util/e-table-specification.c
diff --git a/e-util/e-table-specification.h b/src/e-util/e-table-specification.h
similarity index 100%
rename from e-util/e-table-specification.h
rename to src/e-util/e-table-specification.h
diff --git a/e-util/e-table-state.c b/src/e-util/e-table-state.c
similarity index 100%
rename from e-util/e-table-state.c
rename to src/e-util/e-table-state.c
diff --git a/e-util/e-table-state.h b/src/e-util/e-table-state.h
similarity index 100%
rename from e-util/e-table-state.h
rename to src/e-util/e-table-state.h
diff --git a/e-util/e-table-subset-variable.c b/src/e-util/e-table-subset-variable.c
similarity index 100%
rename from e-util/e-table-subset-variable.c
rename to src/e-util/e-table-subset-variable.c
diff --git a/e-util/e-table-subset-variable.h b/src/e-util/e-table-subset-variable.h
similarity index 100%
rename from e-util/e-table-subset-variable.h
rename to src/e-util/e-table-subset-variable.h
diff --git a/e-util/e-table-subset.c b/src/e-util/e-table-subset.c
similarity index 100%
rename from e-util/e-table-subset.c
rename to src/e-util/e-table-subset.c
diff --git a/e-util/e-table-subset.h b/src/e-util/e-table-subset.h
similarity index 100%
rename from e-util/e-table-subset.h
rename to src/e-util/e-table-subset.h
diff --git a/e-util/e-table-utils.c b/src/e-util/e-table-utils.c
similarity index 100%
rename from e-util/e-table-utils.c
rename to src/e-util/e-table-utils.c
diff --git a/e-util/e-table-utils.h b/src/e-util/e-table-utils.h
similarity index 100%
rename from e-util/e-table-utils.h
rename to src/e-util/e-table-utils.h
diff --git a/e-util/e-table.c b/src/e-util/e-table.c
similarity index 100%
rename from e-util/e-table.c
rename to src/e-util/e-table.c
diff --git a/e-util/e-table.h b/src/e-util/e-table.h
similarity index 100%
rename from e-util/e-table.h
rename to src/e-util/e-table.h
diff --git a/e-util/e-text-event-processor-emacs-like.c b/src/e-util/e-text-event-processor-emacs-like.c
similarity index 100%
rename from e-util/e-text-event-processor-emacs-like.c
rename to src/e-util/e-text-event-processor-emacs-like.c
diff --git a/e-util/e-text-event-processor-emacs-like.h b/src/e-util/e-text-event-processor-emacs-like.h
similarity index 100%
rename from e-util/e-text-event-processor-emacs-like.h
rename to src/e-util/e-text-event-processor-emacs-like.h
diff --git a/e-util/e-text-event-processor-types.h b/src/e-util/e-text-event-processor-types.h
similarity index 100%
rename from e-util/e-text-event-processor-types.h
rename to src/e-util/e-text-event-processor-types.h
diff --git a/e-util/e-text-event-processor.c b/src/e-util/e-text-event-processor.c
similarity index 100%
rename from e-util/e-text-event-processor.c
rename to src/e-util/e-text-event-processor.c
diff --git a/e-util/e-text-event-processor.h b/src/e-util/e-text-event-processor.h
similarity index 100%
rename from e-util/e-text-event-processor.h
rename to src/e-util/e-text-event-processor.h
diff --git a/e-util/e-text-model-repos.c b/src/e-util/e-text-model-repos.c
similarity index 100%
rename from e-util/e-text-model-repos.c
rename to src/e-util/e-text-model-repos.c
diff --git a/e-util/e-text-model-repos.h b/src/e-util/e-text-model-repos.h
similarity index 100%
rename from e-util/e-text-model-repos.h
rename to src/e-util/e-text-model-repos.h
diff --git a/e-util/e-text-model.c b/src/e-util/e-text-model.c
similarity index 100%
rename from e-util/e-text-model.c
rename to src/e-util/e-text-model.c
diff --git a/e-util/e-text-model.h b/src/e-util/e-text-model.h
similarity index 100%
rename from e-util/e-text-model.h
rename to src/e-util/e-text-model.h
diff --git a/e-util/e-text.c b/src/e-util/e-text.c
similarity index 100%
rename from e-util/e-text.c
rename to src/e-util/e-text.c
diff --git a/e-util/e-text.h b/src/e-util/e-text.h
similarity index 100%
rename from e-util/e-text.h
rename to src/e-util/e-text.h
diff --git a/e-util/e-timezone-dialog.c b/src/e-util/e-timezone-dialog.c
similarity index 100%
rename from e-util/e-timezone-dialog.c
rename to src/e-util/e-timezone-dialog.c
diff --git a/e-util/e-timezone-dialog.h b/src/e-util/e-timezone-dialog.h
similarity index 100%
rename from e-util/e-timezone-dialog.h
rename to src/e-util/e-timezone-dialog.h
diff --git a/e-util/e-timezone-dialog.ui b/src/e-util/e-timezone-dialog.ui
similarity index 100%
rename from e-util/e-timezone-dialog.ui
rename to src/e-util/e-timezone-dialog.ui
diff --git a/e-util/e-tree-model-generator.c b/src/e-util/e-tree-model-generator.c
similarity index 100%
rename from e-util/e-tree-model-generator.c
rename to src/e-util/e-tree-model-generator.c
diff --git a/e-util/e-tree-model-generator.h b/src/e-util/e-tree-model-generator.h
similarity index 100%
rename from e-util/e-tree-model-generator.h
rename to src/e-util/e-tree-model-generator.h
diff --git a/e-util/e-tree-model.c b/src/e-util/e-tree-model.c
similarity index 100%
rename from e-util/e-tree-model.c
rename to src/e-util/e-tree-model.c
diff --git a/e-util/e-tree-model.h b/src/e-util/e-tree-model.h
similarity index 100%
rename from e-util/e-tree-model.h
rename to src/e-util/e-tree-model.h
diff --git a/e-util/e-tree-selection-model.c b/src/e-util/e-tree-selection-model.c
similarity index 100%
rename from e-util/e-tree-selection-model.c
rename to src/e-util/e-tree-selection-model.c
diff --git a/e-util/e-tree-selection-model.h b/src/e-util/e-tree-selection-model.h
similarity index 100%
rename from e-util/e-tree-selection-model.h
rename to src/e-util/e-tree-selection-model.h
diff --git a/e-util/e-tree-table-adapter.c b/src/e-util/e-tree-table-adapter.c
similarity index 100%
rename from e-util/e-tree-table-adapter.c
rename to src/e-util/e-tree-table-adapter.c
diff --git a/e-util/e-tree-table-adapter.h b/src/e-util/e-tree-table-adapter.h
similarity index 100%
rename from e-util/e-tree-table-adapter.h
rename to src/e-util/e-tree-table-adapter.h
diff --git a/e-util/e-tree-view-frame.c b/src/e-util/e-tree-view-frame.c
similarity index 100%
rename from e-util/e-tree-view-frame.c
rename to src/e-util/e-tree-view-frame.c
diff --git a/e-util/e-tree-view-frame.h b/src/e-util/e-tree-view-frame.h
similarity index 100%
rename from e-util/e-tree-view-frame.h
rename to src/e-util/e-tree-view-frame.h
diff --git a/e-util/e-tree.c b/src/e-util/e-tree.c
similarity index 100%
rename from e-util/e-tree.c
rename to src/e-util/e-tree.c
diff --git a/e-util/e-tree.h b/src/e-util/e-tree.h
similarity index 100%
rename from e-util/e-tree.h
rename to src/e-util/e-tree.h
diff --git a/e-util/e-unicode.c b/src/e-util/e-unicode.c
similarity index 100%
rename from e-util/e-unicode.c
rename to src/e-util/e-unicode.c
diff --git a/e-util/e-unicode.h b/src/e-util/e-unicode.h
similarity index 100%
rename from e-util/e-unicode.h
rename to src/e-util/e-unicode.h
diff --git a/e-util/e-url-entry.c b/src/e-util/e-url-entry.c
similarity index 100%
rename from e-util/e-url-entry.c
rename to src/e-util/e-url-entry.c
diff --git a/e-util/e-url-entry.h b/src/e-util/e-url-entry.h
similarity index 100%
rename from e-util/e-url-entry.h
rename to src/e-util/e-url-entry.h
diff --git a/e-util/e-util-enums.h b/src/e-util/e-util-enums.h
similarity index 100%
rename from e-util/e-util-enums.h
rename to src/e-util/e-util-enums.h
diff --git a/e-util/e-util-private.h b/src/e-util/e-util-private.h
similarity index 100%
rename from e-util/e-util-private.h
rename to src/e-util/e-util-private.h
diff --git a/e-util/e-util.h b/src/e-util/e-util.h
similarity index 100%
rename from e-util/e-util.h
rename to src/e-util/e-util.h
diff --git a/e-util/e-web-view-preview.c b/src/e-util/e-web-view-preview.c
similarity index 100%
rename from e-util/e-web-view-preview.c
rename to src/e-util/e-web-view-preview.c
diff --git a/e-util/e-web-view-preview.h b/src/e-util/e-web-view-preview.h
similarity index 100%
rename from e-util/e-web-view-preview.h
rename to src/e-util/e-web-view-preview.h
diff --git a/e-util/e-web-view.c b/src/e-util/e-web-view.c
similarity index 100%
rename from e-util/e-web-view.c
rename to src/e-util/e-web-view.c
diff --git a/e-util/e-web-view.h b/src/e-util/e-web-view.h
similarity index 100%
rename from e-util/e-web-view.h
rename to src/e-util/e-web-view.h
diff --git a/e-util/e-widget-undo.c b/src/e-util/e-widget-undo.c
similarity index 100%
rename from e-util/e-widget-undo.c
rename to src/e-util/e-widget-undo.c
diff --git a/e-util/e-widget-undo.h b/src/e-util/e-widget-undo.h
similarity index 100%
rename from e-util/e-widget-undo.h
rename to src/e-util/e-widget-undo.h
diff --git a/e-util/e-win32-defaults.c b/src/e-util/e-win32-defaults.c
similarity index 100%
rename from e-util/e-win32-defaults.c
rename to src/e-util/e-win32-defaults.c
diff --git a/e-util/e-win32-defaults.h b/src/e-util/e-win32-defaults.h
similarity index 100%
rename from e-util/e-win32-defaults.h
rename to src/e-util/e-win32-defaults.h
diff --git a/e-util/e-win32-reloc.c b/src/e-util/e-win32-reloc.c
similarity index 100%
rename from e-util/e-win32-reloc.c
rename to src/e-util/e-win32-reloc.c
diff --git a/e-util/e-xml-utils.c b/src/e-util/e-xml-utils.c
similarity index 100%
rename from e-util/e-xml-utils.c
rename to src/e-util/e-xml-utils.c
diff --git a/e-util/e-xml-utils.h b/src/e-util/e-xml-utils.h
similarity index 100%
rename from e-util/e-xml-utils.h
rename to src/e-util/e-xml-utils.h
diff --git a/e-util/ea-calendar-cell.c b/src/e-util/ea-calendar-cell.c
similarity index 100%
rename from e-util/ea-calendar-cell.c
rename to src/e-util/ea-calendar-cell.c
diff --git a/e-util/ea-calendar-cell.h b/src/e-util/ea-calendar-cell.h
similarity index 100%
rename from e-util/ea-calendar-cell.h
rename to src/e-util/ea-calendar-cell.h
diff --git a/e-util/ea-calendar-item.c b/src/e-util/ea-calendar-item.c
similarity index 100%
rename from e-util/ea-calendar-item.c
rename to src/e-util/ea-calendar-item.c
diff --git a/e-util/ea-calendar-item.h b/src/e-util/ea-calendar-item.h
similarity index 100%
rename from e-util/ea-calendar-item.h
rename to src/e-util/ea-calendar-item.h
diff --git a/e-util/ea-cell-table.c b/src/e-util/ea-cell-table.c
similarity index 100%
rename from e-util/ea-cell-table.c
rename to src/e-util/ea-cell-table.c
diff --git a/e-util/ea-cell-table.h b/src/e-util/ea-cell-table.h
similarity index 100%
rename from e-util/ea-cell-table.h
rename to src/e-util/ea-cell-table.h
diff --git a/e-util/ea-factory.h b/src/e-util/ea-factory.h
similarity index 100%
rename from e-util/ea-factory.h
rename to src/e-util/ea-factory.h
diff --git a/e-util/ea-widgets.c b/src/e-util/ea-widgets.c
similarity index 100%
rename from e-util/ea-widgets.c
rename to src/e-util/ea-widgets.c
diff --git a/e-util/ea-widgets.h b/src/e-util/ea-widgets.h
similarity index 100%
rename from e-util/ea-widgets.h
rename to src/e-util/ea-widgets.h
diff --git a/e-util/evolution-source-viewer.c b/src/e-util/evolution-source-viewer.c
similarity index 100%
rename from e-util/evolution-source-viewer.c
rename to src/e-util/evolution-source-viewer.c
diff --git a/e-util/filter.error.xml b/src/e-util/filter.error.xml
similarity index 100%
rename from e-util/filter.error.xml
rename to src/e-util/filter.error.xml
diff --git a/e-util/filter.ui b/src/e-util/filter.ui
similarity index 100%
rename from e-util/filter.ui
rename to src/e-util/filter.ui
diff --git a/e-util/gal-a11y-e-cell-popup.c b/src/e-util/gal-a11y-e-cell-popup.c
similarity index 100%
rename from e-util/gal-a11y-e-cell-popup.c
rename to src/e-util/gal-a11y-e-cell-popup.c
diff --git a/e-util/gal-a11y-e-cell-popup.h b/src/e-util/gal-a11y-e-cell-popup.h
similarity index 100%
rename from e-util/gal-a11y-e-cell-popup.h
rename to src/e-util/gal-a11y-e-cell-popup.h
diff --git a/e-util/gal-a11y-e-cell-registry.c b/src/e-util/gal-a11y-e-cell-registry.c
similarity index 100%
rename from e-util/gal-a11y-e-cell-registry.c
rename to src/e-util/gal-a11y-e-cell-registry.c
diff --git a/e-util/gal-a11y-e-cell-registry.h b/src/e-util/gal-a11y-e-cell-registry.h
similarity index 100%
rename from e-util/gal-a11y-e-cell-registry.h
rename to src/e-util/gal-a11y-e-cell-registry.h
diff --git a/e-util/gal-a11y-e-cell-text.c b/src/e-util/gal-a11y-e-cell-text.c
similarity index 100%
rename from e-util/gal-a11y-e-cell-text.c
rename to src/e-util/gal-a11y-e-cell-text.c
diff --git a/e-util/gal-a11y-e-cell-text.h b/src/e-util/gal-a11y-e-cell-text.h
similarity index 100%
rename from e-util/gal-a11y-e-cell-text.h
rename to src/e-util/gal-a11y-e-cell-text.h
diff --git a/e-util/gal-a11y-e-cell-toggle.c b/src/e-util/gal-a11y-e-cell-toggle.c
similarity index 100%
rename from e-util/gal-a11y-e-cell-toggle.c
rename to src/e-util/gal-a11y-e-cell-toggle.c
diff --git a/e-util/gal-a11y-e-cell-toggle.h b/src/e-util/gal-a11y-e-cell-toggle.h
similarity index 100%
rename from e-util/gal-a11y-e-cell-toggle.h
rename to src/e-util/gal-a11y-e-cell-toggle.h
diff --git a/e-util/gal-a11y-e-cell-tree.c b/src/e-util/gal-a11y-e-cell-tree.c
similarity index 100%
rename from e-util/gal-a11y-e-cell-tree.c
rename to src/e-util/gal-a11y-e-cell-tree.c
diff --git a/e-util/gal-a11y-e-cell-tree.h b/src/e-util/gal-a11y-e-cell-tree.h
similarity index 100%
rename from e-util/gal-a11y-e-cell-tree.h
rename to src/e-util/gal-a11y-e-cell-tree.h
diff --git a/e-util/gal-a11y-e-cell-vbox.c b/src/e-util/gal-a11y-e-cell-vbox.c
similarity index 100%
rename from e-util/gal-a11y-e-cell-vbox.c
rename to src/e-util/gal-a11y-e-cell-vbox.c
diff --git a/e-util/gal-a11y-e-cell-vbox.h b/src/e-util/gal-a11y-e-cell-vbox.h
similarity index 100%
rename from e-util/gal-a11y-e-cell-vbox.h
rename to src/e-util/gal-a11y-e-cell-vbox.h
diff --git a/e-util/gal-a11y-e-cell.c b/src/e-util/gal-a11y-e-cell.c
similarity index 100%
rename from e-util/gal-a11y-e-cell.c
rename to src/e-util/gal-a11y-e-cell.c
diff --git a/e-util/gal-a11y-e-cell.h b/src/e-util/gal-a11y-e-cell.h
similarity index 100%
rename from e-util/gal-a11y-e-cell.h
rename to src/e-util/gal-a11y-e-cell.h
diff --git a/e-util/gal-a11y-e-table-click-to-add-factory.c
b/src/e-util/gal-a11y-e-table-click-to-add-factory.c
similarity index 100%
rename from e-util/gal-a11y-e-table-click-to-add-factory.c
rename to src/e-util/gal-a11y-e-table-click-to-add-factory.c
diff --git a/e-util/gal-a11y-e-table-click-to-add-factory.h
b/src/e-util/gal-a11y-e-table-click-to-add-factory.h
similarity index 100%
rename from e-util/gal-a11y-e-table-click-to-add-factory.h
rename to src/e-util/gal-a11y-e-table-click-to-add-factory.h
diff --git a/e-util/gal-a11y-e-table-click-to-add.c b/src/e-util/gal-a11y-e-table-click-to-add.c
similarity index 100%
rename from e-util/gal-a11y-e-table-click-to-add.c
rename to src/e-util/gal-a11y-e-table-click-to-add.c
diff --git a/e-util/gal-a11y-e-table-click-to-add.h b/src/e-util/gal-a11y-e-table-click-to-add.h
similarity index 100%
rename from e-util/gal-a11y-e-table-click-to-add.h
rename to src/e-util/gal-a11y-e-table-click-to-add.h
diff --git a/e-util/gal-a11y-e-table-column-header.c b/src/e-util/gal-a11y-e-table-column-header.c
similarity index 100%
rename from e-util/gal-a11y-e-table-column-header.c
rename to src/e-util/gal-a11y-e-table-column-header.c
diff --git a/e-util/gal-a11y-e-table-column-header.h b/src/e-util/gal-a11y-e-table-column-header.h
similarity index 100%
rename from e-util/gal-a11y-e-table-column-header.h
rename to src/e-util/gal-a11y-e-table-column-header.h
diff --git a/e-util/gal-a11y-e-table-factory.c b/src/e-util/gal-a11y-e-table-factory.c
similarity index 100%
rename from e-util/gal-a11y-e-table-factory.c
rename to src/e-util/gal-a11y-e-table-factory.c
diff --git a/e-util/gal-a11y-e-table-factory.h b/src/e-util/gal-a11y-e-table-factory.h
similarity index 100%
rename from e-util/gal-a11y-e-table-factory.h
rename to src/e-util/gal-a11y-e-table-factory.h
diff --git a/e-util/gal-a11y-e-table-item-factory.c b/src/e-util/gal-a11y-e-table-item-factory.c
similarity index 100%
rename from e-util/gal-a11y-e-table-item-factory.c
rename to src/e-util/gal-a11y-e-table-item-factory.c
diff --git a/e-util/gal-a11y-e-table-item-factory.h b/src/e-util/gal-a11y-e-table-item-factory.h
similarity index 100%
rename from e-util/gal-a11y-e-table-item-factory.h
rename to src/e-util/gal-a11y-e-table-item-factory.h
diff --git a/e-util/gal-a11y-e-table-item.c b/src/e-util/gal-a11y-e-table-item.c
similarity index 100%
rename from e-util/gal-a11y-e-table-item.c
rename to src/e-util/gal-a11y-e-table-item.c
diff --git a/e-util/gal-a11y-e-table-item.h b/src/e-util/gal-a11y-e-table-item.h
similarity index 100%
rename from e-util/gal-a11y-e-table-item.h
rename to src/e-util/gal-a11y-e-table-item.h
diff --git a/e-util/gal-a11y-e-table.c b/src/e-util/gal-a11y-e-table.c
similarity index 100%
rename from e-util/gal-a11y-e-table.c
rename to src/e-util/gal-a11y-e-table.c
diff --git a/e-util/gal-a11y-e-table.h b/src/e-util/gal-a11y-e-table.h
similarity index 100%
rename from e-util/gal-a11y-e-table.h
rename to src/e-util/gal-a11y-e-table.h
diff --git a/e-util/gal-a11y-e-text-factory.c b/src/e-util/gal-a11y-e-text-factory.c
similarity index 100%
rename from e-util/gal-a11y-e-text-factory.c
rename to src/e-util/gal-a11y-e-text-factory.c
diff --git a/e-util/gal-a11y-e-text-factory.h b/src/e-util/gal-a11y-e-text-factory.h
similarity index 100%
rename from e-util/gal-a11y-e-text-factory.h
rename to src/e-util/gal-a11y-e-text-factory.h
diff --git a/e-util/gal-a11y-e-text.c b/src/e-util/gal-a11y-e-text.c
similarity index 100%
rename from e-util/gal-a11y-e-text.c
rename to src/e-util/gal-a11y-e-text.c
diff --git a/e-util/gal-a11y-e-text.h b/src/e-util/gal-a11y-e-text.h
similarity index 100%
rename from e-util/gal-a11y-e-text.h
rename to src/e-util/gal-a11y-e-text.h
diff --git a/e-util/gal-a11y-e-tree-factory.c b/src/e-util/gal-a11y-e-tree-factory.c
similarity index 100%
rename from e-util/gal-a11y-e-tree-factory.c
rename to src/e-util/gal-a11y-e-tree-factory.c
diff --git a/e-util/gal-a11y-e-tree-factory.h b/src/e-util/gal-a11y-e-tree-factory.h
similarity index 100%
rename from e-util/gal-a11y-e-tree-factory.h
rename to src/e-util/gal-a11y-e-tree-factory.h
diff --git a/e-util/gal-a11y-e-tree.c b/src/e-util/gal-a11y-e-tree.c
similarity index 100%
rename from e-util/gal-a11y-e-tree.c
rename to src/e-util/gal-a11y-e-tree.c
diff --git a/e-util/gal-a11y-e-tree.h b/src/e-util/gal-a11y-e-tree.h
similarity index 100%
rename from e-util/gal-a11y-e-tree.h
rename to src/e-util/gal-a11y-e-tree.h
diff --git a/e-util/gal-a11y-factory.h b/src/e-util/gal-a11y-factory.h
similarity index 100%
rename from e-util/gal-a11y-factory.h
rename to src/e-util/gal-a11y-factory.h
diff --git a/e-util/gal-a11y-util.c b/src/e-util/gal-a11y-util.c
similarity index 100%
rename from e-util/gal-a11y-util.c
rename to src/e-util/gal-a11y-util.c
diff --git a/e-util/gal-a11y-util.h b/src/e-util/gal-a11y-util.h
similarity index 100%
rename from e-util/gal-a11y-util.h
rename to src/e-util/gal-a11y-util.h
diff --git a/e-util/gal-view-collection.c b/src/e-util/gal-view-collection.c
similarity index 100%
rename from e-util/gal-view-collection.c
rename to src/e-util/gal-view-collection.c
diff --git a/e-util/gal-view-collection.h b/src/e-util/gal-view-collection.h
similarity index 100%
rename from e-util/gal-view-collection.h
rename to src/e-util/gal-view-collection.h
diff --git a/e-util/gal-view-etable.c b/src/e-util/gal-view-etable.c
similarity index 100%
rename from e-util/gal-view-etable.c
rename to src/e-util/gal-view-etable.c
diff --git a/e-util/gal-view-etable.h b/src/e-util/gal-view-etable.h
similarity index 100%
rename from e-util/gal-view-etable.h
rename to src/e-util/gal-view-etable.h
diff --git a/e-util/gal-view-instance-save-as-dialog.c b/src/e-util/gal-view-instance-save-as-dialog.c
similarity index 100%
rename from e-util/gal-view-instance-save-as-dialog.c
rename to src/e-util/gal-view-instance-save-as-dialog.c
diff --git a/e-util/gal-view-instance-save-as-dialog.h b/src/e-util/gal-view-instance-save-as-dialog.h
similarity index 100%
rename from e-util/gal-view-instance-save-as-dialog.h
rename to src/e-util/gal-view-instance-save-as-dialog.h
diff --git a/e-util/gal-view-instance-save-as-dialog.ui b/src/e-util/gal-view-instance-save-as-dialog.ui
similarity index 100%
rename from e-util/gal-view-instance-save-as-dialog.ui
rename to src/e-util/gal-view-instance-save-as-dialog.ui
diff --git a/e-util/gal-view-instance.c b/src/e-util/gal-view-instance.c
similarity index 100%
rename from e-util/gal-view-instance.c
rename to src/e-util/gal-view-instance.c
diff --git a/e-util/gal-view-instance.h b/src/e-util/gal-view-instance.h
similarity index 100%
rename from e-util/gal-view-instance.h
rename to src/e-util/gal-view-instance.h
diff --git a/e-util/gal-view.c b/src/e-util/gal-view.c
similarity index 100%
rename from e-util/gal-view.c
rename to src/e-util/gal-view.c
diff --git a/e-util/gal-view.h b/src/e-util/gal-view.h
similarity index 100%
rename from e-util/gal-view.h
rename to src/e-util/gal-view.h
diff --git a/e-util/test-calendar.c b/src/e-util/test-calendar.c
similarity index 100%
rename from e-util/test-calendar.c
rename to src/e-util/test-calendar.c
diff --git a/e-util/test-category-completion.c b/src/e-util/test-category-completion.c
similarity index 100%
rename from e-util/test-category-completion.c
rename to src/e-util/test-category-completion.c
diff --git a/e-util/test-contact-store.c b/src/e-util/test-contact-store.c
similarity index 100%
rename from e-util/test-contact-store.c
rename to src/e-util/test-contact-store.c
diff --git a/e-util/test-dateedit.c b/src/e-util/test-dateedit.c
similarity index 100%
rename from e-util/test-dateedit.c
rename to src/e-util/test-dateedit.c
diff --git a/e-util/test-html-editor-units-bugs.c b/src/e-util/test-html-editor-units-bugs.c
similarity index 100%
rename from e-util/test-html-editor-units-bugs.c
rename to src/e-util/test-html-editor-units-bugs.c
diff --git a/e-util/test-html-editor-units-bugs.h b/src/e-util/test-html-editor-units-bugs.h
similarity index 100%
rename from e-util/test-html-editor-units-bugs.h
rename to src/e-util/test-html-editor-units-bugs.h
diff --git a/e-util/test-html-editor-units-utils.c b/src/e-util/test-html-editor-units-utils.c
similarity index 100%
rename from e-util/test-html-editor-units-utils.c
rename to src/e-util/test-html-editor-units-utils.c
diff --git a/e-util/test-html-editor-units-utils.h b/src/e-util/test-html-editor-units-utils.h
similarity index 100%
rename from e-util/test-html-editor-units-utils.h
rename to src/e-util/test-html-editor-units-utils.h
diff --git a/e-util/test-html-editor-units.c b/src/e-util/test-html-editor-units.c
similarity index 100%
rename from e-util/test-html-editor-units.c
rename to src/e-util/test-html-editor-units.c
diff --git a/e-util/test-html-editor.c b/src/e-util/test-html-editor.c
similarity index 100%
rename from e-util/test-html-editor.c
rename to src/e-util/test-html-editor.c
diff --git a/e-util/test-keyfile-settings-backend.c b/src/e-util/test-keyfile-settings-backend.c
similarity index 100%
rename from e-util/test-keyfile-settings-backend.c
rename to src/e-util/test-keyfile-settings-backend.c
diff --git a/e-util/test-keyfile-settings-backend.h b/src/e-util/test-keyfile-settings-backend.h
similarity index 100%
rename from e-util/test-keyfile-settings-backend.h
rename to src/e-util/test-keyfile-settings-backend.h
diff --git a/e-util/test-mail-signatures.c b/src/e-util/test-mail-signatures.c
similarity index 100%
rename from e-util/test-mail-signatures.c
rename to src/e-util/test-mail-signatures.c
diff --git a/e-util/test-name-selector.c b/src/e-util/test-name-selector.c
similarity index 100%
rename from e-util/test-name-selector.c
rename to src/e-util/test-name-selector.c
diff --git a/e-util/test-preferences-window.c b/src/e-util/test-preferences-window.c
similarity index 100%
rename from e-util/test-preferences-window.c
rename to src/e-util/test-preferences-window.c
diff --git a/e-util/test-proxy-preferences.c b/src/e-util/test-proxy-preferences.c
similarity index 100%
rename from e-util/test-proxy-preferences.c
rename to src/e-util/test-proxy-preferences.c
diff --git a/e-util/test-source-combo-box.c b/src/e-util/test-source-combo-box.c
similarity index 100%
rename from e-util/test-source-combo-box.c
rename to src/e-util/test-source-combo-box.c
diff --git a/e-util/test-source-config.c b/src/e-util/test-source-config.c
similarity index 100%
rename from e-util/test-source-config.c
rename to src/e-util/test-source-config.c
diff --git a/e-util/test-source-selector.c b/src/e-util/test-source-selector.c
similarity index 100%
rename from e-util/test-source-selector.c
rename to src/e-util/test-source-selector.c
diff --git a/e-util/test-tree-view-frame.c b/src/e-util/test-tree-view-frame.c
similarity index 100%
rename from e-util/test-tree-view-frame.c
rename to src/e-util/test-tree-view-frame.c
diff --git a/e-util/widgets.error.xml b/src/e-util/widgets.error.xml
similarity index 100%
rename from e-util/widgets.error.xml
rename to src/e-util/widgets.error.xml
diff --git a/src/em-format/CMakeLists.txt b/src/em-format/CMakeLists.txt
new file mode 100644
index 0000000..7b6a3d9
--- /dev/null
+++ b/src/em-format/CMakeLists.txt
@@ -0,0 +1,147 @@
+glib_mkenums(e-mail-formatter-enumtypes e-mail-formatter-enums.h E_MAIL_FORMATTER_ENUMTYPES_H)
+
+set(DEPENDENCIES
+ email-engine
+ evolution-shell
+ evolution-util
+)
+
+set(SOURCES
+ e-mail-extension-registry.c
+ e-mail-inline-filter.c
+ e-mail-formatter.c
+ e-mail-formatter-print.c
+ e-mail-formatter-quote.c
+ e-mail-formatter-utils.c
+ e-mail-formatter-attachment.c
+ e-mail-formatter-audio.c
+ e-mail-formatter-error.c
+ e-mail-formatter-extension.c
+ e-mail-formatter-headers.c
+ e-mail-formatter-image.c
+ e-mail-formatter-message-rfc822.c
+ e-mail-formatter-secure-button.c
+ e-mail-formatter-source.c
+ e-mail-formatter-text-enriched.c
+ e-mail-formatter-text-html.c
+ e-mail-formatter-text-plain.c
+ e-mail-formatter-print-headers.c
+ e-mail-formatter-quote-headers.c
+ e-mail-formatter-quote-message-rfc822.c
+ e-mail-formatter-quote-text-enriched.c
+ e-mail-formatter-quote-text-html.c
+ e-mail-formatter-quote-text-plain.c
+ e-mail-parser-extension.c
+ e-mail-parser.c
+ e-mail-parser-application-mbox.c
+ e-mail-parser-audio.c
+ e-mail-parser-headers.c
+ e-mail-parser-image.c
+ e-mail-parser-inlinepgp-encrypted.c
+ e-mail-parser-inlinepgp-signed.c
+ e-mail-parser-message.c
+ e-mail-parser-message-deliverystatus.c
+ e-mail-parser-message-external.c
+ e-mail-parser-message-rfc822.c
+ e-mail-parser-multipart-alternative.c
+ e-mail-parser-multipart-appledouble.c
+ e-mail-parser-multipart-digest.c
+ e-mail-parser-multipart-encrypted.c
+ e-mail-parser-multipart-mixed.c
+ e-mail-parser-multipart-related.c
+ e-mail-parser-multipart-signed.c
+ e-mail-parser-secure-button.c
+ e-mail-parser-source.c
+ e-mail-parser-text-enriched.c
+ e-mail-parser-text-html.c
+ e-mail-parser-text-plain.c
+ e-mail-part.c
+ e-mail-part-attachment.c
+ e-mail-part-audio.c
+ e-mail-part-headers.c
+ e-mail-part-image.c
+ e-mail-part-list.c
+ e-mail-part-secure-button.c
+ e-mail-part-utils.c
+ e-mail-stripsig-filter.c
+ ${CMAKE_CURRENT_BINARY_DIR}/e-mail-formatter-enumtypes.c
+)
+
+if(ENABLE_SMIME)
+ list(APPEND DEPENDENCIES
+ essmime
+ evolution-smime
+ )
+
+ list(APPEND SOURCES
+ e-mail-parser-application-smime.c
+ )
+endif(ENABLE_SMIME)
+
+set(HEADERS
+ e-mail-extension-registry.h
+ e-mail-formatter-extension.h
+ e-mail-formatter.h
+ e-mail-formatter-enums.h
+ e-mail-formatter-print.h
+ e-mail-formatter-quote.h
+ e-mail-formatter-utils.h
+ e-mail-inline-filter.h
+ e-mail-parser-extension.h
+ e-mail-parser.h
+ e-mail-part.h
+ e-mail-part-attachment.h
+ e-mail-part-audio.h
+ e-mail-part-headers.h
+ e-mail-part-image.h
+ e-mail-part-list.h
+ e-mail-part-secure-button.h
+ e-mail-part-utils.h
+ e-mail-stripsig-filter.h
+ ${CMAKE_CURRENT_BINARY_DIR}/e-mail-formatter-enumtypes.h
+)
+
+add_library(evolution-mail-formatter SHARED
+ ${SOURCES}
+ ${HEADERS}
+)
+
+add_dependencies(evolution-mail-formatter
+ ${DEPENDENCIES}
+)
+
+target_compile_definitions(evolution-mail-formatter PRIVATE
+ -DG_LOG_DOMAIN=\"evolution-mail-formatter\"
+ -DEVOLUTION_IMAGESDIR=\"${imagesdir}\"
+ -DEVOLUTION_PRIVDATADIR=\"${privdatadir}\"
+)
+
+target_compile_options(evolution-mail-formatter PUBLIC
+ ${EVOLUTION_DATA_SERVER_CFLAGS}
+ ${GNOME_PLATFORM_CFLAGS}
+)
+
+target_include_directories(evolution-mail-formatter PUBLIC
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}/src
+ ${CMAKE_SOURCE_DIR}/src
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_SOURCE_DIR}/src/smime/lib
+ ${CMAKE_SOURCE_DIR}/src/smime/gui
+ ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+ ${GNOME_PLATFORM_INCLUDE_DIRS}
+)
+
+target_link_libraries(evolution-mail-formatter
+ ${DEPENDENCIES}
+ ${EVOLUTION_DATA_SERVER_LDFLAGS}
+ ${GNOME_PLATFORM_LDFLAGS}
+)
+
+install(TARGETS evolution-mail-formatter
+ DESTINATION ${privsolibdir}
+)
+
+install(FILES ${HEADERS}
+ DESTINATION ${privincludedir}/em-format
+)
diff --git a/em-format/e-mail-extension-registry.c b/src/em-format/e-mail-extension-registry.c
similarity index 100%
rename from em-format/e-mail-extension-registry.c
rename to src/em-format/e-mail-extension-registry.c
diff --git a/em-format/e-mail-extension-registry.h b/src/em-format/e-mail-extension-registry.h
similarity index 100%
rename from em-format/e-mail-extension-registry.h
rename to src/em-format/e-mail-extension-registry.h
diff --git a/em-format/e-mail-formatter-attachment.c b/src/em-format/e-mail-formatter-attachment.c
similarity index 100%
rename from em-format/e-mail-formatter-attachment.c
rename to src/em-format/e-mail-formatter-attachment.c
diff --git a/em-format/e-mail-formatter-audio.c b/src/em-format/e-mail-formatter-audio.c
similarity index 100%
rename from em-format/e-mail-formatter-audio.c
rename to src/em-format/e-mail-formatter-audio.c
diff --git a/em-format/e-mail-formatter-enums.h b/src/em-format/e-mail-formatter-enums.h
similarity index 100%
rename from em-format/e-mail-formatter-enums.h
rename to src/em-format/e-mail-formatter-enums.h
diff --git a/em-format/e-mail-formatter-error.c b/src/em-format/e-mail-formatter-error.c
similarity index 100%
rename from em-format/e-mail-formatter-error.c
rename to src/em-format/e-mail-formatter-error.c
diff --git a/em-format/e-mail-formatter-extension.c b/src/em-format/e-mail-formatter-extension.c
similarity index 100%
rename from em-format/e-mail-formatter-extension.c
rename to src/em-format/e-mail-formatter-extension.c
diff --git a/em-format/e-mail-formatter-extension.h b/src/em-format/e-mail-formatter-extension.h
similarity index 100%
rename from em-format/e-mail-formatter-extension.h
rename to src/em-format/e-mail-formatter-extension.h
diff --git a/em-format/e-mail-formatter-headers.c b/src/em-format/e-mail-formatter-headers.c
similarity index 100%
rename from em-format/e-mail-formatter-headers.c
rename to src/em-format/e-mail-formatter-headers.c
diff --git a/em-format/e-mail-formatter-image.c b/src/em-format/e-mail-formatter-image.c
similarity index 100%
rename from em-format/e-mail-formatter-image.c
rename to src/em-format/e-mail-formatter-image.c
diff --git a/em-format/e-mail-formatter-message-rfc822.c b/src/em-format/e-mail-formatter-message-rfc822.c
similarity index 100%
rename from em-format/e-mail-formatter-message-rfc822.c
rename to src/em-format/e-mail-formatter-message-rfc822.c
diff --git a/em-format/e-mail-formatter-print-headers.c b/src/em-format/e-mail-formatter-print-headers.c
similarity index 100%
rename from em-format/e-mail-formatter-print-headers.c
rename to src/em-format/e-mail-formatter-print-headers.c
diff --git a/em-format/e-mail-formatter-print.c b/src/em-format/e-mail-formatter-print.c
similarity index 100%
rename from em-format/e-mail-formatter-print.c
rename to src/em-format/e-mail-formatter-print.c
diff --git a/em-format/e-mail-formatter-print.h b/src/em-format/e-mail-formatter-print.h
similarity index 100%
rename from em-format/e-mail-formatter-print.h
rename to src/em-format/e-mail-formatter-print.h
diff --git a/em-format/e-mail-formatter-quote-headers.c b/src/em-format/e-mail-formatter-quote-headers.c
similarity index 100%
rename from em-format/e-mail-formatter-quote-headers.c
rename to src/em-format/e-mail-formatter-quote-headers.c
diff --git a/em-format/e-mail-formatter-quote-message-rfc822.c
b/src/em-format/e-mail-formatter-quote-message-rfc822.c
similarity index 100%
rename from em-format/e-mail-formatter-quote-message-rfc822.c
rename to src/em-format/e-mail-formatter-quote-message-rfc822.c
diff --git a/em-format/e-mail-formatter-quote-text-enriched.c
b/src/em-format/e-mail-formatter-quote-text-enriched.c
similarity index 100%
rename from em-format/e-mail-formatter-quote-text-enriched.c
rename to src/em-format/e-mail-formatter-quote-text-enriched.c
diff --git a/em-format/e-mail-formatter-quote-text-html.c b/src/em-format/e-mail-formatter-quote-text-html.c
similarity index 100%
rename from em-format/e-mail-formatter-quote-text-html.c
rename to src/em-format/e-mail-formatter-quote-text-html.c
diff --git a/em-format/e-mail-formatter-quote-text-plain.c b/src/em-format/e-mail-formatter-quote-text-plain.c
similarity index 100%
rename from em-format/e-mail-formatter-quote-text-plain.c
rename to src/em-format/e-mail-formatter-quote-text-plain.c
diff --git a/em-format/e-mail-formatter-quote.c b/src/em-format/e-mail-formatter-quote.c
similarity index 100%
rename from em-format/e-mail-formatter-quote.c
rename to src/em-format/e-mail-formatter-quote.c
diff --git a/em-format/e-mail-formatter-quote.h b/src/em-format/e-mail-formatter-quote.h
similarity index 100%
rename from em-format/e-mail-formatter-quote.h
rename to src/em-format/e-mail-formatter-quote.h
diff --git a/em-format/e-mail-formatter-secure-button.c b/src/em-format/e-mail-formatter-secure-button.c
similarity index 100%
rename from em-format/e-mail-formatter-secure-button.c
rename to src/em-format/e-mail-formatter-secure-button.c
diff --git a/em-format/e-mail-formatter-source.c b/src/em-format/e-mail-formatter-source.c
similarity index 100%
rename from em-format/e-mail-formatter-source.c
rename to src/em-format/e-mail-formatter-source.c
diff --git a/em-format/e-mail-formatter-text-enriched.c b/src/em-format/e-mail-formatter-text-enriched.c
similarity index 100%
rename from em-format/e-mail-formatter-text-enriched.c
rename to src/em-format/e-mail-formatter-text-enriched.c
diff --git a/em-format/e-mail-formatter-text-html.c b/src/em-format/e-mail-formatter-text-html.c
similarity index 100%
rename from em-format/e-mail-formatter-text-html.c
rename to src/em-format/e-mail-formatter-text-html.c
diff --git a/em-format/e-mail-formatter-text-plain.c b/src/em-format/e-mail-formatter-text-plain.c
similarity index 100%
rename from em-format/e-mail-formatter-text-plain.c
rename to src/em-format/e-mail-formatter-text-plain.c
diff --git a/em-format/e-mail-formatter-utils.c b/src/em-format/e-mail-formatter-utils.c
similarity index 100%
rename from em-format/e-mail-formatter-utils.c
rename to src/em-format/e-mail-formatter-utils.c
diff --git a/em-format/e-mail-formatter-utils.h b/src/em-format/e-mail-formatter-utils.h
similarity index 100%
rename from em-format/e-mail-formatter-utils.h
rename to src/em-format/e-mail-formatter-utils.h
diff --git a/em-format/e-mail-formatter.c b/src/em-format/e-mail-formatter.c
similarity index 100%
rename from em-format/e-mail-formatter.c
rename to src/em-format/e-mail-formatter.c
diff --git a/em-format/e-mail-formatter.h b/src/em-format/e-mail-formatter.h
similarity index 100%
rename from em-format/e-mail-formatter.h
rename to src/em-format/e-mail-formatter.h
diff --git a/em-format/e-mail-inline-filter.c b/src/em-format/e-mail-inline-filter.c
similarity index 100%
rename from em-format/e-mail-inline-filter.c
rename to src/em-format/e-mail-inline-filter.c
diff --git a/em-format/e-mail-inline-filter.h b/src/em-format/e-mail-inline-filter.h
similarity index 100%
rename from em-format/e-mail-inline-filter.h
rename to src/em-format/e-mail-inline-filter.h
diff --git a/em-format/e-mail-parser-application-mbox.c b/src/em-format/e-mail-parser-application-mbox.c
similarity index 100%
rename from em-format/e-mail-parser-application-mbox.c
rename to src/em-format/e-mail-parser-application-mbox.c
diff --git a/em-format/e-mail-parser-application-smime.c b/src/em-format/e-mail-parser-application-smime.c
similarity index 100%
rename from em-format/e-mail-parser-application-smime.c
rename to src/em-format/e-mail-parser-application-smime.c
diff --git a/em-format/e-mail-parser-audio.c b/src/em-format/e-mail-parser-audio.c
similarity index 100%
rename from em-format/e-mail-parser-audio.c
rename to src/em-format/e-mail-parser-audio.c
diff --git a/em-format/e-mail-parser-extension.c b/src/em-format/e-mail-parser-extension.c
similarity index 100%
rename from em-format/e-mail-parser-extension.c
rename to src/em-format/e-mail-parser-extension.c
diff --git a/em-format/e-mail-parser-extension.h b/src/em-format/e-mail-parser-extension.h
similarity index 100%
rename from em-format/e-mail-parser-extension.h
rename to src/em-format/e-mail-parser-extension.h
diff --git a/em-format/e-mail-parser-headers.c b/src/em-format/e-mail-parser-headers.c
similarity index 100%
rename from em-format/e-mail-parser-headers.c
rename to src/em-format/e-mail-parser-headers.c
diff --git a/em-format/e-mail-parser-image.c b/src/em-format/e-mail-parser-image.c
similarity index 100%
rename from em-format/e-mail-parser-image.c
rename to src/em-format/e-mail-parser-image.c
diff --git a/em-format/e-mail-parser-inlinepgp-encrypted.c b/src/em-format/e-mail-parser-inlinepgp-encrypted.c
similarity index 100%
rename from em-format/e-mail-parser-inlinepgp-encrypted.c
rename to src/em-format/e-mail-parser-inlinepgp-encrypted.c
diff --git a/em-format/e-mail-parser-inlinepgp-signed.c b/src/em-format/e-mail-parser-inlinepgp-signed.c
similarity index 100%
rename from em-format/e-mail-parser-inlinepgp-signed.c
rename to src/em-format/e-mail-parser-inlinepgp-signed.c
diff --git a/em-format/e-mail-parser-message-deliverystatus.c
b/src/em-format/e-mail-parser-message-deliverystatus.c
similarity index 100%
rename from em-format/e-mail-parser-message-deliverystatus.c
rename to src/em-format/e-mail-parser-message-deliverystatus.c
diff --git a/em-format/e-mail-parser-message-external.c b/src/em-format/e-mail-parser-message-external.c
similarity index 100%
rename from em-format/e-mail-parser-message-external.c
rename to src/em-format/e-mail-parser-message-external.c
diff --git a/em-format/e-mail-parser-message-rfc822.c b/src/em-format/e-mail-parser-message-rfc822.c
similarity index 100%
rename from em-format/e-mail-parser-message-rfc822.c
rename to src/em-format/e-mail-parser-message-rfc822.c
diff --git a/em-format/e-mail-parser-message.c b/src/em-format/e-mail-parser-message.c
similarity index 100%
rename from em-format/e-mail-parser-message.c
rename to src/em-format/e-mail-parser-message.c
diff --git a/em-format/e-mail-parser-multipart-alternative.c
b/src/em-format/e-mail-parser-multipart-alternative.c
similarity index 100%
rename from em-format/e-mail-parser-multipart-alternative.c
rename to src/em-format/e-mail-parser-multipart-alternative.c
diff --git a/em-format/e-mail-parser-multipart-appledouble.c
b/src/em-format/e-mail-parser-multipart-appledouble.c
similarity index 100%
rename from em-format/e-mail-parser-multipart-appledouble.c
rename to src/em-format/e-mail-parser-multipart-appledouble.c
diff --git a/em-format/e-mail-parser-multipart-digest.c b/src/em-format/e-mail-parser-multipart-digest.c
similarity index 100%
rename from em-format/e-mail-parser-multipart-digest.c
rename to src/em-format/e-mail-parser-multipart-digest.c
diff --git a/em-format/e-mail-parser-multipart-encrypted.c b/src/em-format/e-mail-parser-multipart-encrypted.c
similarity index 100%
rename from em-format/e-mail-parser-multipart-encrypted.c
rename to src/em-format/e-mail-parser-multipart-encrypted.c
diff --git a/em-format/e-mail-parser-multipart-mixed.c b/src/em-format/e-mail-parser-multipart-mixed.c
similarity index 100%
rename from em-format/e-mail-parser-multipart-mixed.c
rename to src/em-format/e-mail-parser-multipart-mixed.c
diff --git a/em-format/e-mail-parser-multipart-related.c b/src/em-format/e-mail-parser-multipart-related.c
similarity index 100%
rename from em-format/e-mail-parser-multipart-related.c
rename to src/em-format/e-mail-parser-multipart-related.c
diff --git a/em-format/e-mail-parser-multipart-signed.c b/src/em-format/e-mail-parser-multipart-signed.c
similarity index 100%
rename from em-format/e-mail-parser-multipart-signed.c
rename to src/em-format/e-mail-parser-multipart-signed.c
diff --git a/em-format/e-mail-parser-secure-button.c b/src/em-format/e-mail-parser-secure-button.c
similarity index 100%
rename from em-format/e-mail-parser-secure-button.c
rename to src/em-format/e-mail-parser-secure-button.c
diff --git a/em-format/e-mail-parser-source.c b/src/em-format/e-mail-parser-source.c
similarity index 100%
rename from em-format/e-mail-parser-source.c
rename to src/em-format/e-mail-parser-source.c
diff --git a/em-format/e-mail-parser-text-enriched.c b/src/em-format/e-mail-parser-text-enriched.c
similarity index 100%
rename from em-format/e-mail-parser-text-enriched.c
rename to src/em-format/e-mail-parser-text-enriched.c
diff --git a/em-format/e-mail-parser-text-html.c b/src/em-format/e-mail-parser-text-html.c
similarity index 100%
rename from em-format/e-mail-parser-text-html.c
rename to src/em-format/e-mail-parser-text-html.c
diff --git a/em-format/e-mail-parser-text-plain.c b/src/em-format/e-mail-parser-text-plain.c
similarity index 100%
rename from em-format/e-mail-parser-text-plain.c
rename to src/em-format/e-mail-parser-text-plain.c
diff --git a/em-format/e-mail-parser.c b/src/em-format/e-mail-parser.c
similarity index 100%
rename from em-format/e-mail-parser.c
rename to src/em-format/e-mail-parser.c
diff --git a/em-format/e-mail-parser.h b/src/em-format/e-mail-parser.h
similarity index 100%
rename from em-format/e-mail-parser.h
rename to src/em-format/e-mail-parser.h
diff --git a/em-format/e-mail-part-attachment.c b/src/em-format/e-mail-part-attachment.c
similarity index 100%
rename from em-format/e-mail-part-attachment.c
rename to src/em-format/e-mail-part-attachment.c
diff --git a/em-format/e-mail-part-attachment.h b/src/em-format/e-mail-part-attachment.h
similarity index 100%
rename from em-format/e-mail-part-attachment.h
rename to src/em-format/e-mail-part-attachment.h
diff --git a/em-format/e-mail-part-audio.c b/src/em-format/e-mail-part-audio.c
similarity index 100%
rename from em-format/e-mail-part-audio.c
rename to src/em-format/e-mail-part-audio.c
diff --git a/em-format/e-mail-part-audio.h b/src/em-format/e-mail-part-audio.h
similarity index 100%
rename from em-format/e-mail-part-audio.h
rename to src/em-format/e-mail-part-audio.h
diff --git a/em-format/e-mail-part-headers.c b/src/em-format/e-mail-part-headers.c
similarity index 100%
rename from em-format/e-mail-part-headers.c
rename to src/em-format/e-mail-part-headers.c
diff --git a/em-format/e-mail-part-headers.h b/src/em-format/e-mail-part-headers.h
similarity index 100%
rename from em-format/e-mail-part-headers.h
rename to src/em-format/e-mail-part-headers.h
diff --git a/em-format/e-mail-part-image.c b/src/em-format/e-mail-part-image.c
similarity index 100%
rename from em-format/e-mail-part-image.c
rename to src/em-format/e-mail-part-image.c
diff --git a/em-format/e-mail-part-image.h b/src/em-format/e-mail-part-image.h
similarity index 100%
rename from em-format/e-mail-part-image.h
rename to src/em-format/e-mail-part-image.h
diff --git a/em-format/e-mail-part-list.c b/src/em-format/e-mail-part-list.c
similarity index 100%
rename from em-format/e-mail-part-list.c
rename to src/em-format/e-mail-part-list.c
diff --git a/em-format/e-mail-part-list.h b/src/em-format/e-mail-part-list.h
similarity index 100%
rename from em-format/e-mail-part-list.h
rename to src/em-format/e-mail-part-list.h
diff --git a/em-format/e-mail-part-secure-button.c b/src/em-format/e-mail-part-secure-button.c
similarity index 100%
rename from em-format/e-mail-part-secure-button.c
rename to src/em-format/e-mail-part-secure-button.c
diff --git a/em-format/e-mail-part-secure-button.h b/src/em-format/e-mail-part-secure-button.h
similarity index 100%
rename from em-format/e-mail-part-secure-button.h
rename to src/em-format/e-mail-part-secure-button.h
diff --git a/em-format/e-mail-part-utils.c b/src/em-format/e-mail-part-utils.c
similarity index 100%
rename from em-format/e-mail-part-utils.c
rename to src/em-format/e-mail-part-utils.c
diff --git a/em-format/e-mail-part-utils.h b/src/em-format/e-mail-part-utils.h
similarity index 100%
rename from em-format/e-mail-part-utils.h
rename to src/em-format/e-mail-part-utils.h
diff --git a/em-format/e-mail-part.c b/src/em-format/e-mail-part.c
similarity index 100%
rename from em-format/e-mail-part.c
rename to src/em-format/e-mail-part.c
diff --git a/em-format/e-mail-part.h b/src/em-format/e-mail-part.h
similarity index 100%
rename from em-format/e-mail-part.h
rename to src/em-format/e-mail-part.h
diff --git a/em-format/e-mail-stripsig-filter.c b/src/em-format/e-mail-stripsig-filter.c
similarity index 100%
rename from em-format/e-mail-stripsig-filter.c
rename to src/em-format/e-mail-stripsig-filter.c
diff --git a/em-format/e-mail-stripsig-filter.h b/src/em-format/e-mail-stripsig-filter.h
similarity index 100%
rename from em-format/e-mail-stripsig-filter.h
rename to src/em-format/e-mail-stripsig-filter.h
diff --git a/src/glade/CMakeLists.txt b/src/glade/CMakeLists.txt
new file mode 100644
index 0000000..c887c6d
--- /dev/null
+++ b/src/glade/CMakeLists.txt
@@ -0,0 +1,53 @@
+pkg_check_variable(glade_prefix gladeui-2.0 prefix)
+pkg_check_variable(glade_catalogdir gladeui-2.0 catalogdir)
+pkg_check_variable(glade_moduledir gladeui-2.0 moduledir)
+
+# To honor configured prefix, but still use the right place
+string(REPLACE "${glade_prefix}" "${CMAKE_INSTALL_PREFIX}" glade_catalogdir "${glade_catalogdir}")
+string(REPLACE "${glade_prefix}" "${CMAKE_INSTALL_PREFIX}" glade_moduledir "${glade_moduledir}")
+
+install(FILES evolution.xml
+ DESTINATION ${glade_catalogdir}
+)
+
+set(DEPENDENCIES
+ evolution-calendar
+ evolution-mail
+ evolution-util
+)
+
+add_library(gladeevolution MODULE
+ gladeevolution.c
+)
+
+add_dependencies(gladeevolution
+ ${DEPENDENCIES}
+)
+
+target_compile_definitions(gladeevolution PRIVATE
+ -DG_LOG_DOMAIN=\"gladeevolution\"
+)
+
+target_compile_options(gladeevolution PUBLIC
+ ${EVOLUTION_DATA_SERVER_CFLAGS}
+ ${GNOME_PLATFORM_CFLAGS}
+)
+
+target_include_directories(gladeevolution PUBLIC
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}/src
+ ${CMAKE_SOURCE_DIR}/src
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+ ${GNOME_PLATFORM_INCLUDE_DIRS}
+)
+
+target_link_libraries(gladeevolution
+ ${DEPENDENCIES}
+ ${EVOLUTION_DATA_SERVER_LDFLAGS}
+ ${GNOME_PLATFORM_LDFLAGS}
+)
+
+install(TARGETS gladeevolution
+ DESTINATION ${glade_moduledir}
+)
diff --git a/maint/evolution.xml b/src/glade/evolution.xml
similarity index 100%
rename from maint/evolution.xml
rename to src/glade/evolution.xml
diff --git a/maint/gladeevolution.c b/src/glade/gladeevolution.c
similarity index 100%
rename from maint/gladeevolution.c
rename to src/glade/gladeevolution.c
diff --git a/src/libemail-engine/CMakeLists.txt b/src/libemail-engine/CMakeLists.txt
new file mode 100644
index 0000000..2946599
--- /dev/null
+++ b/src/libemail-engine/CMakeLists.txt
@@ -0,0 +1,95 @@
+glib_mkenums(e-mail-engine-enumtypes e-mail-engine-enums.h E_MAIL_ENGINE_ENUMTYPES_H)
+add_pkgconfig_file(libemail-engine.pc.in libemail-engine.pc)
+
+set(DEPENDENCIES
+ evolution-util
+)
+
+set(SOURCES
+ camel-null-store.c
+ camel-sasl-oauth2-google.c
+ camel-sasl-xoauth2.c
+ e-mail-folder-utils.c
+ e-mail-junk-filter.c
+ e-mail-session-utils.c
+ 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
+ ${CMAKE_CURRENT_BINARY_DIR}/e-mail-engine-enumtypes.c
+)
+
+set(HEADERS
+ libemail-engine.h
+ camel-null-store.h
+ camel-sasl-oauth2-google.h
+ camel-sasl-xoauth2.h
+ e-mail-engine-enums.h
+ e-mail-folder-utils.h
+ e-mail-junk-filter.h
+ e-mail-session-utils.h
+ 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
+ ${CMAKE_CURRENT_BINARY_DIR}/e-mail-engine-enumtypes.h
+)
+
+add_library(email-engine SHARED
+ ${SOURCES}
+ ${HEADERS}
+)
+
+add_dependencies(email-engine
+ ${DEPENDENCIES}
+)
+
+target_compile_definitions(email-engine PRIVATE
+ -DG_LOG_DOMAIN=\"e-mail-engine\"
+ -DEVOLUTION_PRIVDATADIR=\"${privdatadir}\"
+ -DLIBEMAIL_ENGINE_COMPILATION
+)
+
+target_compile_options(email-engine PUBLIC
+ ${EVOLUTION_DATA_SERVER_CFLAGS}
+ ${GNOME_PLATFORM_CFLAGS}
+)
+
+target_include_directories(email-engine PUBLIC
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}/src
+ ${CMAKE_SOURCE_DIR}/src
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+ ${GNOME_PLATFORM_INCLUDE_DIRS}
+)
+
+target_link_libraries(email-engine
+ ${DEPENDENCIES}
+ ${EVOLUTION_DATA_SERVER_LDFLAGS}
+ ${GNOME_PLATFORM_LDFLAGS}
+)
+
+install(TARGETS email-engine
+ DESTINATION ${privsolibdir}
+)
+
+install(FILES ${HEADERS}
+ DESTINATION ${privincludedir}/libemail-engine
+)
diff --git a/libemail-engine/camel-null-store.c b/src/libemail-engine/camel-null-store.c
similarity index 100%
rename from libemail-engine/camel-null-store.c
rename to src/libemail-engine/camel-null-store.c
diff --git a/libemail-engine/camel-null-store.h b/src/libemail-engine/camel-null-store.h
similarity index 100%
rename from libemail-engine/camel-null-store.h
rename to src/libemail-engine/camel-null-store.h
diff --git a/libemail-engine/camel-sasl-oauth2-google.c b/src/libemail-engine/camel-sasl-oauth2-google.c
similarity index 100%
rename from libemail-engine/camel-sasl-oauth2-google.c
rename to src/libemail-engine/camel-sasl-oauth2-google.c
diff --git a/libemail-engine/camel-sasl-oauth2-google.h b/src/libemail-engine/camel-sasl-oauth2-google.h
similarity index 100%
rename from libemail-engine/camel-sasl-oauth2-google.h
rename to src/libemail-engine/camel-sasl-oauth2-google.h
diff --git a/libemail-engine/camel-sasl-xoauth2.c b/src/libemail-engine/camel-sasl-xoauth2.c
similarity index 100%
rename from libemail-engine/camel-sasl-xoauth2.c
rename to src/libemail-engine/camel-sasl-xoauth2.c
diff --git a/libemail-engine/camel-sasl-xoauth2.h b/src/libemail-engine/camel-sasl-xoauth2.h
similarity index 100%
rename from libemail-engine/camel-sasl-xoauth2.h
rename to src/libemail-engine/camel-sasl-xoauth2.h
diff --git a/libemail-engine/e-mail-engine-enums.h b/src/libemail-engine/e-mail-engine-enums.h
similarity index 100%
rename from libemail-engine/e-mail-engine-enums.h
rename to src/libemail-engine/e-mail-engine-enums.h
diff --git a/libemail-engine/e-mail-folder-utils.c b/src/libemail-engine/e-mail-folder-utils.c
similarity index 100%
rename from libemail-engine/e-mail-folder-utils.c
rename to src/libemail-engine/e-mail-folder-utils.c
diff --git a/libemail-engine/e-mail-folder-utils.h b/src/libemail-engine/e-mail-folder-utils.h
similarity index 100%
rename from libemail-engine/e-mail-folder-utils.h
rename to src/libemail-engine/e-mail-folder-utils.h
diff --git a/libemail-engine/e-mail-junk-filter.c b/src/libemail-engine/e-mail-junk-filter.c
similarity index 100%
rename from libemail-engine/e-mail-junk-filter.c
rename to src/libemail-engine/e-mail-junk-filter.c
diff --git a/libemail-engine/e-mail-junk-filter.h b/src/libemail-engine/e-mail-junk-filter.h
similarity index 100%
rename from libemail-engine/e-mail-junk-filter.h
rename to src/libemail-engine/e-mail-junk-filter.h
diff --git a/libemail-engine/e-mail-session-utils.c b/src/libemail-engine/e-mail-session-utils.c
similarity index 100%
rename from libemail-engine/e-mail-session-utils.c
rename to src/libemail-engine/e-mail-session-utils.c
diff --git a/libemail-engine/e-mail-session-utils.h b/src/libemail-engine/e-mail-session-utils.h
similarity index 100%
rename from libemail-engine/e-mail-session-utils.h
rename to src/libemail-engine/e-mail-session-utils.h
diff --git a/libemail-engine/e-mail-session.c b/src/libemail-engine/e-mail-session.c
similarity index 100%
rename from libemail-engine/e-mail-session.c
rename to src/libemail-engine/e-mail-session.c
diff --git a/libemail-engine/e-mail-session.h b/src/libemail-engine/e-mail-session.h
similarity index 100%
rename from libemail-engine/e-mail-session.h
rename to src/libemail-engine/e-mail-session.h
diff --git a/libemail-engine/e-mail-store-utils.c b/src/libemail-engine/e-mail-store-utils.c
similarity index 100%
rename from libemail-engine/e-mail-store-utils.c
rename to src/libemail-engine/e-mail-store-utils.c
diff --git a/libemail-engine/e-mail-store-utils.h b/src/libemail-engine/e-mail-store-utils.h
similarity index 100%
rename from libemail-engine/e-mail-store-utils.h
rename to src/libemail-engine/e-mail-store-utils.h
diff --git a/libemail-engine/e-mail-utils.c b/src/libemail-engine/e-mail-utils.c
similarity index 100%
rename from libemail-engine/e-mail-utils.c
rename to src/libemail-engine/e-mail-utils.c
diff --git a/libemail-engine/e-mail-utils.h b/src/libemail-engine/e-mail-utils.h
similarity index 100%
rename from libemail-engine/e-mail-utils.h
rename to src/libemail-engine/e-mail-utils.h
diff --git a/libemail-engine/em-filter-folder-element.c b/src/libemail-engine/em-filter-folder-element.c
similarity index 100%
rename from libemail-engine/em-filter-folder-element.c
rename to src/libemail-engine/em-filter-folder-element.c
diff --git a/libemail-engine/em-filter-folder-element.h b/src/libemail-engine/em-filter-folder-element.h
similarity index 100%
rename from libemail-engine/em-filter-folder-element.h
rename to src/libemail-engine/em-filter-folder-element.h
diff --git a/libemail-engine/em-vfolder-context.c b/src/libemail-engine/em-vfolder-context.c
similarity index 100%
rename from libemail-engine/em-vfolder-context.c
rename to src/libemail-engine/em-vfolder-context.c
diff --git a/libemail-engine/em-vfolder-context.h b/src/libemail-engine/em-vfolder-context.h
similarity index 100%
rename from libemail-engine/em-vfolder-context.h
rename to src/libemail-engine/em-vfolder-context.h
diff --git a/libemail-engine/em-vfolder-rule.c b/src/libemail-engine/em-vfolder-rule.c
similarity index 100%
rename from libemail-engine/em-vfolder-rule.c
rename to src/libemail-engine/em-vfolder-rule.c
diff --git a/libemail-engine/em-vfolder-rule.h b/src/libemail-engine/em-vfolder-rule.h
similarity index 100%
rename from libemail-engine/em-vfolder-rule.h
rename to src/libemail-engine/em-vfolder-rule.h
diff --git a/libemail-engine/libemail-engine.h b/src/libemail-engine/libemail-engine.h
similarity index 100%
rename from libemail-engine/libemail-engine.h
rename to src/libemail-engine/libemail-engine.h
diff --git a/libemail-engine/libemail-engine.pc.in b/src/libemail-engine/libemail-engine.pc.in
similarity index 100%
rename from libemail-engine/libemail-engine.pc.in
rename to src/libemail-engine/libemail-engine.pc.in
diff --git a/libemail-engine/mail-config.c b/src/libemail-engine/mail-config.c
similarity index 100%
rename from libemail-engine/mail-config.c
rename to src/libemail-engine/mail-config.c
diff --git a/libemail-engine/mail-config.h b/src/libemail-engine/mail-config.h
similarity index 100%
rename from libemail-engine/mail-config.h
rename to src/libemail-engine/mail-config.h
diff --git a/libemail-engine/mail-folder-cache.c b/src/libemail-engine/mail-folder-cache.c
similarity index 100%
rename from libemail-engine/mail-folder-cache.c
rename to src/libemail-engine/mail-folder-cache.c
diff --git a/libemail-engine/mail-folder-cache.h b/src/libemail-engine/mail-folder-cache.h
similarity index 100%
rename from libemail-engine/mail-folder-cache.h
rename to src/libemail-engine/mail-folder-cache.h
diff --git a/libemail-engine/mail-mt.c b/src/libemail-engine/mail-mt.c
similarity index 100%
rename from libemail-engine/mail-mt.c
rename to src/libemail-engine/mail-mt.c
diff --git a/libemail-engine/mail-mt.h b/src/libemail-engine/mail-mt.h
similarity index 100%
rename from libemail-engine/mail-mt.h
rename to src/libemail-engine/mail-mt.h
diff --git a/libemail-engine/mail-ops.c b/src/libemail-engine/mail-ops.c
similarity index 100%
rename from libemail-engine/mail-ops.c
rename to src/libemail-engine/mail-ops.c
diff --git a/libemail-engine/mail-ops.h b/src/libemail-engine/mail-ops.h
similarity index 100%
rename from libemail-engine/mail-ops.h
rename to src/libemail-engine/mail-ops.h
diff --git a/libemail-engine/mail-tools.c b/src/libemail-engine/mail-tools.c
similarity index 100%
rename from libemail-engine/mail-tools.c
rename to src/libemail-engine/mail-tools.c
diff --git a/libemail-engine/mail-tools.h b/src/libemail-engine/mail-tools.h
similarity index 100%
rename from libemail-engine/mail-tools.h
rename to src/libemail-engine/mail-tools.h
diff --git a/libemail-engine/mail-vfolder.c b/src/libemail-engine/mail-vfolder.c
similarity index 100%
rename from libemail-engine/mail-vfolder.c
rename to src/libemail-engine/mail-vfolder.c
diff --git a/libemail-engine/mail-vfolder.h b/src/libemail-engine/mail-vfolder.h
similarity index 100%
rename from libemail-engine/mail-vfolder.h
rename to src/libemail-engine/mail-vfolder.h
diff --git a/src/libgnomecanvas/CMakeLists.txt b/src/libgnomecanvas/CMakeLists.txt
new file mode 100644
index 0000000..167fb0a
--- /dev/null
+++ b/src/libgnomecanvas/CMakeLists.txt
@@ -0,0 +1,72 @@
+set(SOURCES
+ gailcanvas.c
+ gailcanvasgroup.c
+ gailcanvasgroupfactory.c
+ gailcanvasitem.c
+ gailcanvasitemfactory.c
+ gailcanvastext.c
+ gailcanvastextfactory.c
+ gailcanvaswidget.c
+ gailcanvaswidgetfactory.c
+ gnome-canvas-pixbuf.c
+ gnome-canvas-rect.c
+ gnome-canvas-text.c
+ gnome-canvas-util.c
+ gnome-canvas-widget.c
+ gnome-canvas.c
+)
+
+set(HEADERS
+ gailcanvas.h
+ gailcanvasgroup.h
+ gailcanvasgroupfactory.h
+ gailcanvasitem.h
+ gailcanvasitemfactory.h
+ gailcanvastext.h
+ gailcanvastextfactory.h
+ gailcanvaswidget.h
+ gailcanvaswidgetfactory.h
+ gnome-canvas-i18n.h
+ gnome-canvas-pixbuf.h
+ gnome-canvas-rect.h
+ gnome-canvas-text.h
+ gnome-canvas-util.h
+ gnome-canvas-widget.h
+ gnome-canvas.h
+ libgnomecanvas.h
+)
+
+add_library(gnomecanvas SHARED
+ ${SOURCES}
+ ${HEADERS}
+)
+
+target_compile_definitions(gnomecanvas PRIVATE
+ -DG_LOG_DOMAIN=\"GnomeCanvas\"
+)
+
+target_compile_options(gnomecanvas PUBLIC
+ ${GNOME_PLATFORM_CFLAGS}
+)
+
+target_include_directories(gnomecanvas PUBLIC
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}/src
+ ${CMAKE_SOURCE_DIR}/src
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${GNOME_PLATFORM_INCLUDE_DIRS}
+)
+
+target_link_libraries(gnomecanvas
+ ${GNOME_PLATFORM_LDFLAGS}
+ ${MATH_LDFLAGS}
+)
+
+install(TARGETS gnomecanvas
+ DESTINATION ${privsolibdir}
+)
+
+install(FILES ${HEADERS}
+ DESTINATION ${privincludedir}/libgnomecanvas
+)
diff --git a/libgnomecanvas/gailcanvas.c b/src/libgnomecanvas/gailcanvas.c
similarity index 100%
rename from libgnomecanvas/gailcanvas.c
rename to src/libgnomecanvas/gailcanvas.c
diff --git a/libgnomecanvas/gailcanvas.h b/src/libgnomecanvas/gailcanvas.h
similarity index 100%
rename from libgnomecanvas/gailcanvas.h
rename to src/libgnomecanvas/gailcanvas.h
diff --git a/libgnomecanvas/gailcanvasgroup.c b/src/libgnomecanvas/gailcanvasgroup.c
similarity index 100%
rename from libgnomecanvas/gailcanvasgroup.c
rename to src/libgnomecanvas/gailcanvasgroup.c
diff --git a/libgnomecanvas/gailcanvasgroup.h b/src/libgnomecanvas/gailcanvasgroup.h
similarity index 100%
rename from libgnomecanvas/gailcanvasgroup.h
rename to src/libgnomecanvas/gailcanvasgroup.h
diff --git a/libgnomecanvas/gailcanvasgroupfactory.c b/src/libgnomecanvas/gailcanvasgroupfactory.c
similarity index 100%
rename from libgnomecanvas/gailcanvasgroupfactory.c
rename to src/libgnomecanvas/gailcanvasgroupfactory.c
diff --git a/libgnomecanvas/gailcanvasgroupfactory.h b/src/libgnomecanvas/gailcanvasgroupfactory.h
similarity index 100%
rename from libgnomecanvas/gailcanvasgroupfactory.h
rename to src/libgnomecanvas/gailcanvasgroupfactory.h
diff --git a/libgnomecanvas/gailcanvasitem.c b/src/libgnomecanvas/gailcanvasitem.c
similarity index 100%
rename from libgnomecanvas/gailcanvasitem.c
rename to src/libgnomecanvas/gailcanvasitem.c
diff --git a/libgnomecanvas/gailcanvasitem.h b/src/libgnomecanvas/gailcanvasitem.h
similarity index 100%
rename from libgnomecanvas/gailcanvasitem.h
rename to src/libgnomecanvas/gailcanvasitem.h
diff --git a/libgnomecanvas/gailcanvasitemfactory.c b/src/libgnomecanvas/gailcanvasitemfactory.c
similarity index 100%
rename from libgnomecanvas/gailcanvasitemfactory.c
rename to src/libgnomecanvas/gailcanvasitemfactory.c
diff --git a/libgnomecanvas/gailcanvasitemfactory.h b/src/libgnomecanvas/gailcanvasitemfactory.h
similarity index 100%
rename from libgnomecanvas/gailcanvasitemfactory.h
rename to src/libgnomecanvas/gailcanvasitemfactory.h
diff --git a/libgnomecanvas/gailcanvastext.c b/src/libgnomecanvas/gailcanvastext.c
similarity index 100%
rename from libgnomecanvas/gailcanvastext.c
rename to src/libgnomecanvas/gailcanvastext.c
diff --git a/libgnomecanvas/gailcanvastext.h b/src/libgnomecanvas/gailcanvastext.h
similarity index 100%
rename from libgnomecanvas/gailcanvastext.h
rename to src/libgnomecanvas/gailcanvastext.h
diff --git a/libgnomecanvas/gailcanvastextfactory.c b/src/libgnomecanvas/gailcanvastextfactory.c
similarity index 100%
rename from libgnomecanvas/gailcanvastextfactory.c
rename to src/libgnomecanvas/gailcanvastextfactory.c
diff --git a/libgnomecanvas/gailcanvastextfactory.h b/src/libgnomecanvas/gailcanvastextfactory.h
similarity index 100%
rename from libgnomecanvas/gailcanvastextfactory.h
rename to src/libgnomecanvas/gailcanvastextfactory.h
diff --git a/libgnomecanvas/gailcanvaswidget.c b/src/libgnomecanvas/gailcanvaswidget.c
similarity index 100%
rename from libgnomecanvas/gailcanvaswidget.c
rename to src/libgnomecanvas/gailcanvaswidget.c
diff --git a/libgnomecanvas/gailcanvaswidget.h b/src/libgnomecanvas/gailcanvaswidget.h
similarity index 100%
rename from libgnomecanvas/gailcanvaswidget.h
rename to src/libgnomecanvas/gailcanvaswidget.h
diff --git a/libgnomecanvas/gailcanvaswidgetfactory.c b/src/libgnomecanvas/gailcanvaswidgetfactory.c
similarity index 100%
rename from libgnomecanvas/gailcanvaswidgetfactory.c
rename to src/libgnomecanvas/gailcanvaswidgetfactory.c
diff --git a/libgnomecanvas/gailcanvaswidgetfactory.h b/src/libgnomecanvas/gailcanvaswidgetfactory.h
similarity index 100%
rename from libgnomecanvas/gailcanvaswidgetfactory.h
rename to src/libgnomecanvas/gailcanvaswidgetfactory.h
diff --git a/libgnomecanvas/gnome-canvas-i18n.h b/src/libgnomecanvas/gnome-canvas-i18n.h
similarity index 100%
rename from libgnomecanvas/gnome-canvas-i18n.h
rename to src/libgnomecanvas/gnome-canvas-i18n.h
diff --git a/libgnomecanvas/gnome-canvas-pixbuf.c b/src/libgnomecanvas/gnome-canvas-pixbuf.c
similarity index 100%
rename from libgnomecanvas/gnome-canvas-pixbuf.c
rename to src/libgnomecanvas/gnome-canvas-pixbuf.c
diff --git a/libgnomecanvas/gnome-canvas-pixbuf.h b/src/libgnomecanvas/gnome-canvas-pixbuf.h
similarity index 100%
rename from libgnomecanvas/gnome-canvas-pixbuf.h
rename to src/libgnomecanvas/gnome-canvas-pixbuf.h
diff --git a/libgnomecanvas/gnome-canvas-rect.c b/src/libgnomecanvas/gnome-canvas-rect.c
similarity index 100%
rename from libgnomecanvas/gnome-canvas-rect.c
rename to src/libgnomecanvas/gnome-canvas-rect.c
diff --git a/libgnomecanvas/gnome-canvas-rect.h b/src/libgnomecanvas/gnome-canvas-rect.h
similarity index 100%
rename from libgnomecanvas/gnome-canvas-rect.h
rename to src/libgnomecanvas/gnome-canvas-rect.h
diff --git a/libgnomecanvas/gnome-canvas-text.c b/src/libgnomecanvas/gnome-canvas-text.c
similarity index 100%
rename from libgnomecanvas/gnome-canvas-text.c
rename to src/libgnomecanvas/gnome-canvas-text.c
diff --git a/libgnomecanvas/gnome-canvas-text.h b/src/libgnomecanvas/gnome-canvas-text.h
similarity index 100%
rename from libgnomecanvas/gnome-canvas-text.h
rename to src/libgnomecanvas/gnome-canvas-text.h
diff --git a/libgnomecanvas/gnome-canvas-util.c b/src/libgnomecanvas/gnome-canvas-util.c
similarity index 100%
rename from libgnomecanvas/gnome-canvas-util.c
rename to src/libgnomecanvas/gnome-canvas-util.c
diff --git a/libgnomecanvas/gnome-canvas-util.h b/src/libgnomecanvas/gnome-canvas-util.h
similarity index 100%
rename from libgnomecanvas/gnome-canvas-util.h
rename to src/libgnomecanvas/gnome-canvas-util.h
diff --git a/libgnomecanvas/gnome-canvas-widget.c b/src/libgnomecanvas/gnome-canvas-widget.c
similarity index 100%
rename from libgnomecanvas/gnome-canvas-widget.c
rename to src/libgnomecanvas/gnome-canvas-widget.c
diff --git a/libgnomecanvas/gnome-canvas-widget.h b/src/libgnomecanvas/gnome-canvas-widget.h
similarity index 100%
rename from libgnomecanvas/gnome-canvas-widget.h
rename to src/libgnomecanvas/gnome-canvas-widget.h
diff --git a/libgnomecanvas/gnome-canvas.c b/src/libgnomecanvas/gnome-canvas.c
similarity index 100%
rename from libgnomecanvas/gnome-canvas.c
rename to src/libgnomecanvas/gnome-canvas.c
diff --git a/libgnomecanvas/gnome-canvas.h b/src/libgnomecanvas/gnome-canvas.h
similarity index 100%
rename from libgnomecanvas/gnome-canvas.h
rename to src/libgnomecanvas/gnome-canvas.h
diff --git a/libgnomecanvas/libgnomecanvas.h b/src/libgnomecanvas/libgnomecanvas.h
similarity index 100%
rename from libgnomecanvas/libgnomecanvas.h
rename to src/libgnomecanvas/libgnomecanvas.h
diff --git a/src/mail/CMakeLists.txt b/src/mail/CMakeLists.txt
new file mode 100644
index 0000000..a661b35
--- /dev/null
+++ b/src/mail/CMakeLists.txt
@@ -0,0 +1,299 @@
+glib_mkenums(e-mail-enumtypes e-mail-enums.h E_MAIL_ENUMTYPES_H)
+add_error_files(mail mail.error)
+add_custom_xml_files(mail ${privdatadir} filter .in ""
+ filtertypes.xml
+ searchtypes.xml
+ vfoldertypes.xml
+)
+
+install(FILES message-list.etspec
+ DESTINATION ${etspecdir}
+)
+
+install(FILES mail-config.ui
+ mail-dialogs.ui
+ DESTINATION ${uidir}
+)
+
+set(DEPENDENCIES
+ econtacteditor
+ econtactlisteditor
+ email-engine
+ evolution-mail-composer
+ evolution-mail-formatter
+ evolution-shell
+ evolution-util
+)
+
+if(ENABLE_SMIME)
+ list(APPEND DEPENDENCIES
+ essmime
+ evolution-smime
+ )
+endif(ENABLE_SMIME)
+
+set(SOURCES
+ e-cid-request.c
+ e-http-request.c
+ e-mail-account-manager.c
+ e-mail-account-store.c
+ e-mail-account-tree-view.c
+ e-mail-autoconfig.c
+ e-mail-backend.c
+ e-mail-browser.c
+ e-mail-config-activity-page.c
+ e-mail-config-assistant.c
+ e-mail-config-auth-check.c
+ e-mail-config-confirm-page.c
+ e-mail-config-defaults-page.c
+ e-mail-config-identity-page.c
+ e-mail-config-lookup-page.c
+ e-mail-config-notebook.c
+ e-mail-config-page.c
+ e-mail-config-provider-page.c
+ e-mail-config-receiving-page.c
+ e-mail-config-security-page.c
+ e-mail-config-sending-page.c
+ e-mail-config-service-backend.c
+ e-mail-config-service-notebook.c
+ e-mail-config-service-page.c
+ e-mail-config-sidebar.c
+ e-mail-config-summary-page.c
+ e-mail-config-welcome-page.c
+ e-mail-config-window.c
+ e-mail-display.c
+ e-mail-display-popup-extension.c
+ e-mail-folder-create-dialog.c
+ e-mail-folder-pane.c
+ e-mail-free-form-exp.c
+ e-mail-junk-options.c
+ e-mail-label-action.c
+ e-mail-label-dialog.c
+ e-mail-label-list-store.c
+ e-mail-label-manager.c
+ e-mail-label-tree-view.c
+ e-mail-message-pane.c
+ e-mail-migrate.c
+ e-mail-notes.c
+ e-mail-paned-view.c
+ e-mail-print-config-headers.c
+ e-mail-printer.c
+ e-mail-properties.c
+ e-mail-reader-utils.c
+ e-mail-reader.c
+ e-mail-remote-content.c
+ e-mail-request.c
+ e-mail-send-account-override.c
+ e-mail-sidebar.c
+ e-mail-tag-editor.c
+ e-mail-ui-session.c
+ e-mail-view.c
+ em-composer-utils.c
+ em-config.c
+ em-event.c
+ em-filter-context.c
+ em-filter-editor.c
+ em-filter-editor-folder-element.c
+ em-filter-rule.c
+ em-filter-source-element.c
+ em-folder-properties.c
+ em-folder-selection-button.c
+ em-folder-selector.c
+ em-folder-tree-model.c
+ em-folder-tree.c
+ em-folder-utils.c
+ em-search-context.c
+ em-subscription-editor.c
+ em-utils.c
+ em-vfolder-editor-context.c
+ em-vfolder-editor-rule.c
+ em-vfolder-editor.c
+ mail-autofilter.c
+ mail-send-recv.c
+ mail-vfolder-ui.c
+ message-list.c
+ ${CMAKE_CURRENT_BINARY_DIR}/e-mail-enumtypes.c
+)
+
+set(HEADERS
+ e-cid-request.h
+ e-http-request.h
+ e-mail.h
+ e-mail-account-manager.h
+ e-mail-account-store.h
+ e-mail-account-tree-view.h
+ e-mail-autoconfig.h
+ e-mail-backend.h
+ e-mail-browser.h
+ e-mail-config-activity-page.h
+ e-mail-config-assistant.h
+ e-mail-config-auth-check.h
+ e-mail-config-confirm-page.h
+ e-mail-config-defaults-page.h
+ e-mail-config-identity-page.h
+ e-mail-config-lookup-page.h
+ e-mail-config-notebook.h
+ e-mail-config-page.h
+ e-mail-config-provider-page.h
+ e-mail-config-receiving-page.h
+ e-mail-config-security-page.h
+ e-mail-config-sending-page.h
+ e-mail-config-service-backend.h
+ e-mail-config-service-notebook.h
+ e-mail-config-service-page.h
+ e-mail-config-sidebar.h
+ e-mail-config-summary-page.h
+ e-mail-config-welcome-page.h
+ e-mail-config-window.h
+ e-mail-display.h
+ e-mail-display-popup-extension.h
+ e-mail-enums.h
+ e-mail-folder-create-dialog.h
+ e-mail-folder-pane.h
+ e-mail-free-form-exp.h
+ e-mail-junk-options.h
+ e-mail-label-action.h
+ e-mail-label-dialog.h
+ e-mail-label-list-store.h
+ e-mail-label-manager.h
+ e-mail-label-tree-view.h
+ e-mail-message-pane.h
+ e-mail-migrate.h
+ e-mail-notes.h
+ e-mail-paned-view.h
+ e-mail-print-config-headers.h
+ e-mail-printer.h
+ e-mail-properties.h
+ e-mail-reader-utils.h
+ e-mail-reader.h
+ e-mail-remote-content.h
+ e-mail-request.h
+ e-mail-send-account-override.h
+ e-mail-sidebar.h
+ e-mail-tag-editor.h
+ e-mail-ui-session.h
+ e-mail-view.h
+ em-composer-utils.h
+ em-config.h
+ em-event.h
+ em-filter-context.h
+ em-filter-editor.h
+ em-filter-editor-folder-element.h
+ em-filter-rule.h
+ em-filter-source-element.h
+ em-folder-properties.h
+ em-folder-selection-button.h
+ em-folder-selector.h
+ em-folder-tree-model.h
+ em-folder-tree.h
+ em-folder-utils.h
+ em-search-context.h
+ em-subscription-editor.h
+ em-utils.h
+ em-vfolder-editor-context.h
+ em-vfolder-editor-rule.h
+ em-vfolder-editor.h
+ mail-autofilter.h
+ mail-send-recv.h
+ mail-vfolder-ui.h
+ message-list.h
+ ${CMAKE_CURRENT_BINARY_DIR}/e-mail-enumtypes.h
+)
+
+add_library(evolution-mail SHARED
+ ${SOURCES}
+ ${HEADERS}
+)
+
+add_dependencies(evolution-mail
+ ${DEPENDENCIES}
+)
+
+target_compile_definitions(evolution-mail PRIVATE
+ -DG_LOG_DOMAIN=\"evolution-mail\"
+ -DEVOLUTION_PRIVDATADIR=\"${privdatadir}\"
+ -DEVOLUTION_ETSPECDIR=\"${etspecdir}\"
+)
+
+target_compile_options(evolution-mail PUBLIC
+ ${CERT_UI_CFLAGS}
+ ${CANBERRA_CFLAGS}
+ ${EVOLUTION_DATA_SERVER_CFLAGS}
+ ${LIBCRYPTUI_CFLAGS}
+ ${GNOME_PLATFORM_CFLAGS}
+)
+
+target_include_directories(evolution-mail PUBLIC
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}/src
+ ${CMAKE_SOURCE_DIR}/src
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}/src/composer
+ ${CMAKE_BINARY_DIR}/src/em-format
+ ${CMAKE_BINARY_DIR}/src/shell
+ ${CMAKE_BINARY_DIR}/src/smime/lib
+ ${CMAKE_BINARY_DIR}/src/smime/gui
+ ${CMAKE_SOURCE_DIR}/src/composer
+ ${CMAKE_SOURCE_DIR}/src/em-format
+ ${CMAKE_SOURCE_DIR}/src/shell
+ ${CMAKE_SOURCE_DIR}/src/smime/lib
+ ${CMAKE_SOURCE_DIR}/src/smime/gui
+ ${CERT_UI_INCLUDE_DIRS}
+ ${CANBERRA_INCLUDE_DIRS}
+ ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+ ${LIBCRYPTUI_INCLUDE_DIRS}
+ ${GNOME_PLATFORM_INCLUDE_DIRS}
+)
+
+target_link_libraries(evolution-mail
+ ${DEPENDENCIES}
+ ${CERT_UI_LDFLAGS}
+ ${CANBERRA_LDFLAGS}
+ ${EVOLUTION_DATA_SERVER_LDFLAGS}
+ ${LIBCRYPTUI_LDFLAGS}
+ ${GNOME_PLATFORM_LDFLAGS}
+)
+
+install(TARGETS evolution-mail
+ DESTINATION ${privsolibdir}
+)
+
+install(FILES ${HEADERS}
+ DESTINATION ${privincludedir}/mail
+)
+
+# ******************************
+# test-mail-autoconfig
+# ******************************
+
+add_executable(test-mail-autoconfig
+ e-mail-autoconfig.c
+ e-mail-autoconfig.h
+ test-mail-autoconfig.c
+)
+
+target_compile_definitions(test-mail-autoconfig PRIVATE
+ -DG_LOG_DOMAIN=\"test-mail-autoconfig\"
+)
+
+target_compile_options(test-mail-autoconfig PUBLIC
+ ${EVOLUTION_DATA_SERVER_CFLAGS}
+ ${GNOME_PLATFORM_CFLAGS}
+)
+
+target_include_directories(test-mail-autoconfig PUBLIC
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}/src
+ ${CMAKE_SOURCE_DIR}/src
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+ ${GNOME_PLATFORM_INCLUDE_DIRS}
+)
+
+target_link_libraries(test-mail-autoconfig
+ ${EVOLUTION_DATA_SERVER_LDFLAGS}
+ ${GNOME_PLATFORM_LDFLAGS}
+)
+
+add_subdirectory(default)
+add_subdirectory(importers)
diff --git a/mail/README.async b/src/mail/README.async
similarity index 100%
rename from mail/README.async
rename to src/mail/README.async
diff --git a/mail/default/C/Inbox b/src/mail/default/C/Inbox
similarity index 100%
rename from mail/default/C/Inbox
rename to src/mail/default/C/Inbox
diff --git a/mail/default/CMakeLists.txt b/src/mail/default/CMakeLists.txt
similarity index 100%
rename from mail/default/CMakeLists.txt
rename to src/mail/default/CMakeLists.txt
diff --git a/mail/default/ca/Inbox b/src/mail/default/ca/Inbox
similarity index 100%
rename from mail/default/ca/Inbox
rename to src/mail/default/ca/Inbox
diff --git a/mail/default/cs/Inbox b/src/mail/default/cs/Inbox
similarity index 100%
rename from mail/default/cs/Inbox
rename to src/mail/default/cs/Inbox
diff --git a/mail/default/de/Inbox b/src/mail/default/de/Inbox
similarity index 100%
rename from mail/default/de/Inbox
rename to src/mail/default/de/Inbox
diff --git a/mail/default/es/Inbox b/src/mail/default/es/Inbox
similarity index 100%
rename from mail/default/es/Inbox
rename to src/mail/default/es/Inbox
diff --git a/mail/default/fi/Inbox b/src/mail/default/fi/Inbox
similarity index 100%
rename from mail/default/fi/Inbox
rename to src/mail/default/fi/Inbox
diff --git a/mail/default/fr/Inbox b/src/mail/default/fr/Inbox
similarity index 100%
rename from mail/default/fr/Inbox
rename to src/mail/default/fr/Inbox
diff --git a/mail/default/hu/Inbox b/src/mail/default/hu/Inbox
similarity index 100%
rename from mail/default/hu/Inbox
rename to src/mail/default/hu/Inbox
diff --git a/mail/default/id/Inbox b/src/mail/default/id/Inbox
similarity index 100%
rename from mail/default/id/Inbox
rename to src/mail/default/id/Inbox
diff --git a/mail/default/it/Inbox b/src/mail/default/it/Inbox
similarity index 100%
rename from mail/default/it/Inbox
rename to src/mail/default/it/Inbox
diff --git a/mail/default/ja/Inbox b/src/mail/default/ja/Inbox
similarity index 100%
rename from mail/default/ja/Inbox
rename to src/mail/default/ja/Inbox
diff --git a/mail/default/ko/Inbox b/src/mail/default/ko/Inbox
similarity index 100%
rename from mail/default/ko/Inbox
rename to src/mail/default/ko/Inbox
diff --git a/mail/default/lt/Inbox b/src/mail/default/lt/Inbox
similarity index 100%
rename from mail/default/lt/Inbox
rename to src/mail/default/lt/Inbox
diff --git a/mail/default/mk/Inbox b/src/mail/default/mk/Inbox
similarity index 100%
rename from mail/default/mk/Inbox
rename to src/mail/default/mk/Inbox
diff --git a/mail/default/nl/Inbox b/src/mail/default/nl/Inbox
similarity index 100%
rename from mail/default/nl/Inbox
rename to src/mail/default/nl/Inbox
diff --git a/mail/default/pl/Inbox b/src/mail/default/pl/Inbox
similarity index 100%
rename from mail/default/pl/Inbox
rename to src/mail/default/pl/Inbox
diff --git a/mail/default/pt/Inbox b/src/mail/default/pt/Inbox
similarity index 100%
rename from mail/default/pt/Inbox
rename to src/mail/default/pt/Inbox
diff --git a/mail/default/ro/Inbox b/src/mail/default/ro/Inbox
similarity index 100%
rename from mail/default/ro/Inbox
rename to src/mail/default/ro/Inbox
diff --git a/mail/default/sr/Inbox b/src/mail/default/sr/Inbox
similarity index 100%
rename from mail/default/sr/Inbox
rename to src/mail/default/sr/Inbox
diff --git a/mail/default/sr@latin/Inbox b/src/mail/default/sr@latin/Inbox
similarity index 100%
rename from mail/default/sr@latin/Inbox
rename to src/mail/default/sr@latin/Inbox
diff --git a/mail/default/sv/Inbox b/src/mail/default/sv/Inbox
similarity index 100%
rename from mail/default/sv/Inbox
rename to src/mail/default/sv/Inbox
diff --git a/mail/default/zh_CN/Inbox b/src/mail/default/zh_CN/Inbox
similarity index 100%
rename from mail/default/zh_CN/Inbox
rename to src/mail/default/zh_CN/Inbox
diff --git a/mail/e-cid-request.c b/src/mail/e-cid-request.c
similarity index 100%
rename from mail/e-cid-request.c
rename to src/mail/e-cid-request.c
diff --git a/mail/e-cid-request.h b/src/mail/e-cid-request.h
similarity index 100%
rename from mail/e-cid-request.h
rename to src/mail/e-cid-request.h
diff --git a/mail/e-http-request.c b/src/mail/e-http-request.c
similarity index 100%
rename from mail/e-http-request.c
rename to src/mail/e-http-request.c
diff --git a/mail/e-http-request.h b/src/mail/e-http-request.h
similarity index 100%
rename from mail/e-http-request.h
rename to src/mail/e-http-request.h
diff --git a/mail/e-mail-account-manager.c b/src/mail/e-mail-account-manager.c
similarity index 100%
rename from mail/e-mail-account-manager.c
rename to src/mail/e-mail-account-manager.c
diff --git a/mail/e-mail-account-manager.h b/src/mail/e-mail-account-manager.h
similarity index 100%
rename from mail/e-mail-account-manager.h
rename to src/mail/e-mail-account-manager.h
diff --git a/mail/e-mail-account-store.c b/src/mail/e-mail-account-store.c
similarity index 100%
rename from mail/e-mail-account-store.c
rename to src/mail/e-mail-account-store.c
diff --git a/mail/e-mail-account-store.h b/src/mail/e-mail-account-store.h
similarity index 100%
rename from mail/e-mail-account-store.h
rename to src/mail/e-mail-account-store.h
diff --git a/mail/e-mail-account-tree-view.c b/src/mail/e-mail-account-tree-view.c
similarity index 100%
rename from mail/e-mail-account-tree-view.c
rename to src/mail/e-mail-account-tree-view.c
diff --git a/mail/e-mail-account-tree-view.h b/src/mail/e-mail-account-tree-view.h
similarity index 100%
rename from mail/e-mail-account-tree-view.h
rename to src/mail/e-mail-account-tree-view.h
diff --git a/mail/e-mail-autoconfig.c b/src/mail/e-mail-autoconfig.c
similarity index 100%
rename from mail/e-mail-autoconfig.c
rename to src/mail/e-mail-autoconfig.c
diff --git a/mail/e-mail-autoconfig.h b/src/mail/e-mail-autoconfig.h
similarity index 100%
rename from mail/e-mail-autoconfig.h
rename to src/mail/e-mail-autoconfig.h
diff --git a/mail/e-mail-backend.c b/src/mail/e-mail-backend.c
similarity index 100%
rename from mail/e-mail-backend.c
rename to src/mail/e-mail-backend.c
diff --git a/mail/e-mail-backend.h b/src/mail/e-mail-backend.h
similarity index 100%
rename from mail/e-mail-backend.h
rename to src/mail/e-mail-backend.h
diff --git a/mail/e-mail-browser.c b/src/mail/e-mail-browser.c
similarity index 100%
rename from mail/e-mail-browser.c
rename to src/mail/e-mail-browser.c
diff --git a/mail/e-mail-browser.h b/src/mail/e-mail-browser.h
similarity index 100%
rename from mail/e-mail-browser.h
rename to src/mail/e-mail-browser.h
diff --git a/mail/e-mail-config-activity-page.c b/src/mail/e-mail-config-activity-page.c
similarity index 100%
rename from mail/e-mail-config-activity-page.c
rename to src/mail/e-mail-config-activity-page.c
diff --git a/mail/e-mail-config-activity-page.h b/src/mail/e-mail-config-activity-page.h
similarity index 100%
rename from mail/e-mail-config-activity-page.h
rename to src/mail/e-mail-config-activity-page.h
diff --git a/mail/e-mail-config-assistant.c b/src/mail/e-mail-config-assistant.c
similarity index 100%
rename from mail/e-mail-config-assistant.c
rename to src/mail/e-mail-config-assistant.c
diff --git a/mail/e-mail-config-assistant.h b/src/mail/e-mail-config-assistant.h
similarity index 100%
rename from mail/e-mail-config-assistant.h
rename to src/mail/e-mail-config-assistant.h
diff --git a/mail/e-mail-config-auth-check.c b/src/mail/e-mail-config-auth-check.c
similarity index 100%
rename from mail/e-mail-config-auth-check.c
rename to src/mail/e-mail-config-auth-check.c
diff --git a/mail/e-mail-config-auth-check.h b/src/mail/e-mail-config-auth-check.h
similarity index 100%
rename from mail/e-mail-config-auth-check.h
rename to src/mail/e-mail-config-auth-check.h
diff --git a/mail/e-mail-config-confirm-page.c b/src/mail/e-mail-config-confirm-page.c
similarity index 100%
rename from mail/e-mail-config-confirm-page.c
rename to src/mail/e-mail-config-confirm-page.c
diff --git a/mail/e-mail-config-confirm-page.h b/src/mail/e-mail-config-confirm-page.h
similarity index 100%
rename from mail/e-mail-config-confirm-page.h
rename to src/mail/e-mail-config-confirm-page.h
diff --git a/mail/e-mail-config-defaults-page.c b/src/mail/e-mail-config-defaults-page.c
similarity index 100%
rename from mail/e-mail-config-defaults-page.c
rename to src/mail/e-mail-config-defaults-page.c
diff --git a/mail/e-mail-config-defaults-page.h b/src/mail/e-mail-config-defaults-page.h
similarity index 100%
rename from mail/e-mail-config-defaults-page.h
rename to src/mail/e-mail-config-defaults-page.h
diff --git a/mail/e-mail-config-identity-page.c b/src/mail/e-mail-config-identity-page.c
similarity index 100%
rename from mail/e-mail-config-identity-page.c
rename to src/mail/e-mail-config-identity-page.c
diff --git a/mail/e-mail-config-identity-page.h b/src/mail/e-mail-config-identity-page.h
similarity index 100%
rename from mail/e-mail-config-identity-page.h
rename to src/mail/e-mail-config-identity-page.h
diff --git a/mail/e-mail-config-lookup-page.c b/src/mail/e-mail-config-lookup-page.c
similarity index 100%
rename from mail/e-mail-config-lookup-page.c
rename to src/mail/e-mail-config-lookup-page.c
diff --git a/mail/e-mail-config-lookup-page.h b/src/mail/e-mail-config-lookup-page.h
similarity index 100%
rename from mail/e-mail-config-lookup-page.h
rename to src/mail/e-mail-config-lookup-page.h
diff --git a/mail/e-mail-config-notebook.c b/src/mail/e-mail-config-notebook.c
similarity index 100%
rename from mail/e-mail-config-notebook.c
rename to src/mail/e-mail-config-notebook.c
diff --git a/mail/e-mail-config-notebook.h b/src/mail/e-mail-config-notebook.h
similarity index 100%
rename from mail/e-mail-config-notebook.h
rename to src/mail/e-mail-config-notebook.h
diff --git a/mail/e-mail-config-page.c b/src/mail/e-mail-config-page.c
similarity index 100%
rename from mail/e-mail-config-page.c
rename to src/mail/e-mail-config-page.c
diff --git a/mail/e-mail-config-page.h b/src/mail/e-mail-config-page.h
similarity index 100%
rename from mail/e-mail-config-page.h
rename to src/mail/e-mail-config-page.h
diff --git a/mail/e-mail-config-provider-page.c b/src/mail/e-mail-config-provider-page.c
similarity index 100%
rename from mail/e-mail-config-provider-page.c
rename to src/mail/e-mail-config-provider-page.c
diff --git a/mail/e-mail-config-provider-page.h b/src/mail/e-mail-config-provider-page.h
similarity index 100%
rename from mail/e-mail-config-provider-page.h
rename to src/mail/e-mail-config-provider-page.h
diff --git a/mail/e-mail-config-receiving-page.c b/src/mail/e-mail-config-receiving-page.c
similarity index 100%
rename from mail/e-mail-config-receiving-page.c
rename to src/mail/e-mail-config-receiving-page.c
diff --git a/mail/e-mail-config-receiving-page.h b/src/mail/e-mail-config-receiving-page.h
similarity index 100%
rename from mail/e-mail-config-receiving-page.h
rename to src/mail/e-mail-config-receiving-page.h
diff --git a/mail/e-mail-config-security-page.c b/src/mail/e-mail-config-security-page.c
similarity index 100%
rename from mail/e-mail-config-security-page.c
rename to src/mail/e-mail-config-security-page.c
diff --git a/mail/e-mail-config-security-page.h b/src/mail/e-mail-config-security-page.h
similarity index 100%
rename from mail/e-mail-config-security-page.h
rename to src/mail/e-mail-config-security-page.h
diff --git a/mail/e-mail-config-sending-page.c b/src/mail/e-mail-config-sending-page.c
similarity index 100%
rename from mail/e-mail-config-sending-page.c
rename to src/mail/e-mail-config-sending-page.c
diff --git a/mail/e-mail-config-sending-page.h b/src/mail/e-mail-config-sending-page.h
similarity index 100%
rename from mail/e-mail-config-sending-page.h
rename to src/mail/e-mail-config-sending-page.h
diff --git a/mail/e-mail-config-service-backend.c b/src/mail/e-mail-config-service-backend.c
similarity index 100%
rename from mail/e-mail-config-service-backend.c
rename to src/mail/e-mail-config-service-backend.c
diff --git a/mail/e-mail-config-service-backend.h b/src/mail/e-mail-config-service-backend.h
similarity index 100%
rename from mail/e-mail-config-service-backend.h
rename to src/mail/e-mail-config-service-backend.h
diff --git a/mail/e-mail-config-service-notebook.c b/src/mail/e-mail-config-service-notebook.c
similarity index 100%
rename from mail/e-mail-config-service-notebook.c
rename to src/mail/e-mail-config-service-notebook.c
diff --git a/mail/e-mail-config-service-notebook.h b/src/mail/e-mail-config-service-notebook.h
similarity index 100%
rename from mail/e-mail-config-service-notebook.h
rename to src/mail/e-mail-config-service-notebook.h
diff --git a/mail/e-mail-config-service-page.c b/src/mail/e-mail-config-service-page.c
similarity index 100%
rename from mail/e-mail-config-service-page.c
rename to src/mail/e-mail-config-service-page.c
diff --git a/mail/e-mail-config-service-page.h b/src/mail/e-mail-config-service-page.h
similarity index 100%
rename from mail/e-mail-config-service-page.h
rename to src/mail/e-mail-config-service-page.h
diff --git a/mail/e-mail-config-sidebar.c b/src/mail/e-mail-config-sidebar.c
similarity index 100%
rename from mail/e-mail-config-sidebar.c
rename to src/mail/e-mail-config-sidebar.c
diff --git a/mail/e-mail-config-sidebar.h b/src/mail/e-mail-config-sidebar.h
similarity index 100%
rename from mail/e-mail-config-sidebar.h
rename to src/mail/e-mail-config-sidebar.h
diff --git a/mail/e-mail-config-summary-page.c b/src/mail/e-mail-config-summary-page.c
similarity index 100%
rename from mail/e-mail-config-summary-page.c
rename to src/mail/e-mail-config-summary-page.c
diff --git a/mail/e-mail-config-summary-page.h b/src/mail/e-mail-config-summary-page.h
similarity index 100%
rename from mail/e-mail-config-summary-page.h
rename to src/mail/e-mail-config-summary-page.h
diff --git a/mail/e-mail-config-welcome-page.c b/src/mail/e-mail-config-welcome-page.c
similarity index 100%
rename from mail/e-mail-config-welcome-page.c
rename to src/mail/e-mail-config-welcome-page.c
diff --git a/mail/e-mail-config-welcome-page.h b/src/mail/e-mail-config-welcome-page.h
similarity index 100%
rename from mail/e-mail-config-welcome-page.h
rename to src/mail/e-mail-config-welcome-page.h
diff --git a/mail/e-mail-config-window.c b/src/mail/e-mail-config-window.c
similarity index 100%
rename from mail/e-mail-config-window.c
rename to src/mail/e-mail-config-window.c
diff --git a/mail/e-mail-config-window.h b/src/mail/e-mail-config-window.h
similarity index 100%
rename from mail/e-mail-config-window.h
rename to src/mail/e-mail-config-window.h
diff --git a/mail/e-mail-display-popup-extension.c b/src/mail/e-mail-display-popup-extension.c
similarity index 100%
rename from mail/e-mail-display-popup-extension.c
rename to src/mail/e-mail-display-popup-extension.c
diff --git a/mail/e-mail-display-popup-extension.h b/src/mail/e-mail-display-popup-extension.h
similarity index 100%
rename from mail/e-mail-display-popup-extension.h
rename to src/mail/e-mail-display-popup-extension.h
diff --git a/mail/e-mail-display.c b/src/mail/e-mail-display.c
similarity index 100%
rename from mail/e-mail-display.c
rename to src/mail/e-mail-display.c
diff --git a/mail/e-mail-display.h b/src/mail/e-mail-display.h
similarity index 100%
rename from mail/e-mail-display.h
rename to src/mail/e-mail-display.h
diff --git a/mail/e-mail-enums.h b/src/mail/e-mail-enums.h
similarity index 100%
rename from mail/e-mail-enums.h
rename to src/mail/e-mail-enums.h
diff --git a/mail/e-mail-folder-create-dialog.c b/src/mail/e-mail-folder-create-dialog.c
similarity index 100%
rename from mail/e-mail-folder-create-dialog.c
rename to src/mail/e-mail-folder-create-dialog.c
diff --git a/mail/e-mail-folder-create-dialog.h b/src/mail/e-mail-folder-create-dialog.h
similarity index 100%
rename from mail/e-mail-folder-create-dialog.h
rename to src/mail/e-mail-folder-create-dialog.h
diff --git a/mail/e-mail-folder-pane.c b/src/mail/e-mail-folder-pane.c
similarity index 100%
rename from mail/e-mail-folder-pane.c
rename to src/mail/e-mail-folder-pane.c
diff --git a/mail/e-mail-folder-pane.h b/src/mail/e-mail-folder-pane.h
similarity index 100%
rename from mail/e-mail-folder-pane.h
rename to src/mail/e-mail-folder-pane.h
diff --git a/mail/e-mail-free-form-exp.c b/src/mail/e-mail-free-form-exp.c
similarity index 100%
rename from mail/e-mail-free-form-exp.c
rename to src/mail/e-mail-free-form-exp.c
diff --git a/mail/e-mail-free-form-exp.h b/src/mail/e-mail-free-form-exp.h
similarity index 100%
rename from mail/e-mail-free-form-exp.h
rename to src/mail/e-mail-free-form-exp.h
diff --git a/mail/e-mail-junk-options.c b/src/mail/e-mail-junk-options.c
similarity index 100%
rename from mail/e-mail-junk-options.c
rename to src/mail/e-mail-junk-options.c
diff --git a/mail/e-mail-junk-options.h b/src/mail/e-mail-junk-options.h
similarity index 100%
rename from mail/e-mail-junk-options.h
rename to src/mail/e-mail-junk-options.h
diff --git a/mail/e-mail-label-action.c b/src/mail/e-mail-label-action.c
similarity index 100%
rename from mail/e-mail-label-action.c
rename to src/mail/e-mail-label-action.c
diff --git a/mail/e-mail-label-action.h b/src/mail/e-mail-label-action.h
similarity index 100%
rename from mail/e-mail-label-action.h
rename to src/mail/e-mail-label-action.h
diff --git a/mail/e-mail-label-dialog.c b/src/mail/e-mail-label-dialog.c
similarity index 100%
rename from mail/e-mail-label-dialog.c
rename to src/mail/e-mail-label-dialog.c
diff --git a/mail/e-mail-label-dialog.h b/src/mail/e-mail-label-dialog.h
similarity index 100%
rename from mail/e-mail-label-dialog.h
rename to src/mail/e-mail-label-dialog.h
diff --git a/mail/e-mail-label-list-store.c b/src/mail/e-mail-label-list-store.c
similarity index 100%
rename from mail/e-mail-label-list-store.c
rename to src/mail/e-mail-label-list-store.c
diff --git a/mail/e-mail-label-list-store.h b/src/mail/e-mail-label-list-store.h
similarity index 100%
rename from mail/e-mail-label-list-store.h
rename to src/mail/e-mail-label-list-store.h
diff --git a/mail/e-mail-label-manager.c b/src/mail/e-mail-label-manager.c
similarity index 100%
rename from mail/e-mail-label-manager.c
rename to src/mail/e-mail-label-manager.c
diff --git a/mail/e-mail-label-manager.h b/src/mail/e-mail-label-manager.h
similarity index 100%
rename from mail/e-mail-label-manager.h
rename to src/mail/e-mail-label-manager.h
diff --git a/mail/e-mail-label-tree-view.c b/src/mail/e-mail-label-tree-view.c
similarity index 100%
rename from mail/e-mail-label-tree-view.c
rename to src/mail/e-mail-label-tree-view.c
diff --git a/mail/e-mail-label-tree-view.h b/src/mail/e-mail-label-tree-view.h
similarity index 100%
rename from mail/e-mail-label-tree-view.h
rename to src/mail/e-mail-label-tree-view.h
diff --git a/mail/e-mail-message-pane.c b/src/mail/e-mail-message-pane.c
similarity index 100%
rename from mail/e-mail-message-pane.c
rename to src/mail/e-mail-message-pane.c
diff --git a/mail/e-mail-message-pane.h b/src/mail/e-mail-message-pane.h
similarity index 100%
rename from mail/e-mail-message-pane.h
rename to src/mail/e-mail-message-pane.h
diff --git a/mail/e-mail-migrate.c b/src/mail/e-mail-migrate.c
similarity index 100%
rename from mail/e-mail-migrate.c
rename to src/mail/e-mail-migrate.c
diff --git a/mail/e-mail-migrate.h b/src/mail/e-mail-migrate.h
similarity index 100%
rename from mail/e-mail-migrate.h
rename to src/mail/e-mail-migrate.h
diff --git a/mail/e-mail-notes.c b/src/mail/e-mail-notes.c
similarity index 100%
rename from mail/e-mail-notes.c
rename to src/mail/e-mail-notes.c
diff --git a/mail/e-mail-notes.h b/src/mail/e-mail-notes.h
similarity index 100%
rename from mail/e-mail-notes.h
rename to src/mail/e-mail-notes.h
diff --git a/mail/e-mail-paned-view.c b/src/mail/e-mail-paned-view.c
similarity index 100%
rename from mail/e-mail-paned-view.c
rename to src/mail/e-mail-paned-view.c
diff --git a/mail/e-mail-paned-view.h b/src/mail/e-mail-paned-view.h
similarity index 100%
rename from mail/e-mail-paned-view.h
rename to src/mail/e-mail-paned-view.h
diff --git a/mail/e-mail-print-config-headers.c b/src/mail/e-mail-print-config-headers.c
similarity index 100%
rename from mail/e-mail-print-config-headers.c
rename to src/mail/e-mail-print-config-headers.c
diff --git a/mail/e-mail-print-config-headers.h b/src/mail/e-mail-print-config-headers.h
similarity index 100%
rename from mail/e-mail-print-config-headers.h
rename to src/mail/e-mail-print-config-headers.h
diff --git a/mail/e-mail-printer.c b/src/mail/e-mail-printer.c
similarity index 100%
rename from mail/e-mail-printer.c
rename to src/mail/e-mail-printer.c
diff --git a/mail/e-mail-printer.h b/src/mail/e-mail-printer.h
similarity index 100%
rename from mail/e-mail-printer.h
rename to src/mail/e-mail-printer.h
diff --git a/mail/e-mail-properties.c b/src/mail/e-mail-properties.c
similarity index 100%
rename from mail/e-mail-properties.c
rename to src/mail/e-mail-properties.c
diff --git a/mail/e-mail-properties.h b/src/mail/e-mail-properties.h
similarity index 100%
rename from mail/e-mail-properties.h
rename to src/mail/e-mail-properties.h
diff --git a/mail/e-mail-reader-utils.c b/src/mail/e-mail-reader-utils.c
similarity index 100%
rename from mail/e-mail-reader-utils.c
rename to src/mail/e-mail-reader-utils.c
diff --git a/mail/e-mail-reader-utils.h b/src/mail/e-mail-reader-utils.h
similarity index 100%
rename from mail/e-mail-reader-utils.h
rename to src/mail/e-mail-reader-utils.h
diff --git a/mail/e-mail-reader.c b/src/mail/e-mail-reader.c
similarity index 100%
rename from mail/e-mail-reader.c
rename to src/mail/e-mail-reader.c
diff --git a/mail/e-mail-reader.h b/src/mail/e-mail-reader.h
similarity index 100%
rename from mail/e-mail-reader.h
rename to src/mail/e-mail-reader.h
diff --git a/mail/e-mail-remote-content.c b/src/mail/e-mail-remote-content.c
similarity index 100%
rename from mail/e-mail-remote-content.c
rename to src/mail/e-mail-remote-content.c
diff --git a/mail/e-mail-remote-content.h b/src/mail/e-mail-remote-content.h
similarity index 100%
rename from mail/e-mail-remote-content.h
rename to src/mail/e-mail-remote-content.h
diff --git a/mail/e-mail-request.c b/src/mail/e-mail-request.c
similarity index 100%
rename from mail/e-mail-request.c
rename to src/mail/e-mail-request.c
diff --git a/mail/e-mail-request.h b/src/mail/e-mail-request.h
similarity index 100%
rename from mail/e-mail-request.h
rename to src/mail/e-mail-request.h
diff --git a/mail/e-mail-send-account-override.c b/src/mail/e-mail-send-account-override.c
similarity index 100%
rename from mail/e-mail-send-account-override.c
rename to src/mail/e-mail-send-account-override.c
diff --git a/mail/e-mail-send-account-override.h b/src/mail/e-mail-send-account-override.h
similarity index 100%
rename from mail/e-mail-send-account-override.h
rename to src/mail/e-mail-send-account-override.h
diff --git a/mail/e-mail-sidebar.c b/src/mail/e-mail-sidebar.c
similarity index 100%
rename from mail/e-mail-sidebar.c
rename to src/mail/e-mail-sidebar.c
diff --git a/mail/e-mail-sidebar.h b/src/mail/e-mail-sidebar.h
similarity index 100%
rename from mail/e-mail-sidebar.h
rename to src/mail/e-mail-sidebar.h
diff --git a/mail/e-mail-tag-editor.c b/src/mail/e-mail-tag-editor.c
similarity index 100%
rename from mail/e-mail-tag-editor.c
rename to src/mail/e-mail-tag-editor.c
diff --git a/mail/e-mail-tag-editor.h b/src/mail/e-mail-tag-editor.h
similarity index 100%
rename from mail/e-mail-tag-editor.h
rename to src/mail/e-mail-tag-editor.h
diff --git a/mail/e-mail-ui-session.c b/src/mail/e-mail-ui-session.c
similarity index 100%
rename from mail/e-mail-ui-session.c
rename to src/mail/e-mail-ui-session.c
diff --git a/mail/e-mail-ui-session.h b/src/mail/e-mail-ui-session.h
similarity index 100%
rename from mail/e-mail-ui-session.h
rename to src/mail/e-mail-ui-session.h
diff --git a/mail/e-mail-view.c b/src/mail/e-mail-view.c
similarity index 100%
rename from mail/e-mail-view.c
rename to src/mail/e-mail-view.c
diff --git a/mail/e-mail-view.h b/src/mail/e-mail-view.h
similarity index 100%
rename from mail/e-mail-view.h
rename to src/mail/e-mail-view.h
diff --git a/mail/e-mail.h b/src/mail/e-mail.h
similarity index 100%
rename from mail/e-mail.h
rename to src/mail/e-mail.h
diff --git a/mail/em-composer-utils.c b/src/mail/em-composer-utils.c
similarity index 100%
rename from mail/em-composer-utils.c
rename to src/mail/em-composer-utils.c
diff --git a/mail/em-composer-utils.h b/src/mail/em-composer-utils.h
similarity index 100%
rename from mail/em-composer-utils.h
rename to src/mail/em-composer-utils.h
diff --git a/mail/em-config.c b/src/mail/em-config.c
similarity index 100%
rename from mail/em-config.c
rename to src/mail/em-config.c
diff --git a/mail/em-config.h b/src/mail/em-config.h
similarity index 100%
rename from mail/em-config.h
rename to src/mail/em-config.h
diff --git a/mail/em-event.c b/src/mail/em-event.c
similarity index 100%
rename from mail/em-event.c
rename to src/mail/em-event.c
diff --git a/mail/em-event.h b/src/mail/em-event.h
similarity index 100%
rename from mail/em-event.h
rename to src/mail/em-event.h
diff --git a/mail/em-filter-context.c b/src/mail/em-filter-context.c
similarity index 100%
rename from mail/em-filter-context.c
rename to src/mail/em-filter-context.c
diff --git a/mail/em-filter-context.h b/src/mail/em-filter-context.h
similarity index 100%
rename from mail/em-filter-context.h
rename to src/mail/em-filter-context.h
diff --git a/mail/em-filter-editor-folder-element.c b/src/mail/em-filter-editor-folder-element.c
similarity index 100%
rename from mail/em-filter-editor-folder-element.c
rename to src/mail/em-filter-editor-folder-element.c
diff --git a/mail/em-filter-editor-folder-element.h b/src/mail/em-filter-editor-folder-element.h
similarity index 100%
rename from mail/em-filter-editor-folder-element.h
rename to src/mail/em-filter-editor-folder-element.h
diff --git a/mail/em-filter-editor.c b/src/mail/em-filter-editor.c
similarity index 100%
rename from mail/em-filter-editor.c
rename to src/mail/em-filter-editor.c
diff --git a/mail/em-filter-editor.h b/src/mail/em-filter-editor.h
similarity index 100%
rename from mail/em-filter-editor.h
rename to src/mail/em-filter-editor.h
diff --git a/mail/em-filter-rule.c b/src/mail/em-filter-rule.c
similarity index 100%
rename from mail/em-filter-rule.c
rename to src/mail/em-filter-rule.c
diff --git a/mail/em-filter-rule.h b/src/mail/em-filter-rule.h
similarity index 100%
rename from mail/em-filter-rule.h
rename to src/mail/em-filter-rule.h
diff --git a/mail/em-filter-source-element.c b/src/mail/em-filter-source-element.c
similarity index 100%
rename from mail/em-filter-source-element.c
rename to src/mail/em-filter-source-element.c
diff --git a/mail/em-filter-source-element.h b/src/mail/em-filter-source-element.h
similarity index 100%
rename from mail/em-filter-source-element.h
rename to src/mail/em-filter-source-element.h
diff --git a/mail/em-folder-properties.c b/src/mail/em-folder-properties.c
similarity index 100%
rename from mail/em-folder-properties.c
rename to src/mail/em-folder-properties.c
diff --git a/mail/em-folder-properties.h b/src/mail/em-folder-properties.h
similarity index 100%
rename from mail/em-folder-properties.h
rename to src/mail/em-folder-properties.h
diff --git a/mail/em-folder-selection-button.c b/src/mail/em-folder-selection-button.c
similarity index 100%
rename from mail/em-folder-selection-button.c
rename to src/mail/em-folder-selection-button.c
diff --git a/mail/em-folder-selection-button.h b/src/mail/em-folder-selection-button.h
similarity index 100%
rename from mail/em-folder-selection-button.h
rename to src/mail/em-folder-selection-button.h
diff --git a/mail/em-folder-selector.c b/src/mail/em-folder-selector.c
similarity index 100%
rename from mail/em-folder-selector.c
rename to src/mail/em-folder-selector.c
diff --git a/mail/em-folder-selector.h b/src/mail/em-folder-selector.h
similarity index 100%
rename from mail/em-folder-selector.h
rename to src/mail/em-folder-selector.h
diff --git a/mail/em-folder-tree-model.c b/src/mail/em-folder-tree-model.c
similarity index 100%
rename from mail/em-folder-tree-model.c
rename to src/mail/em-folder-tree-model.c
diff --git a/mail/em-folder-tree-model.h b/src/mail/em-folder-tree-model.h
similarity index 100%
rename from mail/em-folder-tree-model.h
rename to src/mail/em-folder-tree-model.h
diff --git a/mail/em-folder-tree.c b/src/mail/em-folder-tree.c
similarity index 100%
rename from mail/em-folder-tree.c
rename to src/mail/em-folder-tree.c
diff --git a/mail/em-folder-tree.h b/src/mail/em-folder-tree.h
similarity index 100%
rename from mail/em-folder-tree.h
rename to src/mail/em-folder-tree.h
diff --git a/mail/em-folder-utils.c b/src/mail/em-folder-utils.c
similarity index 100%
rename from mail/em-folder-utils.c
rename to src/mail/em-folder-utils.c
diff --git a/mail/em-folder-utils.h b/src/mail/em-folder-utils.h
similarity index 100%
rename from mail/em-folder-utils.h
rename to src/mail/em-folder-utils.h
diff --git a/mail/em-search-context.c b/src/mail/em-search-context.c
similarity index 100%
rename from mail/em-search-context.c
rename to src/mail/em-search-context.c
diff --git a/mail/em-search-context.h b/src/mail/em-search-context.h
similarity index 100%
rename from mail/em-search-context.h
rename to src/mail/em-search-context.h
diff --git a/mail/em-subscription-editor.c b/src/mail/em-subscription-editor.c
similarity index 100%
rename from mail/em-subscription-editor.c
rename to src/mail/em-subscription-editor.c
diff --git a/mail/em-subscription-editor.h b/src/mail/em-subscription-editor.h
similarity index 100%
rename from mail/em-subscription-editor.h
rename to src/mail/em-subscription-editor.h
diff --git a/mail/em-utils.c b/src/mail/em-utils.c
similarity index 100%
rename from mail/em-utils.c
rename to src/mail/em-utils.c
diff --git a/mail/em-utils.h b/src/mail/em-utils.h
similarity index 100%
rename from mail/em-utils.h
rename to src/mail/em-utils.h
diff --git a/mail/em-vfolder-editor-context.c b/src/mail/em-vfolder-editor-context.c
similarity index 100%
rename from mail/em-vfolder-editor-context.c
rename to src/mail/em-vfolder-editor-context.c
diff --git a/mail/em-vfolder-editor-context.h b/src/mail/em-vfolder-editor-context.h
similarity index 100%
rename from mail/em-vfolder-editor-context.h
rename to src/mail/em-vfolder-editor-context.h
diff --git a/mail/em-vfolder-editor-rule.c b/src/mail/em-vfolder-editor-rule.c
similarity index 100%
rename from mail/em-vfolder-editor-rule.c
rename to src/mail/em-vfolder-editor-rule.c
diff --git a/mail/em-vfolder-editor-rule.h b/src/mail/em-vfolder-editor-rule.h
similarity index 100%
rename from mail/em-vfolder-editor-rule.h
rename to src/mail/em-vfolder-editor-rule.h
diff --git a/mail/em-vfolder-editor.c b/src/mail/em-vfolder-editor.c
similarity index 100%
rename from mail/em-vfolder-editor.c
rename to src/mail/em-vfolder-editor.c
diff --git a/mail/em-vfolder-editor.h b/src/mail/em-vfolder-editor.h
similarity index 100%
rename from mail/em-vfolder-editor.h
rename to src/mail/em-vfolder-editor.h
diff --git a/mail/filtertypes.xml.in b/src/mail/filtertypes.xml.in
similarity index 100%
rename from mail/filtertypes.xml.in
rename to src/mail/filtertypes.xml.in
diff --git a/src/mail/importers/CMakeLists.txt b/src/mail/importers/CMakeLists.txt
new file mode 100644
index 0000000..a91d154
--- /dev/null
+++ b/src/mail/importers/CMakeLists.txt
@@ -0,0 +1,57 @@
+set(DEPENDENCIES
+ email-engine
+ evolution-mail
+ evolution-shell
+ evolution-util
+)
+
+set(SOURCES
+ kmail-libs.c
+ kmail-libs.h
+ kmail-importer.c
+ mail-importer.c
+ mail-importer.h
+ elm-importer.c
+ pine-importer.c
+ evolution-mbox-importer.c
+)
+
+add_library(evolution-mail-importers SHARED
+ ${SOURCES}
+)
+
+add_dependencies(evolution-mail-importers
+ ${DEPENDENCIES}
+)
+
+target_compile_definitions(evolution-mail-importers PRIVATE
+ -DG_LOG_DOMAIN=\"evolution-mail-importers\"
+ -DEVOLUTION_PRIVDATADIR=\"${privdatadir}\"
+ -DEVOLUTION_ETSPECDIR=\"${etspecdir}\"
+)
+
+target_compile_options(evolution-mail-importers PUBLIC
+ ${EVOLUTION_DATA_SERVER_CFLAGS}
+ ${GNOME_PLATFORM_CFLAGS}
+)
+
+target_include_directories(evolution-mail-importers PUBLIC
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}/src
+ ${CMAKE_SOURCE_DIR}/src
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}/src/mail
+ ${CMAKE_SOURCE_DIR}/src/mail
+ ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+ ${GNOME_PLATFORM_INCLUDE_DIRS}
+)
+
+target_link_libraries(evolution-mail-importers
+ ${DEPENDENCIES}
+ ${EVOLUTION_DATA_SERVER_LDFLAGS}
+ ${GNOME_PLATFORM_LDFLAGS}
+)
+
+install(TARGETS evolution-mail-importers
+ DESTINATION ${privsolibdir}
+)
diff --git a/mail/importers/elm-importer.c b/src/mail/importers/elm-importer.c
similarity index 100%
rename from mail/importers/elm-importer.c
rename to src/mail/importers/elm-importer.c
diff --git a/mail/importers/evolution-mbox-importer.c b/src/mail/importers/evolution-mbox-importer.c
similarity index 100%
rename from mail/importers/evolution-mbox-importer.c
rename to src/mail/importers/evolution-mbox-importer.c
diff --git a/mail/importers/kmail-importer.c b/src/mail/importers/kmail-importer.c
similarity index 100%
rename from mail/importers/kmail-importer.c
rename to src/mail/importers/kmail-importer.c
diff --git a/mail/importers/kmail-libs.c b/src/mail/importers/kmail-libs.c
similarity index 100%
rename from mail/importers/kmail-libs.c
rename to src/mail/importers/kmail-libs.c
diff --git a/mail/importers/kmail-libs.h b/src/mail/importers/kmail-libs.h
similarity index 100%
rename from mail/importers/kmail-libs.h
rename to src/mail/importers/kmail-libs.h
diff --git a/mail/importers/mail-importer.c b/src/mail/importers/mail-importer.c
similarity index 100%
rename from mail/importers/mail-importer.c
rename to src/mail/importers/mail-importer.c
diff --git a/mail/importers/mail-importer.h b/src/mail/importers/mail-importer.h
similarity index 100%
rename from mail/importers/mail-importer.h
rename to src/mail/importers/mail-importer.h
diff --git a/mail/importers/pine-importer.c b/src/mail/importers/pine-importer.c
similarity index 100%
rename from mail/importers/pine-importer.c
rename to src/mail/importers/pine-importer.c
diff --git a/mail/mail-autofilter.c b/src/mail/mail-autofilter.c
similarity index 100%
rename from mail/mail-autofilter.c
rename to src/mail/mail-autofilter.c
diff --git a/mail/mail-autofilter.h b/src/mail/mail-autofilter.h
similarity index 100%
rename from mail/mail-autofilter.h
rename to src/mail/mail-autofilter.h
diff --git a/mail/mail-config.ui b/src/mail/mail-config.ui
similarity index 100%
rename from mail/mail-config.ui
rename to src/mail/mail-config.ui
diff --git a/mail/mail-dialogs.ui b/src/mail/mail-dialogs.ui
similarity index 100%
rename from mail/mail-dialogs.ui
rename to src/mail/mail-dialogs.ui
diff --git a/mail/mail-send-recv.c b/src/mail/mail-send-recv.c
similarity index 100%
rename from mail/mail-send-recv.c
rename to src/mail/mail-send-recv.c
diff --git a/mail/mail-send-recv.h b/src/mail/mail-send-recv.h
similarity index 100%
rename from mail/mail-send-recv.h
rename to src/mail/mail-send-recv.h
diff --git a/mail/mail-vfolder-ui.c b/src/mail/mail-vfolder-ui.c
similarity index 100%
rename from mail/mail-vfolder-ui.c
rename to src/mail/mail-vfolder-ui.c
diff --git a/mail/mail-vfolder-ui.h b/src/mail/mail-vfolder-ui.h
similarity index 100%
rename from mail/mail-vfolder-ui.h
rename to src/mail/mail-vfolder-ui.h
diff --git a/mail/mail.error.xml b/src/mail/mail.error.xml
similarity index 100%
rename from mail/mail.error.xml
rename to src/mail/mail.error.xml
diff --git a/mail/message-list.c b/src/mail/message-list.c
similarity index 100%
rename from mail/message-list.c
rename to src/mail/message-list.c
diff --git a/mail/message-list.etspec b/src/mail/message-list.etspec
similarity index 100%
rename from mail/message-list.etspec
rename to src/mail/message-list.etspec
diff --git a/mail/message-list.h b/src/mail/message-list.h
similarity index 100%
rename from mail/message-list.h
rename to src/mail/message-list.h
diff --git a/mail/searchtypes.xml.in b/src/mail/searchtypes.xml.in
similarity index 100%
rename from mail/searchtypes.xml.in
rename to src/mail/searchtypes.xml.in
diff --git a/mail/test-mail-autoconfig.c b/src/mail/test-mail-autoconfig.c
similarity index 100%
rename from mail/test-mail-autoconfig.c
rename to src/mail/test-mail-autoconfig.c
diff --git a/mail/vfoldertypes.xml.in b/src/mail/vfoldertypes.xml.in
similarity index 100%
rename from mail/vfoldertypes.xml.in
rename to src/mail/vfoldertypes.xml.in
diff --git a/src/modules/CMakeLists.txt b/src/modules/CMakeLists.txt
new file mode 100644
index 0000000..46ecd74
--- /dev/null
+++ b/src/modules/CMakeLists.txt
@@ -0,0 +1,141 @@
+macro(add_simple_module _name _sourcesvar _depsvar _defsvar _cflagsvar _incdirsvar _ldflagsvar _destination)
+ set(DEPENDENCIES
+ evolution-util
+ )
+
+ set(SOURCES
+ ${${_sourcesvar}}
+ )
+
+ add_library(${_name} MODULE
+ ${SOURCES}
+ )
+
+ set_target_properties(${_name} PROPERTIES
+ PREFIX ""
+ )
+
+ add_dependencies(${_name}
+ ${DEPENDENCIES}
+ ${${_depsvar}}
+ )
+
+ target_compile_definitions(${_name} PRIVATE
+ -DG_LOG_DOMAIN=\"${_name}\"
+ ${${_defsvar}}
+ )
+
+ target_compile_options(${_name} PUBLIC
+ ${EVOLUTION_DATA_SERVER_CFLAGS}
+ ${GNOME_PLATFORM_CFLAGS}
+ ${${_cflagsvar}}
+ )
+
+ target_include_directories(${_name} PUBLIC
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}/src
+ ${CMAKE_SOURCE_DIR}/src
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+ ${GNOME_PLATFORM_INCLUDE_DIRS}
+ ${${_incdirsvar}}
+ )
+
+ target_link_libraries(${_name}
+ ${DEPENDENCIES}
+ ${${_depsvar}}
+ ${EVOLUTION_DATA_SERVER_LDFLAGS}
+ ${GNOME_PLATFORM_LDFLAGS}
+ ${${_ldflagsvar}}
+ )
+
+ install(TARGETS ${_name}
+ DESTINATION ${_destination}
+ )
+endmacro(add_simple_module)
+
+macro(add_evolution_module _name _sourcesvar _depsvar _defsvar _cflagsvar _incdirsvar _ldflagsvar)
+ add_simple_module(${_name} ${_sourcesvar} ${_depsvar} ${_defsvar} ${_cflagsvar} ${_incdirsvar}
${_ldflagsvar} ${moduledir})
+endmacro(add_evolution_module)
+
+macro(add_simple_webextension_module _name _sourcesvar _depsvar _defsvar _cflagsvar _incdirsvar _ldflagsvar
_destdir)
+ set(wex_deps
+ ${${_depsvar}}
+ edomutils
+ )
+ set(wex_cflags
+ ${${_cflagsvar}}
+ ${WEB_EXTENSIONS_CFLAGS}
+ )
+ set(wex_incdirs
+ ${${_incdirsvar}}
+ ${WEB_EXTENSIONS_INCLUDE_DIRS}
+ )
+ set(wex_ldflags
+ ${${_ldflagsvar}}
+ ${WEB_EXTENSIONS_LDFLAGS}
+ )
+
+ add_simple_module(${_name} ${_sourcesvar} wex_deps ${_defsvar} wex_cflags wex_incdirs wex_ldflags
${_destdir})
+endmacro(add_simple_webextension_module)
+
+macro(add_webextension_module _name _sourcesvar _depsvar _defsvar _cflagsvar _incdirsvar _ldflagsvar)
+ add_simple_webextension_module(${_name} ${_sourcesvar} ${_depsvar} ${_defsvar} ${_cflagsvar}
${_incdirsvar} ${_ldflagsvar} "${webextensionsdir}")
+endmacro(add_webextension_module)
+
+macro(add_webextension_editor_module _name _sourcesvar _depsvar _defsvar _cflagsvar _incdirsvar _ldflagsvar)
+ add_simple_webextension_module(${_name} ${_sourcesvar} ${_depsvar} ${_defsvar} ${_cflagsvar}
${_incdirsvar} ${_ldflagsvar} "${webextensionswebkiteditordir}")
+endmacro(add_webextension_editor_module)
+
+add_subdirectory(addressbook)
+add_subdirectory(calendar)
+add_subdirectory(mail)
+add_subdirectory(backup-restore)
+add_subdirectory(book-config-google)
+add_subdirectory(book-config-local)
+add_subdirectory(book-config-webdav)
+add_subdirectory(cal-config-caldav)
+add_subdirectory(cal-config-contacts)
+add_subdirectory(cal-config-google)
+add_subdirectory(cal-config-local)
+add_subdirectory(cal-config-webcal)
+add_subdirectory(composer-autosave)
+add_subdirectory(contact-photos)
+add_subdirectory(gravatar)
+add_subdirectory(itip-formatter)
+add_subdirectory(mail-config)
+add_subdirectory(mailto-handler)
+add_subdirectory(mdn)
+add_subdirectory(offline-alert)
+add_subdirectory(plugin-lib)
+add_subdirectory(plugin-manager)
+add_subdirectory(prefer-plain)
+add_subdirectory(settings)
+add_subdirectory(startup-wizard)
+add_subdirectory(vcard-inline)
+add_subdirectory(webkit-editor)
+add_subdirectory(webkit-inspector)
+
+if(ENABLE_TEXT_HIGHLIGHT)
+ add_subdirectory(text-highlight)
+endif(ENABLE_TEXT_HIGHLIGHT)
+
+if(ENABLE_WEATHER)
+ add_subdirectory(cal-config-weather)
+endif(ENABLE_WEATHER)
+
+if(ENABLE_YTNEF)
+ add_subdirectory(tnef-attachment)
+endif(ENABLE_YTNEF)
+
+if(HAVE_LDAP)
+ add_subdirectory(book-config-ldap)
+endif(HAVE_LDAP)
+
+if(WITH_BOGOFILTER)
+ add_subdirectory(bogofilter)
+endif(WITH_BOGOFILTER)
+
+if(WITH_SPAMASSASSIN)
+ add_subdirectory(spamassassin)
+endif(WITH_SPAMASSASSIN)
diff --git a/src/modules/addressbook/CMakeLists.txt b/src/modules/addressbook/CMakeLists.txt
new file mode 100644
index 0000000..58d45a2
--- /dev/null
+++ b/src/modules/addressbook/CMakeLists.txt
@@ -0,0 +1,67 @@
+set(extra_deps
+ eabutil
+ eabwidgets
+ econtacteditor
+ econtactlisteditor
+ econtactprint
+ evolution-addressbook-importers
+ evolution-mail-composer
+ evolution-shell
+)
+if(ENABLE_SMIME)
+ list(APPEND extra_deps evolution-smime)
+endif(ENABLE_SMIME)
+
+set(sources
+ evolution-module-addressbook.c
+ autocompletion-config.c
+ autocompletion-config.h
+ eab-composer-util.c
+ eab-composer-util.h
+ e-book-config-hook.c
+ e-book-config-hook.h
+ e-book-shell-backend.c
+ e-book-shell-backend.h
+ e-book-shell-content.c
+ e-book-shell-content.h
+ e-book-shell-migrate.c
+ e-book-shell-migrate.h
+ e-book-shell-sidebar.c
+ e-book-shell-sidebar.h
+ e-book-shell-view.c
+ e-book-shell-view.h
+ e-book-shell-view-actions.c
+ e-book-shell-view-actions.h
+ e-book-shell-view-private.c
+ e-book-shell-view-private.h
+)
+set(extra_defines)
+set(extra_cflags
+ ${CHAMPLAIN_CFLAGS}
+ ${LDAP_CFLAGS}
+)
+set(extra_incdirs
+ ${CMAKE_BINARY_DIR}/src/addressbook/util
+ ${CMAKE_BINARY_DIR}/src/addressbook/gui/contact-editor
+ ${CMAKE_BINARY_DIR}/src/addressbook/gui/contact-list-editor
+ ${CMAKE_BINARY_DIR}/src/addressbook/gui/widgets
+ ${CMAKE_SOURCE_DIR}/src/addressbook/util
+ ${CMAKE_SOURCE_DIR}/src/addressbook/gui/contact-editor
+ ${CMAKE_SOURCE_DIR}/src/addressbook/gui/contact-list-editor
+ ${CMAKE_SOURCE_DIR}/src/addressbook/gui/widgets
+ ${CHAMPLAIN_INCLUDE_DIRS}
+ ${LDAP_INCLUDE_DIRS}
+)
+set(extra_ldflags
+ ${CHAMPLAIN_LDFLAGS}
+ ${LDAP_LDFLAGS}
+)
+
+add_evolution_module(module-addressbook
+ sources
+ extra_deps
+ extra_defines
+ extra_cflags
+ extra_incdirs
+ extra_ldflags
+)
diff --git a/modules/addressbook/autocompletion-config.c b/src/modules/addressbook/autocompletion-config.c
similarity index 100%
rename from modules/addressbook/autocompletion-config.c
rename to src/modules/addressbook/autocompletion-config.c
diff --git a/modules/addressbook/autocompletion-config.h b/src/modules/addressbook/autocompletion-config.h
similarity index 100%
rename from modules/addressbook/autocompletion-config.h
rename to src/modules/addressbook/autocompletion-config.h
diff --git a/modules/addressbook/e-book-config-hook.c b/src/modules/addressbook/e-book-config-hook.c
similarity index 100%
rename from modules/addressbook/e-book-config-hook.c
rename to src/modules/addressbook/e-book-config-hook.c
diff --git a/modules/addressbook/e-book-config-hook.h b/src/modules/addressbook/e-book-config-hook.h
similarity index 100%
rename from modules/addressbook/e-book-config-hook.h
rename to src/modules/addressbook/e-book-config-hook.h
diff --git a/modules/addressbook/e-book-shell-backend.c b/src/modules/addressbook/e-book-shell-backend.c
similarity index 100%
rename from modules/addressbook/e-book-shell-backend.c
rename to src/modules/addressbook/e-book-shell-backend.c
diff --git a/modules/addressbook/e-book-shell-backend.h b/src/modules/addressbook/e-book-shell-backend.h
similarity index 100%
rename from modules/addressbook/e-book-shell-backend.h
rename to src/modules/addressbook/e-book-shell-backend.h
diff --git a/modules/addressbook/e-book-shell-content.c b/src/modules/addressbook/e-book-shell-content.c
similarity index 100%
rename from modules/addressbook/e-book-shell-content.c
rename to src/modules/addressbook/e-book-shell-content.c
diff --git a/modules/addressbook/e-book-shell-content.h b/src/modules/addressbook/e-book-shell-content.h
similarity index 100%
rename from modules/addressbook/e-book-shell-content.h
rename to src/modules/addressbook/e-book-shell-content.h
diff --git a/modules/addressbook/e-book-shell-migrate.c b/src/modules/addressbook/e-book-shell-migrate.c
similarity index 100%
rename from modules/addressbook/e-book-shell-migrate.c
rename to src/modules/addressbook/e-book-shell-migrate.c
diff --git a/modules/addressbook/e-book-shell-migrate.h b/src/modules/addressbook/e-book-shell-migrate.h
similarity index 100%
rename from modules/addressbook/e-book-shell-migrate.h
rename to src/modules/addressbook/e-book-shell-migrate.h
diff --git a/modules/addressbook/e-book-shell-sidebar.c b/src/modules/addressbook/e-book-shell-sidebar.c
similarity index 100%
rename from modules/addressbook/e-book-shell-sidebar.c
rename to src/modules/addressbook/e-book-shell-sidebar.c
diff --git a/modules/addressbook/e-book-shell-sidebar.h b/src/modules/addressbook/e-book-shell-sidebar.h
similarity index 100%
rename from modules/addressbook/e-book-shell-sidebar.h
rename to src/modules/addressbook/e-book-shell-sidebar.h
diff --git a/modules/addressbook/e-book-shell-view-actions.c
b/src/modules/addressbook/e-book-shell-view-actions.c
similarity index 100%
rename from modules/addressbook/e-book-shell-view-actions.c
rename to src/modules/addressbook/e-book-shell-view-actions.c
diff --git a/modules/addressbook/e-book-shell-view-actions.h
b/src/modules/addressbook/e-book-shell-view-actions.h
similarity index 100%
rename from modules/addressbook/e-book-shell-view-actions.h
rename to src/modules/addressbook/e-book-shell-view-actions.h
diff --git a/modules/addressbook/e-book-shell-view-private.c
b/src/modules/addressbook/e-book-shell-view-private.c
similarity index 100%
rename from modules/addressbook/e-book-shell-view-private.c
rename to src/modules/addressbook/e-book-shell-view-private.c
diff --git a/modules/addressbook/e-book-shell-view-private.h
b/src/modules/addressbook/e-book-shell-view-private.h
similarity index 100%
rename from modules/addressbook/e-book-shell-view-private.h
rename to src/modules/addressbook/e-book-shell-view-private.h
diff --git a/modules/addressbook/e-book-shell-view.c b/src/modules/addressbook/e-book-shell-view.c
similarity index 100%
rename from modules/addressbook/e-book-shell-view.c
rename to src/modules/addressbook/e-book-shell-view.c
diff --git a/modules/addressbook/e-book-shell-view.h b/src/modules/addressbook/e-book-shell-view.h
similarity index 100%
rename from modules/addressbook/e-book-shell-view.h
rename to src/modules/addressbook/e-book-shell-view.h
diff --git a/modules/addressbook/eab-composer-util.c b/src/modules/addressbook/eab-composer-util.c
similarity index 100%
rename from modules/addressbook/eab-composer-util.c
rename to src/modules/addressbook/eab-composer-util.c
diff --git a/modules/addressbook/eab-composer-util.h b/src/modules/addressbook/eab-composer-util.h
similarity index 100%
rename from modules/addressbook/eab-composer-util.h
rename to src/modules/addressbook/eab-composer-util.h
diff --git a/modules/addressbook/evolution-module-addressbook.c
b/src/modules/addressbook/evolution-module-addressbook.c
similarity index 100%
rename from modules/addressbook/evolution-module-addressbook.c
rename to src/modules/addressbook/evolution-module-addressbook.c
diff --git a/modules/addressbook/openldap-extract.h b/src/modules/addressbook/openldap-extract.h
similarity index 100%
rename from modules/addressbook/openldap-extract.h
rename to src/modules/addressbook/openldap-extract.h
diff --git a/src/modules/backup-restore/CMakeLists.txt b/src/modules/backup-restore/CMakeLists.txt
new file mode 100644
index 0000000..f60f31c
--- /dev/null
+++ b/src/modules/backup-restore/CMakeLists.txt
@@ -0,0 +1,80 @@
+add_error_files(backup-restore org-gnome-backup-restore.error)
+
+set(extra_deps
+ email-engine
+ evolution-mail
+ evolution-shell
+)
+set(sources
+ evolution-backup-restore.c
+ e-mail-config-restore-page.c
+ e-mail-config-restore-page.h
+ e-mail-config-restore-ready-page.c
+ e-mail-config-restore-ready-page.h
+)
+set(extra_defines
+ -DEVOLUTION_LOCALEDIR=\"${LOCALE_INSTALL_DIR}\"
+ -DEVOLUTION_TOOLSDIR=\"${privlibexecdir}\"
+)
+set(extra_cflags)
+set(extra_incdirs)
+set(extra_ldflags)
+
+add_evolution_module(module-backup-restore
+ sources
+ extra_deps
+ extra_defines
+ extra_cflags
+ extra_incdirs
+ extra_ldflags
+)
+
+# ******************************
+# evolution-backup binary
+# ******************************
+
+set(DEPENDENCIES
+ evolution-util
+)
+
+set(SOURCES
+ evolution-backup-tool.c
+)
+
+add_executable(evolution-backup
+ ${SOURCES}
+)
+
+add_dependencies(evolution-backup
+ ${DEPENDENCIES}
+)
+
+target_compile_definitions(evolution-backup PRIVATE
+ -DG_LOG_DOMAIN=\"evolution-backup\"
+ -DEVOLUTION_LOCALEDIR=\"${LOCALE_INSTALL_DIR}\"
+ -DDBUS_SERVICES_DIR=\"${SHARE_INSTALL_DIR}/dbus-1/services\"
+)
+
+target_compile_options(evolution-backup PUBLIC
+ ${EVOLUTION_DATA_SERVER_CFLAGS}
+ ${GNOME_PLATFORM_CFLAGS}
+)
+
+target_include_directories(evolution-backup PUBLIC
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}/src
+ ${CMAKE_SOURCE_DIR}/src
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+ ${GNOME_PLATFORM_INCLUDE_DIRS}
+)
+
+target_link_libraries(evolution-backup
+ ${DEPENDENCIES}
+ ${EVOLUTION_DATA_SERVER_LDFLAGS}
+ ${GNOME_PLATFORM_LDFLAGS}
+)
+
+install(TARGETS evolution-backup
+ DESTINATION ${privlibexecdir}
+)
diff --git a/modules/backup-restore/e-mail-config-restore-page.c
b/src/modules/backup-restore/e-mail-config-restore-page.c
similarity index 100%
rename from modules/backup-restore/e-mail-config-restore-page.c
rename to src/modules/backup-restore/e-mail-config-restore-page.c
diff --git a/modules/backup-restore/e-mail-config-restore-page.h
b/src/modules/backup-restore/e-mail-config-restore-page.h
similarity index 100%
rename from modules/backup-restore/e-mail-config-restore-page.h
rename to src/modules/backup-restore/e-mail-config-restore-page.h
diff --git a/modules/backup-restore/e-mail-config-restore-ready-page.c
b/src/modules/backup-restore/e-mail-config-restore-ready-page.c
similarity index 100%
rename from modules/backup-restore/e-mail-config-restore-ready-page.c
rename to src/modules/backup-restore/e-mail-config-restore-ready-page.c
diff --git a/modules/backup-restore/e-mail-config-restore-ready-page.h
b/src/modules/backup-restore/e-mail-config-restore-ready-page.h
similarity index 100%
rename from modules/backup-restore/e-mail-config-restore-ready-page.h
rename to src/modules/backup-restore/e-mail-config-restore-ready-page.h
diff --git a/modules/backup-restore/evolution-backup-restore.c
b/src/modules/backup-restore/evolution-backup-restore.c
similarity index 100%
rename from modules/backup-restore/evolution-backup-restore.c
rename to src/modules/backup-restore/evolution-backup-restore.c
diff --git a/modules/backup-restore/evolution-backup-tool.c
b/src/modules/backup-restore/evolution-backup-tool.c
similarity index 100%
rename from modules/backup-restore/evolution-backup-tool.c
rename to src/modules/backup-restore/evolution-backup-tool.c
diff --git a/modules/backup-restore/org-gnome-backup-restore.error.xml
b/src/modules/backup-restore/org-gnome-backup-restore.error.xml
similarity index 100%
rename from modules/backup-restore/org-gnome-backup-restore.error.xml
rename to src/modules/backup-restore/org-gnome-backup-restore.error.xml
diff --git a/modules/bogofilter/CMakeLists.txt b/src/modules/bogofilter/CMakeLists.txt
similarity index 100%
rename from modules/bogofilter/CMakeLists.txt
rename to src/modules/bogofilter/CMakeLists.txt
diff --git a/modules/bogofilter/evolution-bogofilter.c b/src/modules/bogofilter/evolution-bogofilter.c
similarity index 100%
rename from modules/bogofilter/evolution-bogofilter.c
rename to src/modules/bogofilter/evolution-bogofilter.c
diff --git a/modules/bogofilter/evolution-bogofilter.metainfo.xml.in
b/src/modules/bogofilter/evolution-bogofilter.metainfo.xml.in
similarity index 100%
rename from modules/bogofilter/evolution-bogofilter.metainfo.xml.in
rename to src/modules/bogofilter/evolution-bogofilter.metainfo.xml.in
diff --git a/modules/book-config-google/CMakeLists.txt b/src/modules/book-config-google/CMakeLists.txt
similarity index 100%
rename from modules/book-config-google/CMakeLists.txt
rename to src/modules/book-config-google/CMakeLists.txt
diff --git a/modules/book-config-google/evolution-book-config-google.c
b/src/modules/book-config-google/evolution-book-config-google.c
similarity index 100%
rename from modules/book-config-google/evolution-book-config-google.c
rename to src/modules/book-config-google/evolution-book-config-google.c
diff --git a/modules/book-config-ldap/CMakeLists.txt b/src/modules/book-config-ldap/CMakeLists.txt
similarity index 100%
rename from modules/book-config-ldap/CMakeLists.txt
rename to src/modules/book-config-ldap/CMakeLists.txt
diff --git a/modules/book-config-ldap/evolution-book-config-ldap.c
b/src/modules/book-config-ldap/evolution-book-config-ldap.c
similarity index 100%
rename from modules/book-config-ldap/evolution-book-config-ldap.c
rename to src/modules/book-config-ldap/evolution-book-config-ldap.c
diff --git a/modules/book-config-local/CMakeLists.txt b/src/modules/book-config-local/CMakeLists.txt
similarity index 100%
rename from modules/book-config-local/CMakeLists.txt
rename to src/modules/book-config-local/CMakeLists.txt
diff --git a/modules/book-config-local/evolution-book-config-local.c
b/src/modules/book-config-local/evolution-book-config-local.c
similarity index 100%
rename from modules/book-config-local/evolution-book-config-local.c
rename to src/modules/book-config-local/evolution-book-config-local.c
diff --git a/modules/book-config-webdav/CMakeLists.txt b/src/modules/book-config-webdav/CMakeLists.txt
similarity index 100%
rename from modules/book-config-webdav/CMakeLists.txt
rename to src/modules/book-config-webdav/CMakeLists.txt
diff --git a/modules/book-config-webdav/evolution-book-config-webdav.c
b/src/modules/book-config-webdav/evolution-book-config-webdav.c
similarity index 100%
rename from modules/book-config-webdav/evolution-book-config-webdav.c
rename to src/modules/book-config-webdav/evolution-book-config-webdav.c
diff --git a/modules/cal-config-caldav/CMakeLists.txt b/src/modules/cal-config-caldav/CMakeLists.txt
similarity index 100%
rename from modules/cal-config-caldav/CMakeLists.txt
rename to src/modules/cal-config-caldav/CMakeLists.txt
diff --git a/modules/cal-config-caldav/evolution-cal-config-caldav.c
b/src/modules/cal-config-caldav/evolution-cal-config-caldav.c
similarity index 100%
rename from modules/cal-config-caldav/evolution-cal-config-caldav.c
rename to src/modules/cal-config-caldav/evolution-cal-config-caldav.c
diff --git a/modules/cal-config-contacts/CMakeLists.txt b/src/modules/cal-config-contacts/CMakeLists.txt
similarity index 100%
rename from modules/cal-config-contacts/CMakeLists.txt
rename to src/modules/cal-config-contacts/CMakeLists.txt
diff --git a/modules/cal-config-contacts/e-contacts-selector.c
b/src/modules/cal-config-contacts/e-contacts-selector.c
similarity index 100%
rename from modules/cal-config-contacts/e-contacts-selector.c
rename to src/modules/cal-config-contacts/e-contacts-selector.c
diff --git a/modules/cal-config-contacts/e-contacts-selector.h
b/src/modules/cal-config-contacts/e-contacts-selector.h
similarity index 100%
rename from modules/cal-config-contacts/e-contacts-selector.h
rename to src/modules/cal-config-contacts/e-contacts-selector.h
diff --git a/modules/cal-config-contacts/evolution-cal-config-contacts.c
b/src/modules/cal-config-contacts/evolution-cal-config-contacts.c
similarity index 100%
rename from modules/cal-config-contacts/evolution-cal-config-contacts.c
rename to src/modules/cal-config-contacts/evolution-cal-config-contacts.c
diff --git a/modules/cal-config-google/CMakeLists.txt b/src/modules/cal-config-google/CMakeLists.txt
similarity index 100%
rename from modules/cal-config-google/CMakeLists.txt
rename to src/modules/cal-config-google/CMakeLists.txt
diff --git a/modules/cal-config-google/e-cal-config-google.c
b/src/modules/cal-config-google/e-cal-config-google.c
similarity index 100%
rename from modules/cal-config-google/e-cal-config-google.c
rename to src/modules/cal-config-google/e-cal-config-google.c
diff --git a/modules/cal-config-google/e-cal-config-gtasks.c
b/src/modules/cal-config-google/e-cal-config-gtasks.c
similarity index 100%
rename from modules/cal-config-google/e-cal-config-gtasks.c
rename to src/modules/cal-config-google/e-cal-config-gtasks.c
diff --git a/modules/cal-config-google/e-google-chooser-button.c
b/src/modules/cal-config-google/e-google-chooser-button.c
similarity index 100%
rename from modules/cal-config-google/e-google-chooser-button.c
rename to src/modules/cal-config-google/e-google-chooser-button.c
diff --git a/modules/cal-config-google/e-google-chooser-button.h
b/src/modules/cal-config-google/e-google-chooser-button.h
similarity index 100%
rename from modules/cal-config-google/e-google-chooser-button.h
rename to src/modules/cal-config-google/e-google-chooser-button.h
diff --git a/modules/cal-config-google/module-cal-config-google.c
b/src/modules/cal-config-google/module-cal-config-google.c
similarity index 100%
rename from modules/cal-config-google/module-cal-config-google.c
rename to src/modules/cal-config-google/module-cal-config-google.c
diff --git a/modules/cal-config-google/module-cal-config-google.h
b/src/modules/cal-config-google/module-cal-config-google.h
similarity index 100%
rename from modules/cal-config-google/module-cal-config-google.h
rename to src/modules/cal-config-google/module-cal-config-google.h
diff --git a/modules/cal-config-local/CMakeLists.txt b/src/modules/cal-config-local/CMakeLists.txt
similarity index 100%
rename from modules/cal-config-local/CMakeLists.txt
rename to src/modules/cal-config-local/CMakeLists.txt
diff --git a/modules/cal-config-local/evolution-cal-config-local.c
b/src/modules/cal-config-local/evolution-cal-config-local.c
similarity index 100%
rename from modules/cal-config-local/evolution-cal-config-local.c
rename to src/modules/cal-config-local/evolution-cal-config-local.c
diff --git a/modules/cal-config-weather/CMakeLists.txt b/src/modules/cal-config-weather/CMakeLists.txt
similarity index 100%
rename from modules/cal-config-weather/CMakeLists.txt
rename to src/modules/cal-config-weather/CMakeLists.txt
diff --git a/modules/cal-config-weather/evolution-cal-config-weather.c
b/src/modules/cal-config-weather/evolution-cal-config-weather.c
similarity index 100%
rename from modules/cal-config-weather/evolution-cal-config-weather.c
rename to src/modules/cal-config-weather/evolution-cal-config-weather.c
diff --git a/modules/cal-config-webcal/CMakeLists.txt b/src/modules/cal-config-webcal/CMakeLists.txt
similarity index 100%
rename from modules/cal-config-webcal/CMakeLists.txt
rename to src/modules/cal-config-webcal/CMakeLists.txt
diff --git a/modules/cal-config-webcal/evolution-cal-config-webcal.c
b/src/modules/cal-config-webcal/evolution-cal-config-webcal.c
similarity index 100%
rename from modules/cal-config-webcal/evolution-cal-config-webcal.c
rename to src/modules/cal-config-webcal/evolution-cal-config-webcal.c
diff --git a/modules/calendar/CMakeLists.txt b/src/modules/calendar/CMakeLists.txt
similarity index 100%
rename from modules/calendar/CMakeLists.txt
rename to src/modules/calendar/CMakeLists.txt
diff --git a/modules/calendar/e-cal-attachment-handler.c b/src/modules/calendar/e-cal-attachment-handler.c
similarity index 100%
rename from modules/calendar/e-cal-attachment-handler.c
rename to src/modules/calendar/e-cal-attachment-handler.c
diff --git a/modules/calendar/e-cal-attachment-handler.h b/src/modules/calendar/e-cal-attachment-handler.h
similarity index 100%
rename from modules/calendar/e-cal-attachment-handler.h
rename to src/modules/calendar/e-cal-attachment-handler.h
diff --git a/modules/calendar/e-cal-base-shell-backend.c b/src/modules/calendar/e-cal-base-shell-backend.c
similarity index 100%
rename from modules/calendar/e-cal-base-shell-backend.c
rename to src/modules/calendar/e-cal-base-shell-backend.c
diff --git a/modules/calendar/e-cal-base-shell-backend.h b/src/modules/calendar/e-cal-base-shell-backend.h
similarity index 100%
rename from modules/calendar/e-cal-base-shell-backend.h
rename to src/modules/calendar/e-cal-base-shell-backend.h
diff --git a/modules/calendar/e-cal-base-shell-content.c b/src/modules/calendar/e-cal-base-shell-content.c
similarity index 100%
rename from modules/calendar/e-cal-base-shell-content.c
rename to src/modules/calendar/e-cal-base-shell-content.c
diff --git a/modules/calendar/e-cal-base-shell-content.h b/src/modules/calendar/e-cal-base-shell-content.h
similarity index 100%
rename from modules/calendar/e-cal-base-shell-content.h
rename to src/modules/calendar/e-cal-base-shell-content.h
diff --git a/modules/calendar/e-cal-base-shell-sidebar.c b/src/modules/calendar/e-cal-base-shell-sidebar.c
similarity index 100%
rename from modules/calendar/e-cal-base-shell-sidebar.c
rename to src/modules/calendar/e-cal-base-shell-sidebar.c
diff --git a/modules/calendar/e-cal-base-shell-sidebar.h b/src/modules/calendar/e-cal-base-shell-sidebar.h
similarity index 100%
rename from modules/calendar/e-cal-base-shell-sidebar.h
rename to src/modules/calendar/e-cal-base-shell-sidebar.h
diff --git a/modules/calendar/e-cal-base-shell-view.c b/src/modules/calendar/e-cal-base-shell-view.c
similarity index 100%
rename from modules/calendar/e-cal-base-shell-view.c
rename to src/modules/calendar/e-cal-base-shell-view.c
diff --git a/modules/calendar/e-cal-base-shell-view.h b/src/modules/calendar/e-cal-base-shell-view.h
similarity index 100%
rename from modules/calendar/e-cal-base-shell-view.h
rename to src/modules/calendar/e-cal-base-shell-view.h
diff --git a/modules/calendar/e-cal-config-hook.c b/src/modules/calendar/e-cal-config-hook.c
similarity index 100%
rename from modules/calendar/e-cal-config-hook.c
rename to src/modules/calendar/e-cal-config-hook.c
diff --git a/modules/calendar/e-cal-config-hook.h b/src/modules/calendar/e-cal-config-hook.h
similarity index 100%
rename from modules/calendar/e-cal-config-hook.h
rename to src/modules/calendar/e-cal-config-hook.h
diff --git a/modules/calendar/e-cal-event-hook.c b/src/modules/calendar/e-cal-event-hook.c
similarity index 100%
rename from modules/calendar/e-cal-event-hook.c
rename to src/modules/calendar/e-cal-event-hook.c
diff --git a/modules/calendar/e-cal-event-hook.h b/src/modules/calendar/e-cal-event-hook.h
similarity index 100%
rename from modules/calendar/e-cal-event-hook.h
rename to src/modules/calendar/e-cal-event-hook.h
diff --git a/modules/calendar/e-cal-shell-backend.c b/src/modules/calendar/e-cal-shell-backend.c
similarity index 100%
rename from modules/calendar/e-cal-shell-backend.c
rename to src/modules/calendar/e-cal-shell-backend.c
diff --git a/modules/calendar/e-cal-shell-backend.h b/src/modules/calendar/e-cal-shell-backend.h
similarity index 100%
rename from modules/calendar/e-cal-shell-backend.h
rename to src/modules/calendar/e-cal-shell-backend.h
diff --git a/modules/calendar/e-cal-shell-content.c b/src/modules/calendar/e-cal-shell-content.c
similarity index 100%
rename from modules/calendar/e-cal-shell-content.c
rename to src/modules/calendar/e-cal-shell-content.c
diff --git a/modules/calendar/e-cal-shell-content.h b/src/modules/calendar/e-cal-shell-content.h
similarity index 100%
rename from modules/calendar/e-cal-shell-content.h
rename to src/modules/calendar/e-cal-shell-content.h
diff --git a/modules/calendar/e-cal-shell-migrate.c b/src/modules/calendar/e-cal-shell-migrate.c
similarity index 100%
rename from modules/calendar/e-cal-shell-migrate.c
rename to src/modules/calendar/e-cal-shell-migrate.c
diff --git a/modules/calendar/e-cal-shell-migrate.h b/src/modules/calendar/e-cal-shell-migrate.h
similarity index 100%
rename from modules/calendar/e-cal-shell-migrate.h
rename to src/modules/calendar/e-cal-shell-migrate.h
diff --git a/modules/calendar/e-cal-shell-view-actions.c b/src/modules/calendar/e-cal-shell-view-actions.c
similarity index 100%
rename from modules/calendar/e-cal-shell-view-actions.c
rename to src/modules/calendar/e-cal-shell-view-actions.c
diff --git a/modules/calendar/e-cal-shell-view-actions.h b/src/modules/calendar/e-cal-shell-view-actions.h
similarity index 100%
rename from modules/calendar/e-cal-shell-view-actions.h
rename to src/modules/calendar/e-cal-shell-view-actions.h
diff --git a/modules/calendar/e-cal-shell-view-memopad.c b/src/modules/calendar/e-cal-shell-view-memopad.c
similarity index 100%
rename from modules/calendar/e-cal-shell-view-memopad.c
rename to src/modules/calendar/e-cal-shell-view-memopad.c
diff --git a/modules/calendar/e-cal-shell-view-private.c b/src/modules/calendar/e-cal-shell-view-private.c
similarity index 100%
rename from modules/calendar/e-cal-shell-view-private.c
rename to src/modules/calendar/e-cal-shell-view-private.c
diff --git a/modules/calendar/e-cal-shell-view-private.h b/src/modules/calendar/e-cal-shell-view-private.h
similarity index 100%
rename from modules/calendar/e-cal-shell-view-private.h
rename to src/modules/calendar/e-cal-shell-view-private.h
diff --git a/modules/calendar/e-cal-shell-view-taskpad.c b/src/modules/calendar/e-cal-shell-view-taskpad.c
similarity index 100%
rename from modules/calendar/e-cal-shell-view-taskpad.c
rename to src/modules/calendar/e-cal-shell-view-taskpad.c
diff --git a/modules/calendar/e-cal-shell-view.c b/src/modules/calendar/e-cal-shell-view.c
similarity index 100%
rename from modules/calendar/e-cal-shell-view.c
rename to src/modules/calendar/e-cal-shell-view.c
diff --git a/modules/calendar/e-cal-shell-view.h b/src/modules/calendar/e-cal-shell-view.h
similarity index 100%
rename from modules/calendar/e-cal-shell-view.h
rename to src/modules/calendar/e-cal-shell-view.h
diff --git a/modules/calendar/e-calendar-preferences.c b/src/modules/calendar/e-calendar-preferences.c
similarity index 100%
rename from modules/calendar/e-calendar-preferences.c
rename to src/modules/calendar/e-calendar-preferences.c
diff --git a/modules/calendar/e-calendar-preferences.h b/src/modules/calendar/e-calendar-preferences.h
similarity index 100%
rename from modules/calendar/e-calendar-preferences.h
rename to src/modules/calendar/e-calendar-preferences.h
diff --git a/modules/calendar/e-calendar-preferences.ui b/src/modules/calendar/e-calendar-preferences.ui
similarity index 100%
rename from modules/calendar/e-calendar-preferences.ui
rename to src/modules/calendar/e-calendar-preferences.ui
diff --git a/modules/calendar/e-memo-shell-backend.c b/src/modules/calendar/e-memo-shell-backend.c
similarity index 100%
rename from modules/calendar/e-memo-shell-backend.c
rename to src/modules/calendar/e-memo-shell-backend.c
diff --git a/modules/calendar/e-memo-shell-backend.h b/src/modules/calendar/e-memo-shell-backend.h
similarity index 100%
rename from modules/calendar/e-memo-shell-backend.h
rename to src/modules/calendar/e-memo-shell-backend.h
diff --git a/modules/calendar/e-memo-shell-content.c b/src/modules/calendar/e-memo-shell-content.c
similarity index 100%
rename from modules/calendar/e-memo-shell-content.c
rename to src/modules/calendar/e-memo-shell-content.c
diff --git a/modules/calendar/e-memo-shell-content.h b/src/modules/calendar/e-memo-shell-content.h
similarity index 100%
rename from modules/calendar/e-memo-shell-content.h
rename to src/modules/calendar/e-memo-shell-content.h
diff --git a/modules/calendar/e-memo-shell-migrate.c b/src/modules/calendar/e-memo-shell-migrate.c
similarity index 100%
rename from modules/calendar/e-memo-shell-migrate.c
rename to src/modules/calendar/e-memo-shell-migrate.c
diff --git a/modules/calendar/e-memo-shell-migrate.h b/src/modules/calendar/e-memo-shell-migrate.h
similarity index 100%
rename from modules/calendar/e-memo-shell-migrate.h
rename to src/modules/calendar/e-memo-shell-migrate.h
diff --git a/modules/calendar/e-memo-shell-view-actions.c b/src/modules/calendar/e-memo-shell-view-actions.c
similarity index 100%
rename from modules/calendar/e-memo-shell-view-actions.c
rename to src/modules/calendar/e-memo-shell-view-actions.c
diff --git a/modules/calendar/e-memo-shell-view-actions.h b/src/modules/calendar/e-memo-shell-view-actions.h
similarity index 100%
rename from modules/calendar/e-memo-shell-view-actions.h
rename to src/modules/calendar/e-memo-shell-view-actions.h
diff --git a/modules/calendar/e-memo-shell-view-private.c b/src/modules/calendar/e-memo-shell-view-private.c
similarity index 100%
rename from modules/calendar/e-memo-shell-view-private.c
rename to src/modules/calendar/e-memo-shell-view-private.c
diff --git a/modules/calendar/e-memo-shell-view-private.h b/src/modules/calendar/e-memo-shell-view-private.h
similarity index 100%
rename from modules/calendar/e-memo-shell-view-private.h
rename to src/modules/calendar/e-memo-shell-view-private.h
diff --git a/modules/calendar/e-memo-shell-view.c b/src/modules/calendar/e-memo-shell-view.c
similarity index 100%
rename from modules/calendar/e-memo-shell-view.c
rename to src/modules/calendar/e-memo-shell-view.c
diff --git a/modules/calendar/e-memo-shell-view.h b/src/modules/calendar/e-memo-shell-view.h
similarity index 100%
rename from modules/calendar/e-memo-shell-view.h
rename to src/modules/calendar/e-memo-shell-view.h
diff --git a/modules/calendar/e-task-shell-backend.c b/src/modules/calendar/e-task-shell-backend.c
similarity index 100%
rename from modules/calendar/e-task-shell-backend.c
rename to src/modules/calendar/e-task-shell-backend.c
diff --git a/modules/calendar/e-task-shell-backend.h b/src/modules/calendar/e-task-shell-backend.h
similarity index 100%
rename from modules/calendar/e-task-shell-backend.h
rename to src/modules/calendar/e-task-shell-backend.h
diff --git a/modules/calendar/e-task-shell-content.c b/src/modules/calendar/e-task-shell-content.c
similarity index 100%
rename from modules/calendar/e-task-shell-content.c
rename to src/modules/calendar/e-task-shell-content.c
diff --git a/modules/calendar/e-task-shell-content.h b/src/modules/calendar/e-task-shell-content.h
similarity index 100%
rename from modules/calendar/e-task-shell-content.h
rename to src/modules/calendar/e-task-shell-content.h
diff --git a/modules/calendar/e-task-shell-migrate.c b/src/modules/calendar/e-task-shell-migrate.c
similarity index 100%
rename from modules/calendar/e-task-shell-migrate.c
rename to src/modules/calendar/e-task-shell-migrate.c
diff --git a/modules/calendar/e-task-shell-migrate.h b/src/modules/calendar/e-task-shell-migrate.h
similarity index 100%
rename from modules/calendar/e-task-shell-migrate.h
rename to src/modules/calendar/e-task-shell-migrate.h
diff --git a/modules/calendar/e-task-shell-view-actions.c b/src/modules/calendar/e-task-shell-view-actions.c
similarity index 100%
rename from modules/calendar/e-task-shell-view-actions.c
rename to src/modules/calendar/e-task-shell-view-actions.c
diff --git a/modules/calendar/e-task-shell-view-actions.h b/src/modules/calendar/e-task-shell-view-actions.h
similarity index 100%
rename from modules/calendar/e-task-shell-view-actions.h
rename to src/modules/calendar/e-task-shell-view-actions.h
diff --git a/modules/calendar/e-task-shell-view-private.c b/src/modules/calendar/e-task-shell-view-private.c
similarity index 100%
rename from modules/calendar/e-task-shell-view-private.c
rename to src/modules/calendar/e-task-shell-view-private.c
diff --git a/modules/calendar/e-task-shell-view-private.h b/src/modules/calendar/e-task-shell-view-private.h
similarity index 100%
rename from modules/calendar/e-task-shell-view-private.h
rename to src/modules/calendar/e-task-shell-view-private.h
diff --git a/modules/calendar/e-task-shell-view.c b/src/modules/calendar/e-task-shell-view.c
similarity index 100%
rename from modules/calendar/e-task-shell-view.c
rename to src/modules/calendar/e-task-shell-view.c
diff --git a/modules/calendar/e-task-shell-view.h b/src/modules/calendar/e-task-shell-view.h
similarity index 100%
rename from modules/calendar/e-task-shell-view.h
rename to src/modules/calendar/e-task-shell-view.h
diff --git a/modules/calendar/evolution-module-calendar.c b/src/modules/calendar/evolution-module-calendar.c
similarity index 100%
rename from modules/calendar/evolution-module-calendar.c
rename to src/modules/calendar/evolution-module-calendar.c
diff --git a/modules/composer-autosave/CMakeLists.txt b/src/modules/composer-autosave/CMakeLists.txt
similarity index 100%
rename from modules/composer-autosave/CMakeLists.txt
rename to src/modules/composer-autosave/CMakeLists.txt
diff --git a/modules/composer-autosave/e-autosave-utils.c b/src/modules/composer-autosave/e-autosave-utils.c
similarity index 100%
rename from modules/composer-autosave/e-autosave-utils.c
rename to src/modules/composer-autosave/e-autosave-utils.c
diff --git a/modules/composer-autosave/e-autosave-utils.h b/src/modules/composer-autosave/e-autosave-utils.h
similarity index 100%
rename from modules/composer-autosave/e-autosave-utils.h
rename to src/modules/composer-autosave/e-autosave-utils.h
diff --git a/modules/composer-autosave/e-composer-autosave.c
b/src/modules/composer-autosave/e-composer-autosave.c
similarity index 100%
rename from modules/composer-autosave/e-composer-autosave.c
rename to src/modules/composer-autosave/e-composer-autosave.c
diff --git a/modules/composer-autosave/e-composer-autosave.h
b/src/modules/composer-autosave/e-composer-autosave.h
similarity index 100%
rename from modules/composer-autosave/e-composer-autosave.h
rename to src/modules/composer-autosave/e-composer-autosave.h
diff --git a/modules/composer-autosave/e-composer-registry.c
b/src/modules/composer-autosave/e-composer-registry.c
similarity index 100%
rename from modules/composer-autosave/e-composer-registry.c
rename to src/modules/composer-autosave/e-composer-registry.c
diff --git a/modules/composer-autosave/e-composer-registry.h
b/src/modules/composer-autosave/e-composer-registry.h
similarity index 100%
rename from modules/composer-autosave/e-composer-registry.h
rename to src/modules/composer-autosave/e-composer-registry.h
diff --git a/modules/composer-autosave/evolution-composer-autosave.c
b/src/modules/composer-autosave/evolution-composer-autosave.c
similarity index 100%
rename from modules/composer-autosave/evolution-composer-autosave.c
rename to src/modules/composer-autosave/evolution-composer-autosave.c
diff --git a/modules/contact-photos/CMakeLists.txt b/src/modules/contact-photos/CMakeLists.txt
similarity index 100%
rename from modules/contact-photos/CMakeLists.txt
rename to src/modules/contact-photos/CMakeLists.txt
diff --git a/modules/contact-photos/e-contact-photo-source.c
b/src/modules/contact-photos/e-contact-photo-source.c
similarity index 100%
rename from modules/contact-photos/e-contact-photo-source.c
rename to src/modules/contact-photos/e-contact-photo-source.c
diff --git a/modules/contact-photos/e-contact-photo-source.h
b/src/modules/contact-photos/e-contact-photo-source.h
similarity index 100%
rename from modules/contact-photos/e-contact-photo-source.h
rename to src/modules/contact-photos/e-contact-photo-source.h
diff --git a/modules/contact-photos/e-photo-cache-contact-loader.c
b/src/modules/contact-photos/e-photo-cache-contact-loader.c
similarity index 100%
rename from modules/contact-photos/e-photo-cache-contact-loader.c
rename to src/modules/contact-photos/e-photo-cache-contact-loader.c
diff --git a/modules/contact-photos/e-photo-cache-contact-loader.h
b/src/modules/contact-photos/e-photo-cache-contact-loader.h
similarity index 100%
rename from modules/contact-photos/e-photo-cache-contact-loader.h
rename to src/modules/contact-photos/e-photo-cache-contact-loader.h
diff --git a/modules/contact-photos/evolution-contact-photos.c
b/src/modules/contact-photos/evolution-contact-photos.c
similarity index 100%
rename from modules/contact-photos/evolution-contact-photos.c
rename to src/modules/contact-photos/evolution-contact-photos.c
diff --git a/modules/gravatar/CMakeLists.txt b/src/modules/gravatar/CMakeLists.txt
similarity index 100%
rename from modules/gravatar/CMakeLists.txt
rename to src/modules/gravatar/CMakeLists.txt
diff --git a/modules/gravatar/e-gravatar-photo-source.c b/src/modules/gravatar/e-gravatar-photo-source.c
similarity index 100%
rename from modules/gravatar/e-gravatar-photo-source.c
rename to src/modules/gravatar/e-gravatar-photo-source.c
diff --git a/modules/gravatar/e-gravatar-photo-source.h b/src/modules/gravatar/e-gravatar-photo-source.h
similarity index 100%
rename from modules/gravatar/e-gravatar-photo-source.h
rename to src/modules/gravatar/e-gravatar-photo-source.h
diff --git a/modules/gravatar/e-photo-cache-gravatar-loader.c
b/src/modules/gravatar/e-photo-cache-gravatar-loader.c
similarity index 100%
rename from modules/gravatar/e-photo-cache-gravatar-loader.c
rename to src/modules/gravatar/e-photo-cache-gravatar-loader.c
diff --git a/modules/gravatar/e-photo-cache-gravatar-loader.h
b/src/modules/gravatar/e-photo-cache-gravatar-loader.h
similarity index 100%
rename from modules/gravatar/e-photo-cache-gravatar-loader.h
rename to src/modules/gravatar/e-photo-cache-gravatar-loader.h
diff --git a/modules/gravatar/evolution-module-gravatar.c b/src/modules/gravatar/evolution-module-gravatar.c
similarity index 100%
rename from modules/gravatar/evolution-module-gravatar.c
rename to src/modules/gravatar/evolution-module-gravatar.c
diff --git a/modules/itip-formatter/CMakeLists.txt b/src/modules/itip-formatter/CMakeLists.txt
similarity index 100%
rename from modules/itip-formatter/CMakeLists.txt
rename to src/modules/itip-formatter/CMakeLists.txt
diff --git a/modules/itip-formatter/e-mail-formatter-itip.c
b/src/modules/itip-formatter/e-mail-formatter-itip.c
similarity index 100%
rename from modules/itip-formatter/e-mail-formatter-itip.c
rename to src/modules/itip-formatter/e-mail-formatter-itip.c
diff --git a/modules/itip-formatter/e-mail-formatter-itip.h
b/src/modules/itip-formatter/e-mail-formatter-itip.h
similarity index 100%
rename from modules/itip-formatter/e-mail-formatter-itip.h
rename to src/modules/itip-formatter/e-mail-formatter-itip.h
diff --git a/modules/itip-formatter/e-mail-parser-itip.c b/src/modules/itip-formatter/e-mail-parser-itip.c
similarity index 100%
rename from modules/itip-formatter/e-mail-parser-itip.c
rename to src/modules/itip-formatter/e-mail-parser-itip.c
diff --git a/modules/itip-formatter/e-mail-parser-itip.h b/src/modules/itip-formatter/e-mail-parser-itip.h
similarity index 100%
rename from modules/itip-formatter/e-mail-parser-itip.h
rename to src/modules/itip-formatter/e-mail-parser-itip.h
diff --git a/modules/itip-formatter/e-mail-part-itip.c b/src/modules/itip-formatter/e-mail-part-itip.c
similarity index 100%
rename from modules/itip-formatter/e-mail-part-itip.c
rename to src/modules/itip-formatter/e-mail-part-itip.c
diff --git a/modules/itip-formatter/e-mail-part-itip.h b/src/modules/itip-formatter/e-mail-part-itip.h
similarity index 100%
rename from modules/itip-formatter/e-mail-part-itip.h
rename to src/modules/itip-formatter/e-mail-part-itip.h
diff --git a/modules/itip-formatter/evolution-module-itip-formatter.c
b/src/modules/itip-formatter/evolution-module-itip-formatter.c
similarity index 100%
rename from modules/itip-formatter/evolution-module-itip-formatter.c
rename to src/modules/itip-formatter/evolution-module-itip-formatter.c
diff --git a/modules/itip-formatter/itip-view-elements-defines.h
b/src/modules/itip-formatter/itip-view-elements-defines.h
similarity index 100%
rename from modules/itip-formatter/itip-view-elements-defines.h
rename to src/modules/itip-formatter/itip-view-elements-defines.h
diff --git a/modules/itip-formatter/itip-view.c b/src/modules/itip-formatter/itip-view.c
similarity index 100%
rename from modules/itip-formatter/itip-view.c
rename to src/modules/itip-formatter/itip-view.c
diff --git a/modules/itip-formatter/itip-view.h b/src/modules/itip-formatter/itip-view.h
similarity index 100%
rename from modules/itip-formatter/itip-view.h
rename to src/modules/itip-formatter/itip-view.h
diff --git a/modules/itip-formatter/org-gnome-itip-formatter.error.xml
b/src/modules/itip-formatter/org-gnome-itip-formatter.error.xml
similarity index 100%
rename from modules/itip-formatter/org-gnome-itip-formatter.error.xml
rename to src/modules/itip-formatter/org-gnome-itip-formatter.error.xml
diff --git a/modules/itip-formatter/web-extension/CMakeLists.txt
b/src/modules/itip-formatter/web-extension/CMakeLists.txt
similarity index 100%
rename from modules/itip-formatter/web-extension/CMakeLists.txt
rename to src/modules/itip-formatter/web-extension/CMakeLists.txt
diff --git a/modules/itip-formatter/web-extension/module-itip-formatter-dom-utils.c
b/src/modules/itip-formatter/web-extension/module-itip-formatter-dom-utils.c
similarity index 100%
rename from modules/itip-formatter/web-extension/module-itip-formatter-dom-utils.c
rename to src/modules/itip-formatter/web-extension/module-itip-formatter-dom-utils.c
diff --git a/modules/itip-formatter/web-extension/module-itip-formatter-dom-utils.h
b/src/modules/itip-formatter/web-extension/module-itip-formatter-dom-utils.h
similarity index 100%
rename from modules/itip-formatter/web-extension/module-itip-formatter-dom-utils.h
rename to src/modules/itip-formatter/web-extension/module-itip-formatter-dom-utils.h
diff --git a/modules/itip-formatter/web-extension/module-itip-formatter-web-extension.c
b/src/modules/itip-formatter/web-extension/module-itip-formatter-web-extension.c
similarity index 100%
rename from modules/itip-formatter/web-extension/module-itip-formatter-web-extension.c
rename to src/modules/itip-formatter/web-extension/module-itip-formatter-web-extension.c
diff --git a/modules/itip-formatter/web-extension/module-itip-formatter-web-extension.h
b/src/modules/itip-formatter/web-extension/module-itip-formatter-web-extension.h
similarity index 100%
rename from modules/itip-formatter/web-extension/module-itip-formatter-web-extension.h
rename to src/modules/itip-formatter/web-extension/module-itip-formatter-web-extension.h
diff --git a/modules/mail-config/CMakeLists.txt b/src/modules/mail-config/CMakeLists.txt
similarity index 100%
rename from modules/mail-config/CMakeLists.txt
rename to src/modules/mail-config/CMakeLists.txt
diff --git a/modules/mail-config/e-mail-config-google-summary.c
b/src/modules/mail-config/e-mail-config-google-summary.c
similarity index 100%
rename from modules/mail-config/e-mail-config-google-summary.c
rename to src/modules/mail-config/e-mail-config-google-summary.c
diff --git a/modules/mail-config/e-mail-config-google-summary.h
b/src/modules/mail-config/e-mail-config-google-summary.h
similarity index 100%
rename from modules/mail-config/e-mail-config-google-summary.h
rename to src/modules/mail-config/e-mail-config-google-summary.h
diff --git a/modules/mail-config/e-mail-config-local-accounts.c
b/src/modules/mail-config/e-mail-config-local-accounts.c
similarity index 100%
rename from modules/mail-config/e-mail-config-local-accounts.c
rename to src/modules/mail-config/e-mail-config-local-accounts.c
diff --git a/modules/mail-config/e-mail-config-remote-accounts.c
b/src/modules/mail-config/e-mail-config-remote-accounts.c
similarity index 100%
rename from modules/mail-config/e-mail-config-remote-accounts.c
rename to src/modules/mail-config/e-mail-config-remote-accounts.c
diff --git a/modules/mail-config/e-mail-config-sendmail-backend.c
b/src/modules/mail-config/e-mail-config-sendmail-backend.c
similarity index 100%
rename from modules/mail-config/e-mail-config-sendmail-backend.c
rename to src/modules/mail-config/e-mail-config-sendmail-backend.c
diff --git a/modules/mail-config/e-mail-config-sendmail-backend.h
b/src/modules/mail-config/e-mail-config-sendmail-backend.h
similarity index 100%
rename from modules/mail-config/e-mail-config-sendmail-backend.h
rename to src/modules/mail-config/e-mail-config-sendmail-backend.h
diff --git a/modules/mail-config/e-mail-config-smtp-backend.c
b/src/modules/mail-config/e-mail-config-smtp-backend.c
similarity index 100%
rename from modules/mail-config/e-mail-config-smtp-backend.c
rename to src/modules/mail-config/e-mail-config-smtp-backend.c
diff --git a/modules/mail-config/e-mail-config-smtp-backend.h
b/src/modules/mail-config/e-mail-config-smtp-backend.h
similarity index 100%
rename from modules/mail-config/e-mail-config-smtp-backend.h
rename to src/modules/mail-config/e-mail-config-smtp-backend.h
diff --git a/modules/mail-config/e-mail-config-yahoo-summary.c
b/src/modules/mail-config/e-mail-config-yahoo-summary.c
similarity index 100%
rename from modules/mail-config/e-mail-config-yahoo-summary.c
rename to src/modules/mail-config/e-mail-config-yahoo-summary.c
diff --git a/modules/mail-config/e-mail-config-yahoo-summary.h
b/src/modules/mail-config/e-mail-config-yahoo-summary.h
similarity index 100%
rename from modules/mail-config/e-mail-config-yahoo-summary.h
rename to src/modules/mail-config/e-mail-config-yahoo-summary.h
diff --git a/modules/mail-config/evolution-mail-config.c b/src/modules/mail-config/evolution-mail-config.c
similarity index 100%
rename from modules/mail-config/evolution-mail-config.c
rename to src/modules/mail-config/evolution-mail-config.c
diff --git a/modules/mail/CMakeLists.txt b/src/modules/mail/CMakeLists.txt
similarity index 100%
rename from modules/mail/CMakeLists.txt
rename to src/modules/mail/CMakeLists.txt
diff --git a/modules/mail/e-mail-attachment-handler.c b/src/modules/mail/e-mail-attachment-handler.c
similarity index 100%
rename from modules/mail/e-mail-attachment-handler.c
rename to src/modules/mail/e-mail-attachment-handler.c
diff --git a/modules/mail/e-mail-attachment-handler.h b/src/modules/mail/e-mail-attachment-handler.h
similarity index 100%
rename from modules/mail/e-mail-attachment-handler.h
rename to src/modules/mail/e-mail-attachment-handler.h
diff --git a/modules/mail/e-mail-config-hook.c b/src/modules/mail/e-mail-config-hook.c
similarity index 100%
rename from modules/mail/e-mail-config-hook.c
rename to src/modules/mail/e-mail-config-hook.c
diff --git a/modules/mail/e-mail-config-hook.h b/src/modules/mail/e-mail-config-hook.h
similarity index 100%
rename from modules/mail/e-mail-config-hook.h
rename to src/modules/mail/e-mail-config-hook.h
diff --git a/modules/mail/e-mail-event-hook.c b/src/modules/mail/e-mail-event-hook.c
similarity index 100%
rename from modules/mail/e-mail-event-hook.c
rename to src/modules/mail/e-mail-event-hook.c
diff --git a/modules/mail/e-mail-event-hook.h b/src/modules/mail/e-mail-event-hook.h
similarity index 100%
rename from modules/mail/e-mail-event-hook.h
rename to src/modules/mail/e-mail-event-hook.h
diff --git a/modules/mail/e-mail-shell-backend.c b/src/modules/mail/e-mail-shell-backend.c
similarity index 100%
rename from modules/mail/e-mail-shell-backend.c
rename to src/modules/mail/e-mail-shell-backend.c
diff --git a/modules/mail/e-mail-shell-backend.h b/src/modules/mail/e-mail-shell-backend.h
similarity index 100%
rename from modules/mail/e-mail-shell-backend.h
rename to src/modules/mail/e-mail-shell-backend.h
diff --git a/modules/mail/e-mail-shell-content.c b/src/modules/mail/e-mail-shell-content.c
similarity index 100%
rename from modules/mail/e-mail-shell-content.c
rename to src/modules/mail/e-mail-shell-content.c
diff --git a/modules/mail/e-mail-shell-content.h b/src/modules/mail/e-mail-shell-content.h
similarity index 100%
rename from modules/mail/e-mail-shell-content.h
rename to src/modules/mail/e-mail-shell-content.h
diff --git a/modules/mail/e-mail-shell-sidebar.c b/src/modules/mail/e-mail-shell-sidebar.c
similarity index 100%
rename from modules/mail/e-mail-shell-sidebar.c
rename to src/modules/mail/e-mail-shell-sidebar.c
diff --git a/modules/mail/e-mail-shell-sidebar.h b/src/modules/mail/e-mail-shell-sidebar.h
similarity index 100%
rename from modules/mail/e-mail-shell-sidebar.h
rename to src/modules/mail/e-mail-shell-sidebar.h
diff --git a/modules/mail/e-mail-shell-view-actions.c b/src/modules/mail/e-mail-shell-view-actions.c
similarity index 100%
rename from modules/mail/e-mail-shell-view-actions.c
rename to src/modules/mail/e-mail-shell-view-actions.c
diff --git a/modules/mail/e-mail-shell-view-actions.h b/src/modules/mail/e-mail-shell-view-actions.h
similarity index 100%
rename from modules/mail/e-mail-shell-view-actions.h
rename to src/modules/mail/e-mail-shell-view-actions.h
diff --git a/modules/mail/e-mail-shell-view-private.c b/src/modules/mail/e-mail-shell-view-private.c
similarity index 100%
rename from modules/mail/e-mail-shell-view-private.c
rename to src/modules/mail/e-mail-shell-view-private.c
diff --git a/modules/mail/e-mail-shell-view-private.h b/src/modules/mail/e-mail-shell-view-private.h
similarity index 100%
rename from modules/mail/e-mail-shell-view-private.h
rename to src/modules/mail/e-mail-shell-view-private.h
diff --git a/modules/mail/e-mail-shell-view.c b/src/modules/mail/e-mail-shell-view.c
similarity index 100%
rename from modules/mail/e-mail-shell-view.c
rename to src/modules/mail/e-mail-shell-view.c
diff --git a/modules/mail/e-mail-shell-view.h b/src/modules/mail/e-mail-shell-view.h
similarity index 100%
rename from modules/mail/e-mail-shell-view.h
rename to src/modules/mail/e-mail-shell-view.h
diff --git a/modules/mail/em-account-prefs.c b/src/modules/mail/em-account-prefs.c
similarity index 100%
rename from modules/mail/em-account-prefs.c
rename to src/modules/mail/em-account-prefs.c
diff --git a/modules/mail/em-account-prefs.h b/src/modules/mail/em-account-prefs.h
similarity index 100%
rename from modules/mail/em-account-prefs.h
rename to src/modules/mail/em-account-prefs.h
diff --git a/modules/mail/em-composer-prefs.c b/src/modules/mail/em-composer-prefs.c
similarity index 100%
rename from modules/mail/em-composer-prefs.c
rename to src/modules/mail/em-composer-prefs.c
diff --git a/modules/mail/em-composer-prefs.h b/src/modules/mail/em-composer-prefs.h
similarity index 100%
rename from modules/mail/em-composer-prefs.h
rename to src/modules/mail/em-composer-prefs.h
diff --git a/modules/mail/em-mailer-prefs.c b/src/modules/mail/em-mailer-prefs.c
similarity index 100%
rename from modules/mail/em-mailer-prefs.c
rename to src/modules/mail/em-mailer-prefs.c
diff --git a/modules/mail/em-mailer-prefs.h b/src/modules/mail/em-mailer-prefs.h
similarity index 100%
rename from modules/mail/em-mailer-prefs.h
rename to src/modules/mail/em-mailer-prefs.h
diff --git a/modules/mail/evolution-module-mail.c b/src/modules/mail/evolution-module-mail.c
similarity index 100%
rename from modules/mail/evolution-module-mail.c
rename to src/modules/mail/evolution-module-mail.c
diff --git a/modules/mailto-handler/CMakeLists.txt b/src/modules/mailto-handler/CMakeLists.txt
similarity index 100%
rename from modules/mailto-handler/CMakeLists.txt
rename to src/modules/mailto-handler/CMakeLists.txt
diff --git a/modules/mailto-handler/evolution-mailto-handler.c
b/src/modules/mailto-handler/evolution-mailto-handler.c
similarity index 100%
rename from modules/mailto-handler/evolution-mailto-handler.c
rename to src/modules/mailto-handler/evolution-mailto-handler.c
diff --git a/modules/mdn/CMakeLists.txt b/src/modules/mdn/CMakeLists.txt
similarity index 100%
rename from modules/mdn/CMakeLists.txt
rename to src/modules/mdn/CMakeLists.txt
diff --git a/modules/mdn/evolution-mdn.c b/src/modules/mdn/evolution-mdn.c
similarity index 100%
rename from modules/mdn/evolution-mdn.c
rename to src/modules/mdn/evolution-mdn.c
diff --git a/modules/mdn/evolution-mdn.error.xml b/src/modules/mdn/evolution-mdn.error.xml
similarity index 100%
rename from modules/mdn/evolution-mdn.error.xml
rename to src/modules/mdn/evolution-mdn.error.xml
diff --git a/modules/offline-alert/CMakeLists.txt b/src/modules/offline-alert/CMakeLists.txt
similarity index 100%
rename from modules/offline-alert/CMakeLists.txt
rename to src/modules/offline-alert/CMakeLists.txt
diff --git a/modules/offline-alert/evolution-offline-alert.c
b/src/modules/offline-alert/evolution-offline-alert.c
similarity index 100%
rename from modules/offline-alert/evolution-offline-alert.c
rename to src/modules/offline-alert/evolution-offline-alert.c
diff --git a/modules/offline-alert/evolution-offline-alert.error.xml
b/src/modules/offline-alert/evolution-offline-alert.error.xml
similarity index 100%
rename from modules/offline-alert/evolution-offline-alert.error.xml
rename to src/modules/offline-alert/evolution-offline-alert.error.xml
diff --git a/modules/plugin-lib/CMakeLists.txt b/src/modules/plugin-lib/CMakeLists.txt
similarity index 100%
rename from modules/plugin-lib/CMakeLists.txt
rename to src/modules/plugin-lib/CMakeLists.txt
diff --git a/modules/plugin-lib/e-plugin-lib.c b/src/modules/plugin-lib/e-plugin-lib.c
similarity index 100%
rename from modules/plugin-lib/e-plugin-lib.c
rename to src/modules/plugin-lib/e-plugin-lib.c
diff --git a/modules/plugin-lib/e-plugin-lib.h b/src/modules/plugin-lib/e-plugin-lib.h
similarity index 100%
rename from modules/plugin-lib/e-plugin-lib.h
rename to src/modules/plugin-lib/e-plugin-lib.h
diff --git a/modules/plugin-lib/evolution-module-plugin-lib.c
b/src/modules/plugin-lib/evolution-module-plugin-lib.c
similarity index 100%
rename from modules/plugin-lib/evolution-module-plugin-lib.c
rename to src/modules/plugin-lib/evolution-module-plugin-lib.c
diff --git a/modules/plugin-manager/CMakeLists.txt b/src/modules/plugin-manager/CMakeLists.txt
similarity index 100%
rename from modules/plugin-manager/CMakeLists.txt
rename to src/modules/plugin-manager/CMakeLists.txt
diff --git a/modules/plugin-manager/evolution-plugin-manager.c
b/src/modules/plugin-manager/evolution-plugin-manager.c
similarity index 100%
rename from modules/plugin-manager/evolution-plugin-manager.c
rename to src/modules/plugin-manager/evolution-plugin-manager.c
diff --git a/modules/prefer-plain/CMakeLists.txt b/src/modules/prefer-plain/CMakeLists.txt
similarity index 100%
rename from modules/prefer-plain/CMakeLists.txt
rename to src/modules/prefer-plain/CMakeLists.txt
diff --git a/modules/prefer-plain/e-mail-display-popup-prefer-plain.c
b/src/modules/prefer-plain/e-mail-display-popup-prefer-plain.c
similarity index 100%
rename from modules/prefer-plain/e-mail-display-popup-prefer-plain.c
rename to src/modules/prefer-plain/e-mail-display-popup-prefer-plain.c
diff --git a/modules/prefer-plain/e-mail-display-popup-prefer-plain.h
b/src/modules/prefer-plain/e-mail-display-popup-prefer-plain.h
similarity index 100%
rename from modules/prefer-plain/e-mail-display-popup-prefer-plain.h
rename to src/modules/prefer-plain/e-mail-display-popup-prefer-plain.h
diff --git a/modules/prefer-plain/e-mail-parser-prefer-plain.c
b/src/modules/prefer-plain/e-mail-parser-prefer-plain.c
similarity index 100%
rename from modules/prefer-plain/e-mail-parser-prefer-plain.c
rename to src/modules/prefer-plain/e-mail-parser-prefer-plain.c
diff --git a/modules/prefer-plain/e-mail-parser-prefer-plain.h
b/src/modules/prefer-plain/e-mail-parser-prefer-plain.h
similarity index 100%
rename from modules/prefer-plain/e-mail-parser-prefer-plain.h
rename to src/modules/prefer-plain/e-mail-parser-prefer-plain.h
diff --git a/modules/prefer-plain/evolution-module-prefer-plain.c
b/src/modules/prefer-plain/evolution-module-prefer-plain.c
similarity index 100%
rename from modules/prefer-plain/evolution-module-prefer-plain.c
rename to src/modules/prefer-plain/evolution-module-prefer-plain.c
diff --git a/src/modules/prefer-plain/plugin/CMakeLists.txt b/src/modules/prefer-plain/plugin/CMakeLists.txt
new file mode 100644
index 0000000..503497d
--- /dev/null
+++ b/src/modules/prefer-plain/plugin/CMakeLists.txt
@@ -0,0 +1,45 @@
+add_eplug_file(prefer-plain org-gnome-prefer-plain.eplug)
+
+set(DEPENDENCIES
+ evolution-util
+)
+
+set(SOURCES
+ config-ui.c
+)
+
+add_library(org-gnome-prefer-plain MODULE
+ ${SOURCES}
+)
+
+add_dependencies(org-gnome-prefer-plain
+ ${DEPENDENCIES}
+)
+
+target_compile_definitions(org-gnome-prefer-plain PRIVATE
+ -DG_LOG_DOMAIN=\"prefer-plain\"
+)
+
+target_compile_options(org-gnome-prefer-plain PUBLIC
+ ${EVOLUTION_DATA_SERVER_CFLAGS}
+ ${GNOME_PLATFORM_CFLAGS}
+)
+
+target_include_directories(org-gnome-prefer-plain PUBLIC
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}/src
+ ${CMAKE_SOURCE_DIR}/src
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+ ${GNOME_PLATFORM_INCLUDE_DIRS}
+)
+
+target_link_libraries(org-gnome-prefer-plain
+ ${DEPENDENCIES}
+ ${EVOLUTION_DATA_SERVER_LDFLAGS}
+ ${GNOME_PLATFORM_LDFLAGS}
+)
+
+install(TARGETS org-gnome-prefer-plain
+ DESTINATION ${plugindir}
+)
diff --git a/modules/prefer-plain/plugin/config-ui.c b/src/modules/prefer-plain/plugin/config-ui.c
similarity index 100%
rename from modules/prefer-plain/plugin/config-ui.c
rename to src/modules/prefer-plain/plugin/config-ui.c
diff --git a/modules/prefer-plain/plugin/org-gnome-prefer-plain.eplug.xml
b/src/modules/prefer-plain/plugin/org-gnome-prefer-plain.eplug.xml
similarity index 100%
rename from modules/prefer-plain/plugin/org-gnome-prefer-plain.eplug.xml
rename to src/modules/prefer-plain/plugin/org-gnome-prefer-plain.eplug.xml
diff --git a/modules/settings/CMakeLists.txt b/src/modules/settings/CMakeLists.txt
similarity index 100%
rename from modules/settings/CMakeLists.txt
rename to src/modules/settings/CMakeLists.txt
diff --git a/modules/settings/e-settings-cal-model.c b/src/modules/settings/e-settings-cal-model.c
similarity index 100%
rename from modules/settings/e-settings-cal-model.c
rename to src/modules/settings/e-settings-cal-model.c
diff --git a/modules/settings/e-settings-cal-model.h b/src/modules/settings/e-settings-cal-model.h
similarity index 100%
rename from modules/settings/e-settings-cal-model.h
rename to src/modules/settings/e-settings-cal-model.h
diff --git a/modules/settings/e-settings-calendar-item.c b/src/modules/settings/e-settings-calendar-item.c
similarity index 100%
rename from modules/settings/e-settings-calendar-item.c
rename to src/modules/settings/e-settings-calendar-item.c
diff --git a/modules/settings/e-settings-calendar-item.h b/src/modules/settings/e-settings-calendar-item.h
similarity index 100%
rename from modules/settings/e-settings-calendar-item.h
rename to src/modules/settings/e-settings-calendar-item.h
diff --git a/modules/settings/e-settings-calendar-view.c b/src/modules/settings/e-settings-calendar-view.c
similarity index 100%
rename from modules/settings/e-settings-calendar-view.c
rename to src/modules/settings/e-settings-calendar-view.c
diff --git a/modules/settings/e-settings-calendar-view.h b/src/modules/settings/e-settings-calendar-view.h
similarity index 100%
rename from modules/settings/e-settings-calendar-view.h
rename to src/modules/settings/e-settings-calendar-view.h
diff --git a/modules/settings/e-settings-client-cache.c b/src/modules/settings/e-settings-client-cache.c
similarity index 100%
rename from modules/settings/e-settings-client-cache.c
rename to src/modules/settings/e-settings-client-cache.c
diff --git a/modules/settings/e-settings-client-cache.h b/src/modules/settings/e-settings-client-cache.h
similarity index 100%
rename from modules/settings/e-settings-client-cache.h
rename to src/modules/settings/e-settings-client-cache.h
diff --git a/modules/settings/e-settings-content-editor.c b/src/modules/settings/e-settings-content-editor.c
similarity index 100%
rename from modules/settings/e-settings-content-editor.c
rename to src/modules/settings/e-settings-content-editor.c
diff --git a/modules/settings/e-settings-content-editor.h b/src/modules/settings/e-settings-content-editor.h
similarity index 100%
rename from modules/settings/e-settings-content-editor.h
rename to src/modules/settings/e-settings-content-editor.h
diff --git a/modules/settings/e-settings-date-edit.c b/src/modules/settings/e-settings-date-edit.c
similarity index 100%
rename from modules/settings/e-settings-date-edit.c
rename to src/modules/settings/e-settings-date-edit.c
diff --git a/modules/settings/e-settings-date-edit.h b/src/modules/settings/e-settings-date-edit.h
similarity index 100%
rename from modules/settings/e-settings-date-edit.h
rename to src/modules/settings/e-settings-date-edit.h
diff --git a/modules/settings/e-settings-deprecated.c b/src/modules/settings/e-settings-deprecated.c
similarity index 100%
rename from modules/settings/e-settings-deprecated.c
rename to src/modules/settings/e-settings-deprecated.c
diff --git a/modules/settings/e-settings-deprecated.h b/src/modules/settings/e-settings-deprecated.h
similarity index 100%
rename from modules/settings/e-settings-deprecated.h
rename to src/modules/settings/e-settings-deprecated.h
diff --git a/modules/settings/e-settings-mail-browser.c b/src/modules/settings/e-settings-mail-browser.c
similarity index 100%
rename from modules/settings/e-settings-mail-browser.c
rename to src/modules/settings/e-settings-mail-browser.c
diff --git a/modules/settings/e-settings-mail-browser.h b/src/modules/settings/e-settings-mail-browser.h
similarity index 100%
rename from modules/settings/e-settings-mail-browser.h
rename to src/modules/settings/e-settings-mail-browser.h
diff --git a/modules/settings/e-settings-mail-formatter.c b/src/modules/settings/e-settings-mail-formatter.c
similarity index 100%
rename from modules/settings/e-settings-mail-formatter.c
rename to src/modules/settings/e-settings-mail-formatter.c
diff --git a/modules/settings/e-settings-mail-formatter.h b/src/modules/settings/e-settings-mail-formatter.h
similarity index 100%
rename from modules/settings/e-settings-mail-formatter.h
rename to src/modules/settings/e-settings-mail-formatter.h
diff --git a/modules/settings/e-settings-mail-part-headers.c
b/src/modules/settings/e-settings-mail-part-headers.c
similarity index 100%
rename from modules/settings/e-settings-mail-part-headers.c
rename to src/modules/settings/e-settings-mail-part-headers.c
diff --git a/modules/settings/e-settings-mail-part-headers.h
b/src/modules/settings/e-settings-mail-part-headers.h
similarity index 100%
rename from modules/settings/e-settings-mail-part-headers.h
rename to src/modules/settings/e-settings-mail-part-headers.h
diff --git a/modules/settings/e-settings-mail-reader.c b/src/modules/settings/e-settings-mail-reader.c
similarity index 100%
rename from modules/settings/e-settings-mail-reader.c
rename to src/modules/settings/e-settings-mail-reader.c
diff --git a/modules/settings/e-settings-mail-reader.h b/src/modules/settings/e-settings-mail-reader.h
similarity index 100%
rename from modules/settings/e-settings-mail-reader.h
rename to src/modules/settings/e-settings-mail-reader.h
diff --git a/modules/settings/e-settings-mail-session.c b/src/modules/settings/e-settings-mail-session.c
similarity index 100%
rename from modules/settings/e-settings-mail-session.c
rename to src/modules/settings/e-settings-mail-session.c
diff --git a/modules/settings/e-settings-mail-session.h b/src/modules/settings/e-settings-mail-session.h
similarity index 100%
rename from modules/settings/e-settings-mail-session.h
rename to src/modules/settings/e-settings-mail-session.h
diff --git a/modules/settings/e-settings-meeting-store.c b/src/modules/settings/e-settings-meeting-store.c
similarity index 100%
rename from modules/settings/e-settings-meeting-store.c
rename to src/modules/settings/e-settings-meeting-store.c
diff --git a/modules/settings/e-settings-meeting-store.h b/src/modules/settings/e-settings-meeting-store.h
similarity index 100%
rename from modules/settings/e-settings-meeting-store.h
rename to src/modules/settings/e-settings-meeting-store.h
diff --git a/modules/settings/e-settings-meeting-time-selector.c
b/src/modules/settings/e-settings-meeting-time-selector.c
similarity index 100%
rename from modules/settings/e-settings-meeting-time-selector.c
rename to src/modules/settings/e-settings-meeting-time-selector.c
diff --git a/modules/settings/e-settings-meeting-time-selector.h
b/src/modules/settings/e-settings-meeting-time-selector.h
similarity index 100%
rename from modules/settings/e-settings-meeting-time-selector.h
rename to src/modules/settings/e-settings-meeting-time-selector.h
diff --git a/modules/settings/e-settings-message-list.c b/src/modules/settings/e-settings-message-list.c
similarity index 100%
rename from modules/settings/e-settings-message-list.c
rename to src/modules/settings/e-settings-message-list.c
diff --git a/modules/settings/e-settings-message-list.h b/src/modules/settings/e-settings-message-list.h
similarity index 100%
rename from modules/settings/e-settings-message-list.h
rename to src/modules/settings/e-settings-message-list.h
diff --git a/modules/settings/e-settings-name-selector-entry.c
b/src/modules/settings/e-settings-name-selector-entry.c
similarity index 100%
rename from modules/settings/e-settings-name-selector-entry.c
rename to src/modules/settings/e-settings-name-selector-entry.c
diff --git a/modules/settings/e-settings-name-selector-entry.h
b/src/modules/settings/e-settings-name-selector-entry.h
similarity index 100%
rename from modules/settings/e-settings-name-selector-entry.h
rename to src/modules/settings/e-settings-name-selector-entry.h
diff --git a/modules/settings/e-settings-spell-checker.c b/src/modules/settings/e-settings-spell-checker.c
similarity index 100%
rename from modules/settings/e-settings-spell-checker.c
rename to src/modules/settings/e-settings-spell-checker.c
diff --git a/modules/settings/e-settings-spell-checker.h b/src/modules/settings/e-settings-spell-checker.h
similarity index 100%
rename from modules/settings/e-settings-spell-checker.h
rename to src/modules/settings/e-settings-spell-checker.h
diff --git a/modules/settings/e-settings-spell-entry.c b/src/modules/settings/e-settings-spell-entry.c
similarity index 100%
rename from modules/settings/e-settings-spell-entry.c
rename to src/modules/settings/e-settings-spell-entry.c
diff --git a/modules/settings/e-settings-spell-entry.h b/src/modules/settings/e-settings-spell-entry.h
similarity index 100%
rename from modules/settings/e-settings-spell-entry.h
rename to src/modules/settings/e-settings-spell-entry.h
diff --git a/modules/settings/e-settings-weekday-chooser.c b/src/modules/settings/e-settings-weekday-chooser.c
similarity index 100%
rename from modules/settings/e-settings-weekday-chooser.c
rename to src/modules/settings/e-settings-weekday-chooser.c
diff --git a/modules/settings/e-settings-weekday-chooser.h b/src/modules/settings/e-settings-weekday-chooser.h
similarity index 100%
rename from modules/settings/e-settings-weekday-chooser.h
rename to src/modules/settings/e-settings-weekday-chooser.h
diff --git a/modules/settings/evolution-module-settings.c b/src/modules/settings/evolution-module-settings.c
similarity index 100%
rename from modules/settings/evolution-module-settings.c
rename to src/modules/settings/evolution-module-settings.c
diff --git a/modules/spamassassin/CMakeLists.txt b/src/modules/spamassassin/CMakeLists.txt
similarity index 100%
rename from modules/spamassassin/CMakeLists.txt
rename to src/modules/spamassassin/CMakeLists.txt
diff --git a/modules/spamassassin/evolution-spamassassin.c b/src/modules/spamassassin/evolution-spamassassin.c
similarity index 100%
rename from modules/spamassassin/evolution-spamassassin.c
rename to src/modules/spamassassin/evolution-spamassassin.c
diff --git a/modules/spamassassin/evolution-spamassassin.metainfo.xml.in
b/src/modules/spamassassin/evolution-spamassassin.metainfo.xml.in
similarity index 100%
rename from modules/spamassassin/evolution-spamassassin.metainfo.xml.in
rename to src/modules/spamassassin/evolution-spamassassin.metainfo.xml.in
diff --git a/modules/startup-wizard/CMakeLists.txt b/src/modules/startup-wizard/CMakeLists.txt
similarity index 100%
rename from modules/startup-wizard/CMakeLists.txt
rename to src/modules/startup-wizard/CMakeLists.txt
diff --git a/modules/startup-wizard/e-mail-config-import-page.c
b/src/modules/startup-wizard/e-mail-config-import-page.c
similarity index 100%
rename from modules/startup-wizard/e-mail-config-import-page.c
rename to src/modules/startup-wizard/e-mail-config-import-page.c
diff --git a/modules/startup-wizard/e-mail-config-import-page.h
b/src/modules/startup-wizard/e-mail-config-import-page.h
similarity index 100%
rename from modules/startup-wizard/e-mail-config-import-page.h
rename to src/modules/startup-wizard/e-mail-config-import-page.h
diff --git a/modules/startup-wizard/e-mail-config-import-progress-page.c
b/src/modules/startup-wizard/e-mail-config-import-progress-page.c
similarity index 100%
rename from modules/startup-wizard/e-mail-config-import-progress-page.c
rename to src/modules/startup-wizard/e-mail-config-import-progress-page.c
diff --git a/modules/startup-wizard/e-mail-config-import-progress-page.h
b/src/modules/startup-wizard/e-mail-config-import-progress-page.h
similarity index 100%
rename from modules/startup-wizard/e-mail-config-import-progress-page.h
rename to src/modules/startup-wizard/e-mail-config-import-progress-page.h
diff --git a/modules/startup-wizard/e-startup-assistant.c b/src/modules/startup-wizard/e-startup-assistant.c
similarity index 100%
rename from modules/startup-wizard/e-startup-assistant.c
rename to src/modules/startup-wizard/e-startup-assistant.c
diff --git a/modules/startup-wizard/e-startup-assistant.h b/src/modules/startup-wizard/e-startup-assistant.h
similarity index 100%
rename from modules/startup-wizard/e-startup-assistant.h
rename to src/modules/startup-wizard/e-startup-assistant.h
diff --git a/modules/startup-wizard/evolution-startup-wizard.c
b/src/modules/startup-wizard/evolution-startup-wizard.c
similarity index 100%
rename from modules/startup-wizard/evolution-startup-wizard.c
rename to src/modules/startup-wizard/evolution-startup-wizard.c
diff --git a/modules/text-highlight/CMakeLists.txt b/src/modules/text-highlight/CMakeLists.txt
similarity index 100%
rename from modules/text-highlight/CMakeLists.txt
rename to src/modules/text-highlight/CMakeLists.txt
diff --git a/modules/text-highlight/e-mail-display-popup-text-highlight.c
b/src/modules/text-highlight/e-mail-display-popup-text-highlight.c
similarity index 100%
rename from modules/text-highlight/e-mail-display-popup-text-highlight.c
rename to src/modules/text-highlight/e-mail-display-popup-text-highlight.c
diff --git a/modules/text-highlight/e-mail-display-popup-text-highlight.h
b/src/modules/text-highlight/e-mail-display-popup-text-highlight.h
similarity index 100%
rename from modules/text-highlight/e-mail-display-popup-text-highlight.h
rename to src/modules/text-highlight/e-mail-display-popup-text-highlight.h
diff --git a/modules/text-highlight/e-mail-formatter-text-highlight.c
b/src/modules/text-highlight/e-mail-formatter-text-highlight.c
similarity index 100%
rename from modules/text-highlight/e-mail-formatter-text-highlight.c
rename to src/modules/text-highlight/e-mail-formatter-text-highlight.c
diff --git a/modules/text-highlight/e-mail-formatter-text-highlight.h
b/src/modules/text-highlight/e-mail-formatter-text-highlight.h
similarity index 100%
rename from modules/text-highlight/e-mail-formatter-text-highlight.h
rename to src/modules/text-highlight/e-mail-formatter-text-highlight.h
diff --git a/modules/text-highlight/e-mail-parser-text-highlight.c
b/src/modules/text-highlight/e-mail-parser-text-highlight.c
similarity index 100%
rename from modules/text-highlight/e-mail-parser-text-highlight.c
rename to src/modules/text-highlight/e-mail-parser-text-highlight.c
diff --git a/modules/text-highlight/e-mail-parser-text-highlight.h
b/src/modules/text-highlight/e-mail-parser-text-highlight.h
similarity index 100%
rename from modules/text-highlight/e-mail-parser-text-highlight.h
rename to src/modules/text-highlight/e-mail-parser-text-highlight.h
diff --git a/modules/text-highlight/evolution-module-text-highlight.c
b/src/modules/text-highlight/evolution-module-text-highlight.c
similarity index 100%
rename from modules/text-highlight/evolution-module-text-highlight.c
rename to src/modules/text-highlight/evolution-module-text-highlight.c
diff --git a/modules/text-highlight/languages.c b/src/modules/text-highlight/languages.c
similarity index 100%
rename from modules/text-highlight/languages.c
rename to src/modules/text-highlight/languages.c
diff --git a/modules/text-highlight/languages.h b/src/modules/text-highlight/languages.h
similarity index 100%
rename from modules/text-highlight/languages.h
rename to src/modules/text-highlight/languages.h
diff --git a/modules/tnef-attachment/CMakeLists.txt b/src/modules/tnef-attachment/CMakeLists.txt
similarity index 100%
rename from modules/tnef-attachment/CMakeLists.txt
rename to src/modules/tnef-attachment/CMakeLists.txt
diff --git a/modules/tnef-attachment/e-mail-parser-tnef-attachment.c
b/src/modules/tnef-attachment/e-mail-parser-tnef-attachment.c
similarity index 100%
rename from modules/tnef-attachment/e-mail-parser-tnef-attachment.c
rename to src/modules/tnef-attachment/e-mail-parser-tnef-attachment.c
diff --git a/modules/tnef-attachment/e-mail-parser-tnef-attachment.h
b/src/modules/tnef-attachment/e-mail-parser-tnef-attachment.h
similarity index 100%
rename from modules/tnef-attachment/e-mail-parser-tnef-attachment.h
rename to src/modules/tnef-attachment/e-mail-parser-tnef-attachment.h
diff --git a/modules/tnef-attachment/evolution-module-tnef-attachment.c
b/src/modules/tnef-attachment/evolution-module-tnef-attachment.c
similarity index 100%
rename from modules/tnef-attachment/evolution-module-tnef-attachment.c
rename to src/modules/tnef-attachment/evolution-module-tnef-attachment.c
diff --git a/modules/vcard-inline/CMakeLists.txt b/src/modules/vcard-inline/CMakeLists.txt
similarity index 100%
rename from modules/vcard-inline/CMakeLists.txt
rename to src/modules/vcard-inline/CMakeLists.txt
diff --git a/modules/vcard-inline/e-mail-formatter-vcard.c b/src/modules/vcard-inline/e-mail-formatter-vcard.c
similarity index 100%
rename from modules/vcard-inline/e-mail-formatter-vcard.c
rename to src/modules/vcard-inline/e-mail-formatter-vcard.c
diff --git a/modules/vcard-inline/e-mail-formatter-vcard.h b/src/modules/vcard-inline/e-mail-formatter-vcard.h
similarity index 100%
rename from modules/vcard-inline/e-mail-formatter-vcard.h
rename to src/modules/vcard-inline/e-mail-formatter-vcard.h
diff --git a/modules/vcard-inline/e-mail-parser-vcard.c b/src/modules/vcard-inline/e-mail-parser-vcard.c
similarity index 100%
rename from modules/vcard-inline/e-mail-parser-vcard.c
rename to src/modules/vcard-inline/e-mail-parser-vcard.c
diff --git a/modules/vcard-inline/e-mail-parser-vcard.h b/src/modules/vcard-inline/e-mail-parser-vcard.h
similarity index 100%
rename from modules/vcard-inline/e-mail-parser-vcard.h
rename to src/modules/vcard-inline/e-mail-parser-vcard.h
diff --git a/modules/vcard-inline/e-mail-part-vcard.c b/src/modules/vcard-inline/e-mail-part-vcard.c
similarity index 100%
rename from modules/vcard-inline/e-mail-part-vcard.c
rename to src/modules/vcard-inline/e-mail-part-vcard.c
diff --git a/modules/vcard-inline/e-mail-part-vcard.h b/src/modules/vcard-inline/e-mail-part-vcard.h
similarity index 100%
rename from modules/vcard-inline/e-mail-part-vcard.h
rename to src/modules/vcard-inline/e-mail-part-vcard.h
diff --git a/modules/vcard-inline/evolution-module-vcard-inline.c
b/src/modules/vcard-inline/evolution-module-vcard-inline.c
similarity index 100%
rename from modules/vcard-inline/evolution-module-vcard-inline.c
rename to src/modules/vcard-inline/evolution-module-vcard-inline.c
diff --git a/modules/webkit-editor/CMakeLists.txt b/src/modules/webkit-editor/CMakeLists.txt
similarity index 100%
rename from modules/webkit-editor/CMakeLists.txt
rename to src/modules/webkit-editor/CMakeLists.txt
diff --git a/modules/webkit-editor/e-webkit-editor-extension.c
b/src/modules/webkit-editor/e-webkit-editor-extension.c
similarity index 100%
rename from modules/webkit-editor/e-webkit-editor-extension.c
rename to src/modules/webkit-editor/e-webkit-editor-extension.c
diff --git a/modules/webkit-editor/e-webkit-editor-extension.h
b/src/modules/webkit-editor/e-webkit-editor-extension.h
similarity index 100%
rename from modules/webkit-editor/e-webkit-editor-extension.h
rename to src/modules/webkit-editor/e-webkit-editor-extension.h
diff --git a/modules/webkit-editor/e-webkit-editor.c b/src/modules/webkit-editor/e-webkit-editor.c
similarity index 100%
rename from modules/webkit-editor/e-webkit-editor.c
rename to src/modules/webkit-editor/e-webkit-editor.c
diff --git a/modules/webkit-editor/e-webkit-editor.h b/src/modules/webkit-editor/e-webkit-editor.h
similarity index 100%
rename from modules/webkit-editor/e-webkit-editor.h
rename to src/modules/webkit-editor/e-webkit-editor.h
diff --git a/modules/webkit-editor/evolution-module-webkit-editor.c
b/src/modules/webkit-editor/evolution-module-webkit-editor.c
similarity index 100%
rename from modules/webkit-editor/evolution-module-webkit-editor.c
rename to src/modules/webkit-editor/evolution-module-webkit-editor.c
diff --git a/modules/webkit-editor/web-extension/CMakeLists.txt
b/src/modules/webkit-editor/web-extension/CMakeLists.txt
similarity index 100%
rename from modules/webkit-editor/web-extension/CMakeLists.txt
rename to src/modules/webkit-editor/web-extension/CMakeLists.txt
diff --git a/modules/webkit-editor/web-extension/e-composer-dom-functions.c
b/src/modules/webkit-editor/web-extension/e-composer-dom-functions.c
similarity index 100%
rename from modules/webkit-editor/web-extension/e-composer-dom-functions.c
rename to src/modules/webkit-editor/web-extension/e-composer-dom-functions.c
diff --git a/modules/webkit-editor/web-extension/e-composer-dom-functions.h
b/src/modules/webkit-editor/web-extension/e-composer-dom-functions.h
similarity index 100%
rename from modules/webkit-editor/web-extension/e-composer-dom-functions.h
rename to src/modules/webkit-editor/web-extension/e-composer-dom-functions.h
diff --git a/modules/webkit-editor/web-extension/e-dialogs-dom-functions.c
b/src/modules/webkit-editor/web-extension/e-dialogs-dom-functions.c
similarity index 100%
rename from modules/webkit-editor/web-extension/e-dialogs-dom-functions.c
rename to src/modules/webkit-editor/web-extension/e-dialogs-dom-functions.c
diff --git a/modules/webkit-editor/web-extension/e-dialogs-dom-functions.h
b/src/modules/webkit-editor/web-extension/e-dialogs-dom-functions.h
similarity index 100%
rename from modules/webkit-editor/web-extension/e-dialogs-dom-functions.h
rename to src/modules/webkit-editor/web-extension/e-dialogs-dom-functions.h
diff --git a/modules/webkit-editor/web-extension/e-editor-dom-functions.c
b/src/modules/webkit-editor/web-extension/e-editor-dom-functions.c
similarity index 100%
rename from modules/webkit-editor/web-extension/e-editor-dom-functions.c
rename to src/modules/webkit-editor/web-extension/e-editor-dom-functions.c
diff --git a/modules/webkit-editor/web-extension/e-editor-dom-functions.h
b/src/modules/webkit-editor/web-extension/e-editor-dom-functions.h
similarity index 100%
rename from modules/webkit-editor/web-extension/e-editor-dom-functions.h
rename to src/modules/webkit-editor/web-extension/e-editor-dom-functions.h
diff --git a/modules/webkit-editor/web-extension/e-editor-page.c
b/src/modules/webkit-editor/web-extension/e-editor-page.c
similarity index 100%
rename from modules/webkit-editor/web-extension/e-editor-page.c
rename to src/modules/webkit-editor/web-extension/e-editor-page.c
diff --git a/modules/webkit-editor/web-extension/e-editor-page.h
b/src/modules/webkit-editor/web-extension/e-editor-page.h
similarity index 100%
rename from modules/webkit-editor/web-extension/e-editor-page.h
rename to src/modules/webkit-editor/web-extension/e-editor-page.h
diff --git a/modules/webkit-editor/web-extension/e-editor-undo-redo-manager.c
b/src/modules/webkit-editor/web-extension/e-editor-undo-redo-manager.c
similarity index 100%
rename from modules/webkit-editor/web-extension/e-editor-undo-redo-manager.c
rename to src/modules/webkit-editor/web-extension/e-editor-undo-redo-manager.c
diff --git a/modules/webkit-editor/web-extension/e-editor-undo-redo-manager.h
b/src/modules/webkit-editor/web-extension/e-editor-undo-redo-manager.h
similarity index 100%
rename from modules/webkit-editor/web-extension/e-editor-undo-redo-manager.h
rename to src/modules/webkit-editor/web-extension/e-editor-undo-redo-manager.h
diff --git a/modules/webkit-editor/web-extension/e-editor-web-extension-main.c
b/src/modules/webkit-editor/web-extension/e-editor-web-extension-main.c
similarity index 100%
rename from modules/webkit-editor/web-extension/e-editor-web-extension-main.c
rename to src/modules/webkit-editor/web-extension/e-editor-web-extension-main.c
diff --git a/modules/webkit-editor/web-extension/e-editor-web-extension-names.h
b/src/modules/webkit-editor/web-extension/e-editor-web-extension-names.h
similarity index 100%
rename from modules/webkit-editor/web-extension/e-editor-web-extension-names.h
rename to src/modules/webkit-editor/web-extension/e-editor-web-extension-names.h
diff --git a/modules/webkit-editor/web-extension/e-editor-web-extension.c
b/src/modules/webkit-editor/web-extension/e-editor-web-extension.c
similarity index 100%
rename from modules/webkit-editor/web-extension/e-editor-web-extension.c
rename to src/modules/webkit-editor/web-extension/e-editor-web-extension.c
diff --git a/modules/webkit-editor/web-extension/e-editor-web-extension.h
b/src/modules/webkit-editor/web-extension/e-editor-web-extension.h
similarity index 100%
rename from modules/webkit-editor/web-extension/e-editor-web-extension.h
rename to src/modules/webkit-editor/web-extension/e-editor-web-extension.h
diff --git a/modules/webkit-inspector/CMakeLists.txt b/src/modules/webkit-inspector/CMakeLists.txt
similarity index 100%
rename from modules/webkit-inspector/CMakeLists.txt
rename to src/modules/webkit-inspector/CMakeLists.txt
diff --git a/modules/webkit-inspector/evolution-webkit-inspector.c
b/src/modules/webkit-inspector/evolution-webkit-inspector.c
similarity index 100%
rename from modules/webkit-inspector/evolution-webkit-inspector.c
rename to src/modules/webkit-inspector/evolution-webkit-inspector.c
diff --git a/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt
similarity index 100%
rename from plugins/CMakeLists.txt
rename to src/plugins/CMakeLists.txt
diff --git a/src/plugins/attachment-reminder/CMakeLists.txt b/src/plugins/attachment-reminder/CMakeLists.txt
new file mode 100644
index 0000000..fcde9d1
--- /dev/null
+++ b/src/plugins/attachment-reminder/CMakeLists.txt
@@ -0,0 +1,51 @@
+add_error_files(attachment-reminder org-gnome-attachment-reminder.error)
+add_eplug_file(attachment-reminder org-gnome-evolution-attachment-reminder.eplug)
+
+set(DEPENDENCIES
+ econtacteditor
+ econtactlisteditor
+ evolution-mail
+ evolution-mail-composer
+ evolution-shell
+ evolution-util
+)
+
+set(SOURCES
+ attachment-reminder.c
+)
+
+add_library(org-gnome-evolution-attachment-reminder MODULE
+ ${SOURCES}
+)
+
+add_dependencies(org-gnome-evolution-attachment-reminder
+ ${DEPENDENCIES}
+)
+
+target_compile_definitions(org-gnome-evolution-attachment-reminder PRIVATE
+ -DG_LOG_DOMAIN=\"attachment-reminder\"
+)
+
+target_compile_options(org-gnome-evolution-attachment-reminder PUBLIC
+ ${EVOLUTION_DATA_SERVER_CFLAGS}
+ ${GNOME_PLATFORM_CFLAGS}
+)
+
+target_include_directories(org-gnome-evolution-attachment-reminder PUBLIC
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}/src
+ ${CMAKE_SOURCE_DIR}/src
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+ ${GNOME_PLATFORM_INCLUDE_DIRS}
+)
+
+target_link_libraries(org-gnome-evolution-attachment-reminder
+ ${DEPENDENCIES}
+ ${EVOLUTION_DATA_SERVER_LDFLAGS}
+ ${GNOME_PLATFORM_LDFLAGS}
+)
+
+install(TARGETS org-gnome-evolution-attachment-reminder
+ DESTINATION ${plugindir}
+)
diff --git a/plugins/attachment-reminder/attachment-reminder.c
b/src/plugins/attachment-reminder/attachment-reminder.c
similarity index 100%
rename from plugins/attachment-reminder/attachment-reminder.c
rename to src/plugins/attachment-reminder/attachment-reminder.c
diff --git a/plugins/attachment-reminder/org-gnome-attachment-reminder.error.xml
b/src/plugins/attachment-reminder/org-gnome-attachment-reminder.error.xml
similarity index 100%
rename from plugins/attachment-reminder/org-gnome-attachment-reminder.error.xml
rename to src/plugins/attachment-reminder/org-gnome-attachment-reminder.error.xml
diff --git a/plugins/attachment-reminder/org-gnome-evolution-attachment-reminder.eplug.xml
b/src/plugins/attachment-reminder/org-gnome-evolution-attachment-reminder.eplug.xml
similarity index 100%
rename from plugins/attachment-reminder/org-gnome-evolution-attachment-reminder.eplug.xml
rename to src/plugins/attachment-reminder/org-gnome-evolution-attachment-reminder.eplug.xml
diff --git a/src/plugins/bbdb/CMakeLists.txt b/src/plugins/bbdb/CMakeLists.txt
new file mode 100644
index 0000000..9b2b4ca
--- /dev/null
+++ b/src/plugins/bbdb/CMakeLists.txt
@@ -0,0 +1,53 @@
+add_eplug_file(bbdb org-gnome-evolution-bbdb.eplug)
+
+set(DEPENDENCIES
+ eabutil
+ econtacteditor
+ econtactlisteditor
+ evolution-mail
+ evolution-mail-composer
+ evolution-shell
+ evolution-util
+)
+
+set(SOURCES
+ bbdb.c
+ bbdb.h
+ gaimbuddies.c
+)
+
+add_library(org-gnome-evolution-bbdb MODULE
+ ${SOURCES}
+)
+
+add_dependencies(org-gnome-evolution-bbdb
+ ${DEPENDENCIES}
+)
+
+target_compile_definitions(org-gnome-evolution-bbdb PRIVATE
+ -DG_LOG_DOMAIN=\"bbdb\"
+)
+
+target_compile_options(org-gnome-evolution-bbdb PUBLIC
+ ${EVOLUTION_DATA_SERVER_CFLAGS}
+ ${GNOME_PLATFORM_CFLAGS}
+)
+
+target_include_directories(org-gnome-evolution-bbdb PUBLIC
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}/src
+ ${CMAKE_SOURCE_DIR}/src
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+ ${GNOME_PLATFORM_INCLUDE_DIRS}
+)
+
+target_link_libraries(org-gnome-evolution-bbdb
+ ${DEPENDENCIES}
+ ${EVOLUTION_DATA_SERVER_LDFLAGS}
+ ${GNOME_PLATFORM_LDFLAGS}
+)
+
+install(TARGETS org-gnome-evolution-bbdb
+ DESTINATION ${plugindir}
+)
diff --git a/plugins/bbdb/bbdb.c b/src/plugins/bbdb/bbdb.c
similarity index 100%
rename from plugins/bbdb/bbdb.c
rename to src/plugins/bbdb/bbdb.c
diff --git a/plugins/bbdb/bbdb.h b/src/plugins/bbdb/bbdb.h
similarity index 100%
rename from plugins/bbdb/bbdb.h
rename to src/plugins/bbdb/bbdb.h
diff --git a/plugins/bbdb/gaimbuddies.c b/src/plugins/bbdb/gaimbuddies.c
similarity index 100%
rename from plugins/bbdb/gaimbuddies.c
rename to src/plugins/bbdb/gaimbuddies.c
diff --git a/plugins/bbdb/org-gnome-evolution-bbdb.eplug.xml
b/src/plugins/bbdb/org-gnome-evolution-bbdb.eplug.xml
similarity index 100%
rename from plugins/bbdb/org-gnome-evolution-bbdb.eplug.xml
rename to src/plugins/bbdb/org-gnome-evolution-bbdb.eplug.xml
diff --git a/plugins/bbdb/test-evobuddy.c b/src/plugins/bbdb/test-evobuddy.c
similarity index 100%
rename from plugins/bbdb/test-evobuddy.c
rename to src/plugins/bbdb/test-evobuddy.c
diff --git a/src/plugins/dbx-import/CMakeLists.txt b/src/plugins/dbx-import/CMakeLists.txt
new file mode 100644
index 0000000..3458b09
--- /dev/null
+++ b/src/plugins/dbx-import/CMakeLists.txt
@@ -0,0 +1,48 @@
+add_eplug_file(dbx-import org-gnome-dbx-import.eplug)
+
+set(DEPENDENCIES
+ email-engine
+ evolution-mail
+ evolution-shell
+ evolution-util
+)
+
+set(SOURCES
+ dbx-importer.c
+)
+
+add_library(org-gnome-dbx-import MODULE
+ ${SOURCES}
+)
+
+add_dependencies(org-gnome-dbx-import
+ ${DEPENDENCIES}
+)
+
+target_compile_definitions(org-gnome-dbx-import PRIVATE
+ -DG_LOG_DOMAIN=\"dbx-import\"
+)
+
+target_compile_options(org-gnome-dbx-import PUBLIC
+ ${EVOLUTION_DATA_SERVER_CFLAGS}
+ ${GNOME_PLATFORM_CFLAGS}
+)
+
+target_include_directories(org-gnome-dbx-import PUBLIC
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}/src
+ ${CMAKE_SOURCE_DIR}/src
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+ ${GNOME_PLATFORM_INCLUDE_DIRS}
+)
+
+target_link_libraries(org-gnome-dbx-import
+ ${DEPENDENCIES}
+ ${EVOLUTION_DATA_SERVER_LDFLAGS}
+ ${GNOME_PLATFORM_LDFLAGS}
+)
+
+install(TARGETS org-gnome-dbx-import
+ DESTINATION ${plugindir}
+)
diff --git a/plugins/dbx-import/dbx-importer.c b/src/plugins/dbx-import/dbx-importer.c
similarity index 100%
rename from plugins/dbx-import/dbx-importer.c
rename to src/plugins/dbx-import/dbx-importer.c
diff --git a/plugins/dbx-import/org-gnome-dbx-import.eplug.xml
b/src/plugins/dbx-import/org-gnome-dbx-import.eplug.xml
similarity index 100%
rename from plugins/dbx-import/org-gnome-dbx-import.eplug.xml
rename to src/plugins/dbx-import/org-gnome-dbx-import.eplug.xml
diff --git a/src/plugins/email-custom-header/CMakeLists.txt b/src/plugins/email-custom-header/CMakeLists.txt
new file mode 100644
index 0000000..f1c6956
--- /dev/null
+++ b/src/plugins/email-custom-header/CMakeLists.txt
@@ -0,0 +1,55 @@
+add_eplug_file(email-custom-header org-gnome-email-custom-header.eplug)
+
+install(FILES org-gnome-email-custom-header.ui
+ DESTINATION ${uidir}
+)
+
+set(DEPENDENCIES
+ econtacteditor
+ econtactlisteditor
+ evolution-mail
+ evolution-mail-composer
+ evolution-shell
+ evolution-util
+)
+
+set(SOURCES
+ email-custom-header.c
+ email-custom-header.h
+)
+
+add_library(org-gnome-email-custom-header MODULE
+ ${SOURCES}
+)
+
+add_dependencies(org-gnome-email-custom-header
+ ${DEPENDENCIES}
+)
+
+target_compile_definitions(org-gnome-email-custom-header PRIVATE
+ -DG_LOG_DOMAIN=\"email-custom-header\"
+)
+
+target_compile_options(org-gnome-email-custom-header PUBLIC
+ ${EVOLUTION_DATA_SERVER_CFLAGS}
+ ${GNOME_PLATFORM_CFLAGS}
+)
+
+target_include_directories(org-gnome-email-custom-header PUBLIC
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}/src
+ ${CMAKE_SOURCE_DIR}/src
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+ ${GNOME_PLATFORM_INCLUDE_DIRS}
+)
+
+target_link_libraries(org-gnome-email-custom-header
+ ${DEPENDENCIES}
+ ${EVOLUTION_DATA_SERVER_LDFLAGS}
+ ${GNOME_PLATFORM_LDFLAGS}
+)
+
+install(TARGETS org-gnome-email-custom-header
+ DESTINATION ${plugindir}
+)
diff --git a/plugins/email-custom-header/email-custom-header.c
b/src/plugins/email-custom-header/email-custom-header.c
similarity index 100%
rename from plugins/email-custom-header/email-custom-header.c
rename to src/plugins/email-custom-header/email-custom-header.c
diff --git a/plugins/email-custom-header/email-custom-header.h
b/src/plugins/email-custom-header/email-custom-header.h
similarity index 100%
rename from plugins/email-custom-header/email-custom-header.h
rename to src/plugins/email-custom-header/email-custom-header.h
diff --git a/plugins/email-custom-header/org-gnome-email-custom-header.eplug.xml
b/src/plugins/email-custom-header/org-gnome-email-custom-header.eplug.xml
similarity index 100%
rename from plugins/email-custom-header/org-gnome-email-custom-header.eplug.xml
rename to src/plugins/email-custom-header/org-gnome-email-custom-header.eplug.xml
diff --git a/plugins/email-custom-header/org-gnome-email-custom-header.ui
b/src/plugins/email-custom-header/org-gnome-email-custom-header.ui
similarity index 100%
rename from plugins/email-custom-header/org-gnome-email-custom-header.ui
rename to src/plugins/email-custom-header/org-gnome-email-custom-header.ui
diff --git a/src/plugins/external-editor/CMakeLists.txt b/src/plugins/external-editor/CMakeLists.txt
new file mode 100644
index 0000000..471c43d
--- /dev/null
+++ b/src/plugins/external-editor/CMakeLists.txt
@@ -0,0 +1,51 @@
+add_error_files(external-editor org-gnome-external-editor.error)
+add_eplug_file(external-editor org-gnome-external-editor.eplug)
+
+set(DEPENDENCIES
+ econtacteditor
+ econtactlisteditor
+ evolution-mail
+ evolution-mail-composer
+ evolution-shell
+ evolution-util
+)
+
+set(SOURCES
+ external-editor.c
+)
+
+add_library(org-gnome-external-editor MODULE
+ ${SOURCES}
+)
+
+add_dependencies(org-gnome-external-editor
+ ${DEPENDENCIES}
+)
+
+target_compile_definitions(org-gnome-external-editor PRIVATE
+ -DG_LOG_DOMAIN=\"external-editor\"
+)
+
+target_compile_options(org-gnome-external-editor PUBLIC
+ ${EVOLUTION_DATA_SERVER_CFLAGS}
+ ${GNOME_PLATFORM_CFLAGS}
+)
+
+target_include_directories(org-gnome-external-editor PUBLIC
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}/src
+ ${CMAKE_SOURCE_DIR}/src
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+ ${GNOME_PLATFORM_INCLUDE_DIRS}
+)
+
+target_link_libraries(org-gnome-external-editor
+ ${DEPENDENCIES}
+ ${EVOLUTION_DATA_SERVER_LDFLAGS}
+ ${GNOME_PLATFORM_LDFLAGS}
+)
+
+install(TARGETS org-gnome-external-editor
+ DESTINATION ${plugindir}
+)
diff --git a/plugins/external-editor/external-editor.c b/src/plugins/external-editor/external-editor.c
similarity index 100%
rename from plugins/external-editor/external-editor.c
rename to src/plugins/external-editor/external-editor.c
diff --git a/plugins/external-editor/org-gnome-external-editor.eplug.xml
b/src/plugins/external-editor/org-gnome-external-editor.eplug.xml
similarity index 100%
rename from plugins/external-editor/org-gnome-external-editor.eplug.xml
rename to src/plugins/external-editor/org-gnome-external-editor.eplug.xml
diff --git a/plugins/external-editor/org-gnome-external-editor.error.xml
b/src/plugins/external-editor/org-gnome-external-editor.error.xml
similarity index 100%
rename from plugins/external-editor/org-gnome-external-editor.error.xml
rename to src/plugins/external-editor/org-gnome-external-editor.error.xml
diff --git a/src/plugins/face/CMakeLists.txt b/src/plugins/face/CMakeLists.txt
new file mode 100644
index 0000000..af98d5a
--- /dev/null
+++ b/src/plugins/face/CMakeLists.txt
@@ -0,0 +1,51 @@
+add_error_files(face org-gnome-face.error)
+add_eplug_file(face org-gnome-face.eplug)
+
+set(DEPENDENCIES
+ econtacteditor
+ econtactlisteditor
+ evolution-mail
+ evolution-mail-composer
+ evolution-shell
+ evolution-util
+)
+
+set(SOURCES
+ face.c
+)
+
+add_library(org-gnome-face MODULE
+ ${SOURCES}
+)
+
+add_dependencies(org-gnome-face
+ ${DEPENDENCIES}
+)
+
+target_compile_definitions(org-gnome-face PRIVATE
+ -DG_LOG_DOMAIN=\"face\"
+)
+
+target_compile_options(org-gnome-face PUBLIC
+ ${EVOLUTION_DATA_SERVER_CFLAGS}
+ ${GNOME_PLATFORM_CFLAGS}
+)
+
+target_include_directories(org-gnome-face PUBLIC
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}/src
+ ${CMAKE_SOURCE_DIR}/src
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+ ${GNOME_PLATFORM_INCLUDE_DIRS}
+)
+
+target_link_libraries(org-gnome-face
+ ${DEPENDENCIES}
+ ${EVOLUTION_DATA_SERVER_LDFLAGS}
+ ${GNOME_PLATFORM_LDFLAGS}
+)
+
+install(TARGETS org-gnome-face
+ DESTINATION ${plugindir}
+)
diff --git a/plugins/face/face.c b/src/plugins/face/face.c
similarity index 100%
rename from plugins/face/face.c
rename to src/plugins/face/face.c
diff --git a/plugins/face/org-gnome-face.eplug.xml b/src/plugins/face/org-gnome-face.eplug.xml
similarity index 100%
rename from plugins/face/org-gnome-face.eplug.xml
rename to src/plugins/face/org-gnome-face.eplug.xml
diff --git a/plugins/face/org-gnome-face.error.xml b/src/plugins/face/org-gnome-face.error.xml
similarity index 100%
rename from plugins/face/org-gnome-face.error.xml
rename to src/plugins/face/org-gnome-face.error.xml
diff --git a/src/plugins/mail-notification/CMakeLists.txt b/src/plugins/mail-notification/CMakeLists.txt
new file mode 100644
index 0000000..203817c
--- /dev/null
+++ b/src/plugins/mail-notification/CMakeLists.txt
@@ -0,0 +1,54 @@
+add_eplug_file(mail-notification org-gnome-mail-notification.eplug)
+
+set(DEPENDENCIES
+ email-engine
+ evolution-mail
+ evolution-shell
+ evolution-util
+)
+
+set(SOURCES
+ mail-notification.c
+)
+
+add_library(org-gnome-mail-notification MODULE
+ ${SOURCES}
+)
+
+add_dependencies(org-gnome-mail-notification
+ ${DEPENDENCIES}
+)
+
+target_compile_definitions(org-gnome-mail-notification PRIVATE
+ -DG_LOG_DOMAIN=\"mail-notification\"
+)
+
+target_compile_options(org-gnome-mail-notification PUBLIC
+ ${CANBERRA_CFLAGS}
+ ${EVOLUTION_DATA_SERVER_CFLAGS}
+ ${GNOME_PLATFORM_CFLAGS}
+ ${LIBNOTIFY_CFLAGS}
+)
+
+target_include_directories(org-gnome-mail-notification PUBLIC
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}/src
+ ${CMAKE_SOURCE_DIR}/src
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${CANBERRA_INCLUDE_DIRS}
+ ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+ ${GNOME_PLATFORM_INCLUDE_DIRS}
+ ${LIBNOTIFY_INCLUDE_DIRS}
+)
+
+target_link_libraries(org-gnome-mail-notification
+ ${DEPENDENCIES}
+ ${CANBERRA_LDFLAGS}
+ ${EVOLUTION_DATA_SERVER_LDFLAGS}
+ ${GNOME_PLATFORM_LDFLAGS}
+ ${LIBNOTIFY_LDFLAGS}
+)
+
+install(TARGETS org-gnome-mail-notification
+ DESTINATION ${plugindir}
+)
diff --git a/plugins/mail-notification/mail-notification.c b/src/plugins/mail-notification/mail-notification.c
similarity index 100%
rename from plugins/mail-notification/mail-notification.c
rename to src/plugins/mail-notification/mail-notification.c
diff --git a/plugins/mail-notification/org-gnome-mail-notification.eplug.xml
b/src/plugins/mail-notification/org-gnome-mail-notification.eplug.xml
similarity index 100%
rename from plugins/mail-notification/org-gnome-mail-notification.eplug.xml
rename to src/plugins/mail-notification/org-gnome-mail-notification.eplug.xml
diff --git a/src/plugins/mail-to-task/CMakeLists.txt b/src/plugins/mail-to-task/CMakeLists.txt
new file mode 100644
index 0000000..6ea3c4f
--- /dev/null
+++ b/src/plugins/mail-to-task/CMakeLists.txt
@@ -0,0 +1,50 @@
+add_eplug_file(mail-to-task org-gnome-mail-to-task.eplug)
+
+set(DEPENDENCIES
+ email-engine
+ evolution-calendar
+ evolution-mail
+ evolution-mail-formatter
+ evolution-shell
+ evolution-util
+)
+
+set(SOURCES
+ mail-to-task.c
+)
+
+add_library(org-gnome-mail-to-task MODULE
+ ${SOURCES}
+)
+
+add_dependencies(org-gnome-mail-to-task
+ ${DEPENDENCIES}
+)
+
+target_compile_definitions(org-gnome-mail-to-task PRIVATE
+ -DG_LOG_DOMAIN=\"mail-to-task\"
+)
+
+target_compile_options(org-gnome-mail-to-task PUBLIC
+ ${EVOLUTION_DATA_SERVER_CFLAGS}
+ ${GNOME_PLATFORM_CFLAGS}
+)
+
+target_include_directories(org-gnome-mail-to-task PUBLIC
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}/src
+ ${CMAKE_SOURCE_DIR}/src
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+ ${GNOME_PLATFORM_INCLUDE_DIRS}
+)
+
+target_link_libraries(org-gnome-mail-to-task
+ ${DEPENDENCIES}
+ ${EVOLUTION_DATA_SERVER_LDFLAGS}
+ ${GNOME_PLATFORM_LDFLAGS}
+)
+
+install(TARGETS org-gnome-mail-to-task
+ DESTINATION ${plugindir}
+)
diff --git a/plugins/mail-to-task/mail-to-task.c b/src/plugins/mail-to-task/mail-to-task.c
similarity index 100%
rename from plugins/mail-to-task/mail-to-task.c
rename to src/plugins/mail-to-task/mail-to-task.c
diff --git a/plugins/mail-to-task/org-gnome-mail-to-task.eplug.xml
b/src/plugins/mail-to-task/org-gnome-mail-to-task.eplug.xml
similarity index 100%
rename from plugins/mail-to-task/org-gnome-mail-to-task.eplug.xml
rename to src/plugins/mail-to-task/org-gnome-mail-to-task.eplug.xml
diff --git a/src/plugins/mailing-list-actions/CMakeLists.txt b/src/plugins/mailing-list-actions/CMakeLists.txt
new file mode 100644
index 0000000..b332772
--- /dev/null
+++ b/src/plugins/mailing-list-actions/CMakeLists.txt
@@ -0,0 +1,52 @@
+add_error_files(mailing-list-actions org-gnome-mailing-list-actions.error)
+add_eplug_file(mailing-list-actions org-gnome-mailing-list-actions.eplug)
+
+set(DEPENDENCIES
+ econtacteditor
+ econtactlisteditor
+ evolution-mail
+ evolution-mail-composer
+ evolution-mail-formatter
+ evolution-shell
+ evolution-util
+)
+
+set(SOURCES
+ mailing-list-actions.c
+)
+
+add_library(org-gnome-mailing-list-actions MODULE
+ ${SOURCES}
+)
+
+add_dependencies(org-gnome-mailing-list-actions
+ ${DEPENDENCIES}
+)
+
+target_compile_definitions(org-gnome-mailing-list-actions PRIVATE
+ -DG_LOG_DOMAIN=\"mailing-list-actions\"
+)
+
+target_compile_options(org-gnome-mailing-list-actions PUBLIC
+ ${EVOLUTION_DATA_SERVER_CFLAGS}
+ ${GNOME_PLATFORM_CFLAGS}
+)
+
+target_include_directories(org-gnome-mailing-list-actions PUBLIC
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}/src
+ ${CMAKE_SOURCE_DIR}/src
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+ ${GNOME_PLATFORM_INCLUDE_DIRS}
+)
+
+target_link_libraries(org-gnome-mailing-list-actions
+ ${DEPENDENCIES}
+ ${EVOLUTION_DATA_SERVER_LDFLAGS}
+ ${GNOME_PLATFORM_LDFLAGS}
+)
+
+install(TARGETS org-gnome-mailing-list-actions
+ DESTINATION ${plugindir}
+)
diff --git a/plugins/mailing-list-actions/mailing-list-actions.c
b/src/plugins/mailing-list-actions/mailing-list-actions.c
similarity index 100%
rename from plugins/mailing-list-actions/mailing-list-actions.c
rename to src/plugins/mailing-list-actions/mailing-list-actions.c
diff --git a/plugins/mailing-list-actions/org-gnome-mailing-list-actions.eplug.xml
b/src/plugins/mailing-list-actions/org-gnome-mailing-list-actions.eplug.xml
similarity index 100%
rename from plugins/mailing-list-actions/org-gnome-mailing-list-actions.eplug.xml
rename to src/plugins/mailing-list-actions/org-gnome-mailing-list-actions.eplug.xml
diff --git a/plugins/mailing-list-actions/org-gnome-mailing-list-actions.error.xml
b/src/plugins/mailing-list-actions/org-gnome-mailing-list-actions.error.xml
similarity index 100%
rename from plugins/mailing-list-actions/org-gnome-mailing-list-actions.error.xml
rename to src/plugins/mailing-list-actions/org-gnome-mailing-list-actions.error.xml
diff --git a/src/plugins/pst-import/CMakeLists.txt b/src/plugins/pst-import/CMakeLists.txt
new file mode 100644
index 0000000..6b66393
--- /dev/null
+++ b/src/plugins/pst-import/CMakeLists.txt
@@ -0,0 +1,52 @@
+add_eplug_file(pst-import org-gnome-pst-import.eplug)
+add_appdata_file(evolution-pst.metainfo.xml.in evolution-pst.metainfo.xml)
+
+set(DEPENDENCIES
+ email-engine
+ evolution-mail
+ evolution-shell
+ evolution-util
+)
+
+set(SOURCES
+ pst-importer.c
+)
+
+add_library(org-gnome-pst-import MODULE
+ ${SOURCES}
+)
+
+add_dependencies(org-gnome-pst-import
+ ${DEPENDENCIES}
+)
+
+target_compile_definitions(org-gnome-pst-import PRIVATE
+ -DG_LOG_DOMAIN=\"pst-import\"
+)
+
+target_compile_options(org-gnome-pst-import PUBLIC
+ ${EVOLUTION_DATA_SERVER_CFLAGS}
+ ${GNOME_PLATFORM_CFLAGS}
+ ${LIBPST_CFLAGS}
+)
+
+target_include_directories(org-gnome-pst-import PUBLIC
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}/src
+ ${CMAKE_SOURCE_DIR}/src
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+ ${GNOME_PLATFORM_INCLUDE_DIRS}
+ ${LIBPST_INCLUDE_DIRS}
+)
+
+target_link_libraries(org-gnome-pst-import
+ ${DEPENDENCIES}
+ ${EVOLUTION_DATA_SERVER_LDFLAGS}
+ ${GNOME_PLATFORM_LDFLAGS}
+ ${LIBPST_LDFLAGS}
+)
+
+install(TARGETS org-gnome-pst-import
+ DESTINATION ${plugindir}
+)
diff --git a/plugins/pst-import/evolution-pst.metainfo.xml.in
b/src/plugins/pst-import/evolution-pst.metainfo.xml.in
similarity index 100%
rename from plugins/pst-import/evolution-pst.metainfo.xml.in
rename to src/plugins/pst-import/evolution-pst.metainfo.xml.in
diff --git a/plugins/pst-import/org-gnome-pst-import.eplug.xml
b/src/plugins/pst-import/org-gnome-pst-import.eplug.xml
similarity index 100%
rename from plugins/pst-import/org-gnome-pst-import.eplug.xml
rename to src/plugins/pst-import/org-gnome-pst-import.eplug.xml
diff --git a/plugins/pst-import/pst-importer.c b/src/plugins/pst-import/pst-importer.c
similarity index 100%
rename from plugins/pst-import/pst-importer.c
rename to src/plugins/pst-import/pst-importer.c
diff --git a/src/plugins/publish-calendar/CMakeLists.txt b/src/plugins/publish-calendar/CMakeLists.txt
new file mode 100644
index 0000000..5980835
--- /dev/null
+++ b/src/plugins/publish-calendar/CMakeLists.txt
@@ -0,0 +1,62 @@
+add_eplug_file(publish-calendar org-gnome-publish-calendar.eplug)
+
+install(FILES publish-calendar.ui
+ DESTINATION ${uidir}
+)
+
+set(DEPENDENCIES
+ evolution-calendar
+ evolution-shell
+ evolution-util
+)
+
+set(SOURCES
+ publish-calendar.c
+ publish-format-fb.c
+ publish-format-fb.h
+ publish-format-ical.c
+ publish-format-ical.h
+ publish-location.c
+ publish-location.h
+ url-editor-dialog.c
+ url-editor-dialog.h
+)
+
+add_library(org-gnome-publish-calendar MODULE
+ ${SOURCES}
+)
+
+add_dependencies(org-gnome-publish-calendar
+ ${DEPENDENCIES}
+)
+
+target_compile_definitions(org-gnome-publish-calendar PRIVATE
+ -DG_LOG_DOMAIN=\"publish-calendar\"
+)
+
+target_compile_options(org-gnome-publish-calendar PUBLIC
+ ${EVOLUTION_DATA_SERVER_CFLAGS}
+ ${GNOME_PLATFORM_CFLAGS}
+ ${LIBNOTIFY_CFLAGS}
+)
+
+target_include_directories(org-gnome-publish-calendar PUBLIC
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}/src
+ ${CMAKE_SOURCE_DIR}/src
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+ ${GNOME_PLATFORM_INCLUDE_DIRS}
+ ${LIBNOTIFY_INCLUDE_DIRS}
+)
+
+target_link_libraries(org-gnome-publish-calendar
+ ${DEPENDENCIES}
+ ${EVOLUTION_DATA_SERVER_LDFLAGS}
+ ${GNOME_PLATFORM_LDFLAGS}
+ ${LIBNOTIFY_LDFLAGS}
+)
+
+install(TARGETS org-gnome-publish-calendar
+ DESTINATION ${plugindir}
+)
diff --git a/plugins/publish-calendar/org-gnome-publish-calendar.eplug.xml
b/src/plugins/publish-calendar/org-gnome-publish-calendar.eplug.xml
similarity index 100%
rename from plugins/publish-calendar/org-gnome-publish-calendar.eplug.xml
rename to src/plugins/publish-calendar/org-gnome-publish-calendar.eplug.xml
diff --git a/plugins/publish-calendar/publish-calendar.c b/src/plugins/publish-calendar/publish-calendar.c
similarity index 100%
rename from plugins/publish-calendar/publish-calendar.c
rename to src/plugins/publish-calendar/publish-calendar.c
diff --git a/plugins/publish-calendar/publish-calendar.ui b/src/plugins/publish-calendar/publish-calendar.ui
similarity index 100%
rename from plugins/publish-calendar/publish-calendar.ui
rename to src/plugins/publish-calendar/publish-calendar.ui
diff --git a/plugins/publish-calendar/publish-format-fb.c b/src/plugins/publish-calendar/publish-format-fb.c
similarity index 100%
rename from plugins/publish-calendar/publish-format-fb.c
rename to src/plugins/publish-calendar/publish-format-fb.c
diff --git a/plugins/publish-calendar/publish-format-fb.h b/src/plugins/publish-calendar/publish-format-fb.h
similarity index 100%
rename from plugins/publish-calendar/publish-format-fb.h
rename to src/plugins/publish-calendar/publish-format-fb.h
diff --git a/plugins/publish-calendar/publish-format-ical.c
b/src/plugins/publish-calendar/publish-format-ical.c
similarity index 100%
rename from plugins/publish-calendar/publish-format-ical.c
rename to src/plugins/publish-calendar/publish-format-ical.c
diff --git a/plugins/publish-calendar/publish-format-ical.h
b/src/plugins/publish-calendar/publish-format-ical.h
similarity index 100%
rename from plugins/publish-calendar/publish-format-ical.h
rename to src/plugins/publish-calendar/publish-format-ical.h
diff --git a/plugins/publish-calendar/publish-location.c b/src/plugins/publish-calendar/publish-location.c
similarity index 100%
rename from plugins/publish-calendar/publish-location.c
rename to src/plugins/publish-calendar/publish-location.c
diff --git a/plugins/publish-calendar/publish-location.h b/src/plugins/publish-calendar/publish-location.h
similarity index 100%
rename from plugins/publish-calendar/publish-location.h
rename to src/plugins/publish-calendar/publish-location.h
diff --git a/plugins/publish-calendar/url-editor-dialog.c b/src/plugins/publish-calendar/url-editor-dialog.c
similarity index 100%
rename from plugins/publish-calendar/url-editor-dialog.c
rename to src/plugins/publish-calendar/url-editor-dialog.c
diff --git a/plugins/publish-calendar/url-editor-dialog.h b/src/plugins/publish-calendar/url-editor-dialog.h
similarity index 100%
rename from plugins/publish-calendar/url-editor-dialog.h
rename to src/plugins/publish-calendar/url-editor-dialog.h
diff --git a/src/plugins/save-calendar/CMakeLists.txt b/src/plugins/save-calendar/CMakeLists.txt
new file mode 100644
index 0000000..6dd30c6
--- /dev/null
+++ b/src/plugins/save-calendar/CMakeLists.txt
@@ -0,0 +1,50 @@
+add_eplug_file(save-calendar org-gnome-save-calendar.eplug)
+
+set(DEPENDENCIES
+ evolution-shell
+ evolution-util
+)
+
+set(SOURCES
+ save-calendar.c
+ ical-format.c
+ csv-format.c
+ rdf-format.c
+ format-handler.h
+)
+
+add_library(org-gnome-save-calendar MODULE
+ ${SOURCES}
+)
+
+add_dependencies(org-gnome-save-calendar
+ ${DEPENDENCIES}
+)
+
+target_compile_definitions(org-gnome-save-calendar PRIVATE
+ -DG_LOG_DOMAIN=\"save-calendar\"
+)
+
+target_compile_options(org-gnome-save-calendar PUBLIC
+ ${EVOLUTION_DATA_SERVER_CFLAGS}
+ ${GNOME_PLATFORM_CFLAGS}
+)
+
+target_include_directories(org-gnome-save-calendar PUBLIC
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}/src
+ ${CMAKE_SOURCE_DIR}/src
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+ ${GNOME_PLATFORM_INCLUDE_DIRS}
+)
+
+target_link_libraries(org-gnome-save-calendar
+ ${DEPENDENCIES}
+ ${EVOLUTION_DATA_SERVER_LDFLAGS}
+ ${GNOME_PLATFORM_LDFLAGS}
+)
+
+install(TARGETS org-gnome-save-calendar
+ DESTINATION ${plugindir}
+)
diff --git a/plugins/save-calendar/csv-format.c b/src/plugins/save-calendar/csv-format.c
similarity index 100%
rename from plugins/save-calendar/csv-format.c
rename to src/plugins/save-calendar/csv-format.c
diff --git a/plugins/save-calendar/format-handler.h b/src/plugins/save-calendar/format-handler.h
similarity index 100%
rename from plugins/save-calendar/format-handler.h
rename to src/plugins/save-calendar/format-handler.h
diff --git a/plugins/save-calendar/ical-format.c b/src/plugins/save-calendar/ical-format.c
similarity index 100%
rename from plugins/save-calendar/ical-format.c
rename to src/plugins/save-calendar/ical-format.c
diff --git a/plugins/save-calendar/org-gnome-save-calendar.eplug.xml
b/src/plugins/save-calendar/org-gnome-save-calendar.eplug.xml
similarity index 100%
rename from plugins/save-calendar/org-gnome-save-calendar.eplug.xml
rename to src/plugins/save-calendar/org-gnome-save-calendar.eplug.xml
diff --git a/plugins/save-calendar/rdf-format.c b/src/plugins/save-calendar/rdf-format.c
similarity index 100%
rename from plugins/save-calendar/rdf-format.c
rename to src/plugins/save-calendar/rdf-format.c
diff --git a/plugins/save-calendar/save-calendar.c b/src/plugins/save-calendar/save-calendar.c
similarity index 100%
rename from plugins/save-calendar/save-calendar.c
rename to src/plugins/save-calendar/save-calendar.c
diff --git a/src/plugins/templates/CMakeLists.txt b/src/plugins/templates/CMakeLists.txt
new file mode 100644
index 0000000..c5f90a6
--- /dev/null
+++ b/src/plugins/templates/CMakeLists.txt
@@ -0,0 +1,51 @@
+add_eplug_file(templates org-gnome-templates.eplug)
+
+set(DEPENDENCIES
+ email-engine
+ evolution-mail
+ evolution-mail-composer
+ evolution-shell
+ evolution-util
+)
+
+set(SOURCES
+ templates.c
+ e-templates-store.h
+ e-templates-store.c
+)
+
+add_library(org-gnome-templates MODULE
+ ${SOURCES}
+)
+
+add_dependencies(org-gnome-templates
+ ${DEPENDENCIES}
+)
+
+target_compile_definitions(org-gnome-templates PRIVATE
+ -DG_LOG_DOMAIN=\"templates\"
+)
+
+target_compile_options(org-gnome-templates PUBLIC
+ ${EVOLUTION_DATA_SERVER_CFLAGS}
+ ${GNOME_PLATFORM_CFLAGS}
+)
+
+target_include_directories(org-gnome-templates PUBLIC
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}/src
+ ${CMAKE_SOURCE_DIR}/src
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+ ${GNOME_PLATFORM_INCLUDE_DIRS}
+)
+
+target_link_libraries(org-gnome-templates
+ ${DEPENDENCIES}
+ ${EVOLUTION_DATA_SERVER_LDFLAGS}
+ ${GNOME_PLATFORM_LDFLAGS}
+)
+
+install(TARGETS org-gnome-templates
+ DESTINATION ${plugindir}
+)
diff --git a/plugins/templates/e-templates-store.c b/src/plugins/templates/e-templates-store.c
similarity index 100%
rename from plugins/templates/e-templates-store.c
rename to src/plugins/templates/e-templates-store.c
diff --git a/plugins/templates/e-templates-store.h b/src/plugins/templates/e-templates-store.h
similarity index 100%
rename from plugins/templates/e-templates-store.h
rename to src/plugins/templates/e-templates-store.h
diff --git a/plugins/templates/org-gnome-templates.eplug.xml
b/src/plugins/templates/org-gnome-templates.eplug.xml
similarity index 100%
rename from plugins/templates/org-gnome-templates.eplug.xml
rename to src/plugins/templates/org-gnome-templates.eplug.xml
diff --git a/plugins/templates/templates.c b/src/plugins/templates/templates.c
similarity index 100%
rename from plugins/templates/templates.c
rename to src/plugins/templates/templates.c
diff --git a/src/shell/CMakeLists.txt b/src/shell/CMakeLists.txt
new file mode 100644
index 0000000..1eb839d
--- /dev/null
+++ b/src/shell/CMakeLists.txt
@@ -0,0 +1,224 @@
+glib_mkenums(e-shell-enumtypes e-shell.h E_SHELL_ENUMTYPES_H)
+add_error_files(shell shell.error)
+
+configure_file(evo-version.h.in
+ evo-version.h
+ @ONLY
+)
+
+# ******************************
+# evolution-shell library
+# ******************************
+
+set(DEPENDENCIES
+ evolution-util
+)
+
+set(SOURCES
+ e-shell.c
+ e-shell-backend.c
+ e-shell-content.c
+ e-shell-enumtypes.c
+ e-shell-searchbar.c
+ e-shell-sidebar.c
+ e-shell-switcher.c
+ e-shell-taskbar.c
+ e-shell-utils.c
+ e-shell-view.c
+ e-shell-window.c
+ e-shell-window-private.c
+ e-shell-window-private.h
+ e-shell-migrate.c
+ e-shell-migrate.h
+ e-shell-window-actions.c
+ ${CMAKE_CURRENT_BINARY_DIR}/e-shell-enumtypes.c
+ ${CMAKE_CURRENT_BINARY_DIR}/evo-version.h
+)
+
+set(HEADERS
+ e-shell.h
+ e-shell-backend.h
+ e-shell-common.h
+ e-shell-content.h
+ e-shell-searchbar.h
+ e-shell-sidebar.h
+ e-shell-switcher.h
+ e-shell-taskbar.h
+ e-shell-utils.h
+ e-shell-view.h
+ e-shell-window.h
+ e-shell-window-actions.h
+ ${CMAKE_CURRENT_BINARY_DIR}/e-shell-enumtypes.h
+)
+
+add_library(evolution-shell SHARED
+ ${SOURCES}
+ ${HEADERS}
+)
+
+add_dependencies(evolution-shell
+ ${DEPENDENCIES}
+)
+
+target_compile_definitions(evolution-shell PRIVATE
+ -DG_LOG_DOMAIN=\"evolution-shell\"
+ -DEVOLUTION_LOCALEDIR=\"${LOCALE_INSTALL_DIR}\"
+ -DEVOLUTION_GALVIEWSDIR=\"${viewsdir}\"
+ -DEVOLUTION_HELPDIR=\"${evolutionhelpdir}\"
+ -DEVOLUTION_ICONDIR=\"${icondir}\"
+ -DEVOLUTION_MODULEDIR=\"${moduledir}\"
+ -DEVOLUTION_RULEDIR=\"${privdatadir}\"
+)
+
+target_compile_options(evolution-shell PUBLIC
+ ${CLUTTER_GTK_CFLAGS}
+ ${EVOLUTION_DATA_SERVER_CFLAGS}
+ ${GNOME_PLATFORM_CFLAGS}
+)
+
+target_include_directories(evolution-shell PUBLIC
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}/src
+ ${CMAKE_SOURCE_DIR}/src
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${CLUTTER_GTK_INCLUDE_DIRS}
+ ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+ ${GNOME_PLATFORM_INCLUDE_DIRS}
+)
+
+target_link_libraries(evolution-shell
+ ${DEPENDENCIES}
+ ${CLUTTER_GTK_LDFLAGS}
+ ${EVOLUTION_DATA_SERVER_LDFLAGS}
+ ${GNOME_PLATFORM_LDFLAGS}
+)
+
+install(TARGETS evolution-shell
+ DESTINATION ${privsolibdir}
+)
+
+install(FILES ${HEADERS}
+ DESTINATION ${privincludedir}/shell
+)
+
+# ******************************
+# evolution binary
+# ******************************
+
+set(DEPENDENCIES
+ evolution-util
+ evolution-shell
+)
+
+set(SOURCES
+ main.c
+ e-convert-local-mail.c
+ e-migrate-base-dirs.c
+)
+
+add_executable(evolution
+ ${SOURCES}
+)
+
+add_dependencies(evolution
+ ${DEPENDENCIES}
+)
+
+target_compile_definitions(evolution PRIVATE
+ -DG_LOG_DOMAIN=\"evolution\"
+ -DEVOLUTION_LOCALEDIR=\"${LOCALE_INSTALL_DIR}\"
+ -DEVOLUTION_GALVIEWSDIR=\"${viewsdir}\"
+ -DEVOLUTION_HELPDIR=\"${evolutionhelpdir}\"
+ -DEVOLUTION_ICONDIR=\"${icondir}\"
+ -DEVOLUTION_MODULEDIR=\"${moduledir}\"
+ -DEVOLUTION_RULEDIR=\"${privdatadir}\"
+ -DEVOLUTION_TOOLSDIR=\"${privlibexecdir}\"
+)
+
+target_compile_options(evolution PUBLIC
+ ${EVOLUTION_DATA_SERVER_CFLAGS}
+ ${GNOME_PLATFORM_CFLAGS}
+ ${CLUTTER_GTK_CFLAGS}
+)
+
+target_include_directories(evolution PUBLIC
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}/src
+ ${CMAKE_SOURCE_DIR}/src
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+ ${GNOME_PLATFORM_INCLUDE_DIRS}
+ ${CLUTTER_GTK_INCLUDE_DIRS}
+)
+
+target_link_libraries(evolution
+ ${DEPENDENCIES}
+ ${EVOLUTION_DATA_SERVER_LDFLAGS}
+ ${GNOME_PLATFORM_LDFLAGS}
+ ${CLUTTER_GTK_LDFLAGS}
+)
+
+if(WIN32)
+ find_program(WINDRES windres)
+ if(WINDRES)
+ add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/evolution-icon.o
+ COMMAND ${WINDRES} ${CMAKE_CURRENT_SOURCE_DIR}/evolution-icon.rc
${CMAKE_CURRENT_BINARY_DIR}/evolution-icon.o
+ DEPENDS evolution-icon.rc
+ evolution.ico
+ evolution-mail.ico
+ evolution-memos.ico
+ evolution-tasks.ico
+ )
+
+ target_link_libraries(evolution
+ ${CMAKE_CURRENT_BINARY_DIR}/evolution-icon.o
+ )
+ endif(WINDRES)
+endif(WIN32)
+
+install(TARGETS evolution
+ DESTINATION ${BIN_INSTALL_DIR}
+)
+
+# ******************************
+# killev binary
+# ******************************
+
+if(NOT WIN32)
+ set(SOURCES
+ killev.c
+ )
+
+ add_executable(killev
+ ${SOURCES}
+ )
+
+ target_compile_definitions(killev PRIVATE
+ -DG_LOG_DOMAIN=\"killev\"
+ -DEVOLUTION_LOCALEDIR=\"${LOCALE_INSTALL_DIR}\"
+ )
+
+ target_compile_options(killev PUBLIC
+ ${EVOLUTION_DATA_SERVER_CFLAGS}
+ ${GNOME_PLATFORM_CFLAGS}
+ )
+
+ target_include_directories(killev PUBLIC
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}/src
+ ${CMAKE_SOURCE_DIR}/src
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+ ${GNOME_PLATFORM_INCLUDE_DIRS}
+ )
+
+ target_link_libraries(killev
+ ${DEPENDENCIES}
+ ${EVOLUTION_DATA_SERVER_LDFLAGS}
+ ${GNOME_PLATFORM_LDFLAGS}
+ )
+
+ install(TARGETS killev
+ DESTINATION ${privlibexecdir}
+ )
+endif(NOT WIN32)
diff --git a/shell/e-convert-local-mail.c b/src/shell/e-convert-local-mail.c
similarity index 100%
rename from shell/e-convert-local-mail.c
rename to src/shell/e-convert-local-mail.c
diff --git a/shell/e-migrate-base-dirs.c b/src/shell/e-migrate-base-dirs.c
similarity index 100%
rename from shell/e-migrate-base-dirs.c
rename to src/shell/e-migrate-base-dirs.c
diff --git a/shell/e-shell-backend.c b/src/shell/e-shell-backend.c
similarity index 100%
rename from shell/e-shell-backend.c
rename to src/shell/e-shell-backend.c
diff --git a/shell/e-shell-backend.h b/src/shell/e-shell-backend.h
similarity index 100%
rename from shell/e-shell-backend.h
rename to src/shell/e-shell-backend.h
diff --git a/shell/e-shell-common.h b/src/shell/e-shell-common.h
similarity index 100%
rename from shell/e-shell-common.h
rename to src/shell/e-shell-common.h
diff --git a/shell/e-shell-content.c b/src/shell/e-shell-content.c
similarity index 100%
rename from shell/e-shell-content.c
rename to src/shell/e-shell-content.c
diff --git a/shell/e-shell-content.h b/src/shell/e-shell-content.h
similarity index 100%
rename from shell/e-shell-content.h
rename to src/shell/e-shell-content.h
diff --git a/shell/e-shell-migrate.c b/src/shell/e-shell-migrate.c
similarity index 100%
rename from shell/e-shell-migrate.c
rename to src/shell/e-shell-migrate.c
diff --git a/shell/e-shell-migrate.h b/src/shell/e-shell-migrate.h
similarity index 100%
rename from shell/e-shell-migrate.h
rename to src/shell/e-shell-migrate.h
diff --git a/shell/e-shell-searchbar.c b/src/shell/e-shell-searchbar.c
similarity index 100%
rename from shell/e-shell-searchbar.c
rename to src/shell/e-shell-searchbar.c
diff --git a/shell/e-shell-searchbar.h b/src/shell/e-shell-searchbar.h
similarity index 100%
rename from shell/e-shell-searchbar.h
rename to src/shell/e-shell-searchbar.h
diff --git a/shell/e-shell-sidebar.c b/src/shell/e-shell-sidebar.c
similarity index 100%
rename from shell/e-shell-sidebar.c
rename to src/shell/e-shell-sidebar.c
diff --git a/shell/e-shell-sidebar.h b/src/shell/e-shell-sidebar.h
similarity index 100%
rename from shell/e-shell-sidebar.h
rename to src/shell/e-shell-sidebar.h
diff --git a/shell/e-shell-switcher.c b/src/shell/e-shell-switcher.c
similarity index 100%
rename from shell/e-shell-switcher.c
rename to src/shell/e-shell-switcher.c
diff --git a/shell/e-shell-switcher.h b/src/shell/e-shell-switcher.h
similarity index 100%
rename from shell/e-shell-switcher.h
rename to src/shell/e-shell-switcher.h
diff --git a/shell/e-shell-taskbar.c b/src/shell/e-shell-taskbar.c
similarity index 100%
rename from shell/e-shell-taskbar.c
rename to src/shell/e-shell-taskbar.c
diff --git a/shell/e-shell-taskbar.h b/src/shell/e-shell-taskbar.h
similarity index 100%
rename from shell/e-shell-taskbar.h
rename to src/shell/e-shell-taskbar.h
diff --git a/shell/e-shell-utils.c b/src/shell/e-shell-utils.c
similarity index 100%
rename from shell/e-shell-utils.c
rename to src/shell/e-shell-utils.c
diff --git a/shell/e-shell-utils.h b/src/shell/e-shell-utils.h
similarity index 100%
rename from shell/e-shell-utils.h
rename to src/shell/e-shell-utils.h
diff --git a/shell/e-shell-view.c b/src/shell/e-shell-view.c
similarity index 100%
rename from shell/e-shell-view.c
rename to src/shell/e-shell-view.c
diff --git a/shell/e-shell-view.h b/src/shell/e-shell-view.h
similarity index 100%
rename from shell/e-shell-view.h
rename to src/shell/e-shell-view.h
diff --git a/shell/e-shell-window-actions.c b/src/shell/e-shell-window-actions.c
similarity index 100%
rename from shell/e-shell-window-actions.c
rename to src/shell/e-shell-window-actions.c
diff --git a/shell/e-shell-window-actions.h b/src/shell/e-shell-window-actions.h
similarity index 100%
rename from shell/e-shell-window-actions.h
rename to src/shell/e-shell-window-actions.h
diff --git a/shell/e-shell-window-private.c b/src/shell/e-shell-window-private.c
similarity index 100%
rename from shell/e-shell-window-private.c
rename to src/shell/e-shell-window-private.c
diff --git a/shell/e-shell-window-private.h b/src/shell/e-shell-window-private.h
similarity index 100%
rename from shell/e-shell-window-private.h
rename to src/shell/e-shell-window-private.h
diff --git a/shell/e-shell-window.c b/src/shell/e-shell-window.c
similarity index 100%
rename from shell/e-shell-window.c
rename to src/shell/e-shell-window.c
diff --git a/shell/e-shell-window.h b/src/shell/e-shell-window.h
similarity index 100%
rename from shell/e-shell-window.h
rename to src/shell/e-shell-window.h
diff --git a/shell/e-shell.c b/src/shell/e-shell.c
similarity index 100%
rename from shell/e-shell.c
rename to src/shell/e-shell.c
diff --git a/shell/e-shell.h b/src/shell/e-shell.h
similarity index 100%
rename from shell/e-shell.h
rename to src/shell/e-shell.h
diff --git a/shell/evo-version.h.in b/src/shell/evo-version.h.in
similarity index 100%
rename from shell/evo-version.h.in
rename to src/shell/evo-version.h.in
diff --git a/shell/evolution-icon.rc b/src/shell/evolution-icon.rc
similarity index 100%
rename from shell/evolution-icon.rc
rename to src/shell/evolution-icon.rc
diff --git a/shell/killev.c b/src/shell/killev.c
similarity index 100%
rename from shell/killev.c
rename to src/shell/killev.c
diff --git a/shell/main.c b/src/shell/main.c
similarity index 100%
rename from shell/main.c
rename to src/shell/main.c
diff --git a/shell/shell.error.xml b/src/shell/shell.error.xml
similarity index 100%
rename from shell/shell.error.xml
rename to src/shell/shell.error.xml
diff --git a/smime/CMakeLists.txt b/src/smime/CMakeLists.txt
similarity index 100%
rename from smime/CMakeLists.txt
rename to src/smime/CMakeLists.txt
diff --git a/src/smime/gui/CMakeLists.txt b/src/smime/gui/CMakeLists.txt
new file mode 100644
index 0000000..89ed22f
--- /dev/null
+++ b/src/smime/gui/CMakeLists.txt
@@ -0,0 +1,62 @@
+set(DEPENDENCIES
+ evolution-shell
+ evolution-util
+ essmime
+)
+
+set(SOURCES
+ ca-trust-dialog.c
+ ca-trust-dialog.h
+ cert-trust-dialog.c
+ cert-trust-dialog.h
+ certificate-manager.c
+ certificate-manager.h
+ e-cert-selector.c
+ e-cert-selector.h
+ component.c
+ component.h
+)
+
+add_library(evolution-smime SHARED
+ ${SOURCES}
+)
+
+add_dependencies(evolution-smime
+ ${DEPENDENCIES}
+)
+
+target_compile_definitions(evolution-smime PRIVATE
+ -DG_LOG_DOMAIN=\"evolution-smime\"
+)
+
+target_compile_options(evolution-smime PUBLIC
+ ${CERT_UI_CFLAGS}
+ ${EVOLUTION_DATA_SERVER_CFLAGS}
+ ${GNOME_PLATFORM_CFLAGS}
+)
+
+target_include_directories(evolution-smime PUBLIC
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}/src
+ ${CMAKE_SOURCE_DIR}/src
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_SOURCE_DIR}/src/smime/lib
+ ${CERT_UI_INCLUDE_DIRS}
+ ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+ ${GNOME_PLATFORM_INCLUDE_DIRS}
+)
+
+target_link_libraries(evolution-smime
+ ${DEPENDENCIES}
+ ${CERT_UI_LDFLAGS}
+ ${EVOLUTION_DATA_SERVER_LDFLAGS}
+ ${GNOME_PLATFORM_LDFLAGS}
+)
+
+install(TARGETS evolution-smime
+ DESTINATION ${privsolibdir}
+)
+
+install(FILES smime-ui.ui
+ DESTINATION ${uidir}
+)
diff --git a/smime/gui/ca-trust-dialog.c b/src/smime/gui/ca-trust-dialog.c
similarity index 100%
rename from smime/gui/ca-trust-dialog.c
rename to src/smime/gui/ca-trust-dialog.c
diff --git a/smime/gui/ca-trust-dialog.h b/src/smime/gui/ca-trust-dialog.h
similarity index 100%
rename from smime/gui/ca-trust-dialog.h
rename to src/smime/gui/ca-trust-dialog.h
diff --git a/smime/gui/cert-trust-dialog.c b/src/smime/gui/cert-trust-dialog.c
similarity index 100%
rename from smime/gui/cert-trust-dialog.c
rename to src/smime/gui/cert-trust-dialog.c
diff --git a/smime/gui/cert-trust-dialog.h b/src/smime/gui/cert-trust-dialog.h
similarity index 100%
rename from smime/gui/cert-trust-dialog.h
rename to src/smime/gui/cert-trust-dialog.h
diff --git a/smime/gui/certificate-manager.c b/src/smime/gui/certificate-manager.c
similarity index 100%
rename from smime/gui/certificate-manager.c
rename to src/smime/gui/certificate-manager.c
diff --git a/smime/gui/certificate-manager.h b/src/smime/gui/certificate-manager.h
similarity index 100%
rename from smime/gui/certificate-manager.h
rename to src/smime/gui/certificate-manager.h
diff --git a/smime/gui/component.c b/src/smime/gui/component.c
similarity index 100%
rename from smime/gui/component.c
rename to src/smime/gui/component.c
diff --git a/smime/gui/component.h b/src/smime/gui/component.h
similarity index 100%
rename from smime/gui/component.h
rename to src/smime/gui/component.h
diff --git a/smime/gui/e-cert-selector.c b/src/smime/gui/e-cert-selector.c
similarity index 100%
rename from smime/gui/e-cert-selector.c
rename to src/smime/gui/e-cert-selector.c
diff --git a/smime/gui/e-cert-selector.h b/src/smime/gui/e-cert-selector.h
similarity index 100%
rename from smime/gui/e-cert-selector.h
rename to src/smime/gui/e-cert-selector.h
diff --git a/smime/gui/smime-ui.ui b/src/smime/gui/smime-ui.ui
similarity index 100%
rename from smime/gui/smime-ui.ui
rename to src/smime/gui/smime-ui.ui
diff --git a/src/smime/lib/CMakeLists.txt b/src/smime/lib/CMakeLists.txt
new file mode 100644
index 0000000..7f15427
--- /dev/null
+++ b/src/smime/lib/CMakeLists.txt
@@ -0,0 +1,53 @@
+set(DEPENDENCIES
+ evolution-util
+)
+
+set(SOURCES
+ e-cert.c
+ e-cert.h
+ e-cert-trust.c
+ e-cert-trust.h
+ e-cert-db.c
+ e-cert-db.h
+ e-pkcs12.c
+ e-pkcs12.h
+)
+
+add_library(essmime SHARED
+ ${SOURCES}
+)
+
+add_dependencies(essmime
+ ${DEPENDENCIES}
+)
+
+target_compile_definitions(essmime PRIVATE
+ -DG_LOG_DOMAIN=\"essmime\"
+)
+
+target_compile_options(essmime PUBLIC
+ ${CERT_UI_CFLAGS}
+ ${EVOLUTION_DATA_SERVER_CFLAGS}
+ ${GNOME_PLATFORM_CFLAGS}
+)
+
+target_include_directories(essmime PUBLIC
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}/src
+ ${CMAKE_SOURCE_DIR}/src
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${CERT_UI_INCLUDE_DIRS}
+ ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+ ${GNOME_PLATFORM_INCLUDE_DIRS}
+)
+
+target_link_libraries(essmime
+ ${DEPENDENCIES}
+ ${CERT_UI_LDFLAGS}
+ ${EVOLUTION_DATA_SERVER_LDFLAGS}
+ ${GNOME_PLATFORM_LDFLAGS}
+)
+
+install(TARGETS essmime
+ DESTINATION ${privsolibdir}
+)
diff --git a/smime/lib/e-cert-db.c b/src/smime/lib/e-cert-db.c
similarity index 100%
rename from smime/lib/e-cert-db.c
rename to src/smime/lib/e-cert-db.c
diff --git a/smime/lib/e-cert-db.h b/src/smime/lib/e-cert-db.h
similarity index 100%
rename from smime/lib/e-cert-db.h
rename to src/smime/lib/e-cert-db.h
diff --git a/smime/lib/e-cert-trust.c b/src/smime/lib/e-cert-trust.c
similarity index 100%
rename from smime/lib/e-cert-trust.c
rename to src/smime/lib/e-cert-trust.c
diff --git a/smime/lib/e-cert-trust.h b/src/smime/lib/e-cert-trust.h
similarity index 100%
rename from smime/lib/e-cert-trust.h
rename to src/smime/lib/e-cert-trust.h
diff --git a/smime/lib/e-cert.c b/src/smime/lib/e-cert.c
similarity index 100%
rename from smime/lib/e-cert.c
rename to src/smime/lib/e-cert.c
diff --git a/smime/lib/e-cert.h b/src/smime/lib/e-cert.h
similarity index 100%
rename from smime/lib/e-cert.h
rename to src/smime/lib/e-cert.h
diff --git a/smime/lib/e-pkcs12.c b/src/smime/lib/e-pkcs12.c
similarity index 100%
rename from smime/lib/e-pkcs12.c
rename to src/smime/lib/e-pkcs12.c
diff --git a/smime/lib/e-pkcs12.h b/src/smime/lib/e-pkcs12.h
similarity index 100%
rename from smime/lib/e-pkcs12.h
rename to src/smime/lib/e-pkcs12.h
diff --git a/smime/tests/import-cert.c b/src/smime/tests/import-cert.c
similarity index 100%
rename from smime/tests/import-cert.c
rename to src/smime/tests/import-cert.c
diff --git a/src/web-extensions/CMakeLists.txt b/src/web-extensions/CMakeLists.txt
new file mode 100644
index 0000000..9e5c03d
--- /dev/null
+++ b/src/web-extensions/CMakeLists.txt
@@ -0,0 +1,94 @@
+set(DEPENDENCIES
+ evolution-util
+)
+
+set(SOURCES
+ e-dom-utils.h
+ e-dom-utils.c
+)
+
+add_library(edomutils SHARED
+ ${SOURCES}
+)
+
+add_dependencies(edomutils
+ ${DEPENDENCIES}
+)
+
+target_compile_definitions(edomutils PRIVATE
+ -DG_LOG_DOMAIN=\"edomutils\"
+ -DEVOLUTION_IMAGESDIR=\"${imagesdir}\"
+)
+
+target_compile_options(edomutils PUBLIC
+ ${EVOLUTION_DATA_SERVER_CFLAGS}
+ ${GNOME_PLATFORM_CFLAGS}
+)
+
+target_include_directories(edomutils PUBLIC
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}/src
+ ${CMAKE_SOURCE_DIR}/src
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+ ${GNOME_PLATFORM_INCLUDE_DIRS}
+)
+
+target_link_libraries(edomutils
+ ${DEPENDENCIES}
+ ${EVOLUTION_DATA_SERVER_LDFLAGS}
+ ${GNOME_PLATFORM_LDFLAGS}
+)
+
+install(TARGETS edomutils
+ DESTINATION ${privsolibdir}
+)
+
+set(SOURCES
+ e-web-extension.h
+ e-web-extension-names.h
+ e-dom-utils.h
+ e-web-extension.c
+ e-web-extension-main.c
+ e-dom-utils.c
+)
+
+add_library(ewebextension MODULE
+ ${SOURCES}
+)
+
+add_dependencies(ewebextension
+ ${DEPENDENCIES}
+)
+
+target_compile_definitions(ewebextension PRIVATE
+ -DG_LOG_DOMAIN=\"ewebextension\"
+ -DEVOLUTION_IMAGESDIR=\"${imagesdir}\"
+)
+
+target_compile_options(ewebextension PUBLIC
+ ${EVOLUTION_DATA_SERVER_CFLAGS}
+ ${GNOME_PLATFORM_CFLAGS}
+ ${WEB_EXTENSIONS_CFLAGS}
+)
+
+target_include_directories(ewebextension PUBLIC
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}/src
+ ${CMAKE_SOURCE_DIR}/src
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+ ${GNOME_PLATFORM_INCLUDE_DIRS}
+ ${WEB_EXTENSIONS_INCLUDE_DIRS}
+)
+
+target_link_libraries(ewebextension
+ ${DEPENDENCIES}
+ ${EVOLUTION_DATA_SERVER_LDFLAGS}
+ ${GNOME_PLATFORM_LDFLAGS}
+ ${WEB_EXTENSIONS_LDFLAGS}
+)
+
+install(TARGETS ewebextension
+ DESTINATION ${webextensionsdir}
+)
diff --git a/web-extensions/e-dom-utils.c b/src/web-extensions/e-dom-utils.c
similarity index 100%
rename from web-extensions/e-dom-utils.c
rename to src/web-extensions/e-dom-utils.c
diff --git a/web-extensions/e-dom-utils.h b/src/web-extensions/e-dom-utils.h
similarity index 100%
rename from web-extensions/e-dom-utils.h
rename to src/web-extensions/e-dom-utils.h
diff --git a/web-extensions/e-web-extension-main.c b/src/web-extensions/e-web-extension-main.c
similarity index 100%
rename from web-extensions/e-web-extension-main.c
rename to src/web-extensions/e-web-extension-main.c
diff --git a/web-extensions/e-web-extension-names.h b/src/web-extensions/e-web-extension-names.h
similarity index 100%
rename from web-extensions/e-web-extension-names.h
rename to src/web-extensions/e-web-extension-names.h
diff --git a/web-extensions/e-web-extension.c b/src/web-extensions/e-web-extension.c
similarity index 100%
rename from web-extensions/e-web-extension.c
rename to src/web-extensions/e-web-extension.c
diff --git a/web-extensions/e-web-extension.h b/src/web-extensions/e-web-extension.h
similarity index 100%
rename from web-extensions/e-web-extension.h
rename to src/web-extensions/e-web-extension.h
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]